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

Unified Diff: Source/core/accessibility/AccessibilityRenderObject.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
« no previous file with comments | « Source/core/accessibility/AccessibilityNodeObject.cpp ('k') | Source/core/dom/DocumentOrderedMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AccessibilityRenderObject.cpp
diff --git a/Source/core/accessibility/AccessibilityRenderObject.cpp b/Source/core/accessibility/AccessibilityRenderObject.cpp
index bd9806d5bb3d2431cba9b7f380fbe714393c7555..2b8b25120e7ac98ada150d0b93ebfdf9262f1a8d 100644
--- a/Source/core/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/core/accessibility/AccessibilityRenderObject.cpp
@@ -270,8 +270,8 @@ HTMLLabelElement* AccessibilityRenderObject::labelElementContainer() const
// find if this has a parent that is a label
for (Node* parentNode = m_renderer->node(); parentNode; parentNode = parentNode->parentNode()) {
- if (parentNode->hasTagName(labelTag))
- return static_cast<HTMLLabelElement*>(parentNode);
+ if (isHTMLLabelElement(parentNode))
+ return toHTMLLabelElement(parentNode);
}
return 0;
@@ -404,7 +404,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
if (node && node->hasTagName(pTag))
return ParagraphRole;
- if (node && node->hasTagName(labelTag))
+ if (node && isHTMLLabelElement(node))
return LabelRole;
if (node && node->hasTagName(divTag))
@@ -725,7 +725,7 @@ bool AccessibilityRenderObject::computeAccessibilityIsIgnored() const
// don't ignore labels, because they serve as TitleUIElements
Node* node = m_renderer->node();
- if (node && node->hasTagName(labelTag))
+ if (node && isHTMLLabelElement(node))
return false;
// Anything that is content editable should not be ignored.
« no previous file with comments | « Source/core/accessibility/AccessibilityNodeObject.cpp ('k') | Source/core/dom/DocumentOrderedMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698