- From: Domenic Denicola <notifications@github.com>
- Date: Wed, 18 Dec 2024 20:03:19 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 19 December 2024 04:03:23 UTC
This is very subtle. I wrote several wrong answers to this question before arriving at the conclusion that, yes, I think this is true. The case I was concerned about was. ```js customElements.define("x-y", class extends HTMLElement { constructor() { // super() intentionally omitted } }); document.createElement("x-y"); ``` 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. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/1338#issuecomment-2552726901 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/1338/2552726901@github.com>
Received on Thursday, 19 December 2024 04:03:23 UTC