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

Unified Diff: Source/core/accessibility/AccessibilityNodeObject.cpp

Issue 18259016: Introduce isHTMLLabelElement and toHTMLLabelElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Took tkent's comment into consideration Created 7 years, 5 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
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;
« no previous file with comments | « Source/core/accessibility/AXObjectCache.cpp ('k') | Source/core/accessibility/AccessibilityRenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698