OLD | NEW |
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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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.JsNative.getProperty(js.context, jsClassName); | 373 var baseElement = js.JsNative.getProperty(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.JsNative.getProperty(js.context, 'HTMLElement'); | 376 baseElement = js.JsNative.getProperty(js.context, 'HTMLElement'); |
377 } | 377 } |
378 var elemProto = js.JsNative.callMethod(js.JsNative.getProperty(js.context,
'Object'), "create", [js.JsNative.getProperty(baseElement, 'prototype')]); | 378 var elemProto = js.JsNative.callMethod(js.JsNative.getProperty(js.context,
'Object'), "create", [js.JsNative.getProperty(baseElement, 'prototype')]); |
379 | 379 |
380 // Remember for any upgrading done in wrap_jso. | 380 // Remember for any upgrading done in wrap_jso. |
381 _knownCustomeElements[tag] = customElementClass; | 381 _knownCustomElements[tag] = customElementClass; |
382 | 382 |
383 // 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 |
384 // created() constructor of the custom element does e.g., | 384 // created() constructor of the custom element does e.g., |
385 // | 385 // |
386 // MyElement.created() : super.created() { | 386 // MyElement.created() : super.created() { |
387 // this.innerHtml = "<b>I'm an x-foo-with-markup!</b>"; | 387 // this.innerHtml = "<b>I'm an x-foo-with-markup!</b>"; |
388 // } | 388 // } |
389 // | 389 // |
390 // sanitizing causes custom element to created recursively | 390 // sanitizing causes custom element to created recursively |
391 // until stack overflow. | 391 // until stack overflow. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 /// parameter must be provided. | 487 /// parameter must be provided. |
488 @Experimental() | 488 @Experimental() |
489 ElementUpgrader createElementUpgrader(Type type, {String extendsTag}) { | 489 ElementUpgrader createElementUpgrader(Type type, {String extendsTag}) { |
490 $if DART2JS | 490 $if DART2JS |
491 return new _JSElementUpgrader(this, type, extendsTag); | 491 return new _JSElementUpgrader(this, type, extendsTag); |
492 $else | 492 $else |
493 return new _VMElementUpgrader(this, type, extendsTag); | 493 return new _VMElementUpgrader(this, type, extendsTag); |
494 $endif | 494 $endif |
495 } | 495 } |
496 } | 496 } |
OLD | NEW |