Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index bb638c79e5ba62286b6ea9d474350d927ae45288..4b0ad253802576b8b5f73c518e91db4851d31603 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -2121,9 +2121,6 @@ void Document::detach(const AttachContext& context) |
if (m_frame->loader().client()->sharedWorkerRepositoryClient()) |
m_frame->loader().client()->sharedWorkerRepositoryClient()->documentDetached(this); |
- if (this == &axObjectCacheOwner()) |
- clearAXObjectCache(); |
- |
stopActiveDOMObjects(); |
// FIXME: consider using ActiveDOMObject. |
@@ -2153,9 +2150,11 @@ void Document::detach(const AttachContext& context) |
m_focusedElement = nullptr; |
if (frameHost()) |
frameHost()->chrome().focusedNodeChanged(oldFocusedElement.get(), nullptr); |
- |
} |
+ if (this == &axObjectCacheOwner()) |
+ clearAXObjectCache(); |
+ |
m_layoutView = nullptr; |
ContainerNode::detach(context); |