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

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

Issue 10800104: Convert DOM and HTML frog to dart2js. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 // 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
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 }
OLDNEW
« no previous file with comments | « lib/dom/templates/html/impl/impl_Document.darttemplate ('k') | lib/dom/templates/html/impl/impl_MutationObserver.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698