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

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

Issue 2945773002: Relation properties for Accessibility Object Model phase 1 (Closed)
Patch Set: Fix merge error, format Created 3 years, 6 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/AXObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
index 9f0dddb05c00b8b1bdc7434512998e81102c0a09..f7145d1222ce32544ce1452749a5150af2eccd15 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
@@ -381,6 +381,17 @@ const AtomicString& AXObject::GetAOMPropertyOrARIAAttribute(
return g_null_atom;
}
+Element* AXObject::GetAOMPropertyOrARIAAttribute(
+ AOMRelationProperty property) const {
+ Element* element = this->GetElement();
+ if (!element)
+ return nullptr;
+
+ AccessibleNode* target =
+ AccessibleNode::GetPropertyOrARIAAttribute(element, property);
+ return target ? target->element() : nullptr;
+}
+
bool AXObject::HasAOMPropertyOrARIAAttribute(AOMBooleanProperty property,
bool& result) const {
Element* element = this->GetElement();
@@ -829,7 +840,8 @@ bool AXObject::CanReceiveAccessibilityFocus() const {
return false;
// Focusable, and not forwarding the focus somewhere else
- if (elem->IsFocusable() && !elem->FastHasAttribute(aria_activedescendantAttr))
+ if (elem->IsFocusable() &&
+ !GetAOMPropertyOrARIAAttribute(AOMRelationProperty::kActiveDescendant))
return true;
// aria-activedescendant focus
@@ -847,7 +859,8 @@ bool AXObject::ComputeAncestorExposesActiveDescendant() const {
return false;
if (parent->SupportsActiveDescendant() &&
- parent->HasAttribute(aria_activedescendantAttr)) {
+ parent->GetAOMPropertyOrARIAAttribute(
+ AOMRelationProperty::kActiveDescendant)) {
return true;
}

Powered by Google App Engine
This is Rietveld 408576698