| 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 // TODO(jacobr): use _Lists.dart to remove some of the duplicated | 5 // TODO(jacobr): use _Lists.dart to remove some of the duplicated |
| 6 // functionality. | 6 // functionality. |
| 7 class _ChildrenElementList implements ElementList { | 7 class _ChildrenElementList implements ElementList { |
| 8 // Raw Element. | 8 // Raw Element. |
| 9 final _ElementImpl _element; | 9 final _ElementImpl _element; |
| 10 final _HTMLCollectionImpl _childElements; | 10 final _HTMLCollectionImpl _childElements; |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 element = temp.elements[tag == 'head' ? 0 : 1]; | 768 element = temp.elements[tag == 'head' ? 0 : 1]; |
| 769 } else { | 769 } else { |
| 770 throw new IllegalArgumentException('HTML had ${temp.elements.length} ' | 770 throw new IllegalArgumentException('HTML had ${temp.elements.length} ' |
| 771 'top level elements but 1 expected'); | 771 'top level elements but 1 expected'); |
| 772 } | 772 } |
| 773 element.remove(); | 773 element.remove(); |
| 774 return element; | 774 return element; |
| 775 } | 775 } |
| 776 | 776 |
| 777 /** @domName Document.createElement */ | 777 /** @domName Document.createElement */ |
| 778 $if FROG | 778 $if DART2JS |
| 779 // Optimization to improve performance until the frog compiler inlines this | 779 // Optimization to improve performance until the dart2js compiler inlines this |
| 780 // method. | 780 // method. |
| 781 factory Element.tag(String tag) native "return document.createElement(tag)"; | 781 factory Element.tag(String tag) native "return document.createElement(tag)"; |
| 782 $else | 782 $else |
| 783 factory Element.tag(String tag) => _document.$dom_createElement(tag); | 783 factory Element.tag(String tag) => _document.$dom_createElement(tag); |
| 784 $endif | 784 $endif |
| 785 } | 785 } |
| OLD | NEW |