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

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

Issue 19482024: fix parsing of semantic template interation w/ shadowdom polyfill (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 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
« 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // WARNING: Do not edit - generated code. 5 // WARNING: Do not edit - generated code.
6 6
7 part of $LIBRARYNAME; 7 part of $LIBRARYNAME;
8 8
9 9
10 /** 10 /**
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 * already decorated. 128 * already decorated.
129 */ 129 */
130 @Experimental() 130 @Experimental()
131 static bool decorate(Element template, [Element instanceRef]) { 131 static bool decorate(Element template, [Element instanceRef]) {
132 // == true check because it starts as a null field. 132 // == true check because it starts as a null field.
133 if (template._templateIsDecorated == true) return false; 133 if (template._templateIsDecorated == true) return false;
134 134
135 _injectStylesheet(); 135 _injectStylesheet();
136 136
137 var templateElement = template; 137 var templateElement = template;
138 templateElement._templateIsDecorated = true;
138 var isNative = templateElement is TemplateElement; 139 var isNative = templateElement is TemplateElement;
139 var bootstrapContents = isNative; 140 var bootstrapContents = isNative;
140 var liftContents = !isNative; 141 var liftContents = !isNative;
141 var liftRoot = false; 142 var liftRoot = false;
142 143
143 if (!isNative && templateElement._isAttributeTemplate) { 144 if (!isNative && templateElement._isAttributeTemplate) {
144 if (instanceRef != null) { 145 if (instanceRef != null) {
145 // TODO(jmesserly): this is just an assert in MDV. 146 // TODO(jmesserly): this is just an assert in MDV.
146 throw new ArgumentError('instanceRef should not be supplied for ' 147 throw new ArgumentError('instanceRef should not be supplied for '
147 'attribute templates.'); 148 'attribute templates.');
148 } 149 }
149 templateElement = _extractTemplateFromAttributeTemplate(template); 150 templateElement = _extractTemplateFromAttributeTemplate(template);
151 templateElement._templateIsDecorated = true;
150 isNative = templateElement is TemplateElement; 152 isNative = templateElement is TemplateElement;
151 liftRoot = true; 153 liftRoot = true;
152 } 154 }
153 155
154 templateElement._templateIsDecorated = true;
155
156 if (!isNative) { 156 if (!isNative) {
157 var doc = _getTemplateContentsOwner(templateElement.document); 157 var doc = _getTemplateContentsOwner(templateElement.document);
158 templateElement._templateContent = doc.createDocumentFragment(); 158 templateElement._templateContent = doc.createDocumentFragment();
159 } 159 }
160 160
161 if (instanceRef != null) { 161 if (instanceRef != null) {
162 // template is contained within an instance, its direct content must be 162 // template is contained within an instance, its direct content must be
163 // empty 163 // empty
164 templateElement._templateInstanceRef = instanceRef; 164 templateElement._templateInstanceRef = instanceRef;
165 } else if (liftContents) { 165 } else if (liftContents) {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 document.head.append(style); 292 document.head.append(style);
293 } 293 }
294 294
295 /** 295 /**
296 * A mapping of names to Custom Syntax objects. See [CustomBindingSyntax] for 296 * A mapping of names to Custom Syntax objects. See [CustomBindingSyntax] for
297 * more information. 297 * more information.
298 */ 298 */
299 @Experimental() 299 @Experimental()
300 static Map<String, CustomBindingSyntax> syntax = {}; 300 static Map<String, CustomBindingSyntax> syntax = {};
301 } 301 }
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