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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 /** The parent of the current node (or null for the document node). */ | 82 /** The parent of the current node (or null for the document node). */ |
83 Node parent; | 83 Node parent; |
84 | 84 |
85 /** | 85 /** |
86 * A map holding name, value pairs for attributes of the node. | 86 * A map holding name, value pairs for attributes of the node. |
87 * | 87 * |
88 * Note that attribute order needs to be stable for serialization, so we use a | 88 * Note that attribute order needs to be stable for serialization, so we use a |
89 * LinkedHashMap. Each key is a [String] or [AttributeName]. | 89 * LinkedHashMap. Each key is a [String] or [AttributeName]. |
90 */ | 90 */ |
91 LinkedHashMap<Dynamic, String> attributes = new LinkedHashMap(); | 91 LinkedHashMap<dynamic, String> attributes = new LinkedHashMap(); |
92 | 92 |
93 /** | 93 /** |
94 * A list of child nodes of the current node. This must | 94 * A list of child nodes of the current node. This must |
95 * include all elements but not necessarily other node types. | 95 * include all elements but not necessarily other node types. |
96 */ | 96 */ |
97 final NodeList nodes = new NodeList._(); | 97 final NodeList nodes = new NodeList._(); |
98 | 98 |
99 /** | 99 /** |
100 * The source span of this node, if it was created by the [HtmlParser]. | 100 * The source span of this node, if it was created by the [HtmlParser]. |
101 */ | 101 */ |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 UnsupportedError('cannot add the same node multiple times.'); | 488 throw new UnsupportedError('cannot add the same node multiple times.'); |
489 } | 489 } |
490 super.insertRange(start, 1, _setParent(initialValue)); | 490 super.insertRange(start, 1, _setParent(initialValue)); |
491 } | 491 } |
492 } | 492 } |
OLD | NEW |