Chromium Code Reviews| 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) |