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

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

Issue 18970003: Introduce isHTMLOptGroupElement and toHTMLOptGroupElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « no previous file | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AccessibilityListBoxOption.cpp
diff --git a/Source/core/accessibility/AccessibilityListBoxOption.cpp b/Source/core/accessibility/AccessibilityListBoxOption.cpp
index 6a413c2ed4597715ea7041ed2ce09c37968dd667..c847b4e747017505d3cf9700622b29194eb29184 100644
--- a/Source/core/accessibility/AccessibilityListBoxOption.cpp
+++ b/Source/core/accessibility/AccessibilityListBoxOption.cpp
@@ -59,8 +59,8 @@ bool AccessibilityListBoxOption::isEnabled() const
{
if (!m_optionElement)
return false;
-
- if (m_optionElement->hasTagName(optgroupTag))
+
+ if (isHTMLOptGroupElement(m_optionElement))
return false;
if (equalIgnoringCase(getAttribute(aria_disabledAttr), "true"))
@@ -154,10 +154,10 @@ String AccessibilityListBoxOption::stringValue() const
if (m_optionElement->hasTagName(optionTag))
return toHTMLOptionElement(m_optionElement)->text();
-
- if (m_optionElement->hasTagName(optgroupTag))
- return static_cast<HTMLOptGroupElement*>(m_optionElement)->groupLabelText();
-
+
+ if (isHTMLOptGroupElement(m_optionElement))
+ return toHTMLOptGroupElement(m_optionElement)->groupLabelText();
+
return String();
}
@@ -200,10 +200,10 @@ HTMLSelectElement* AccessibilityListBoxOption::listBoxOptionParentNode() const
if (m_optionElement->hasTagName(optionTag))
return toHTMLOptionElement(m_optionElement)->ownerSelectElement();
-
- if (m_optionElement->hasTagName(optgroupTag))
- return static_cast<HTMLOptGroupElement*>(m_optionElement)->ownerSelectElement();
-
+
+ if (isHTMLOptGroupElement(m_optionElement))
+ return toHTMLOptGroupElement(m_optionElement)->ownerSelectElement();
+
return 0;
}
« no previous file with comments | « no previous file | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698