| 12:59 | <keithamus> | annevk: is it right to say WebKit doesn't implement the "active custom element constructor map"? |
| 12:59 | <keithamus> | I'm having difficulty understanding this piece of the spec as it seems no one implements it (except Ladybird, who fail the re-entrancy case that I believe this is trying to guard). |
| 13:02 | <annevk> | keithamus: I'm pretty sure we implement it. |
| 13:02 | <keithamus> | AFAICT you have activeCustomElementRegistry https://searchfox.org/wubkat/source/Source/WebCore/dom/Document.h#590 which is different, it seems. I can't find such a map though. |
| 13:03 | <annevk> | Test that shows it's different? |
| 13:03 | <keithamus> | Yeah if you implement per spec the re-entrancy tests fail: https://wpt.fyi/results/custom-elements/registries/constructor-reentry-with-different-definition.html?label=master&label=experimental&product=chrome&product=ladybird&product=firefox&product=safari&aligned&view=interop&q=label%3Ainterop-2026-scoped-custom-element-registries |
| 13:04 | <keithamus> | AIUI because HTMLConstructor clears the active constructor map which ofc means re-calling it, it does not have its constructor in the active map. |
| 13:05 | <keithamus> | Sorry that wasn't clear but https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors:~:text=Remove%20the%20surrounding%20agent%27s%20active%20custom%20element%20constructor%20map%5BNewTarget%5D%2E I think is the problematic line. |
| 13:07 | <keithamus> | My understanding of this is still imperfect. I've tried implementing per spec and it fails, so I've removed that line and I get a passing test. |
| 13:10 | <annevk> | I'm not sure I have time to look into this before vacation, but I've asked Claude to take a look at least. Can you file an issue so it's tracked keithamus? |
| 13:11 | <keithamus> | Yeah I'm filing an issue, just also trying to wrap my head around it 😅 |
| 13:13 | <annevk> | keithamus: Claude agrees with you that these three things are not in line. |
| 13:15 | <keithamus> | you should let Claude know I appreciate the insight |
| 13:17 | <annevk> | It did elaborate and I think I see the problem. The problem is that the map key is not unique. I think I assumed it would be for some reason and that therefore the designs were equivalent. |
| 13:24 | <keithamus> | https://github.com/whatwg/html/issues/12691 |
| 15:14 | <annevk> | keithamus: so I think we need both the map and save+restore of the matching entry. Hopefully I can put some draft changes online tomorrow. Won't be finished before mid to end of August most likely. |