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() |