W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2013

Re: Custom elements ES6/ES5 syntax compromise, was: document.register and ES6

From: Dimitri Glazkov <dglazkov@google.com>
Date: Wed, 20 Feb 2013 09:54:18 -0800
Message-ID: <CADh5Ky2UvrbeA5UPe6FocOkEKP1j5L=KmNFBrk02FYwo=A819A@mail.gmail.com>
To: Daniel Buchner <daniel@mozilla.com>
Cc: Scott Miles <sjmiles@google.com>, Anne van Kesteren <annevk@annevk.nl>, Boris Zbarsky <bzbarsky@mit.edu>, Erik Arvidsson <arv@chromium.org>, public-webapps <public-webapps@w3.org>
It seems that there's some additional reasoning that needs to go into
whether an element could be constructed as custom tag. Like in this
case, it should work both as a custom tag and as a type extension (the
"is" attr).

:DG<

On Tue, Feb 19, 2013 at 10:13 PM, Daniel Buchner <daniel@mozilla.com> wrote:
> Nope, you're 100% right, I saw header and thought HTMLHeadingElement for
> some reason - so this seems like a valid concern. What are the
> mitigation/solution options we can present to developers for this case?
>
>
> Daniel J. Buchner
> Product Manager, Developer Ecosystem
> Mozilla Corporation
>
>
> On Tue, Feb 19, 2013 at 9:17 PM, Scott Miles <sjmiles@google.com> wrote:
>>
>> Perhaps I'm making a mistake, but there is no specific prototype for the
>> native header element. 'header', 'footer', 'section', e.g., are all
>> HTMLElement, so all I can do is
>>
>> FancyHeaderPrototype = Object.create(HTMLElement.prototype);
>>
>> Afaict, the 'headerness' cannot be expressed this way.
>>
>>
>> On Tue, Feb 19, 2013 at 8:34 PM, Daniel Buchner <daniel@mozilla.com>
>> wrote:
>>>
>>> Wait a sec, perhaps I've missed something, but in your example you never
>>> extend the actual native header element, was that on purpose? I was under
>>> the impression you still needed to inherit from it in the prototype
>>> creation/registration phase, is that not true?
>>>
>>> On Feb 19, 2013 8:26 PM, "Scott Miles" <sjmiles@google.com> wrote:
>>>>
>>>> Question: if I do
>>>>
>>>> FancyHeaderPrototype = Object.create(HTMLElement.prototype);
>>>> document.register('fancy-header', {
>>>>   prototype: FancyHeaderPrototype
>>>> ...
>>>>
>>>> In this case, I intend to extend "header". I expect my custom elements
>>>> to look like <header is="fancy-header">, but how does the system know what
>>>> localName to use? I believe the notion was that the localName would be
>>>> inferred from the prototype, but there are various semantic tags that share
>>>> prototypes, so it seems ambiguous in these cases.
>>>>
>>>> S
Received on Wednesday, 20 February 2013 17:54:55 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:57 GMT