OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 class FilteredElementList implements ElementList { | 5 class FilteredElementList implements ElementList { |
6 final Node _node; | 6 final Node _node; |
7 final NodeList _childNodes; | 7 final NodeList _childNodes; |
8 | 8 |
9 FilteredElementList(Node node): _childNodes = node.nodes, _node = node; | 9 FilteredElementList(Node node): _childNodes = node.nodes, _node = node; |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // TODO: The type of value should be Collection<Element>. See http://b/5392897 | 139 // TODO: The type of value should be Collection<Element>. See http://b/5392897 |
140 void set elements(value) { | 140 void set elements(value) { |
141 // Copy list first since we don't want liveness during iteration. | 141 // Copy list first since we don't want liveness during iteration. |
142 List copy = new List.from(value); | 142 List copy = new List.from(value); |
143 final elements = this.elements; | 143 final elements = this.elements; |
144 elements.clear(); | 144 elements.clear(); |
145 elements.addAll(copy); | 145 elements.addAll(copy); |
146 } | 146 } |
147 | 147 |
148 ElementList queryAll(String selectors) => | 148 ElementList queryAll(String selectors) => |
149 new _FrozenElementList._wrap(_querySelectorAll(selectors)); | 149 new _FrozenElementList._wrap($dom_querySelectorAll(selectors)); |
150 | 150 |
151 String get innerHTML() { | 151 String get innerHTML() { |
152 final e = new Element.tag("div"); | 152 final e = new Element.tag("div"); |
153 e.nodes.add(this.clone(true)); | 153 e.nodes.add(this.clone(true)); |
154 return e.innerHTML; | 154 return e.innerHTML; |
155 } | 155 } |
156 | 156 |
157 String get outerHTML() => innerHTML; | 157 String get outerHTML() => innerHTML; |
158 | 158 |
159 // TODO(nweiz): Do we want to support some variant of innerHTML for XML and/or | 159 // TODO(nweiz): Do we want to support some variant of innerHTML for XML and/or |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 bool get draggable() => false; | 208 bool get draggable() => false; |
209 bool get hidden() => false; | 209 bool get hidden() => false; |
210 bool get spellcheck() => false; | 210 bool get spellcheck() => false; |
211 bool get translate() => false; | 211 bool get translate() => false; |
212 int get tabIndex() => -1; | 212 int get tabIndex() => -1; |
213 String get id() => ""; | 213 String get id() => ""; |
214 String get title() => ""; | 214 String get title() => ""; |
215 String get tagName() => ""; | 215 String get tagName() => ""; |
216 String get webkitdropzone() => ""; | 216 String get webkitdropzone() => ""; |
217 String get webkitRegionOverflow() => ""; | 217 String get webkitRegionOverflow() => ""; |
218 Element get firstElementChild() => elements.first(); | 218 Element get $dom_firstElementChild() => elements.first(); |
219 Element get lastElementChild() => elements.last(); | 219 Element get $dom_lastElementChild() => elements.last(); |
220 Element get nextElementSibling() => null; | 220 Element get nextElementSibling() => null; |
221 Element get previousElementSibling() => null; | 221 Element get previousElementSibling() => null; |
222 Element get offsetParent() => null; | 222 Element get offsetParent() => null; |
223 Element get parent() => null; | 223 Element get parent() => null; |
224 Map<String, String> get attributes() => const {}; | 224 Map<String, String> get attributes() => const {}; |
225 // Issue 174: this should be a const set. | 225 // Issue 174: this should be a const set. |
226 Set<String> get classes() => new Set<String>(); | 226 Set<String> get classes() => new Set<String>(); |
227 Map<String, String> get dataAttributes() => const {}; | 227 Map<String, String> get dataAttributes() => const {}; |
228 CSSStyleDeclaration get style() => new Element.tag('div').style; | 228 CSSStyleDeclaration get style() => new Element.tag('div').style; |
229 Future<CSSStyleDeclaration> get computedStyle() => | 229 Future<CSSStyleDeclaration> get computedStyle() => |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 "WebKit drop zone can't be set for document fragments."); | 335 "WebKit drop zone can't be set for document fragments."); |
336 } | 336 } |
337 | 337 |
338 void set webkitRegionOverflow(String value) { | 338 void set webkitRegionOverflow(String value) { |
339 throw new UnsupportedOperationException( | 339 throw new UnsupportedOperationException( |
340 "WebKit region overflow can't be set for document fragments."); | 340 "WebKit region overflow can't be set for document fragments."); |
341 } | 341 } |
342 | 342 |
343 $!MEMBERS | 343 $!MEMBERS |
344 } | 344 } |
OLD | NEW |