Where's the best place to see usage stats for the "is" attribute on customized built-in HTML elements?

15 Views Asked by At

I'd like very much to use the "is" attribute to customize built-in HTML elements but am worried about going down a dead end ? Hence the desire for usage stats. It seems like it's been in the W3C Spec for a while and is well supported in all modern browsers except Apple Webkit (Safari, Epiphany) at the time of writing.

https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is

https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements

I am worried that the W3C, thanks to Apple's stance, may try to kill it off long term, despite the brilliant, working, Polyfill for the Apple Webkit Browser from @AndreaGiammarchi: https://github.com/ungap/custom-elements ?

eg:

<form is="my-custom-form" name="myForm"></form>

class MyCustomForm extends HTMLFormElement {
  constructor() {
    super();
  }

  connectedCallback() {
    // Do stuff
  }

}

// Define the custom element
customElements.define('my-custom-form', MyCustomForm, { extends: 'form' });

@Apple: If I can already do the following, then what's the big deal with security ?

document.forms.myForm.myCustomFunction=function(){ console.log('hello);}

https://developer.apple.com/forums/thread/682165

0

There are 0 best solutions below