OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
6 | 6 |
7 /** | 7 /** |
8 * Lazy implementation of the child nodes of an element that does not request | 8 * Lazy implementation of the child nodes of an element that does not request |
9 * the actual child nodes of an element until strictly necessary greatly | 9 * the actual child nodes of an element until strictly necessary greatly |
10 * improving performance for the typical cases where it is not required. | 10 * improving performance for the typical cases where it is not required. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 Node operator[](int index) => _this.childNodes[index]; | 191 Node operator[](int index) => _this.childNodes[index]; |
192 | 192 |
193 List<Node> get rawList => _this.childNodes; | 193 List<Node> get rawList => _this.childNodes; |
194 } | 194 } |
195 | 195 |
196 | 196 |
197 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
{ | 197 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
{ |
198 | 198 |
199 // Custom element created callback. | 199 // Custom element created callback. |
| 200 $if DART2JS |
200 Node._created() : super._created(); | 201 Node._created() : super._created(); |
| 202 $else |
| 203 Node._created() : super._created() { |
| 204 // By this point blink_jsObject should be setup if it's not then we weren't |
| 205 // called by the registerElement createdCallback - probably created() was |
| 206 // called directly which is verboten. |
| 207 if (this.blink_jsObject == null) { |
| 208 throw new DomException.jsInterop("the created constructor cannot be called
directly"); |
| 209 } |
| 210 } |
| 211 $endif |
201 | 212 |
202 /** | 213 /** |
203 * A modifiable list of this node's children. | 214 * A modifiable list of this node's children. |
204 */ | 215 */ |
205 List<Node> get nodes { | 216 List<Node> get nodes { |
206 return new _ChildNodeListLazy(this); | 217 return new _ChildNodeListLazy(this); |
207 } | 218 } |
208 | 219 |
209 set nodes(Iterable<Node> value) { | 220 set nodes(Iterable<Node> value) { |
210 // Copy list first since we don't want liveness during iteration. | 221 // Copy list first since we don't want liveness during iteration. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 */ | 318 */ |
308 @DomName('Node.childNodes') | 319 @DomName('Node.childNodes') |
309 @DocsEditable() | 320 @DocsEditable() |
310 @Returns('NodeList') | 321 @Returns('NodeList') |
311 @Creates('NodeList') | 322 @Creates('NodeList') |
312 final List<Node> childNodes; | 323 final List<Node> childNodes; |
313 | 324 |
314 $endif | 325 $endif |
315 $!MEMBERS | 326 $!MEMBERS |
316 } | 327 } |
OLD | NEW |