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

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

Issue 14990005: Remove ENTITY_REFERENCE_NODE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove some empty lines Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Attr.h ('k') | Source/core/dom/ContainerNode.cpp » ('j') | 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, 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 PassRefPtr<Node> Attr::cloneNode(bool /*deep*/) 144 PassRefPtr<Node> Attr::cloneNode(bool /*deep*/)
145 { 145 {
146 RefPtr<Attr> clone = adoptRef(new Attr(document(), qualifiedName(), value()) ); 146 RefPtr<Attr> clone = adoptRef(new Attr(document(), qualifiedName(), value()) );
147 cloneChildNodes(clone.get()); 147 cloneChildNodes(clone.get());
148 return clone.release(); 148 return clone.release();
149 } 149 }
150 150
151 // DOM Section 1.1.1 151 // DOM Section 1.1.1
152 bool Attr::childTypeAllowed(NodeType type) const 152 bool Attr::childTypeAllowed(NodeType type) const
153 { 153 {
154 switch (type) { 154 return TEXT_NODE == type;
155 case TEXT_NODE:
156 case ENTITY_REFERENCE_NODE:
157 return true;
158 default:
159 return false;
160 }
161 } 155 }
162 156
163 void Attr::childrenChanged(bool, Node*, Node*, int) 157 void Attr::childrenChanged(bool, Node*, Node*, int)
164 { 158 {
165 if (m_ignoreChildrenChanged > 0) 159 if (m_ignoreChildrenChanged > 0)
166 return; 160 return;
167 161
168 invalidateNodeListCachesInAncestors(&qualifiedName(), m_element); 162 invalidateNodeListCachesInAncestors(&qualifiedName(), m_element);
169 163
170 // FIXME: We should include entity references in the value
171
172 StringBuilder valueBuilder; 164 StringBuilder valueBuilder;
173 for (Node *n = firstChild(); n; n = n->nextSibling()) { 165 for (Node *n = firstChild(); n; n = n->nextSibling()) {
174 if (n->isTextNode()) 166 if (n->isTextNode())
175 valueBuilder.append(toText(n)->data()); 167 valueBuilder.append(toText(n)->data());
176 } 168 }
177 169
178 AtomicString newValue = valueBuilder.toAtomicString(); 170 AtomicString newValue = valueBuilder.toAtomicString();
179 if (m_element) 171 if (m_element)
180 m_element->willModifyAttribute(qualifiedName(), value(), newValue); 172 m_element->willModifyAttribute(qualifiedName(), value(), newValue);
181 173
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 218 }
227 219
228 void Attr::attachToElement(Element* element) 220 void Attr::attachToElement(Element* element)
229 { 221 {
230 ASSERT(!m_element); 222 ASSERT(!m_element);
231 m_element = element; 223 m_element = element;
232 m_standaloneValue = nullAtom; 224 m_standaloneValue = nullAtom;
233 } 225 }
234 226
235 } 227 }
OLDNEW
« no previous file with comments | « Source/core/dom/Attr.h ('k') | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698