Re: Custom Elements: is=""

> On Jun 13, 2015, at 4:49 PM, Léonie Watson <LWatson@PacielloGroup.com> wrote:
> 
> From: Bruce Lawson [mailto:brucel@opera.com] 
> Sent: 13 June 2015 16:34
> 
> On 13 June 2015 at 15:30, Léonie Watson <lwatson@paciellogroup.com> wrote:
>> why not use the extends= syntax you mentioned?
>> 
>> <my-button extends="button" attributes>Push</my-button>
> 
> because browsers that don't know about web components wouldn't pay any attention to <my-button>, and render "Push" as plain text.
> 
> Of course! I should have thought of that.

That's not entirely true.  If the implementation of my-button, let us call it MyButtonElement had the prototype that extends HTMLButtonElement, then the browser can set role=button just fine.

> On Jun 13, 2015, at 5:41 PM, Patrick H. Lauke <redux@splintered.co.uk> wrote:
> 
> On 13/06/2015 16:33, Bruce Lawson wrote:
>> On 13 June 2015 at 15:30, Léonie Watson <lwatson@paciellogroup.com> wrote:
>>> why not use the extends= syntax you mentioned?
>>> 
>>> <my-button extends="button" attributes>Push</my-button>
>> 
>> because browsers that don't know about web components wouldn't pay any
>> attention to <my-button>, and render "Push" as plain text.
>> 
>>  Browsers that don't know about web components will fall back to
>> <button> with <button
>> this-is-made-much-more-marvellous-by="my-button"> (or whatever)
> 
> However, this fallback will only really be useful for very simple cases, where web components have been used to jazz up what essentially is still the element that was extended. And, I would posit, any scripting that was done to act on the all-singing, all-dancing new web component button (if it does anything more than a regular button) would not work for the fallback. Unless it's really just using web components for fancy styling (for instance having a "material design" button that essentially still works just like a button) - in which case, it makes more sense to work on stylability of standard elements.


Precisely!  I've been saying that for the last two years.  It's so nice & refreshing to hear someone making the same argument :)  And we (Apple) would love to solve the stylability issue of form elements.

- R. Niwa

Received on Thursday, 2 July 2015 07:00:15 UTC