Index: Source/core/accessibility/AXObject.cpp |
diff --git a/Source/core/accessibility/AXObject.cpp b/Source/core/accessibility/AXObject.cpp |
index 55bdba6394da246fe386f4784da922bf69156604..89b75a383cdbed9e0c4166f0846c49784af3104b 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,11 @@ 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); |
} |
bool AXObject::accessibilityIsIgnoredByDefault() const |
@@ -392,7 +396,7 @@ bool AXObject::ariaPressedIsPresent() const |
bool AXObject::supportsARIAAttributes() const |
{ |
- return supportsARIALiveRegion() |
+ return isLiveRegion() |
|| supportsARIADragging() |
|| supportsARIADropping() |
|| supportsARIAFlowTo() |
@@ -424,12 +428,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) |