Re: [webcomponents]: Of weird script elements and Benadryl

On Fri, Apr 12, 2013 at 2:02 PM, Daniel Buchner <daniel@mozilla.com> wrote:
> Dimitri, Web-Component-Companions,
>
> Is it possible to create an HTMLElement-inheriting object for the custom
> element in question in a defined way when the parser hits the <element> tag,
> so that the developer can just refer to the object within the <script> tag?
> Here's what I mean:
>
> <element tagname="x-foo">
>   <template>...</template>
>   <script>
>       HTMLXFooElement.prototype.bar = function(){...}
>       HTMLXFooElement.prototype.readyCallback = function(){...}
>   </script>
> </element>

The way the tree is constructed currently, the <element> is born after
</element> is seen. So it won't run its constructor (which presumably
sets up HTMLXFooElement) until after <script> has executed.

:DG<

Received on Friday, 12 April 2013 22:24:27 UTC