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

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

Issue 887643003: Changed accessibility properies to meet W3C standard. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Aplying rewiewer's sugestion. Created 5 years, 10 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/AXNodeObject.cpp
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp
index b3e12f79c86764bd417482cc84fb214465064807..36f2ca7291c4f830e018d38f21ad02560f7caa41 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -242,7 +242,7 @@ AccessibilityRole AXNodeObject::determineAccessibilityRoleUtil()
}
if (isHTMLSelectElement(*node())) {
HTMLSelectElement& selectElement = toHTMLSelectElement(*node());
- return selectElement.multiple() ? ListBoxRole : PopUpButtonRole;
+ return (selectElement.multiple() || selectElement.size() > 1) ? ListBoxRole : PopUpButtonRole;
}
if (isHTMLTextAreaElement(*node()))
return TextAreaRole;
@@ -1181,14 +1181,21 @@ String AXNodeObject::stringValue() const
if (!overriddenDescription.isNull())
return overriddenDescription;
}
- if (!selectElement.multiple())
- return selectElement.value();
- return String();
+ return selectElement.value();
}
if (isTextControl())
return text();
+ // Handle other HTML input elements that aren't text controls, like date and time
+ // controls, by returning the string value, with the exception of checkboxes
+ // and radio buttons (which would return "on").
+ if (node && isHTMLInputElement(node)) {
+ HTMLInputElement* input = toHTMLInputElement(node);
+ if (input->type() != InputTypeNames::checkbox && input->type() != InputTypeNames::radio)
+ return input->value();
+ }
+
// FIXME: We might need to implement a value here for more types
// FIXME: It would be better not to advertise a value at all for the types for which we don't implement one;
// this would require subclassing or making accessibilityAttributeNames do something other than return a

Powered by Google App Engine
This is Rietveld 408576698