| 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 class _ChildrenElementList extends ListBase<Element> { | 7 class _ChildrenElementList extends ListBase<Element> { |
| 8 // Raw Element. | 8 // Raw Element. |
| 9 final Element _element; | 9 final Element _element; |
| 10 final HtmlCollection _childElements; | 10 final HtmlCollection _childElements; |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 /// Creates a new `<ul>` element. | 493 /// Creates a new `<ul>` element. |
| 494 /// | 494 /// |
| 495 /// This is identical to calling `new Element.tag('ul')`. | 495 /// This is identical to calling `new Element.tag('ul')`. |
| 496 factory Element.ul() => new Element.tag('ul'); | 496 factory Element.ul() => new Element.tag('ul'); |
| 497 | 497 |
| 498 /// Creates a new `<video>` element. | 498 /// Creates a new `<video>` element. |
| 499 /// | 499 /// |
| 500 /// This is identical to calling `new Element.tag('video')`. | 500 /// This is identical to calling `new Element.tag('video')`. |
| 501 factory Element.video() => new Element.tag('video'); | 501 factory Element.video() => new Element.tag('video'); |
| 502 | 502 |
| 503 Map<String, String> _cachedAttributeMap; | |
| 504 /** | 503 /** |
| 505 * All attributes on this element. | 504 * All attributes on this element. |
| 506 * | 505 * |
| 507 * Any modifications to the attribute map will automatically be applied to | 506 * Any modifications to the attribute map will automatically be applied to |
| 508 * this element. | 507 * this element. |
| 509 * | 508 * |
| 510 * This only includes attributes which are not in a namespace | 509 * This only includes attributes which are not in a namespace |
| 511 * (such as 'xlink:href'), additional attributes can be accessed via | 510 * (such as 'xlink:href'), additional attributes can be accessed via |
| 512 * [getNamespacedAttributes]. | 511 * [getNamespacedAttributes]. |
| 513 */ | 512 */ |
| 514 Map<String, String> get attributes { | 513 Map<String, String> get attributes => new _ElementAttributeMap(this); |
| 515 if (_cachedAttributeMap == null) { | |
| 516 _cachedAttributeMap = new _ElementAttributeMap(this); | |
| 517 } | |
| 518 return _cachedAttributeMap; | |
| 519 } | |
| 520 | 514 |
| 521 void set attributes(Map<String, String> value) { | 515 void set attributes(Map<String, String> value) { |
| 522 Map<String, String> attributes = this.attributes; | 516 Map<String, String> attributes = this.attributes; |
| 523 attributes.clear(); | 517 attributes.clear(); |
| 524 for (String key in value.keys) { | 518 for (String key in value.keys) { |
| 525 attributes[key] = value[key]; | 519 attributes[key] = value[key]; |
| 526 } | 520 } |
| 527 } | 521 } |
| 528 | 522 |
| 529 /** | 523 /** |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 const ScrollAlignment._internal(this._value); | 1367 const ScrollAlignment._internal(this._value); |
| 1374 toString() => 'ScrollAlignment.$_value'; | 1368 toString() => 'ScrollAlignment.$_value'; |
| 1375 | 1369 |
| 1376 /// Attempt to align the element to the top of the scrollable area. | 1370 /// Attempt to align the element to the top of the scrollable area. |
| 1377 static const TOP = const ScrollAlignment._internal('TOP'); | 1371 static const TOP = const ScrollAlignment._internal('TOP'); |
| 1378 /// Attempt to center the element in the scrollable area. | 1372 /// Attempt to center the element in the scrollable area. |
| 1379 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1373 static const CENTER = const ScrollAlignment._internal('CENTER'); |
| 1380 /// Attempt to align the element to the bottom of the scrollable area. | 1374 /// Attempt to align the element to the bottom of the scrollable area. |
| 1381 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1375 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
| 1382 } | 1376 } |
| OLD | NEW |