Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 12715003: Cleaning up document.query (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/templates/html/impl/impl_Document.darttemplate ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_Document.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698