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

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

Issue 27223003: Deprecate query and queryAll, also add back querySelector and querySelectorAll. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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) 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 * Model-Driven Views (MDV)'s native features enables a wide-range of use cases, 10 * Model-Driven Views (MDV)'s native features enables a wide-range of use cases,
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 static void bootstrap(Node content) { 247 static void bootstrap(Node content) {
248 void _bootstrap(template) { 248 void _bootstrap(template) {
249 if (!TemplateElement.decorate(template)) { 249 if (!TemplateElement.decorate(template)) {
250 bootstrap(template.content); 250 bootstrap(template.content);
251 } 251 }
252 } 252 }
253 253
254 // Need to do this first as the contents may get lifted if |node| is 254 // Need to do this first as the contents may get lifted if |node| is
255 // template. 255 // template.
256 // TODO(jmesserly): content is DocumentFragment or Element 256 // TODO(jmesserly): content is DocumentFragment or Element
257 var descendents = (content as dynamic).queryAll(_allTemplatesSelectors); 257 var descendents =
258 (content as dynamic).querySelectorAll(_allTemplatesSelectors);
258 if (content is Element && (content as Element).isTemplate) { 259 if (content is Element && (content as Element).isTemplate) {
259 _bootstrap(content); 260 _bootstrap(content);
260 } 261 }
261 262
262 descendents.forEach(_bootstrap); 263 descendents.forEach(_bootstrap);
263 } 264 }
264 265
265 static final String _allTemplatesSelectors = 266 static final String _allTemplatesSelectors =
266 'template, option[template], optgroup[template], ' + 267 'template, option[template], optgroup[template], ' +
267 Element._TABLE_TAGS.keys.map((k) => "$k[template]").join(", "); 268 Element._TABLE_TAGS.keys.map((k) => "$k[template]").join(", ");
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 */ 300 */
300 void setInnerHtml(String html, 301 void setInnerHtml(String html,
301 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) { 302 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
302 text = null; 303 text = null;
303 var fragment = createFragment( 304 var fragment = createFragment(
304 html, validator: validator, treeSanitizer: treeSanitizer); 305 html, validator: validator, treeSanitizer: treeSanitizer);
305 306
306 content.append(fragment); 307 content.append(fragment);
307 } 308 }
308 } 309 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698