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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXObjectImpl.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/AXObjectImpl.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp b/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp
index c425d319cef09becd3e2ef032be455727988e426..1b6e85114762795b16851bf679002ff13da36cb3 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp
@@ -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 {
dmazzoni 2017/05/19 19:54:04 Should this check for the right type of container?
+ 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