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

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

Issue 189963007: Use isHTML*Element() helpers more in the accessibility code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/AXListBoxOption.cpp
diff --git a/Source/core/accessibility/AXListBoxOption.cpp b/Source/core/accessibility/AXListBoxOption.cpp
index 3708ccdab6792a24fd5c48330ba9a135a6c586ff..e8f82e75c5711379aea177184a9d48303a502bca 100644
--- a/Source/core/accessibility/AXListBoxOption.cpp
+++ b/Source/core/accessibility/AXListBoxOption.cpp
@@ -74,10 +74,7 @@ bool AXListBoxOption::isEnabled() const
bool AXListBoxOption::isSelected() const
{
- if (!m_optionElement)
- return false;
-
- if (!m_optionElement->hasTagName(optionTag))
+ if (!isHTMLOptionElement(m_optionElement))
return false;
return toHTMLOptionElement(m_optionElement)->selected();
@@ -152,10 +149,10 @@ String AXListBoxOption::stringValue() const
if (!ariaLabel.isNull())
return ariaLabel;
- if (m_optionElement->hasTagName(optionTag))
+ if (isHTMLOptionElement(*m_optionElement))
return toHTMLOptionElement(m_optionElement)->text();
- if (m_optionElement->hasTagName(optgroupTag))
+ if (isHTMLOptGroupElement(*m_optionElement))
return toHTMLOptGroupElement(m_optionElement)->groupLabelText();
return String();
@@ -198,10 +195,10 @@ HTMLSelectElement* AXListBoxOption::listBoxOptionParentNode() const
if (!m_optionElement)
return 0;
- if (m_optionElement->hasTagName(optionTag))
+ if (isHTMLOptionElement(*m_optionElement))
return toHTMLOptionElement(m_optionElement)->ownerSelectElement();
- if (m_optionElement->hasTagName(optgroupTag))
+ if (isHTMLOptGroupElement(*m_optionElement))
return toHTMLOptGroupElement(m_optionElement)->ownerSelectElement();
return 0;
« no previous file with comments | « Source/build/scripts/templates/ElementTypeHelpers.h.tmpl ('k') | Source/core/accessibility/AXMediaControls.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698