| 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 html; | 5 part of html; |
| 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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 this.parentNode.insertBefore(node, this.nextNode); | 889 this.parentNode.insertBefore(node, this.nextNode); |
| 890 break; | 890 break; |
| 891 default: | 891 default: |
| 892 throw new ArgumentError("Invalid position ${where}"); | 892 throw new ArgumentError("Invalid position ${where}"); |
| 893 } | 893 } |
| 894 } | 894 } |
| 895 | 895 |
| 896 /** | 896 /** |
| 897 * Checks if this element matches the CSS selectors. | 897 * Checks if this element matches the CSS selectors. |
| 898 */ | 898 */ |
| 899 @Experimental() | 899 @Experimental |
| 900 bool matches(String selectors) { | 900 bool matches(String selectors) { |
| 901 if (JS('bool', '!!#.matches', this)) { | 901 if (JS('bool', '!!#.matches', this)) { |
| 902 return JS('bool', '#.matches(#)', this, selectors); | 902 return JS('bool', '#.matches(#)', this, selectors); |
| 903 } else if (JS('bool', '!!#.webkitMatchesSelector', this)) { | 903 } else if (JS('bool', '!!#.webkitMatchesSelector', this)) { |
| 904 return JS('bool', '#.webkitMatchesSelector(#)', this, selectors); | 904 return JS('bool', '#.webkitMatchesSelector(#)', this, selectors); |
| 905 } else if (JS('bool', '!!#.mozMatchesSelector', this)) { | 905 } else if (JS('bool', '!!#.mozMatchesSelector', this)) { |
| 906 return JS('bool', '#.mozMatchesSelector(#)', this, selectors); | 906 return JS('bool', '#.mozMatchesSelector(#)', this, selectors); |
| 907 } else if (JS('bool', '!!#.msMatchesSelector', this)) { | 907 } else if (JS('bool', '!!#.msMatchesSelector', this)) { |
| 908 return JS('bool', '#.msMatchesSelector(#)', this, selectors); | 908 return JS('bool', '#.msMatchesSelector(#)', this, selectors); |
| 909 } | 909 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 $if DART2JS | 1044 $if DART2JS |
| 1045 // Optimization to improve performance until the dart2js compiler inlines this | 1045 // Optimization to improve performance until the dart2js compiler inlines this |
| 1046 // method. | 1046 // method. |
| 1047 static dynamic createElement_tag(String tag) => | 1047 static dynamic createElement_tag(String tag) => |
| 1048 JS('Element', 'document.createElement(#)', tag); | 1048 JS('Element', 'document.createElement(#)', tag); |
| 1049 $else | 1049 $else |
| 1050 static Element createElement_tag(String tag) => | 1050 static Element createElement_tag(String tag) => |
| 1051 document.$dom_createElement(tag); | 1051 document.$dom_createElement(tag); |
| 1052 $endif | 1052 $endif |
| 1053 } | 1053 } |
| OLD | NEW |