Index: Source/core/html/HTMLLegendElement.cpp |
diff --git a/Source/core/html/HTMLLegendElement.cpp b/Source/core/html/HTMLLegendElement.cpp |
index 889056f495f2b9130250e76b60caab5bf743a4b1..858578d812f79483110e8a93fda24ca6f7370fd0 100644 |
--- a/Source/core/html/HTMLLegendElement.cpp |
+++ b/Source/core/html/HTMLLegendElement.cpp |
@@ -50,7 +50,7 @@ HTMLFormControlElement* HTMLLegendElement::associatedControl() |
{ |
// Check if there's a fieldset belonging to this legend. |
Element* fieldset = parentElement(); |
- while (fieldset && !fieldset->hasTagName(fieldsetTag)) |
+ while (fieldset && !isHTMLFieldSetElement(*fieldset)) |
fieldset = fieldset->parentElement(); |
if (!fieldset) |
return 0; |
@@ -82,7 +82,7 @@ HTMLFormElement* HTMLLegendElement::form() const |
// its parent, then the form attribute must return the same value as the |
// form attribute on that fieldset element. Otherwise, it must return null. |
ContainerNode* fieldset = parentNode(); |
- if (!fieldset || !fieldset->hasTagName(fieldsetTag)) |
+ if (!isHTMLFieldSetElement(fieldset)) |
return 0; |
return toHTMLFieldSetElement(fieldset)->formOwner(); |