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

Unified Diff: Source/WebCore/dom/Node.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/Element.cpp ('k') | Source/WebCore/editing/AppendNodeCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Node.cpp
===================================================================
--- Source/WebCore/dom/Node.cpp (revision 146890)
+++ Source/WebCore/dom/Node.cpp (working copy)
@@ -431,10 +431,8 @@
if (renderer())
detach();
- if (doc && !isContainerNode()) {
- if (AXObjectCache* cache = doc->existingAXObjectCache())
- cache->remove(this);
- }
+ if (AXObjectCache::accessibilityEnabled() && doc && doc->axObjectCacheExists() && !isContainerNode())
+ doc->axObjectCache()->remove(this);
if (m_previous)
m_previous->setNextSibling(0);
@@ -728,12 +726,10 @@
ASSERT(document());
ASSERT(AXObjectCache::accessibilityEnabled());
- ASSERT(document()->existingAXObjectCache());
+ ASSERT(document()->axObjectCacheExists());
- if (document()) {
- if (AXObjectCache* cache = document()->existingAXObjectCache())
- return cache->rootAXEditableElement(this);
- }
+ if (document() && AXObjectCache::accessibilityEnabled() && document()->axObjectCacheExists())
+ return document()->axObjectCache()->rootAXEditableElement(this);
return false;
}
@@ -1086,10 +1082,9 @@
setAttached();
clearNeedsStyleRecalc();
- if (Document* doc = documentInternal()) {
- if (AXObjectCache* cache = doc->axObjectCache())
- cache->updateCacheAfterNodeIsAttached(this);
- }
+ Document* doc = documentInternal();
+ if (AXObjectCache::accessibilityEnabled() && doc && doc->axObjectCacheExists())
+ doc->axObjectCache()->updateCacheAfterNodeIsAttached(this);
}
#ifndef NDEBUG
@@ -1310,11 +1305,9 @@
Element* Node::rootEditableElement(EditableType editableType) const
{
- if (editableType == HasEditableAXRole) {
- if (AXObjectCache* cache = document()->existingAXObjectCache())
- return const_cast<Element*>(cache->rootAXEditableElement(this));
- }
-
+ if (editableType == HasEditableAXRole)
+ return const_cast<Element*>(document()->axObjectCache()->rootAXEditableElement(this));
+
return rootEditableElement();
}
@@ -2092,9 +2085,8 @@
{
TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(oldDocument);
- if (AXObjectCache::accessibilityEnabled() && oldDocument)
- if (AXObjectCache* cache = oldDocument->existingAXObjectCache())
- cache->remove(this);
+ if (AXObjectCache::accessibilityEnabled() && oldDocument && oldDocument->axObjectCacheExists())
+ oldDocument->axObjectCache()->remove(this);
// FIXME: Event listener types for this node should be set on the new owner document here.
« no previous file with comments | « Source/WebCore/dom/Element.cpp ('k') | Source/WebCore/editing/AppendNodeCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698