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

Side by Side 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 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 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2012 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2012 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 treeScope().adoptIfNeeded(*textNode); 99 treeScope().adoptIfNeeded(*textNode);
100 setFirstChild(textNode.get()); 100 setFirstChild(textNode.get());
101 setLastChild(textNode.get()); 101 setLastChild(textNode.get());
102 } 102 }
103 } 103 }
104 104
105 void Attr::setValue(const AtomicString& value) 105 void Attr::setValue(const AtomicString& value)
106 { 106 {
107 EventQueueScope scope; 107 EventQueueScope scope;
108 m_ignoreChildrenChanged++; 108 m_ignoreChildrenChanged++;
109 removeChildren(); 109 // We don't fire the DOMSubtreeModified event for Attr Nodes. This matches t he behavior
110 // of IE and Firefox. This event is fired synchronously and is a source of t rouble for
111 // attributes as the JS callback could alter the attributes and leave us in a bad state.
112 removeChildren(OmitSubtreeModifiedEvent);
110 if (m_element) 113 if (m_element)
111 elementAttribute().setValue(value); 114 elementAttribute().setValue(value);
112 else 115 else
113 m_standaloneValueOrAttachedLocalName = value; 116 m_standaloneValueOrAttachedLocalName = value;
114 createTextChild(); 117 createTextChild();
115 m_ignoreChildrenChanged--; 118 m_ignoreChildrenChanged--;
116 119
117 QualifiedName name = qualifiedName(); 120 QualifiedName name = qualifiedName();
118 invalidateNodeListCachesInAncestors(&name, m_element); 121 invalidateNodeListCachesInAncestors(&name, m_element);
119 } 122 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 m_standaloneValueOrAttachedLocalName = attachedLocalName; 223 m_standaloneValueOrAttachedLocalName = attachedLocalName;
221 } 224 }
222 225
223 void Attr::trace(Visitor* visitor) 226 void Attr::trace(Visitor* visitor)
224 { 227 {
225 visitor->trace(m_element); 228 visitor->trace(m_element);
226 ContainerNode::trace(visitor); 229 ContainerNode::trace(visitor);
227 } 230 }
228 231
229 } 232 }
OLDNEW
« 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