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

Unified Diff: Source/modules/accessibility/AXLayoutObject.cpp

Issue 1039873002: AX presentation role should be inherited to its required owned elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moved code to AXNodeObject Created 5 years, 9 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: Source/modules/accessibility/AXLayoutObject.cpp
diff --git a/Source/modules/accessibility/AXLayoutObject.cpp b/Source/modules/accessibility/AXLayoutObject.cpp
index c9fae167c7f5c373131187f1f292abadfd85b441..87f0b905a1744f9122168d3e316064200178b8f1 100644
--- a/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/Source/modules/accessibility/AXLayoutObject.cpp
@@ -563,7 +563,7 @@ bool AXLayoutObject::computeAccessibilityIsIgnored() const
if (roleValue() == IgnoredRole)
return true;
- if ((roleValue() == NoneRole || roleValue() == PresentationalRole) || inheritsPresentationalRole())
+ if (isPresentationRole(static_cast<const AXObject*>(this)))
dmazzoni 2015/03/31 16:35:23 Can you do this without the cast? If you do need
je_julie(Not used) 2015/04/01 12:51:28 Because |this| is AXLayoutObject and parameter typ
return true;
// An ARIA tree can only have tree items and static text as children.
@@ -2292,36 +2292,6 @@ bool AXLayoutObject::elementAttributeValue(const QualifiedName& attributeName) c
return equalIgnoringCase(getAttribute(attributeName), "true");
}
-bool AXLayoutObject::inheritsPresentationalRole() const
-{
- // ARIA states if an item can get focus, it should not be presentational.
- if (canSetFocusAttribute())
- return false;
-
- // ARIA spec says that when a parent object is presentational, and it has required child elements,
- // those child elements are also presentational. For example, <li> becomes presentational from <ul>.
- // http://www.w3.org/WAI/PF/aria/complete#presentation
- if (roleValue() != ListItemRole && roleValue() != ListMarkerRole)
- return false;
-
- AXObject* parent = parentObject();
- if (!parent->isAXLayoutObject())
- return false;
-
- Node* elementNode = toAXLayoutObject(parent)->node();
- if (!elementNode || !elementNode->isElementNode())
- return false;
-
- QualifiedName tagName = toElement(elementNode)->tagQName();
- if (tagName != ulTag && tagName != olTag && tagName != dlTag)
- return false;
-
- if (parent->roleValue() == NoneRole || parent->roleValue() == PresentationalRole)
- return ariaRoleAttribute() == UnknownRole;
-
- return false;
-}
-
LayoutRect AXLayoutObject::computeElementRect() const
{
LayoutObject* obj = m_layoutObject;

Powered by Google App Engine
This is Rietveld 408576698