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

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

Issue 1039873002: AX presentation role should be inherited to its required owned elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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/modules/accessibility/AXListBoxOption.cpp
diff --git a/Source/modules/accessibility/AXListBoxOption.cpp b/Source/modules/accessibility/AXListBoxOption.cpp
index 58a91d3a8961d74c081a87413373c69a193e9678..f450328eeab67642bf32845c88ef392982a65305 100644
--- a/Source/modules/accessibility/AXListBoxOption.cpp
+++ b/Source/modules/accessibility/AXListBoxOption.cpp
@@ -58,9 +58,32 @@ AccessibilityRole AXListBoxOption::roleValue() const
AccessibilityRole ariaRole = ariaRoleAttribute();
if (ariaRole != UnknownRole)
return ariaRole;
+
+ // This is for handling presentation Role.
+ // Currently IE handles presentation role correctly with OptionElement.
dmazzoni 2015/03/29 07:46:22 I'd leave out this comment on IE unless the only r
je_julie(Not used) 2015/03/31 16:14:27 I replaced the comment with the spec description.
+ // It doesn't ignore tree but handles it with Static Text Role.
+ // That's why it's handled in roleValue(), not in computeAccessibilityIsIgnored()
+ if (isParentPresentationRole())
+ return StaticTextRole;
+
return ListBoxOptionRole;
}
+bool AXListBoxOption::isParentPresentationRole() const
+{
+ AXObject* parent = parentObject();
+ if (!parent)
+ return false;
+
+ Node* parentNode = parent->node();
+ if (isHTMLSelectElement(parentNode)) {
+ HTMLSelectElement& selectElement = toHTMLSelectElement(*parentNode);
+ if (selectElement.multiple() && isPresentationRole(parent))
+ return true;
+ }
+ return false;
+}
+
bool AXListBoxOption::isEnabled() const
{
if (!node())

Powered by Google App Engine
This is Rietveld 408576698