You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we improve this by saying custom element definition is non-null? And custom element state is "custom"? I think that should hold after a successful constructor call.
The text was updated successfully, but these errors were encountered:
In that case the Web IDL "construct" call does nothing to set the custom element state or custom element definition (since no [HTMLConstructor] spec code ran). So I thought the assert would fail. However, what actually happens is that https://webidl.spec.whatwg.org/#construct-a-callback-function step 12 throws, because result is not a platform object and so cannot be converted to HTMLElement.
Inserting a note to this effect would be helpful to future readers, I think.
So yes, if we make it past the construct step, we must have run the [HTMLConstructor] steps to completion. Which I believe means your suggestions hold.
It still might be worth building WebKit with such an assertion and then running the custom-elements/ WPT suite, just to check.
<script>customElements.define("x-y, asBefore);
</script><x-y></x-y><script>constfailedCE=document.querySelector("x-y");// upgrade failed so this has state "failed"customElements.define("x-z",classextendsHTMLElement{constructor(){returnfailedCE;}});constfailedCE2=document.createElement("x-z");</script>
I haven't traced through what this will do all the way, but I'm pretty sure it will make it to the assert line in question with the CE state as "failed", not "custom".
@domenic in create an element we have:
Can we improve this by saying custom element definition is non-null? And custom element state is "custom"? I think that should hold after a successful constructor call.
The text was updated successfully, but these errors were encountered: