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

Unified Diff: Source/modules/accessibility/AXRenderObject.cpp

Issue 887643003: Changed accessibility properies to meet W3C standard. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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/modules/accessibility/AXRenderObject.cpp
diff --git a/Source/modules/accessibility/AXRenderObject.cpp b/Source/modules/accessibility/AXRenderObject.cpp
index a7c75232694e36186a0b8961e8e66d5df2346858..5a509841cfafc6e36e61cd8bfadaa2f2cfb11bc5 100644
--- a/Source/modules/accessibility/AXRenderObject.cpp
+++ b/Source/modules/accessibility/AXRenderObject.cpp
@@ -280,6 +280,10 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole()
return ListItemRole;
if (m_renderer->isListMarker())
return ListMarkerRole;
+ if (isHTMLSelectElement(node)) {
+ HTMLSelectElement& selectElement = toHTMLSelectElement(*node);
+ return (selectElement.multiple() || selectElement.size() > 1 ) ? ListBoxRole : PopUpButtonRole;
dmazzoni 2015/01/29 16:28:29 I don't think this will return the correct result
m.lapinski 2015/01/30 10:46:21 According to standard (working draft) http://www.w
dmazzoni 2015/02/02 19:49:25 Yeah, I think we need to fix the layout test so th
+ }
if (m_renderer->isBR())
return LineBreakRole;
if (isHTMLLegendElement(node))
@@ -896,8 +900,6 @@ String AXRenderObject::stringValue() const
if (isPasswordFieldAndShouldHideValue())
return String();
- RenderBoxModelObject* cssBox = renderBoxModelObject();
-
if (ariaRoleAttribute() == StaticTextRole) {
String staticText = text();
if (!staticText.length())
@@ -908,7 +910,7 @@ String AXRenderObject::stringValue() const
if (m_renderer->isText())
return textUnderElement();
- if (cssBox && cssBox->isMenuList()) {
+ if (isHTMLSelectElement(m_renderer->node())) {
// RenderMenuList will go straight to the text() of its selected item.
// This has to be overridden in the case where the selected item has an ARIA label.
HTMLSelectElement* selectElement = toHTMLSelectElement(m_renderer->node());
@@ -919,7 +921,7 @@ String AXRenderObject::stringValue() const
if (!overriddenDescription.isNull())
return overriddenDescription;
}
- return toRenderMenuList(m_renderer)->text();
+ return selectElement->value();
}
if (m_renderer->isListMarker())

Powered by Google App Engine
This is Rietveld 408576698