| 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 // TODO(jacobr): use _Lists.dart to remove some of the duplicated | 7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated |
| 8 // functionality. | 8 // functionality. |
| 9 class _ChildrenElementList implements List { | 9 class _ChildrenElementList implements List { |
| 10 // Raw Element. | 10 // Raw Element. |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 | 609 |
| 610 void set children(List<Element> value) { | 610 void set children(List<Element> value) { |
| 611 // Copy list first since we don't want liveness during iteration. | 611 // Copy list first since we don't want liveness during iteration. |
| 612 List copy = new List.from(value); | 612 List copy = new List.from(value); |
| 613 var children = this.children; | 613 var children = this.children; |
| 614 children.clear(); | 614 children.clear(); |
| 615 children.addAll(copy); | 615 children.addAll(copy); |
| 616 } | 616 } |
| 617 | 617 |
| 618 /** | 618 /** |
| 619 * Finds the first descendant element of this element that matches the | |
| 620 * specified group of selectors. | |
| 621 * | |
| 622 * [selectors] should be a string using CSS selector syntax. | |
| 623 * | |
| 624 * // Gets the first descendant with the class 'classname' | |
| 625 * var element = element.query('.className'); | |
| 626 * // Gets the element with id 'id' | |
| 627 * var element = element.query('#id'); | |
| 628 * // Gets the first descendant [ImageElement] | |
| 629 * var img = element.query('img'); | |
| 630 * | |
| 631 * See also: | |
| 632 * | |
| 633 * * [CSS Selectors](http://docs.webplatform.org/wiki/css/selectors) | |
| 634 */ | |
| 635 Element query(String selectors) => $dom_querySelector(selectors); | |
| 636 | |
| 637 /** | |
| 638 * Finds all descendent elements of this element that match the specified | 619 * Finds all descendent elements of this element that match the specified |
| 639 * group of selectors. | 620 * group of selectors. |
| 640 * | 621 * |
| 641 * [selectors] should be a string using CSS selector syntax. | 622 * [selectors] should be a string using CSS selector syntax. |
| 642 * | 623 * |
| 643 * var items = element.query('.itemClassName'); | 624 * var items = element.query('.itemClassName'); |
| 644 */ | 625 */ |
| 645 List<Element> queryAll(String selectors) => | 626 List<Element> queryAll(String selectors) => |
| 646 new _FrozenElementList._wrap($dom_querySelectorAll(selectors)); | 627 new _FrozenElementList._wrap($dom_querySelectorAll(selectors)); |
| 647 | 628 |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 const ScrollAlignment._internal(this._value); | 1130 const ScrollAlignment._internal(this._value); |
| 1150 toString() => 'ScrollAlignment.$_value'; | 1131 toString() => 'ScrollAlignment.$_value'; |
| 1151 | 1132 |
| 1152 /// Attempt to align the element to the top of the scrollable area. | 1133 /// Attempt to align the element to the top of the scrollable area. |
| 1153 static const TOP = const ScrollAlignment._internal('TOP'); | 1134 static const TOP = const ScrollAlignment._internal('TOP'); |
| 1154 /// Attempt to center the element in the scrollable area. | 1135 /// Attempt to center the element in the scrollable area. |
| 1155 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1136 static const CENTER = const ScrollAlignment._internal('CENTER'); |
| 1156 /// Attempt to align the element to the bottom of the scrollable area. | 1137 /// Attempt to align the element to the bottom of the scrollable area. |
| 1157 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1138 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
| 1158 } | 1139 } |
| OLD | NEW |