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

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: Applied suggestions 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/AXObject.cpp
diff --git a/Source/modules/accessibility/AXObject.cpp b/Source/modules/accessibility/AXObject.cpp
index f5cd5277653bcf7d39b8ee6be823cef3b425d883..80c8b6d82d2d1dbf038b5d045d512e36dd5801bb 100644
--- a/Source/modules/accessibility/AXObject.cpp
+++ b/Source/modules/accessibility/AXObject.cpp
@@ -368,6 +368,7 @@ void AXObject::updateCachedAttributeValuesIfNeeded() const
m_lastModificationCount = cache->modificationCount();
m_cachedIsInertOrAriaHidden = computeIsInertOrAriaHidden();
m_cachedIsDescendantOfBarrenParent = computeIsDescendantOfBarrenParent();
+ m_cachedIsDescendantOfDisabledParent = computeIsDescendantOfDisabledParent();
m_cachedIsIgnored = computeAccessibilityIsIgnored();
m_cachedLiveRegionRoot = isLiveRegion() ?
this :
@@ -434,6 +435,24 @@ bool AXObject::computeIsDescendantOfBarrenParent() const
return false;
}
+bool AXObject::isDescendantOfDisabledParent() const
+{
+ updateCachedAttributeValuesIfNeeded();
+ return m_cachedIsDescendantOfDisabledParent;
+}
+
+bool AXObject::computeIsDescendantOfDisabledParent() const
dmazzoni 2015/03/23 16:16:51 Please rewrite this to look more like computeIsIne
+{
+ for (AXObject* parent = const_cast<AXObject*>(this); parent; parent = parent->parentObject()) {
dmazzoni 2015/03/23 16:16:51 Why do you need the const_cast? Can you write it a
+ const AtomicString& disabled = parent->getAttribute(aria_disabledAttr);
+ if (equalIgnoringCase(disabled, "true"))
+ return true;
+ if (equalIgnoringCase(disabled, "false"))
+ return false;
+ }
+ return false;
+}
+
bool AXObject::lastKnownIsIgnoredValue()
{
if (m_lastKnownIsIgnoredValue == DefaultBehavior)
« LayoutTests/accessibility/aria-disabled.html ('K') | « Source/modules/accessibility/AXObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698