Index: Source/core/accessibility/AXObject.cpp |
diff --git a/Source/core/accessibility/AXObject.cpp b/Source/core/accessibility/AXObject.cpp |
index 55bdba6394da246fe386f4784da922bf69156604..bb537021d54a15b71753a32a1cb5a1832d547e84 100644 |
--- a/Source/core/accessibility/AXObject.cpp |
+++ b/Source/core/accessibility/AXObject.cpp |
@@ -136,6 +136,7 @@ AXObject::AXObject() |
, m_detached(false) |
, m_lastModificationCount(-1) |
, m_cachedIsIgnored(false) |
+ , m_cachedLiveRegionRoot(0) |
{ |
} |
@@ -263,8 +264,9 @@ void AXObject::updateCachedAttributeValuesIfNeeded() const |
if (cache->modificationCount() == m_lastModificationCount) |
return; |
- m_cachedIsIgnored = computeAccessibilityIsIgnored(); |
m_lastModificationCount = cache->modificationCount(); |
+ m_cachedIsIgnored = computeAccessibilityIsIgnored(); |
+ m_cachedLiveRegionRoot = isLiveRegion() ? this : (parentObjectIfExists() ? parentObjectIfExists()->liveRegionRoot() : 0); |
aboxhall
2014/10/27 17:29:53
I'd consider wrapping this onto a few lines to mak
dmazzoni
2014/10/27 18:08:25
Done.
|
} |
bool AXObject::accessibilityIsIgnoredByDefault() const |
@@ -392,7 +394,7 @@ bool AXObject::ariaPressedIsPresent() const |
bool AXObject::supportsARIAAttributes() const |
{ |
- return supportsARIALiveRegion() |
+ return isLiveRegion() |
|| supportsARIADragging() |
|| supportsARIADropping() |
|| supportsARIAFlowTo() |
@@ -424,12 +426,42 @@ void AXObject::ariaTreeRows(AccessibilityChildrenVector& result) |
} |
} |
-bool AXObject::supportsARIALiveRegion() const |
+bool AXObject::isLiveRegion() const |
{ |
- const AtomicString& liveRegion = ariaLiveRegionStatus(); |
+ const AtomicString& liveRegion = liveRegionStatus(); |
return equalIgnoringCase(liveRegion, "polite") || equalIgnoringCase(liveRegion, "assertive"); |
} |
+const AXObject* AXObject::liveRegionRoot() const |
+{ |
+ updateCachedAttributeValuesIfNeeded(); |
+ return m_cachedLiveRegionRoot; |
+} |
+ |
+const AtomicString& AXObject::containerLiveRegionStatus() const |
+{ |
+ updateCachedAttributeValuesIfNeeded(); |
+ return m_cachedLiveRegionRoot ? m_cachedLiveRegionRoot->liveRegionStatus() : nullAtom; |
+} |
+ |
+const AtomicString& AXObject::containerLiveRegionRelevant() const |
+{ |
+ updateCachedAttributeValuesIfNeeded(); |
+ return m_cachedLiveRegionRoot ? m_cachedLiveRegionRoot->liveRegionRelevant() : nullAtom; |
+} |
+ |
+bool AXObject::containerLiveRegionAtomic() const |
+{ |
+ updateCachedAttributeValuesIfNeeded(); |
+ return m_cachedLiveRegionRoot ? m_cachedLiveRegionRoot->liveRegionAtomic() : false; |
+} |
+ |
+bool AXObject::containerLiveRegionBusy() const |
+{ |
+ updateCachedAttributeValuesIfNeeded(); |
+ return m_cachedLiveRegionRoot ? m_cachedLiveRegionRoot->liveRegionBusy() : false; |
+} |
+ |
void AXObject::markCachedElementRectDirty() const |
{ |
for (unsigned i = 0; i < m_children.size(); ++i) |