| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // update auxiliary doc info (e.g. iterators) to note that node is being rem
oved | 361 // update auxiliary doc info (e.g. iterators) to note that node is being rem
oved |
| 362 child->document()->nodeWillBeRemoved(child); | 362 child->document()->nodeWillBeRemoved(child); |
| 363 | 363 |
| 364 // fire removed from document mutation events. | 364 // fire removed from document mutation events. |
| 365 dispatchChildRemovalEvents(child); | 365 dispatchChildRemovalEvents(child); |
| 366 child->willRemove(); | 366 child->willRemove(); |
| 367 } | 367 } |
| 368 | 368 |
| 369 static void willRemoveChildren(ContainerNode* container) | 369 static void willRemoveChildren(ContainerNode* container) |
| 370 { | 370 { |
| 371 container->document()->nodeChildrenWillBeRemoved(container); | |
| 372 | |
| 373 NodeVector children; | 371 NodeVector children; |
| 374 getChildNodes(container, children); | 372 getChildNodes(container, children); |
| 375 | 373 |
| 374 container->document()->nodeChildrenWillBeRemoved(container); |
| 375 |
| 376 #if ENABLE(MUTATION_OBSERVERS) | 376 #if ENABLE(MUTATION_OBSERVERS) |
| 377 ChildListMutationScope mutation(container); | 377 ChildListMutationScope mutation(container); |
| 378 #endif | 378 #endif |
| 379 | 379 |
| 380 for (NodeVector::const_iterator it = children.begin(); it != children.end();
it++) { | 380 for (NodeVector::const_iterator it = children.begin(); it != children.end();
it++) { |
| 381 Node* child = it->get(); | 381 Node* child = it->get(); |
| 382 // fire removed from document mutation events. | 382 // fire removed from document mutation events. |
| 383 dispatchChildRemovalEvents(child); | 383 dispatchChildRemovalEvents(child); |
| 384 child->willRemove(); | 384 child->willRemove(); |
| 385 } | 385 } |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 c->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeRemoved
Event, true, c->parentNode())); | 1126 c->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeRemoved
Event, true, c->parentNode())); |
| 1127 | 1127 |
| 1128 // dispatch the DOMNodeRemovedFromDocument event to all descendants | 1128 // dispatch the DOMNodeRemovedFromDocument event to all descendants |
| 1129 if (c->inDocument() && document->hasListenerType(Document::DOMNODEREMOVEDFRO
MDOCUMENT_LISTENER)) { | 1129 if (c->inDocument() && document->hasListenerType(Document::DOMNODEREMOVEDFRO
MDOCUMENT_LISTENER)) { |
| 1130 for (; c; c = c->traverseNextNode(child)) | 1130 for (; c; c = c->traverseNextNode(child)) |
| 1131 c->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeRem
ovedFromDocumentEvent, false)); | 1131 c->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeRem
ovedFromDocumentEvent, false)); |
| 1132 } | 1132 } |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 } // namespace WebCore | 1135 } // namespace WebCore |
| OLD | NEW |