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

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

Issue 176883005: Have Element::ensureUniqueElementData() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/dom/Element.h » ('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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 { 163 {
164 if (m_element) 164 if (m_element)
165 return m_element->getAttribute(qualifiedName()); 165 return m_element->getAttribute(qualifiedName());
166 return m_standaloneValue; 166 return m_standaloneValue;
167 } 167 }
168 168
169 Attribute& Attr::elementAttribute() 169 Attribute& Attr::elementAttribute()
170 { 170 {
171 ASSERT(m_element); 171 ASSERT(m_element);
172 ASSERT(m_element->elementData()); 172 ASSERT(m_element->elementData());
173 return *m_element->ensureUniqueElementData()->getAttributeItem(qualifiedName ()); 173 return *m_element->ensureUniqueElementData().getAttributeItem(qualifiedName( ));
174 } 174 }
175 175
176 void Attr::detachFromElementWithValue(const AtomicString& value) 176 void Attr::detachFromElementWithValue(const AtomicString& value)
177 { 177 {
178 ASSERT(m_element); 178 ASSERT(m_element);
179 ASSERT(m_standaloneValue.isNull()); 179 ASSERT(m_standaloneValue.isNull());
180 m_standaloneValue = value; 180 m_standaloneValue = value;
181 m_element = 0; 181 m_element = 0;
182 } 182 }
183 183
184 void Attr::attachToElement(Element* element) 184 void Attr::attachToElement(Element* element)
185 { 185 {
186 ASSERT(!m_element); 186 ASSERT(!m_element);
187 m_element = element; 187 m_element = element;
188 m_standaloneValue = nullAtom; 188 m_standaloneValue = nullAtom;
189 } 189 }
190 190
191 } 191 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698