Chromium Code Reviews| 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(); |