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

Side by Side Diff: Source/web/WebElement.cpp

Issue 180723006: Have ElementData::attributeItem() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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 | « Source/core/xml/parser/XMLDocumentParser.cpp ('k') | Source/web/WebPageSerializerImpl.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 ShadowRoot* shadowRoot = constUnwrap<Element>()->shadowRoot(); 118 ShadowRoot* shadowRoot = constUnwrap<Element>()->shadowRoot();
119 if (!shadowRoot) 119 if (!shadowRoot)
120 return WebNode(); 120 return WebNode();
121 return WebNode(shadowRoot->toNode()); 121 return WebNode(shadowRoot->toNode());
122 } 122 }
123 123
124 WebString WebElement::attributeLocalName(unsigned index) const 124 WebString WebElement::attributeLocalName(unsigned index) const
125 { 125 {
126 if (index >= attributeCount()) 126 if (index >= attributeCount())
127 return WebString(); 127 return WebString();
128 return constUnwrap<Element>()->attributeItem(index)->localName(); 128 return constUnwrap<Element>()->attributeItem(index).localName();
129 } 129 }
130 130
131 WebString WebElement::attributeValue(unsigned index) const 131 WebString WebElement::attributeValue(unsigned index) const
132 { 132 {
133 if (index >= attributeCount()) 133 if (index >= attributeCount())
134 return WebString(); 134 return WebString();
135 return constUnwrap<Element>()->attributeItem(index)->value(); 135 return constUnwrap<Element>()->attributeItem(index).value();
136 } 136 }
137 137
138 WebString WebElement::innerText() 138 WebString WebElement::innerText()
139 { 139 {
140 return unwrap<Element>()->innerText(); 140 return unwrap<Element>()->innerText();
141 } 141 }
142 142
143 WebString WebElement::computeInheritedLanguage() const 143 WebString WebElement::computeInheritedLanguage() const
144 { 144 {
145 return WebString(constUnwrap<Element>()->computeInheritedLanguage()); 145 return WebString(constUnwrap<Element>()->computeInheritedLanguage());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 m_private = elem; 181 m_private = elem;
182 return *this; 182 return *this;
183 } 183 }
184 184
185 WebElement::operator PassRefPtr<Element>() const 185 WebElement::operator PassRefPtr<Element>() const
186 { 186 {
187 return toElement(m_private.get()); 187 return toElement(m_private.get());
188 } 188 }
189 189
190 } // namespace blink 190 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/xml/parser/XMLDocumentParser.cpp ('k') | Source/web/WebPageSerializerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698