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

Side by Side Diff: Source/WebCore/dom/Attr.cpp

Issue 6588061: Merge 79810 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 9 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 | « 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 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 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed.
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
11 * version 2 of the License, or (at your option) any later version. 11 * version 2 of the License, or (at your option) any later version.
12 * 12 *
13 * This library is distributed in the hope that it will be useful, 13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details. 16 * Library General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Library General Public License 18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to 19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA. 21 * Boston, MA 02110-1301, USA.
22 */ 22 */
23 #include "config.h" 23 #include "config.h"
24 #include "Attr.h" 24 #include "Attr.h"
25 25
26 #include "Element.h" 26 #include "Element.h"
27 #include "ExceptionCode.h" 27 #include "ExceptionCode.h"
28 #include "HTMLNames.h" 28 #include "HTMLNames.h"
29 #include "ScopedEventQueue.h"
29 #include "Text.h" 30 #include "Text.h"
30 #include "XMLNSNames.h" 31 #include "XMLNSNames.h"
31 32
32 namespace WebCore { 33 namespace WebCore {
33 34
34 using namespace HTMLNames; 35 using namespace HTMLNames;
35 36
36 inline Attr::Attr(Element* element, Document* document, PassRefPtr<Attribute> at tribute) 37 inline Attr::Attr(Element* element, Document* document, PassRefPtr<Attribute> at tribute)
37 : ContainerNode(document) 38 : ContainerNode(document)
38 , m_element(element) 39 , m_element(element)
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 m_attribute->setPrefix(prefix.isEmpty() ? AtomicString() : prefix); 113 m_attribute->setPrefix(prefix.isEmpty() ? AtomicString() : prefix);
113 } 114 }
114 115
115 String Attr::nodeValue() const 116 String Attr::nodeValue() const
116 { 117 {
117 return value(); 118 return value();
118 } 119 }
119 120
120 void Attr::setValue(const AtomicString& value) 121 void Attr::setValue(const AtomicString& value)
121 { 122 {
123 EventQueueScope scope;
122 m_ignoreChildrenChanged++; 124 m_ignoreChildrenChanged++;
123 removeChildren(); 125 removeChildren();
124 m_attribute->setValue(value); 126 m_attribute->setValue(value);
125 createTextChild(); 127 createTextChild();
126 m_ignoreChildrenChanged--; 128 m_ignoreChildrenChanged--;
127 } 129 }
128 130
129 void Attr::setValue(const AtomicString& value, ExceptionCode&) 131 void Attr::setValue(const AtomicString& value, ExceptionCode&)
130 { 132 {
131 if (m_element && m_element->isIdAttributeName(m_attribute->name())) 133 if (m_element && m_element->isIdAttributeName(m_attribute->name()))
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 if (m_element) 185 if (m_element)
184 m_element->attributeChanged(m_attribute.get()); 186 m_element->attributeChanged(m_attribute.get());
185 } 187 }
186 188
187 bool Attr::isId() const 189 bool Attr::isId() const
188 { 190 {
189 return qualifiedName().matches(document()->idAttributeName()); 191 return qualifiedName().matches(document()->idAttributeName());
190 } 192 }
191 193
192 } 194 }
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