| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 if (index < 0 || index > length) { | 75 if (index < 0 || index > length) { |
| 76 throw new RangeError.range(index, 0, length); | 76 throw new RangeError.range(index, 0, length); |
| 77 } | 77 } |
| 78 if (index == length) { | 78 if (index == length) { |
| 79 _this.append(node); | 79 _this.append(node); |
| 80 } else { | 80 } else { |
| 81 _this.insertBefore(node, this[index]); | 81 _this.insertBefore(node, this[index]); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 void insertAll(int index, Iterable<Node> iterable) { |
| 86 throw new UnimplementedError(); |
| 87 } |
| 88 |
| 89 void setAll(int index, Iterable<Node> iterable) { |
| 90 throw new UnimplementedError(); |
| 91 } |
| 92 |
| 85 Node removeLast() { | 93 Node removeLast() { |
| 86 final result = last; | 94 final result = last; |
| 87 if (result != null) { | 95 if (result != null) { |
| 88 _this.$dom_removeChild(result); | 96 _this.$dom_removeChild(result); |
| 89 } | 97 } |
| 90 return result; | 98 return result; |
| 91 } | 99 } |
| 92 | 100 |
| 93 Node removeAt(int index) { | 101 Node removeAt(int index) { |
| 94 var result = this[index]; | 102 var result = this[index]; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 167 } |
| 160 void removeRange(int start, int end) { | 168 void removeRange(int start, int end) { |
| 161 throw new UnsupportedError( | 169 throw new UnsupportedError( |
| 162 "Cannot removeRange on immutable List."); | 170 "Cannot removeRange on immutable List."); |
| 163 } | 171 } |
| 164 | 172 |
| 165 Iterable<Node> getRange(int start, int end) { | 173 Iterable<Node> getRange(int start, int end) { |
| 166 throw new UnimplementedError("NodeList.getRange"); | 174 throw new UnimplementedError("NodeList.getRange"); |
| 167 } | 175 } |
| 168 | 176 |
| 177 void replaceRange(int start, int end, Iterable<Node> iterable) { |
| 178 throw new UnimplementedError("NodeList.replaceRange"); |
| 179 } |
| 180 |
| 181 void fillRange(int start, int end, [Node fillValue]) { |
| 182 throw new UnimplementedError("NodeList.fillRange"); |
| 183 } |
| 184 |
| 169 List<Node> sublist(int start, [int end]) { | 185 List<Node> sublist(int start, [int end]) { |
| 170 if (end == null) end == length; | 186 if (end == null) end == length; |
| 171 return Lists.getRange(this, start, end, <Node>[]); | 187 return Lists.getRange(this, start, end, <Node>[]); |
| 172 } | 188 } |
| 173 | 189 |
| 174 String toString() { | 190 String toString() { |
| 175 StringBuffer buffer = new StringBuffer('['); | 191 StringBuffer buffer = new StringBuffer('['); |
| 176 buffer.writeAll(this, ', '); | 192 buffer.writeAll(this, ', '); |
| 177 buffer.write(']'); | 193 buffer.write(']'); |
| 178 return buffer.toString(); | 194 return buffer.toString(); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 } | 358 } |
| 343 | 359 |
| 344 /** | 360 /** |
| 345 * Print out a String representation of this Node. | 361 * Print out a String representation of this Node. |
| 346 */ | 362 */ |
| 347 String toString() => localName == null ? | 363 String toString() => localName == null ? |
| 348 (nodeValue == null ? super.toString() : nodeValue) : localName; | 364 (nodeValue == null ? super.toString() : nodeValue) : localName; |
| 349 | 365 |
| 350 $!MEMBERS | 366 $!MEMBERS |
| 351 } | 367 } |
| OLD | NEW |