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

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

Issue 670093002: Get rid of AXComputedObjectAttributeCache (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comment 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/AXObjectCacheImpl.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 dd3f7b0ac1def71d5c2b562020589227d16ef36a..55bdba6394da246fe386f4784da922bf69156604 100644
--- a/Source/core/accessibility/AXObject.cpp
+++ b/Source/core/accessibility/AXObject.cpp
@@ -134,6 +134,8 @@ AXObject::AXObject()
, m_role(UnknownRole)
, m_lastKnownIsIgnoredValue(DefaultBehavior)
, m_detached(false)
+ , m_lastModificationCount(-1)
+ , m_cachedIsIgnored(false)
{
}
@@ -248,29 +250,21 @@ bool AXObject::isClickable() const
bool AXObject::accessibilityIsIgnored() const
{
+ updateCachedAttributeValuesIfNeeded();
+ return m_cachedIsIgnored;
+}
+
+void AXObject::updateCachedAttributeValuesIfNeeded() const
+{
AXObjectCacheImpl* cache = axObjectCache();
if (!cache)
- return true;
-
- AXComputedObjectAttributeCache* attributeCache = cache->computedObjectAttributeCache();
- if (attributeCache) {
- AXObjectInclusion ignored = attributeCache->getIgnored(axObjectID());
- switch (ignored) {
- case IgnoreObject:
- return true;
- case IncludeObject:
- return false;
- case DefaultBehavior:
- break;
- }
- }
-
- bool result = computeAccessibilityIsIgnored();
+ return;
- if (attributeCache)
- attributeCache->setIgnored(axObjectID(), result ? IgnoreObject : IncludeObject);
+ if (cache->modificationCount() == m_lastModificationCount)
+ return;
- return result;
+ m_cachedIsIgnored = computeAccessibilityIsIgnored();
+ m_lastModificationCount = cache->modificationCount();
}
bool AXObject::accessibilityIsIgnoredByDefault() const
« no previous file with comments | « Source/core/accessibility/AXObject.h ('k') | Source/core/accessibility/AXObjectCacheImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698