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

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

Issue 22755002: Move matches method so that it gets generated for dart2js and dartium. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 // Raw Element. 8 // Raw Element.
9 final Element _element; 9 final Element _element;
10 final HtmlCollection _childElements; 10 final HtmlCollection _childElements;
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 case 'beforeend': 865 case 'beforeend':
866 this.append(node); 866 this.append(node);
867 break; 867 break;
868 case 'afterend': 868 case 'afterend':
869 this.parentNode.insertBefore(node, this.nextNode); 869 this.parentNode.insertBefore(node, this.nextNode);
870 break; 870 break;
871 default: 871 default:
872 throw new ArgumentError("Invalid position ${where}"); 872 throw new ArgumentError("Invalid position ${where}");
873 } 873 }
874 } 874 }
875 $endif
875 876
876 /** 877 /**
877 * Checks if this element matches the CSS selectors. 878 * Checks if this element matches the CSS selectors.
878 */ 879 */
879 @Experimental() 880 @Experimental()
880 bool matches(String selectors) { 881 bool matches(String selectors) {
881 if (JS('bool', '!!#.matches', this)) { 882 if (JS('bool', '!!#.matches', this)) {
882 return JS('bool', '#.matches(#)', this, selectors); 883 return JS('bool', '#.matches(#)', this, selectors);
883 } else if (JS('bool', '!!#.webkitMatchesSelector', this)) { 884 } else if (JS('bool', '!!#.webkitMatchesSelector', this)) {
884 return JS('bool', '#.webkitMatchesSelector(#)', this, selectors); 885 return JS('bool', '#.webkitMatchesSelector(#)', this, selectors);
885 } else if (JS('bool', '!!#.mozMatchesSelector', this)) { 886 } else if (JS('bool', '!!#.mozMatchesSelector', this)) {
886 return JS('bool', '#.mozMatchesSelector(#)', this, selectors); 887 return JS('bool', '#.mozMatchesSelector(#)', this, selectors);
887 } else if (JS('bool', '!!#.msMatchesSelector', this)) { 888 } else if (JS('bool', '!!#.msMatchesSelector', this)) {
888 return JS('bool', '#.msMatchesSelector(#)', this, selectors); 889 return JS('bool', '#.msMatchesSelector(#)', this, selectors);
889 } 890 }
890 throw new UnsupportedError("Not supported on this platform"); 891 throw new UnsupportedError("Not supported on this platform");
891 } 892 }
892 $else
893 $endif
894 893
895 $if DART2JS 894 $if DART2JS
896 @Creates('Null') // Set from Dart code; does not instantiate a native type. 895 @Creates('Null') // Set from Dart code; does not instantiate a native type.
897 $endif 896 $endif
898 Element _templateInstanceRef; 897 Element _templateInstanceRef;
899 898
900 // Note: only used if `this is! TemplateElement` 899 // Note: only used if `this is! TemplateElement`
901 $if DART2JS 900 $if DART2JS
902 @Creates('Null') // Set from Dart code; does not instantiate a native type. 901 @Creates('Null') // Set from Dart code; does not instantiate a native type.
903 $endif 902 $endif
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 const ScrollAlignment._internal(this._value); 1295 const ScrollAlignment._internal(this._value);
1297 toString() => 'ScrollAlignment.$_value'; 1296 toString() => 'ScrollAlignment.$_value';
1298 1297
1299 /// Attempt to align the element to the top of the scrollable area. 1298 /// Attempt to align the element to the top of the scrollable area.
1300 static const TOP = const ScrollAlignment._internal('TOP'); 1299 static const TOP = const ScrollAlignment._internal('TOP');
1301 /// Attempt to center the element in the scrollable area. 1300 /// Attempt to center the element in the scrollable area.
1302 static const CENTER = const ScrollAlignment._internal('CENTER'); 1301 static const CENTER = const ScrollAlignment._internal('CENTER');
1303 /// Attempt to align the element to the bottom of the scrollable area. 1302 /// Attempt to align the element to the bottom of the scrollable area.
1304 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1303 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1305 } 1304 }
OLDNEW
« sdk/lib/html/dartium/html_dartium.dart ('K') | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698