| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 class FilteredElementList implements ElementList { | 5 class FilteredElementList implements ElementList { |
| 6 final Node _node; | 6 final Node _node; |
| 7 final NodeList _childNodes; | 7 final NodeList _childNodes; |
| 8 | 8 |
| 9 FilteredElementList(Node node): _childNodes = node.nodes, _node = node; | 9 FilteredElementList(Node node): _childNodes = node.nodes, _node = node; |
| 10 | 10 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 => this._insertAdjacentNode(where, element); | 190 => this._insertAdjacentNode(where, element); |
| 191 | 191 |
| 192 void insertAdjacentText(String where, String text) { | 192 void insertAdjacentText(String where, String text) { |
| 193 this._insertAdjacentNode(where, new Text(text)); | 193 this._insertAdjacentNode(where, new Text(text)); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void insertAdjacentHTML(String where, String text) { | 196 void insertAdjacentHTML(String where, String text) { |
| 197 this._insertAdjacentNode(where, new DocumentFragment.html(text)); | 197 this._insertAdjacentNode(where, new DocumentFragment.html(text)); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void addText(String text) { | |
| 201 this.insertAdjacentText('beforeend', text); | |
| 202 } | |
| 203 | |
| 204 void addHTML(String text) { | |
| 205 this.insertAdjacentHTML('beforeend', text); | |
| 206 } | |
| 207 | |
| 208 Future<ElementRect> get rect() { | 200 Future<ElementRect> get rect() { |
| 209 return _createMeasurementFuture(() => const EmptyElementRect(), | 201 return _createMeasurementFuture(() => const EmptyElementRect(), |
| 210 new Completer<ElementRect>()); | 202 new Completer<ElementRect>()); |
| 211 } | 203 } |
| 212 | 204 |
| 213 // If we can come up with a semi-reasonable default value for an Element | 205 // If we can come up with a semi-reasonable default value for an Element |
| 214 // getter, we'll use it. In general, these return the same values as an | 206 // getter, we'll use it. In general, these return the same values as an |
| 215 // element that has no parent. | 207 // element that has no parent. |
| 216 String get contentEditable() => "false"; | 208 String get contentEditable() => "false"; |
| 217 bool get isContentEditable() => false; | 209 bool get isContentEditable() => false; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 "WebKit drop zone can't be set for document fragments."); | 337 "WebKit drop zone can't be set for document fragments."); |
| 346 } | 338 } |
| 347 | 339 |
| 348 void set webkitRegionOverflow(String value) { | 340 void set webkitRegionOverflow(String value) { |
| 349 throw new UnsupportedOperationException( | 341 throw new UnsupportedOperationException( |
| 350 "WebKit region overflow can't be set for document fragments."); | 342 "WebKit region overflow can't be set for document fragments."); |
| 351 } | 343 } |
| 352 | 344 |
| 353 $!MEMBERS | 345 $!MEMBERS |
| 354 } | 346 } |
| OLD | NEW |