Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: Source/core/dom/Element.cpp

Issue 18259016: Introduce isHTMLLabelElement and toHTMLLabelElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Took tkent's comment into consideration Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/DocumentOrderedMap.cpp ('k') | Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2774 matching lines...) Expand 10 before | Expand all | Expand 10 after
2785 { 2785 {
2786 ASSERT(hasTagName(labelTag)); 2786 ASSERT(hasTagName(labelTag));
2787 2787
2788 if (!inDocument()) 2788 if (!inDocument())
2789 return; 2789 return;
2790 2790
2791 if (oldForAttributeValue == newForAttributeValue) 2791 if (oldForAttributeValue == newForAttributeValue)
2792 return; 2792 return;
2793 2793
2794 if (!oldForAttributeValue.isEmpty()) 2794 if (!oldForAttributeValue.isEmpty())
2795 scope->removeLabel(oldForAttributeValue, static_cast<HTMLLabelElement*>( this)); 2795 scope->removeLabel(oldForAttributeValue, toHTMLLabelElement(this));
2796 if (!newForAttributeValue.isEmpty()) 2796 if (!newForAttributeValue.isEmpty())
2797 scope->addLabel(newForAttributeValue, static_cast<HTMLLabelElement*>(thi s)); 2797 scope->addLabel(newForAttributeValue, toHTMLLabelElement(this));
2798 } 2798 }
2799 2799
2800 void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue) 2800 void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue)
2801 { 2801 {
2802 if (isIdAttributeName(name)) 2802 if (isIdAttributeName(name))
2803 updateId(oldValue, newValue); 2803 updateId(oldValue, newValue);
2804 else if (name == HTMLNames::nameAttr) 2804 else if (name == HTMLNames::nameAttr)
2805 updateName(oldValue, newValue); 2805 updateName(oldValue, newValue);
2806 else if (name == HTMLNames::forAttr && hasTagName(labelTag)) { 2806 else if (name == HTMLNames::forAttr && hasTagName(labelTag)) {
2807 TreeScope* scope = treeScope(); 2807 TreeScope* scope = treeScope();
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
3647 return 0; 3647 return 0;
3648 } 3648 }
3649 3649
3650 Attribute* UniqueElementData::attributeItem(unsigned index) 3650 Attribute* UniqueElementData::attributeItem(unsigned index)
3651 { 3651 {
3652 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3652 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3653 return &m_attributeVector.at(index); 3653 return &m_attributeVector.at(index);
3654 } 3654 }
3655 3655
3656 } // namespace WebCore 3656 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentOrderedMap.cpp ('k') | Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698