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 implements NodeListWrapper { | 8 implements NodeListWrapper { |
9 // Raw Element. | 9 // Raw Element. |
10 final Element _element; | 10 final Element _element; |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 * For example, HTML specified as: | 659 * For example, HTML specified as: |
660 * | 660 * |
661 * <div data-my-random-value='value'></div> | 661 * <div data-my-random-value='value'></div> |
662 * | 662 * |
663 * Would be accessed in Dart as: | 663 * Would be accessed in Dart as: |
664 * | 664 * |
665 * var value = element.dataset['myRandomValue']; | 665 * var value = element.dataset['myRandomValue']; |
666 * | 666 * |
667 * See also: | 667 * See also: |
668 * | 668 * |
669 * * [Custom data attributes](http://www.w3.org/TR/html5/global-attributes.htm
l#custom-data-attribute) | 669 * * [Custom data |
| 670 * attributes](http://dev.w3.org/html5/spec-preview/global-attributes.html#c
ustom-data-attribute) |
670 */ | 671 */ |
671 Map<String, String> get dataset => | 672 Map<String, String> get dataset => |
672 new _DataAttributeMap(attributes); | 673 new _DataAttributeMap(attributes); |
673 | 674 |
674 set dataset(Map<String, String> value) { | 675 set dataset(Map<String, String> value) { |
675 final data = this.dataset; | 676 final data = this.dataset; |
676 data.clear(); | 677 data.clear(); |
677 for (String key in value.keys) { | 678 for (String key in value.keys) { |
678 data[key] = value[key]; | 679 data[key] = value[key]; |
679 } | 680 } |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 String get localName => _localName; | 886 String get localName => _localName; |
886 $endif | 887 $endif |
887 | 888 |
888 /** | 889 /** |
889 * A URI that identifies the XML namespace of this element. | 890 * A URI that identifies the XML namespace of this element. |
890 * | 891 * |
891 * `null` if no namespace URI is specified. | 892 * `null` if no namespace URI is specified. |
892 * | 893 * |
893 * ## Other resources | 894 * ## Other resources |
894 * | 895 * |
895 * * [Node.namespaceURI] | 896 * * [Node.namespaceURI](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-No
deNSname) |
896 * (http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSname) from W3C. | 897 * from W3C. |
897 */ | 898 */ |
898 @DomName('Element.namespaceUri') | 899 @DomName('Element.namespaceUri') |
899 String get namespaceUri => _namespaceUri; | 900 String get namespaceUri => _namespaceUri; |
900 | 901 |
901 /** | 902 /** |
902 * The string representation of this element. | 903 * The string representation of this element. |
903 * | 904 * |
904 * This is equivalent to reading the [localName] property. | 905 * This is equivalent to reading the [localName] property. |
905 */ | 906 */ |
906 String toString() => localName; | 907 String toString() => localName; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 } while(elem != null); | 1116 } while(elem != null); |
1116 return false; | 1117 return false; |
1117 } | 1118 } |
1118 | 1119 |
1119 $if DART2JS | 1120 $if DART2JS |
1120 /** | 1121 /** |
1121 * Creates a new shadow root for this shadow host. | 1122 * Creates a new shadow root for this shadow host. |
1122 * | 1123 * |
1123 * ## Other resources | 1124 * ## Other resources |
1124 * | 1125 * |
1125 * * [Shadow DOM 101] | 1126 * * [Shadow DOM 101](http://www.html5rocks.com/en/tutorials/webcomponents/sha
dowdom/) |
1126 * (http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom/) | 1127 * from HTML5Rocks. |
1127 * from HTML5Rocks. | 1128 * * [Shadow DOM specification](http://www.w3.org/TR/shadow-dom/) from W3C. |
1128 * * [Shadow DOM specification] | |
1129 * (http://www.w3.org/TR/shadow-dom/) from W3C. | |
1130 */ | 1129 */ |
1131 @DomName('Element.createShadowRoot') | 1130 @DomName('Element.createShadowRoot') |
1132 @SupportedBrowser(SupportedBrowser.CHROME, '25') | 1131 @SupportedBrowser(SupportedBrowser.CHROME, '25') |
1133 @Experimental() | 1132 @Experimental() |
1134 ShadowRoot createShadowRoot() { | 1133 ShadowRoot createShadowRoot() { |
1135 return JS('ShadowRoot', | 1134 return JS('ShadowRoot', |
1136 '(#.createShadowRoot || #.webkitCreateShadowRoot).call(#)', | 1135 '(#.createShadowRoot || #.webkitCreateShadowRoot).call(#)', |
1137 this, this, this); | 1136 this, this, this); |
1138 } | 1137 } |
1139 | 1138 |
1140 /** | 1139 /** |
1141 * The shadow root of this shadow host. | 1140 * The shadow root of this shadow host. |
1142 * | 1141 * |
1143 * ## Other resources | 1142 * ## Other resources |
1144 * | 1143 * |
1145 * * [Shadow DOM 101] | 1144 * * [Shadow DOM 101](http://www.html5rocks.com/en/tutorials/webcomponents/sha
dowdom/) |
1146 * (http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom/) | 1145 * from HTML5Rocks. |
1147 * from HTML5Rocks. | 1146 * * [Shadow DOM specification](http://www.w3.org/TR/shadow-dom/) |
1148 * * [Shadow DOM specification] | 1147 * from W3C. |
1149 * (http://www.w3.org/TR/shadow-dom/) from W3C. | |
1150 */ | 1148 */ |
1151 @DomName('Element.shadowRoot') | 1149 @DomName('Element.shadowRoot') |
1152 @SupportedBrowser(SupportedBrowser.CHROME, '25') | 1150 @SupportedBrowser(SupportedBrowser.CHROME, '25') |
1153 @Experimental() | 1151 @Experimental() |
1154 ShadowRoot get shadowRoot => | 1152 ShadowRoot get shadowRoot => |
1155 JS('ShadowRoot|Null', '#.shadowRoot || #.webkitShadowRoot', this, this); | 1153 JS('ShadowRoot|Null', '#.shadowRoot || #.webkitShadowRoot', this, this); |
1156 $endif | 1154 $endif |
1157 | 1155 |
1158 /** | 1156 /** |
1159 * Access this element's content position. | 1157 * Access this element's content position. |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 const ScrollAlignment._internal(this._value); | 1738 const ScrollAlignment._internal(this._value); |
1741 toString() => 'ScrollAlignment.$_value'; | 1739 toString() => 'ScrollAlignment.$_value'; |
1742 | 1740 |
1743 /// Attempt to align the element to the top of the scrollable area. | 1741 /// Attempt to align the element to the top of the scrollable area. |
1744 static const TOP = const ScrollAlignment._internal('TOP'); | 1742 static const TOP = const ScrollAlignment._internal('TOP'); |
1745 /// Attempt to center the element in the scrollable area. | 1743 /// Attempt to center the element in the scrollable area. |
1746 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1744 static const CENTER = const ScrollAlignment._internal('CENTER'); |
1747 /// Attempt to align the element to the bottom of the scrollable area. | 1745 /// Attempt to align the element to the bottom of the scrollable area. |
1748 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1746 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
1749 } | 1747 } |
OLD | NEW |