Chromium Code Reviews| 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 // 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 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1021 if (list.length == 1) return list[0]; | 1021 if (list.length == 1) return list[0]; |
| 1022 throw new ArgumentError('HTML had ${list.length} ' | 1022 throw new ArgumentError('HTML had ${list.length} ' |
| 1023 'top level elements but 1 expected'); | 1023 'top level elements but 1 expected'); |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 @DomName('Document.createElement') | 1026 @DomName('Document.createElement') |
| 1027 $if DART2JS | 1027 $if DART2JS |
| 1028 // Optimization to improve performance until the dart2js compiler inlines this | 1028 // Optimization to improve performance until the dart2js compiler inlines this |
| 1029 // method. | 1029 // method. |
| 1030 static dynamic createElement_tag(String tag) => | 1030 static dynamic createElement_tag(String tag) => |
| 1031 JS('Element', 'document.createElement(#)', tag); | 1031 JS('Element|Function', 'document.createElement(#)', tag); |
|
sra1
2013/02/04 22:46:37
I'd write
// Firefox may return a JavaScript func
| |
| 1032 $else | 1032 $else |
| 1033 static Element createElement_tag(String tag) => | 1033 static Element createElement_tag(String tag) => |
| 1034 document.$dom_createElement(tag); | 1034 document.$dom_createElement(tag); |
| 1035 $endif | 1035 $endif |
| 1036 } | 1036 } |
| OLD | NEW |