| 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.
|
|
|
|
|