-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Agent's active custom element constructor map can have null registries, causing problems #11256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Actually this might be related to a different issue I was having: The previous version of https://html.spec.whatwg.org/multipage/custom-elements.html#look-up-a-custom-element-definition returned null if there was no browsing context, but the new algorithm doesn't. I added that check back in because it was causing problems, but maybe returning null from there is causing the problem here. |
Nice find, this one took me a while, but I'm pretty sure the problem is that "upgrade particular elements within a document" needs to also accept a (In WebKit this is implemented in |
When a CustomElementRegistry define() call starts upgrading elements, we need to make sure to only include those associated with the current registry. This has test coverage through WPT custom-elements/registries/CustomElementRegistry-upgrade.html. Fixes #11256.
Thanks! That definitely sounds like it would cause problems! It'll be interesting to see if this solves any of my other issues. |
When a CustomElementRegistry define() call starts upgrading elements, we need to make sure to only include those associated with the current registry. This has test coverage through WPT custom-elements/registries/CustomElementRegistry-upgrade.html. Fixes #11256.
What is the issue with the HTML Standard?
With this test case based on https://wpt.live/custom-elements/registries/CustomElementRegistry-upgrade.html :
Running this with my changes in Ladybird:
registry
gets assigned to that, so it's null too.registry
, and explodes.Changing "HTML element constructors" step 3 to also check for non-null fixes the issue.
I'm not sure if we even should have null registries in that map. In step 1 above, is the element supposed to have a null registry? As far as I can tell I'm assigning the element's registry where I'm supposed to, so I think it's correct. But I have been staring at this for too long so I might be missing something.
cc: @annevk
The text was updated successfully, but these errors were encountered: