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

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

Issue 9567012: Merge 108152 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 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
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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 472
473 // FIXME: After sending the mutation events, "this" could be destroyed. 473 // FIXME: After sending the mutation events, "this" could be destroyed.
474 // We can prevent that by doing a "ref", but first we have to make sure 474 // We can prevent that by doing a "ref", but first we have to make sure
475 // that no callers call with ref count == 0 and parent = 0 (as of this 475 // that no callers call with ref count == 0 and parent = 0 (as of this
476 // writing, there are definitely callers who call that way). 476 // writing, there are definitely callers who call that way).
477 477
478 Node* prev = child->previousSibling(); 478 Node* prev = child->previousSibling();
479 Node* next = child->nextSibling(); 479 Node* next = child->nextSibling();
480 removeBetween(prev, next, child.get()); 480 removeBetween(prev, next, child.get());
481 481
482 // Dispatch post-removal mutation events
483 childrenChanged(false, prev, next, -1);
484 dispatchSubtreeModifiedEvent();
485
486 if (child->inDocument()) 482 if (child->inDocument())
487 child->removedFromDocument(); 483 child->removedFromDocument();
488 else 484 else
489 child->removedFromTree(true); 485 child->removedFromTree(true);
490 486
487 // Dispatch post-removal mutation events
488 childrenChanged(false, prev, next, -1);
489 dispatchSubtreeModifiedEvent();
490
491 return child; 491 return child;
492 } 492 }
493 493
494 void ContainerNode::removeBetween(Node* previousChild, Node* nextChild, Node* ol dChild) 494 void ContainerNode::removeBetween(Node* previousChild, Node* nextChild, Node* ol dChild)
495 { 495 {
496 ASSERT(oldChild); 496 ASSERT(oldChild);
497 ASSERT(oldChild->parentNode() == this); 497 ASSERT(oldChild->parentNode() == this);
498 498
499 forbidEventDispatch(); 499 forbidEventDispatch();
500 500
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER)) 1173 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER))
1174 return true; 1174 return true;
1175 1175
1176 RefPtr<ContainerNode> protector(this); 1176 RefPtr<ContainerNode> protector(this);
1177 RefPtr<BeforeLoadEvent> beforeLoadEvent = BeforeLoadEvent::create(sourceURL) ; 1177 RefPtr<BeforeLoadEvent> beforeLoadEvent = BeforeLoadEvent::create(sourceURL) ;
1178 dispatchEvent(beforeLoadEvent.get()); 1178 dispatchEvent(beforeLoadEvent.get());
1179 return !beforeLoadEvent->defaultPrevented(); 1179 return !beforeLoadEvent->defaultPrevented();
1180 } 1180 }
1181 1181
1182 } // namespace WebCore 1182 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/getElementById-consistency2-expected.txt ('k') | Source/WebCore/svg/SVGTRefElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698