Commit ebde78e3 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Relax aria-activedescendant validation

Removing the role check for aria-activedescendant support simplifies the
code and decreases differences with Firefox.

Bug: None
Change-Id: Ie497d29434344152d1e51d27a9301e31e332b1d9
Reviewed-on: https://chromium-review.googlesource.com/1213539Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590294}
parent 129510a5
...@@ -2414,7 +2414,7 @@ void AXLayoutObject::HandleActiveDescendantChanged() { ...@@ -2414,7 +2414,7 @@ void AXLayoutObject::HandleActiveDescendantChanged() {
return; return;
AXObject* focused_object = AXObjectCache().FocusedObject(); AXObject* focused_object = AXObjectCache().FocusedObject();
if (focused_object == this && SupportsARIAActiveDescendant()) { if (focused_object == this) {
AXObject* active_descendant = ActiveDescendant(); AXObject* active_descendant = ActiveDescendant();
if (active_descendant && active_descendant->IsSelectedFromFocus()) { if (active_descendant && active_descendant->IsSelectedFromFocus()) {
// In single selection containers, selection follows focus, so a selection // In single selection containers, selection follows focus, so a selection
......
...@@ -1290,8 +1290,7 @@ bool AXObject::AncestorExposesActiveDescendant() const { ...@@ -1290,8 +1290,7 @@ bool AXObject::AncestorExposesActiveDescendant() const {
if (!parent) if (!parent)
return false; return false;
if (parent->SupportsARIAActiveDescendant() && if (parent->GetAOMPropertyOrARIAAttribute(
parent->GetAOMPropertyOrARIAAttribute(
AOMRelationProperty::kActiveDescendant)) { AOMRelationProperty::kActiveDescendant)) {
return true; return true;
} }
...@@ -1734,34 +1733,6 @@ bool AXObject::AriaCheckedIsPresent() const { ...@@ -1734,34 +1733,6 @@ bool AXObject::AriaCheckedIsPresent() const {
return HasAOMPropertyOrARIAAttribute(AOMStringProperty::kChecked, result); return HasAOMPropertyOrARIAAttribute(AOMStringProperty::kChecked, result);
} }
bool AXObject::SupportsARIAActiveDescendant() const {
// According to the ARIA Spec, all ARIA composite widgets, ARIA text boxes,
// ARIA groups and ARIA application should be able to expose an active descendant.
// Implicitly, <input> and <textarea> elements should also have this ability.
switch (RoleValue()) {
case kComboBoxGroupingRole:
case kComboBoxMenuButtonRole:
case kGridRole:
case kGroupRole:
case kListBoxRole:
case kMenuRole:
case kMenuBarRole:
case kRadioGroupRole:
case kRowRole:
case kSearchBoxRole:
case kTabListRole:
case kTextFieldRole:
case kTextFieldWithComboBoxRole:
case kToolbarRole:
case kTreeRole:
case kTreeGridRole:
case kApplicationRole:
return true;
default:
return false;
}
}
bool AXObject::SupportsARIAExpanded() const { bool AXObject::SupportsARIAExpanded() const {
switch (RoleValue()) { switch (RoleValue()) {
case kAlertDialogRole: case kAlertDialogRole:
......
...@@ -727,7 +727,6 @@ class MODULES_EXPORT AXObject : public GarbageCollectedFinalized<AXObject> { ...@@ -727,7 +727,6 @@ class MODULES_EXPORT AXObject : public GarbageCollectedFinalized<AXObject> {
virtual bool IsRichlyEditable() const { return false; } virtual bool IsRichlyEditable() const { return false; }
bool AriaCheckedIsPresent() const; bool AriaCheckedIsPresent() const;
bool AriaPressedIsPresent() const; bool AriaPressedIsPresent() const;
bool SupportsARIAActiveDescendant() const;
bool SupportsARIAAttributes() const; bool SupportsARIAAttributes() const;
bool SupportsARIAExpanded() const; bool SupportsARIAExpanded() const;
virtual bool SupportsARIADragging() const { return false; } virtual bool SupportsARIADragging() const { return false; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment