Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(694)

Side by Side Diff: Source/WebCore/dom/ContainerNode.cpp

Issue 10408073: Merge 117224 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698