Re: customized built-in element questions

On Sun, Aug 21, 2016 at 12:02 PM, Mark Giffin <m1879@earthlink.net> wrote:

> I have two questions I cannot seem to find the answer to in the Custom
> Elements spec,
> https://www.w3.org/TR/2016/WD-custom-elements-20160721/
>
> 1. Can I use the is= syntax for more than one customized built-in element,
> like <button is="big-button red-button">?


No.

It's an interesting possibility, but there's a practical problem with it,
which is: What prototype does the button get? big-button's, or red-button's?

If you write that today, what happens is the whole value is treated as a
potential name. There are lots of ways to create elements, but take create
an element for a token
<https://www.w3.org/TR/2016/WD-custom-elements-20160721/#create-an-element-for-the-token>,
which is used by parsing, for example. Step 3 takes the value of the entire
attribute but since "big-button red-button" isn't a valid name (it contains
a space) step 4 will never find a matching definition.

2. Is the is= syntax for using a customized built-in element likely to be
> deprecated sometime soon? I have heard only rumors.
>

I work on Chrome. Here are our plans at the moment:

- We have implemented the "autonomous custom elements" parts of this spec
(that is the <custom-tags> part, not the is="..." part); you can try it
today by enabling Experimental Web Platform Features in chrome://flags in
Chrome 54 or later. Feedback <https://crbug.com/new> welcome.
- We are debating whether to ship this now; you can follow the process
<http://www.chromium.org/blink#TOC-Web-Platform-Changes:-Process> in this
thread
<https://groups.google.com/a/chromium.org/d/msg/blink-dev/P2UKXfsFWWE/Nii0d7snBQAJ>
.
- We implemented an earlier version of this spec, including "is". It uses
document.registerElement to define custom elements. We plan to remove this,
but we have a process for that too
<http://www.chromium.org/blink#TOC-Launch-Process:-Deprecation> and we
probably can't remove it this year.
- We are implementing the "new" is="..." stuff right now. You should be
able to play with it behind a flag in a couple of months.


> Thanks,
> Mark
>

Received on Monday, 22 August 2016 11:53:44 UTC