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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 m_element->willModifyAttribute(qualifiedName(), this->value(), value); | 136 m_element->willModifyAttribute(qualifiedName(), this->value(), value); |
137 | 137 |
138 setValue(value); | 138 setValue(value); |
139 | 139 |
140 if (m_element) | 140 if (m_element) |
141 m_element->didModifyAttribute(qualifiedName(), value); | 141 m_element->didModifyAttribute(qualifiedName(), value); |
142 } | 142 } |
143 | 143 |
144 void Attr::setNodeValue(const String& v) | 144 void Attr::setNodeValue(const String& v) |
145 { | 145 { |
146 setValue(v, IGNORE_EXCEPTION); | 146 // Attr uses AtomicString type for its value to save memory as there |
| 147 // is duplication among Elements' attributes values. |
| 148 setValue(AtomicString(v), IGNORE_EXCEPTION); |
147 } | 149 } |
148 | 150 |
149 PassRefPtr<Node> Attr::cloneNode(bool /*deep*/) | 151 PassRefPtr<Node> Attr::cloneNode(bool /*deep*/) |
150 { | 152 { |
151 RefPtr<Attr> clone = adoptRef(new Attr(document(), qualifiedName(), value())
); | 153 RefPtr<Attr> clone = adoptRef(new Attr(document(), qualifiedName(), value())
); |
152 cloneChildNodes(clone.get()); | 154 cloneChildNodes(clone.get()); |
153 return clone.release(); | 155 return clone.release(); |
154 } | 156 } |
155 | 157 |
156 // DOM Section 1.1.1 | 158 // DOM Section 1.1.1 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 215 } |
214 | 216 |
215 void Attr::attachToElement(Element* element) | 217 void Attr::attachToElement(Element* element) |
216 { | 218 { |
217 ASSERT(!m_element); | 219 ASSERT(!m_element); |
218 m_element = element; | 220 m_element = element; |
219 m_standaloneValue = nullAtom; | 221 m_standaloneValue = nullAtom; |
220 } | 222 } |
221 | 223 |
222 } | 224 } |
OLD | NEW |