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

Unified Diff: Source/core/dom/Attr.cpp

Issue 688933002: Make textContent trigger single DOMSubtreeModified event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address comments Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Attr.cpp
diff --git a/Source/core/dom/Attr.cpp b/Source/core/dom/Attr.cpp
index 33453205688ace876928c3a94e41aeb55bb02716..c6236a4faaeec174777f96e9d170b8d0d21164dd 100644
--- a/Source/core/dom/Attr.cpp
+++ b/Source/core/dom/Attr.cpp
@@ -106,7 +106,10 @@ void Attr::setValue(const AtomicString& value)
{
EventQueueScope scope;
m_ignoreChildrenChanged++;
- removeChildren();
+ // We don't fire the DOMSubtreeModified event for Attr Nodes. This matches the behavior
+ // of IE and Firefox. This event is fired synchronously and is a source of trouble for
+ // attributes as the JS callback could alter the attributes and leave us in a bad state.
+ removeChildren(OmitSubtreeModifiedEvent);
if (m_element)
elementAttribute().setValue(value);
else
« no previous file with comments | « LayoutTests/fast/dom/document-set-title-single-DOMSubtreeModified-expected.txt ('k') | Source/core/dom/ContainerNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698