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

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: Update 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
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.h ('k') | Source/modules/accessibility/AXListBoxOption.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXLayoutObject.cpp
diff --git a/Source/modules/accessibility/AXLayoutObject.cpp b/Source/modules/accessibility/AXLayoutObject.cpp
index d963361898e1725889e596975126929f162ba82e..f0f763bb6ba5b9e46954ec27ee96f112de5db6bd 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 (hasInheritedPresentationalRole())
return true;
// An ARIA tree can only have tree items and static text as children.
@@ -2293,36 +2293,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;
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.h ('k') | Source/modules/accessibility/AXListBoxOption.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698