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

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
306
300 _nodeList.forEach((e) => e.classes = value); 307 _nodeList.forEach((e) => e.classes = value);
301 } 308 }
302 309
303 CssRect get contentEdge => new _ContentCssListRect(this); 310 CssRect get contentEdge => new _ContentCssListRect(this);
304 311
305 CssRect get paddingEdge => this.first.paddingEdge; 312 CssRect get paddingEdge => this.first.paddingEdge;
306 313
307 CssRect get borderEdge => this.first.borderEdge; 314 CssRect get borderEdge => this.first.borderEdge;
308 315
309 CssRect get marginEdge => this.first.marginEdge; 316 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 623 * This set makes it easy to add, remove or toggle the classes applied to
617 * this element. 624 * this element.
618 * 625 *
619 * element.classes.add('selected'); 626 * element.classes.add('selected');
620 * element.classes.toggle('isOnline'); 627 * element.classes.toggle('isOnline');
621 * element.classes.remove('selected'); 628 * element.classes.remove('selected');
622 */ 629 */
623 CssClassSet get classes => new _ElementCssClassSet(this); 630 CssClassSet get classes => new _ElementCssClassSet(this);
624 631
625 void set classes(Iterable<String> value) { 632 void set classes(Iterable<String> value) {
633 // TODO(sra): Do this without reading the classes in clear() and addAll(),
634 // or writing the classes in clear().
626 CssClassSet classSet = classes; 635 CssClassSet classSet = classes;
627 classSet.clear(); 636 classSet.clear();
628 classSet.addAll(value); 637 classSet.addAll(value);
629 } 638 }
630 639
631 /** 640 /**
632 * Allows access to all custom data attributes (data-*) set on this element. 641 * Allows access to all custom data attributes (data-*) set on this element.
633 * 642 *
634 * The keys for the map must follow these rules: 643 * The keys for the map must follow these rules:
635 * 644 *
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 const ScrollAlignment._internal(this._value); 1489 const ScrollAlignment._internal(this._value);
1481 toString() => 'ScrollAlignment.$_value'; 1490 toString() => 'ScrollAlignment.$_value';
1482 1491
1483 /// Attempt to align the element to the top of the scrollable area. 1492 /// Attempt to align the element to the top of the scrollable area.
1484 static const TOP = const ScrollAlignment._internal('TOP'); 1493 static const TOP = const ScrollAlignment._internal('TOP');
1485 /// Attempt to center the element in the scrollable area. 1494 /// Attempt to center the element in the scrollable area.
1486 static const CENTER = const ScrollAlignment._internal('CENTER'); 1495 static const CENTER = const ScrollAlignment._internal('CENTER');
1487 /// Attempt to align the element to the bottom of the scrollable area. 1496 /// Attempt to align the element to the bottom of the scrollable area.
1488 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1497 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1489 } 1498 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698