Index: Source/core/html/HTMLLegendElement.cpp |
diff --git a/Source/core/html/HTMLLegendElement.cpp b/Source/core/html/HTMLLegendElement.cpp |
index 20a6e8f6b60e5fa27fbc9245a8bff1f0009b2313..889056f495f2b9130250e76b60caab5bf743a4b1 100644 |
--- a/Source/core/html/HTMLLegendElement.cpp |
+++ b/Source/core/html/HTMLLegendElement.cpp |
@@ -57,13 +57,7 @@ HTMLFormControlElement* HTMLLegendElement::associatedControl() |
// Find first form element inside the fieldset that is not a legend element. |
// FIXME: Should we consider tabindex? |
- Element* element = fieldset; |
- while ((element = ElementTraversal::next(*element, fieldset))) { |
- if (element->isFormControlElement()) |
- return toHTMLFormControlElement(element); |
- } |
- |
- return 0; |
+ return Traversal<HTMLFormControlElement>::next(*fieldset, fieldset); |
} |
void HTMLLegendElement::focus(bool, FocusType type) |