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

Side by Side Diff: third_party/WebKit/Source/core/dom/ContainerNode.cpp

Issue 2325143002: Node.replaceChild with an empty DocumentFragment should not dispatch DOMSubtreeModified twice. (Closed)
Patch Set: Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/fast/loader/delete-inside-cancelTimer-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, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 if (!checkAcceptChild(newChild, child, exceptionState)) { 393 if (!checkAcceptChild(newChild, child, exceptionState)) {
394 if (exceptionState.hadException()) 394 if (exceptionState.hadException())
395 return nullptr; 395 return nullptr;
396 return child; 396 return child;
397 } 397 }
398 398
399 NodeVector targets; 399 NodeVector targets;
400 collectChildrenAndRemoveFromOldParent(*newChild, targets, exceptionState); 400 collectChildrenAndRemoveFromOldParent(*newChild, targets, exceptionState);
401 if (exceptionState.hadException()) 401 if (exceptionState.hadException())
402 return nullptr; 402 return nullptr;
403 if (targets.isEmpty())
404 return child;
403 405
404 // Does this yet another check because collectChildrenAndRemoveFromOldParent () fires a MutationEvent. 406 // Does this yet another check because collectChildrenAndRemoveFromOldParent () fires a MutationEvent.
405 if (!checkAcceptChild(newChild, child, exceptionState)) { 407 if (!checkAcceptChild(newChild, child, exceptionState)) {
406 if (exceptionState.hadException()) 408 if (exceptionState.hadException())
407 return nullptr; 409 return nullptr;
408 return child; 410 return child;
409 } 411 }
410 412
411 if (next) 413 if (next)
412 insertNodeVector(targets, next, AdoptAndInsertBefore()); 414 insertNodeVector(targets, next, AdoptAndInsertBefore());
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 return true; 1382 return true;
1381 1383
1382 if (node->isElementNode() && toElement(node)->shadow()) 1384 if (node->isElementNode() && toElement(node)->shadow())
1383 return true; 1385 return true;
1384 1386
1385 return false; 1387 return false;
1386 } 1388 }
1387 #endif 1389 #endif
1388 1390
1389 } // namespace blink 1391 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/loader/delete-inside-cancelTimer-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698