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

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

Issue 659563006: Add live region root to the cached properties of an AXObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address feedback Created 6 years, 2 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/core/accessibility/AXObject.h ('k') | Source/core/accessibility/AXRenderObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/core/accessibility/AXObject.h ('k') | Source/core/accessibility/AXRenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698