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

Unified Diff: Source/core/html/HTMLFieldSetElement.cpp

Issue 189923002: Use new Traversal<HTML*Element> API in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLDetailsElement.cpp ('k') | Source/core/html/HTMLMapElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFieldSetElement.cpp
diff --git a/Source/core/html/HTMLFieldSetElement.cpp b/Source/core/html/HTMLFieldSetElement.cpp
index 65640c69e28a69409bd320ea002d7adf642a8e72..61d70db9287f01cadd466fb3ff80b201b75d2760 100644
--- a/Source/core/html/HTMLFieldSetElement.cpp
+++ b/Source/core/html/HTMLFieldSetElement.cpp
@@ -67,10 +67,8 @@ void HTMLFieldSetElement::disabledAttributeChanged()
void HTMLFieldSetElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
HTMLFormControlElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
- for (Element* element = ElementTraversal::firstWithin(*this); element; element = ElementTraversal::nextSkippingChildren(*element, this)) {
- if (element->hasTagName(legendTag))
- invalidateDisabledStateUnder(*element);
- }
+ for (HTMLLegendElement* legend = Traversal<HTMLLegendElement>::firstChild(*this); legend; legend = Traversal<HTMLLegendElement>::nextSibling(*legend))
+ invalidateDisabledStateUnder(*legend);
}
bool HTMLFieldSetElement::supportsFocus() const
@@ -91,11 +89,7 @@ RenderObject* HTMLFieldSetElement::createRenderer(RenderStyle*)
HTMLLegendElement* HTMLFieldSetElement::legend() const
{
- for (Element* child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSkippingChildren(*child, this)) {
- if (child->hasTagName(legendTag))
- return toHTMLLegendElement(child);
- }
- return 0;
+ return Traversal<HTMLLegendElement>::firstChild(*this);
}
PassRefPtr<HTMLCollection> HTMLFieldSetElement::elements()
« no previous file with comments | « Source/core/html/HTMLDetailsElement.cpp ('k') | Source/core/html/HTMLMapElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698