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

Unified Diff: Source/WebCore/dom/Document.cpp

Issue 12703031: Revert 146726 "AXObjectCache gets recreated during document tear..." (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1453/
Patch Set: Created 7 years, 9 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/WebCore/dom/Document.h ('k') | Source/WebCore/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Document.cpp
===================================================================
--- Source/WebCore/dom/Document.cpp (revision 146890)
+++ Source/WebCore/dom/Document.cpp (working copy)
@@ -629,8 +629,7 @@
m_renderArena.clear();
- if (this == topDocument())
- clearAXObjectCache();
+ clearAXObjectCache();
m_decoder = 0;
@@ -2212,40 +2211,23 @@
void Document::clearAXObjectCache()
{
- ASSERT(topDocument() == this);
// Clear the cache member variable before calling delete because attempts
// are made to access it during destruction.
- m_axObjectCache.clear();
+ topDocument()->m_axObjectCache.release();
}
-AXObjectCache* Document::existingAXObjectCache() const
+bool Document::axObjectCacheExists() const
{
- if (!AXObjectCache::accessibilityEnabled())
- return 0;
-
- // If the renderer is gone then we are in the process of destruction.
- // This method will be called before m_frame = 0.
- if (!topDocument()->renderer())
- return 0;
-
- return topDocument()->m_axObjectCache.get();
+ return topDocument()->m_axObjectCache;
}
AXObjectCache* Document::axObjectCache() const
{
- if (!AXObjectCache::accessibilityEnabled())
- return 0;
-
// The only document that actually has a AXObjectCache is the top-level
// document. This is because we need to be able to get from any WebCoreAXObject
// to any other WebCoreAXObject on the same page. Using a single cache allows
// lookups across nested webareas (i.e. multiple documents).
Document* topDocument = this->topDocument();
-
- // If the document has already been detached, do not make a new axObjectCache.
- if (!topDocument->renderer())
- return 0;
-
ASSERT(topDocument == this || !m_axObjectCache);
if (!topDocument->m_axObjectCache)
topDocument->m_axObjectCache = adoptPtr(new AXObjectCache(topDocument));
@@ -3494,12 +3476,10 @@
}
}
- if (!focusChangeBlocked && m_focusedNode) {
- // Create the AXObject cache in a focus change because Chromium relies on it.
- if (AXObjectCache* cache = axObjectCache())
- cache->handleFocusedUIElementChanged(oldFocusedNode.get(), newFocusedNode.get());
- }
-
+#if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(CHROMIUM)
+ if (!focusChangeBlocked && m_focusedNode && AXObjectCache::accessibilityEnabled())
+ axObjectCache()->handleFocusedUIElementChanged(oldFocusedNode.get(), newFocusedNode.get());
+#endif
if (!focusChangeBlocked)
page()->chrome()->focusedNodeChanged(m_focusedNode.get());
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | Source/WebCore/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698