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

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

Issue 357033002: Remove attributeCount() / attributeAt() API from Element (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Clean up Created 6 years, 5 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/inspector/DOMPatchSupport.cpp ('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) 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 CustomElementCallbackDispatcher::CallbackDeliveryScope deliverCustomElementC allbacks; 98 CustomElementCallbackDispatcher::CallbackDeliveryScope deliverCustomElementC allbacks;
99 TrackExceptionState exceptionState; 99 TrackExceptionState exceptionState;
100 unwrap<Element>()->setAttribute(attrName, attrValue, exceptionState); 100 unwrap<Element>()->setAttribute(attrName, attrValue, exceptionState);
101 return !exceptionState.hadException(); 101 return !exceptionState.hadException();
102 } 102 }
103 103
104 unsigned WebElement::attributeCount() const 104 unsigned WebElement::attributeCount() const
105 { 105 {
106 if (!constUnwrap<Element>()->hasAttributes()) 106 if (!constUnwrap<Element>()->hasAttributes())
107 return 0; 107 return 0;
108 return constUnwrap<Element>()->attributeCount(); 108 return constUnwrap<Element>()->attributes().size();
109 } 109 }
110 110
111 WebNode WebElement::shadowRoot() const 111 WebNode WebElement::shadowRoot() const
112 { 112 {
113 ShadowRoot* shadowRoot = constUnwrap<Element>()->shadowRoot(); 113 ShadowRoot* shadowRoot = constUnwrap<Element>()->shadowRoot();
114 if (!shadowRoot) 114 if (!shadowRoot)
115 return WebNode(); 115 return WebNode();
116 return WebNode(shadowRoot->toNode()); 116 return WebNode(shadowRoot->toNode());
117 } 117 }
118 118
119 WebString WebElement::attributeLocalName(unsigned index) const 119 WebString WebElement::attributeLocalName(unsigned index) const
120 { 120 {
121 if (index >= attributeCount()) 121 if (index >= attributeCount())
122 return WebString(); 122 return WebString();
123 return constUnwrap<Element>()->attributeAt(index).localName(); 123 return constUnwrap<Element>()->attributes().at(index).localName();
124 } 124 }
125 125
126 WebString WebElement::attributeValue(unsigned index) const 126 WebString WebElement::attributeValue(unsigned index) const
127 { 127 {
128 if (index >= attributeCount()) 128 if (index >= attributeCount())
129 return WebString(); 129 return WebString();
130 return constUnwrap<Element>()->attributeAt(index).value(); 130 return constUnwrap<Element>()->attributes().at(index).value();
131 } 131 }
132 132
133 WebString WebElement::innerText() 133 WebString WebElement::innerText()
134 { 134 {
135 return unwrap<Element>()->innerText(); 135 return unwrap<Element>()->innerText();
136 } 136 }
137 137
138 WebString WebElement::computeInheritedLanguage() const 138 WebString WebElement::computeInheritedLanguage() const
139 { 139 {
140 return WebString(constUnwrap<Element>()->computeInheritedLanguage()); 140 return WebString(constUnwrap<Element>()->computeInheritedLanguage());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 m_private = elem; 176 m_private = elem;
177 return *this; 177 return *this;
178 } 178 }
179 179
180 WebElement::operator PassRefPtrWillBeRawPtr<Element>() const 180 WebElement::operator PassRefPtrWillBeRawPtr<Element>() const
181 { 181 {
182 return toElement(m_private.get()); 182 return toElement(m_private.get());
183 } 183 }
184 184
185 } // namespace blink 185 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/DOMPatchSupport.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698