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

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 UTC