OLD | NEW |
1 /** | 1 /** |
2 * A simple tree API that results from parsing html. Intended to be compatible | 2 * A simple tree API that results from parsing html. Intended to be compatible |
3 * with dart:html, but right now it resembles the classic JS DOM. | 3 * with dart:html, but right now it resembles the classic JS DOM. |
4 */ | 4 */ |
5 library dom; | 5 library dom; |
6 | 6 |
7 import 'src/constants.dart'; | 7 import 'src/constants.dart'; |
8 import 'src/list_proxy.dart'; | 8 import 'src/list_proxy.dart'; |
9 import 'src/treebuilder.dart'; | 9 import 'src/treebuilder.dart'; |
10 import 'src/utils.dart'; | 10 import 'src/utils.dart'; |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 void removeRange(int start, int rangeLength) { | 478 void removeRange(int start, int rangeLength) { |
479 for (int i = start; i < rangeLength; i++) this[i].parent = null; | 479 for (int i = start; i < rangeLength; i++) this[i].parent = null; |
480 super.removeRange(start, rangeLength); | 480 super.removeRange(start, rangeLength); |
481 } | 481 } |
482 | 482 |
483 void insertRange(int start, int rangeLength, [Node initialValue]) { | 483 void insertRange(int start, int rangeLength, [Node initialValue]) { |
484 if (initialValue == null) { | 484 if (initialValue == null) { |
485 throw new ArgumentError('cannot add null node.'); | 485 throw new ArgumentError('cannot add null node.'); |
486 } | 486 } |
487 if (rangeLength > 1) { | 487 if (rangeLength > 1) { |
488 throw new UnsupportedOperationException('cannot add the same node ' | 488 throw new UnsupportedError('cannot add the same node multiple times.'); |
489 'multiple times.'); | |
490 } | 489 } |
491 super.insertRange(start, 1, _setParent(initialValue)); | 490 super.insertRange(start, 1, _setParent(initialValue)); |
492 } | 491 } |
493 } | 492 } |
OLD | NEW |