OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |