diff options
Diffstat (limited to 'WebCore/dom/ContainerNode.cpp')
-rw-r--r-- | WebCore/dom/ContainerNode.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp index 569756c..2d79156 100644 --- a/WebCore/dom/ContainerNode.cpp +++ b/WebCore/dom/ContainerNode.cpp @@ -869,16 +869,16 @@ static void dispatchChildInsertionEvents(Node* child, ExceptionCode& ec) ASSERT(!eventDispatchForbidden()); RefPtr<Node> c = child; - RefPtr<Document> document = child->document(); + DocPtr<Document> doc = child->document(); if (c->parentNode() && c->parentNode()->inDocument()) c->insertedIntoDocument(); else c->insertedIntoTree(true); - document->incDOMTreeVersion(); + doc->incDOMTreeVersion(); - if (c->parentNode() && document->hasListenerType(Document::DOMNODEINSERTED_LISTENER)) { + if (c->parentNode() && doc->hasListenerType(Document::DOMNODEINSERTED_LISTENER)) { ec = 0; c->dispatchMutationEvent(eventNames().DOMNodeInsertedEvent, true, c->parentNode(), String(), String(), ec); if (ec) @@ -886,28 +886,27 @@ static void dispatchChildInsertionEvents(Node* child, ExceptionCode& ec) } // dispatch the DOMNodeInsertedIntoDocument event to all descendants - if (c->inDocument() && document->hasListenerType(Document::DOMNODEINSERTEDINTODOCUMENT_LISTENER)) { + if (c->inDocument() && doc->hasListenerType(Document::DOMNODEINSERTEDINTODOCUMENT_LISTENER)) for (; c; c = c->traverseNextNode(child)) { ec = 0; c->dispatchMutationEvent(eventNames().DOMNodeInsertedIntoDocumentEvent, false, 0, String(), String(), ec); if (ec) return; } - } } static void dispatchChildRemovalEvents(Node* child, ExceptionCode& ec) { RefPtr<Node> c = child; - RefPtr<Document> document = child->document(); + DocPtr<Document> doc = child->document(); // update auxiliary doc info (e.g. iterators) to note that node is being removed - document->nodeWillBeRemoved(child); + doc->nodeWillBeRemoved(child); - document->incDOMTreeVersion(); + doc->incDOMTreeVersion(); // dispatch pre-removal mutation events - if (c->parentNode() && document->hasListenerType(Document::DOMNODEREMOVED_LISTENER)) { + if (c->parentNode() && doc->hasListenerType(Document::DOMNODEREMOVED_LISTENER)) { ec = 0; c->dispatchMutationEvent(eventNames().DOMNodeRemovedEvent, true, c->parentNode(), String(), String(), ec); if (ec) @@ -915,7 +914,7 @@ static void dispatchChildRemovalEvents(Node* child, ExceptionCode& ec) } // dispatch the DOMNodeRemovedFromDocument event to all descendants - if (c->inDocument() && document->hasListenerType(Document::DOMNODEREMOVEDFROMDOCUMENT_LISTENER)) + if (c->inDocument() && doc->hasListenerType(Document::DOMNODEREMOVEDFROMDOCUMENT_LISTENER)) for (; c; c = c->traverseNextNode(child)) { ec = 0; c->dispatchMutationEvent(eventNames().DOMNodeRemovedFromDocumentEvent, false, 0, String(), String(), ec); |