[webcomponents] [Custom]: type extensions should be available as custom tags, not only through <baseTag is="..."> (bugzilla: 27976) (#147)

Title: [Custom]: type extensions should be available as custom tags, not only through <baseTag is="..."> (bugzilla: 27976)

Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27976

----
comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27976#c0
*Randy Harmon* wrote on 2015-02-07 18:52:01 +0000.

It seems to me that it's unnecessarily limiting to require that users specify the base tag type and also the extension tag.  It seems to prevent the direct use of semantic tags which happen to use a non-generic html tag prototype.

This might be simply a clarity issue, where in 11.2 Type Extension Example, you could specify that \<button is=tequila-button\> is equivalent to \<tequila-button\>.

----

comment: 1
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27976#c1
*Boris Zbarsky* wrote on 2015-02-07 21:44:19 +0000.

If you want the HTML spec (and hence browsers) to think it's a button, you can't call it \<tequila-button\>, because both the HTML spec and browser implementations are in terms of the localName of the element.  So are browser extensions, various web libraries, and so forth.

This has been discussed at quite some length several times already.  Doing this in a green-field design might have made sense, but at this point we're talking about boiling the ocean.

----

comment: 2
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27976#c2
*Randy Harmon* wrote on 2015-02-08 21:25:05 +0000.

OK.  Thanks for the info.

Seems worth an aside in the doc, just to clarify that for current compatibility reasons, a native element cannot be considered a native element by the browser if it is extended via is="".

----

comment: 3
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27976#c3
*Randy Harmon* wrote on 2015-02-08 21:26:08 +0000.

s/cannot/can only/

----

comment: 4
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27976#c4
*markg* wrote on 2015-02-19 03:48:52 +0000.

I have not seen this stated very explicitly anywhere. How about a note in the spec at someplace like this location:

http://w3c.github.io/webcomponents/spec/custom/#custom-tag-example

It might make it clear like this:

"If you want a custom element to extend a native element like \<button\>, then you cannot use a custom tag name for it. Instead, you must use the native element tagname with the @is-(this-is-inserted-to-avoid-notification-in-migration) attribute, something like \<button is="my-button">. It will not work to use a custom tag such as \<my-button\> to extend \<button\> (HTMLButtonElement prototype).

"Saying it another way, custom tagnames can only be used when you are not extending a native element (other than the default HTMLElement)."

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/147

Received on Monday, 6 July 2015 07:36:47 UTC