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

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

Issue 1012663002: Aria disabled does not apply to descendant elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed methods names to ..DisabledNode() 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/AXObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXObject.cpp
diff --git a/Source/modules/accessibility/AXObject.cpp b/Source/modules/accessibility/AXObject.cpp
index 90a72e45f9f2a2836ce7cd19e4c349bcaf4e3785..d451350c269b3c73125e32f061c7b31bacc2fce0 100644
--- a/Source/modules/accessibility/AXObject.cpp
+++ b/Source/modules/accessibility/AXObject.cpp
@@ -236,6 +236,7 @@ AXObject::AXObject(AXObjectCacheImpl* axObjectCache)
, m_cachedIsIgnored(false)
, m_cachedIsInertOrAriaHidden(false)
, m_cachedIsDescendantOfBarrenParent(false)
+ , m_cachedIsDescendantOfDisabledNode(false)
, m_cachedLiveRegionRoot(0)
, m_axObjectCache(axObjectCache)
{
@@ -371,6 +372,7 @@ void AXObject::updateCachedAttributeValuesIfNeeded() const
m_lastModificationCount = cache->modificationCount();
m_cachedIsInertOrAriaHidden = computeIsInertOrAriaHidden();
m_cachedIsDescendantOfBarrenParent = computeIsDescendantOfBarrenParent();
+ m_cachedIsDescendantOfDisabledNode = computeIsDescendantOfDisabledNode();
m_cachedIsIgnored = computeAccessibilityIsIgnored();
m_cachedLiveRegionRoot = isLiveRegion() ?
this :
@@ -447,6 +449,26 @@ const AXObject* AXObject::ariaHiddenRoot() const
return 0;
}
+bool AXObject::isDescendantOfDisabledNode() const
+{
+ updateCachedAttributeValuesIfNeeded();
+ return m_cachedIsDescendantOfDisabledNode;
+}
+
+bool AXObject::computeIsDescendantOfDisabledNode() const
+{
+ const AtomicString& disabled = getAttribute(aria_disabledAttr);
+ if (equalIgnoringCase(disabled, "true"))
+ return true;
+ if (equalIgnoringCase(disabled, "false"))
+ return false;
+
+ if (AXObject* parent = parentObject())
+ return parent->isDescendantOfDisabledNode();
+
+ return false;
+}
+
bool AXObject::lastKnownIsIgnoredValue()
{
if (m_lastKnownIsIgnoredValue == DefaultBehavior)
« no previous file with comments | « Source/modules/accessibility/AXObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698