Chromium Code Reviews| Index: third_party/WebKit/Source/modules/accessibility/AXObject.cpp |
| diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp |
| index fee64c6d8d0827216bf91915953c1d68b30addb7..fce425f9af40a21639827fd3821b41305229e0e6 100644 |
| --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp |
| +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp |
| @@ -330,7 +330,8 @@ const char* ariaWidgets[] = { |
| "timer", |
| "tooltip", |
| "treeitem", |
| - // Composite user interface widgets. This list is also from w3.org site refrerenced above. |
| + // Composite user interface widgets. |
| + // This list is also from the w3.org site referenced above. |
| "combobox", |
| "grid", |
| "listbox", |
| @@ -676,6 +677,18 @@ bool AXObject::isPresentationalChild() const |
| return m_cachedIsPresentationalChild; |
| } |
| +bool AXObject::ancestorExposesActiveDescendant() const |
|
dmazzoni
2016/03/31 05:48:30
To be correct, shouldn't we check the role of the
|
| +{ |
| + for (const AXObject* object = this; object; object = object->parentObjectUnignored()) { |
| + if (object->supportsActiveDescendant() |
| + && !object->getAttribute(aria_activedescendantAttr).isEmpty()) { |
| + return true; |
| + } |
| + } |
| + |
| + return false; |
| +} |
| + |
| // Simplify whitespace, but preserve a single leading and trailing whitespace character if it's present. |
| // static |
| String AXObject::collapseWhitespace(const String& str) |
| @@ -979,6 +992,29 @@ bool AXObject::ariaPressedIsPresent() const |
| return !getAttribute(aria_pressedAttr).isEmpty(); |
| } |
| +bool AXObject::supportsActiveDescendant() const |
| +{ |
| + // According to the ARIA Spec, all ARIA composite widgets, ARIA text boxes |
| + // and ARIA groups should be able to expose an active descendant. |
| + // Implicitly, <input> and <textarea> elements should also have this ability. |
| + switch (ariaRoleAttribute()) { |
| + case ComboBoxRole: |
| + case GridRole: |
| + case GroupRole: |
| + case ListBoxRole: |
| + case MenuRole: |
| + case MenuBarRole: |
| + case RadioGroupRole: |
| + case TabListRole: |
| + case TextFieldRole: |
|
dmazzoni
2016/03/31 05:48:30
You deleted toolbar and some others, but the ARIA
|
| + case TreeRole: |
| + case TreeGridRole: |
| + return true; |
| + default: |
| + return false; |
| + } |
| +} |
| + |
| bool AXObject::supportsARIAAttributes() const |
| { |
| return isLiveRegion() |