This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
If I use a function as the argument to document.register, its @@create method is not called when an instance is created. class MyElement extends HTMLElement { [Symbol.create]() { console.log("never called :'("); super(); } } MyElement = document.register('my-element', MyElement) new MyElement;
I think this should be addressed in Level 2 of the Custom Elements spec, or in a related spec. Chrome is not in a position to implement this now. I believe the spec needs to explain when @@create should be called. As a first cut, I believe the UA should have latitude as to when to call it. The requirement should be something like @@create MUST be called as the first step of upgrade. Would this result in intolerable weirdness when doing post-hoc upgrade of an existing element?
https://github.com/w3c/webcomponents/pull/12