Index: Source/core/dom/Node.cpp |
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
index 445d1888d125c3798d7677b1f8c7e2b3ea0a4c14..afaead1921a380356e74cf2965522db934489038 100644 |
--- a/Source/core/dom/Node.cpp |
+++ b/Source/core/dom/Node.cpp |
@@ -293,10 +293,8 @@ Node::~Node() |
RELEASE_ASSERT(!renderer()); |
- if (!isContainerNode()) { |
- if (Document* document = documentInternal()) |
- willBeDeletedFrom(document); |
- } |
+ if (!isContainerNode()) |
+ willBeDeletedFromDocument(); |
if (m_previous) |
m_previous->setNextSibling(0); |
@@ -308,18 +306,19 @@ Node::~Node() |
InspectorCounters::decrementCounter(InspectorCounters::NodeCounter); |
} |
-void Node::willBeDeletedFrom(Document* document) |
+void Node::willBeDeletedFromDocument() |
{ |
+ Document* document = documentInternal(); |
+ if (!document) |
+ return; |
+ |
if (hasEventTargetData()) { |
- if (document) |
- document->didRemoveEventTargetNode(this); |
+ document->didRemoveEventTargetNode(this); |
clearEventTargetData(); |
} |
- if (document) { |
- if (AXObjectCache* cache = document->existingAXObjectCache()) |
- cache->remove(this); |
- } |
+ if (AXObjectCache* cache = document->existingAXObjectCache()) |
+ cache->remove(this); |
} |
NodeRareData* Node::rareData() const |