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

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

Issue 452093003: Do not fire a DOMSubtreeModified event when Attr.value attribute is set (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typo Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/dom/attribute-change-on-mutate-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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 removeBetween(0, child->nextSibling(), *child); 663 removeBetween(0, child->nextSibling(), *child);
664 removedChildren.append(child.get()); 664 removedChildren.append(child.get());
665 notifyNodeRemoved(*child); 665 notifyNodeRemoved(*child);
666 } 666 }
667 } 667 }
668 668
669 ChildrenChange change = {AllChildrenRemoved, nullptr, nullptr, ChildrenC hangeSourceAPI}; 669 ChildrenChange change = {AllChildrenRemoved, nullptr, nullptr, ChildrenC hangeSourceAPI};
670 childrenChanged(change); 670 childrenChanged(change);
671 } 671 }
672 672
673 dispatchSubtreeModifiedEvent(); 673 // We don't fire the DOMSubtreeModified event for Attr Nodes. This matches t he behavior
674 // of IE and Firefox. This event is fired synchronously and is a source of t rouble for
675 // attributes as the JS callback could alter the attributes and leave us in a bad state.
676 if (!isAttributeNode())
677 dispatchSubtreeModifiedEvent();
674 } 678 }
675 679
676 PassRefPtrWillBeRawPtr<Node> ContainerNode::appendChild(PassRefPtrWillBeRawPtr<N ode> newChild, ExceptionState& exceptionState) 680 PassRefPtrWillBeRawPtr<Node> ContainerNode::appendChild(PassRefPtrWillBeRawPtr<N ode> newChild, ExceptionState& exceptionState)
677 { 681 {
678 RefPtrWillBeRawPtr<ContainerNode> protect(this); 682 RefPtrWillBeRawPtr<ContainerNode> protect(this);
679 683
680 #if !ENABLE(OILPAN) 684 #if !ENABLE(OILPAN)
681 // Check that this node is not "floating". 685 // Check that this node is not "floating".
682 // If it is, it can be deleted as a side effect of sending mutation events. 686 // If it is, it can be deleted as a side effect of sending mutation events.
683 ASSERT(refCount() || parentOrShadowHostNode()); 687 ASSERT(refCount() || parentOrShadowHostNode());
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 return true; 1410 return true;
1407 1411
1408 if (node->isElementNode() && toElement(node)->shadow()) 1412 if (node->isElementNode() && toElement(node)->shadow())
1409 return true; 1413 return true;
1410 1414
1411 return false; 1415 return false;
1412 } 1416 }
1413 #endif 1417 #endif
1414 1418
1415 } // namespace blink 1419 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/attribute-change-on-mutate-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698