Index: Source/core/accessibility/AccessibilityNodeObject.cpp |
diff --git a/Source/core/accessibility/AccessibilityNodeObject.cpp b/Source/core/accessibility/AccessibilityNodeObject.cpp |
index 1cc5f008b2d1277cb069bd62f9ba2d33ba8f4408..5a19c00731087a4125aea8e594aa325ebcf7321b 100644 |
--- a/Source/core/accessibility/AccessibilityNodeObject.cpp |
+++ b/Source/core/accessibility/AccessibilityNodeObject.cpp |
@@ -208,7 +208,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole() |
return DivRole; |
if (node()->hasTagName(pTag)) |
return ParagraphRole; |
- if (node()->hasTagName(labelTag)) |
+ if (isHTMLLabelElement(node())) |
return LabelRole; |
if (node()->isFocusable()) |
return GroupRole; |
@@ -350,8 +350,8 @@ HTMLLabelElement* AccessibilityNodeObject::labelForElement(Element* element) con |
} |
for (Element* parent = element->parentElement(); parent; parent = parent->parentElement()) { |
- if (parent->hasTagName(labelTag)) |
- return static_cast<HTMLLabelElement*>(parent); |
+ if (isHTMLLabelElement(parent)) |
+ return toHTMLLabelElement(parent); |
} |
return 0; |