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

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

Issue 12262048: Renaming Element.dataAttributes to Element.dataset. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 * * The name cannot contain any capital letters. 662 * * The name cannot contain any capital letters.
663 * 663 *
664 * Any keys from markup will be converted to camel-cased keys in the map. 664 * Any keys from markup will be converted to camel-cased keys in the map.
665 * 665 *
666 * For example, HTML specified as: 666 * For example, HTML specified as:
667 * 667 *
668 * <div data-my-random-value='value'></div> 668 * <div data-my-random-value='value'></div>
669 * 669 *
670 * Would be accessed in Dart as: 670 * Would be accessed in Dart as:
671 * 671 *
672 * var value = element.dataAttributes['myRandomValue']; 672 * var value = element.dataset['myRandomValue'];
673 * 673 *
674 * See also: 674 * See also:
675 * 675 *
676 * * [Custom data attributes](http://www.w3.org/TR/html5/global-attributes.htm l#custom-data-attribute) 676 * * [Custom data attributes](http://www.w3.org/TR/html5/global-attributes.htm l#custom-data-attribute)
677 */ 677 */
Jacob 2013/02/14 18:16:36 we should think about whether the regular browser
678 Map<String, String> get dataAttributes => 678 Map<String, String> get dataset =>
679 new _DataAttributeMap(attributes); 679 new _DataAttributeMap(attributes);
680 680
681 void set dataAttributes(Map<String, String> value) { 681 void set dataset(Map<String, String> value) {
682 final dataAttributes = this.dataAttributes; 682 final data = this.dataset;
683 dataAttributes.clear(); 683 data.clear();
684 for (String key in value.keys) { 684 for (String key in value.keys) {
685 dataAttributes[key] = value[key]; 685 data[key] = value[key];
686 } 686 }
687 } 687 }
688 688
689 /** 689 /**
690 * Gets a map for manipulating the attributes of a particular namespace. 690 * Gets a map for manipulating the attributes of a particular namespace.
691 * 691 *
692 * This is primarily useful for SVG attributes such as xref:link. 692 * This is primarily useful for SVG attributes such as xref:link.
693 */ 693 */
694 Map<String, String> getNamespacedAttributes(String namespace) { 694 Map<String, String> getNamespacedAttributes(String namespace) {
695 return new _NamespacedAttributeMap(this, namespace); 695 return new _NamespacedAttributeMap(this, namespace);
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 const ScrollAlignment._internal(this._value); 1112 const ScrollAlignment._internal(this._value);
1113 toString() => 'ScrollAlignment.$_value'; 1113 toString() => 'ScrollAlignment.$_value';
1114 1114
1115 /// Attempt to align the element to the top of the scrollable area. 1115 /// Attempt to align the element to the top of the scrollable area.
1116 static const TOP = const ScrollAlignment._internal('TOP'); 1116 static const TOP = const ScrollAlignment._internal('TOP');
1117 /// Attempt to center the element in the scrollable area. 1117 /// Attempt to center the element in the scrollable area.
1118 static const CENTER = const ScrollAlignment._internal('CENTER'); 1118 static const CENTER = const ScrollAlignment._internal('CENTER');
1119 /// Attempt to align the element to the bottom of the scrollable area. 1119 /// Attempt to align the element to the bottom of the scrollable area.
1120 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1120 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1121 } 1121 }
OLDNEW
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698