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

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

Issue 2893683002: Selection follows focus/activedescendant in single selection containers (Closed)
Patch Set: Last test to fix we hope 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/AXObjectImpl.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp b/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp
index 37699ded8eb6daca5aa78529441b7caa1843913c..e30e4a4005faf14054d76d89cb18fce95c517156 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp
@@ -774,7 +774,7 @@ bool AXObjectImpl::ComputeAncestorExposesActiveDescendant() const {
return false;
if (parent->SupportsActiveDescendant() &&
- !parent->GetAttribute(aria_activedescendantAttr).IsEmpty()) {
+ parent->HasAttribute(aria_activedescendantAttr)) {
return true;
}
@@ -1255,6 +1255,35 @@ AXObjectImpl* AXObjectImpl::ParentObjectUnignored() const {
return parent;
}
+// Container widgets are those that a user tabs into and arrows around
+// sub-widgets
+bool AXObjectImpl::IsContainerWidget() const {
+ switch (RoleValue()) {
+ case kComboBoxRole:
+ case kGridRole:
+ case kListBoxRole:
+ case kMenuBarRole:
+ case kMenuRole:
+ case kRadioGroupRole:
+ case kSpinButtonRole:
+ case kTabListRole:
+ case kToolbarRole:
+ case kTreeGridRole:
+ case kTreeRole:
+ return true;
+ default:
+ return false;
+ }
+}
+
+AXObjectImpl* AXObjectImpl::ContainerWidget() const {
+ AXObjectImpl* ancestor = ParentObjectUnignored();
+ while (ancestor && !ancestor->IsContainerWidget())
+ ancestor = ancestor->ParentObjectUnignored();
+
+ return ancestor;
+}
+
void AXObjectImpl::UpdateChildrenIfNecessary() {
if (!HasChildren())
AddChildren();

Powered by Google App Engine
This is Rietveld 408576698