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

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

Issue 891583002: Add type annotations to some dart:html closures (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
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 class _ChildrenElementList extends ListBase<Element> 7 class _ChildrenElementList extends ListBase<Element>
8 implements NodeListWrapper { 8 implements NodeListWrapper {
9 // Raw Element. 9 // Raw Element.
10 final Element _element; 10 final Element _element;
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 Element get last => _nodeList.last; 290 Element get last => _nodeList.last;
291 291
292 Element get single => _nodeList.single; 292 Element get single => _nodeList.single;
293 293
294 CssClassSet get classes => new _MultiElementCssClassSet(this); 294 CssClassSet get classes => new _MultiElementCssClassSet(this);
295 295
296 CssStyleDeclarationBase get style => 296 CssStyleDeclarationBase get style =>
297 new _CssStyleDeclarationSet(this); 297 new _CssStyleDeclarationSet(this);
298 298
299 void set classes(Iterable<String> value) { 299 void set classes(Iterable<String> value) {
300 // TODO(sra): This might be faster for Sets:
301 //
302 // new _MultiElementCssClassSet(this).writeClasses(value)
303 //
304 // as the code below converts the Iterable[value] to a string multiple
305 // times. Maybe compute the string and set className here.
300 _nodeList.forEach((e) => e.classes = value); 306 _nodeList.forEach((e) => e.classes = value);
301 } 307 }
302 308
303 CssRect get contentEdge => new _ContentCssListRect(this); 309 CssRect get contentEdge => new _ContentCssListRect(this);
304 310
305 CssRect get paddingEdge => this.first.paddingEdge; 311 CssRect get paddingEdge => this.first.paddingEdge;
306 312
307 CssRect get borderEdge => this.first.borderEdge; 313 CssRect get borderEdge => this.first.borderEdge;
308 314
309 CssRect get marginEdge => this.first.marginEdge; 315 CssRect get marginEdge => this.first.marginEdge;
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 * This set makes it easy to add, remove or toggle the classes applied to 622 * This set makes it easy to add, remove or toggle the classes applied to
617 * this element. 623 * this element.
618 * 624 *
619 * element.classes.add('selected'); 625 * element.classes.add('selected');
620 * element.classes.toggle('isOnline'); 626 * element.classes.toggle('isOnline');
621 * element.classes.remove('selected'); 627 * element.classes.remove('selected');
622 */ 628 */
623 CssClassSet get classes => new _ElementCssClassSet(this); 629 CssClassSet get classes => new _ElementCssClassSet(this);
624 630
625 void set classes(Iterable<String> value) { 631 void set classes(Iterable<String> value) {
632 // TODO(sra): Do this without reading the classes in clear() and addAll(),
633 // or writing the classes in clear().
626 CssClassSet classSet = classes; 634 CssClassSet classSet = classes;
627 classSet.clear(); 635 classSet.clear();
628 classSet.addAll(value); 636 classSet.addAll(value);
629 } 637 }
630 638
631 /** 639 /**
632 * Allows access to all custom data attributes (data-*) set on this element. 640 * Allows access to all custom data attributes (data-*) set on this element.
633 * 641 *
634 * The keys for the map must follow these rules: 642 * The keys for the map must follow these rules:
635 * 643 *
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 const ScrollAlignment._internal(this._value); 1488 const ScrollAlignment._internal(this._value);
1481 toString() => 'ScrollAlignment.$_value'; 1489 toString() => 'ScrollAlignment.$_value';
1482 1490
1483 /// Attempt to align the element to the top of the scrollable area. 1491 /// Attempt to align the element to the top of the scrollable area.
1484 static const TOP = const ScrollAlignment._internal('TOP'); 1492 static const TOP = const ScrollAlignment._internal('TOP');
1485 /// Attempt to center the element in the scrollable area. 1493 /// Attempt to center the element in the scrollable area.
1486 static const CENTER = const ScrollAlignment._internal('CENTER'); 1494 static const CENTER = const ScrollAlignment._internal('CENTER');
1487 /// Attempt to align the element to the bottom of the scrollable area. 1495 /// Attempt to align the element to the bottom of the scrollable area.
1488 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1496 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1489 } 1497 }
OLDNEW
« no previous file with comments | « tools/dom/src/CssClassSet.dart ('k') | tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698