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

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

Issue 13393008: Revert "Optimizing createElement_html" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 } 1026 }
1027 parentTag = _CUSTOM_PARENT_TAG_MAP[tag]; 1027 parentTag = _CUSTOM_PARENT_TAG_MAP[tag];
1028 if (parentTag == null) parentTag = 'div'; 1028 if (parentTag == null) parentTag = 'div';
1029 } 1029 }
1030 1030
1031 final temp = new Element.tag(parentTag); 1031 final temp = new Element.tag(parentTag);
1032 temp.innerHtml = html; 1032 temp.innerHtml = html;
1033 1033
1034 Element element; 1034 Element element;
1035 if (temp.children.length == 1) { 1035 if (temp.children.length == 1) {
1036 element = temp.$dom_firstChild; 1036 element = temp.children[0];
1037 } else if (parentTag == 'html' && temp.children.length == 2) { 1037 } else if (parentTag == 'html' && temp.children.length == 2) {
1038 // In html5 the root <html> tag will always have a <body> and a <head>, 1038 // In html5 the root <html> tag will always have a <body> and a <head>,
1039 // even though the inner html only contains one of them. 1039 // even though the inner html only contains one of them.
1040 element = temp.children[tag == 'head' ? 0 : 1]; 1040 element = temp.children[tag == 'head' ? 0 : 1];
1041 } else { 1041 } else {
1042 // Throw an exception because too many children.
1043 _singleNode(temp.children); 1042 _singleNode(temp.children);
1044 } 1043 }
1045 element.remove(); 1044 element.remove();
1046 return element; 1045 return element;
1047 } 1046 }
1048 1047
1049 /** 1048 /**
1050 * IE table elements don't support innerHTML (even in standards mode). 1049 * IE table elements don't support innerHTML (even in standards mode).
1051 * Instead we use a div and inject the table element in the innerHtml string. 1050 * Instead we use a div and inject the table element in the innerHtml string.
1052 * This technique works on other browsers too, but it's probably slower, 1051 * This technique works on other browsers too, but it's probably slower,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 const ScrollAlignment._internal(this._value); 1127 const ScrollAlignment._internal(this._value);
1129 toString() => 'ScrollAlignment.$_value'; 1128 toString() => 'ScrollAlignment.$_value';
1130 1129
1131 /// Attempt to align the element to the top of the scrollable area. 1130 /// Attempt to align the element to the top of the scrollable area.
1132 static const TOP = const ScrollAlignment._internal('TOP'); 1131 static const TOP = const ScrollAlignment._internal('TOP');
1133 /// Attempt to center the element in the scrollable area. 1132 /// Attempt to center the element in the scrollable area.
1134 static const CENTER = const ScrollAlignment._internal('CENTER'); 1133 static const CENTER = const ScrollAlignment._internal('CENTER');
1135 /// Attempt to align the element to the bottom of the scrollable area. 1134 /// Attempt to align the element to the bottom of the scrollable area.
1136 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1135 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1137 } 1136 }
OLDNEW
« no previous file with comments | « 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