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

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

Issue 2893683002: Selection follows focus/activedescendant in single selection containers (Closed)
Patch Set: Format Created 3 years, 7 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: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
index c50a0bd5fe58a5002fb9ce0c5dd8b0e03c353906..ae82be562a3fabcf24a200ba5c6734bef3c69673 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -1294,11 +1294,13 @@ bool AXNodeObject::CanSetValueAttribute() const {
}
bool AXNodeObject::CanSetSelectedAttribute() const {
- // ARIA list box options can be selected if they are children of an element
- // with an aria-activedescendant attribute.
- if (AriaRoleAttribute() == kListBoxOptionRole &&
- AncestorExposesActiveDescendant())
+ const AccessibilityRole role = AriaRoleAttribute();
+ // These elements can be selected if not disabled (native or ARIA)
+ if ((role == kListBoxOptionRole || role == kTreeItemRole ||
+ role == kCellRole || role == kTabRole) &&
+ IsEnabled()) {
dmazzoni 2017/05/19 19:54:04 Do we need to check if the container is enabled or
return true;
+ }
return AXObjectImpl::CanSetSelectedAttribute();
}

Powered by Google App Engine
This is Rietveld 408576698