| 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 html; | 5 part of html; |
| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // a local copy of $dom_childNodes is more efficient. | 223 // a local copy of $dom_childNodes is more efficient. |
| 224 int get length => _this.$dom_childNodes.length; | 224 int get length => _this.$dom_childNodes.length; |
| 225 | 225 |
| 226 void set length(int value) { | 226 void set length(int value) { |
| 227 throw new UnsupportedError( | 227 throw new UnsupportedError( |
| 228 "Cannot set length on immutable List."); | 228 "Cannot set length on immutable List."); |
| 229 } | 229 } |
| 230 | 230 |
| 231 Node operator[](int index) => _this.$dom_childNodes[index]; | 231 Node operator[](int index) => _this.$dom_childNodes[index]; |
| 232 } | 232 } |
| 233 $ANNOTATIONS | 233 |
| 234 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 234 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 235 List<Node> get nodes { | 235 List<Node> get nodes { |
| 236 return new _ChildNodeListLazy(this); | 236 return new _ChildNodeListLazy(this); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void set nodes(Collection<Node> value) { | 239 void set nodes(Collection<Node> value) { |
| 240 // Copy list first since we don't want liveness during iteration. | 240 // Copy list first since we don't want liveness during iteration. |
| 241 // TODO(jacobr): there is a better way to do this. | 241 // TODO(jacobr): there is a better way to do this. |
| 242 List copy = new List.from(value); | 242 List copy = new List.from(value); |
| 243 text = ''; | 243 text = ''; |
| 244 for (Node node in copy) { | 244 for (Node node in copy) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 268 final Node parent = this.parentNode; | 268 final Node parent = this.parentNode; |
| 269 parent.$dom_replaceChild(otherNode, this); | 269 parent.$dom_replaceChild(otherNode, this); |
| 270 } catch (e) { | 270 } catch (e) { |
| 271 | 271 |
| 272 }; | 272 }; |
| 273 return this; | 273 return this; |
| 274 } | 274 } |
| 275 | 275 |
| 276 $!MEMBERS | 276 $!MEMBERS |
| 277 } | 277 } |
| OLD | NEW |