- From: Dimitri Glazkov <dglazkov@google.com>
- Date: Fri, 12 Apr 2013 15:23:58 -0700
- To: Daniel Buchner <daniel@mozilla.com>
- Cc: Rick Waldron <waldron.rick@gmail.com>, Allen Wirfs-Brock <allen@wirfs-brock.com>, John J Barton <johnjbarton@johnjbarton.com>, Scott Miles <sjmiles@google.com>, Rafael Weinstein <rafaelw@google.com>, public-webapps <public-webapps@w3.org>, Blake Kaplan <mrbkap@mozilla.com>, William Chen <wchen@mozilla.com>, Jonas Sicking <jonas@sicking.cc>, Steve Orvell <sorvell@google.com>, Dave Herman <dherman@mozilla.com>, Boris Zbarsky <bzbarsky@mit.edu>
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