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

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

Issue 1382383003: Fixed element upgrading for polymer (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged Created 5 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
« no previous file with comments | « tools/dom/templates/html/dartium/html_dartium.darttemplate ('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 // 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 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS { 9 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
10 $!MEMBERS 10 $!MEMBERS
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 // 370 //
371 // var myProto = Object.create(HTMLElement.prototype); 371 // var myProto = Object.create(HTMLElement.prototype);
372 // var myElement = document.registerElement('x-foo', {prototype: myPro to}); 372 // var myElement = document.registerElement('x-foo', {prototype: myPro to});
373 var baseElement = js.context[jsClassName]; 373 var baseElement = js.context[jsClassName];
374 if (baseElement == null) { 374 if (baseElement == null) {
375 // Couldn't find the HTML element so use a generic one. 375 // Couldn't find the HTML element so use a generic one.
376 baseElement = js.context['HTMLElement']; 376 baseElement = js.context['HTMLElement'];
377 } 377 }
378 var elemProto = js.context['Object'].callMethod("create", [baseElement['pr ototype']]); 378 var elemProto = js.context['Object'].callMethod("create", [baseElement['pr ototype']]);
379 379
380 // Remember for any upgrading done in wrap_jso.
381 _knownCustomeElements[tag] = customElementClass;
382
380 // TODO(terry): Hack to stop recursion re-creating custom element when the 383 // TODO(terry): Hack to stop recursion re-creating custom element when the
381 // created() constructor of the custom element does e.g., 384 // created() constructor of the custom element does e.g.,
382 // 385 //
383 // MyElement.created() : super.created() { 386 // MyElement.created() : super.created() {
384 // this.innerHtml = "<b>I'm an x-foo-with-markup!</b>"; 387 // this.innerHtml = "<b>I'm an x-foo-with-markup!</b>";
385 // } 388 // }
386 // 389 //
387 // sanitizing causes custom element to created recursively 390 // sanitizing causes custom element to created recursively
388 // until stack overflow. 391 // until stack overflow.
389 // 392 //
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 /// parameter must be provided. 491 /// parameter must be provided.
489 @Experimental() 492 @Experimental()
490 ElementUpgrader createElementUpgrader(Type type, {String extendsTag}) { 493 ElementUpgrader createElementUpgrader(Type type, {String extendsTag}) {
491 $if DART2JS 494 $if DART2JS
492 return new _JSElementUpgrader(this, type, extendsTag); 495 return new _JSElementUpgrader(this, type, extendsTag);
493 $else 496 $else
494 return new _VMElementUpgrader(this, type, extendsTag); 497 return new _VMElementUpgrader(this, type, extendsTag);
495 $endif 498 $endif
496 } 499 }
497 } 500 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/dartium/html_dartium.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698