Update element adoption logic for scoped registry#1437
Conversation
|
Just added some tests but I haven't fully verified them yet. Feel free to take a look. |
|
@annevk Want to verify that this is the expected behavior from this change on effective gloabl registry. Consider this test case from Given that now we look at the parent's registry's effective global registry, the last assert of the test should probably be given that the parent is using a scoped registry. |
|
Yeah, I suppose distinguishing those cases would be better. I doubt anyone is going to run into this in practice, but we might as well make it nice. |
4b9862b to
90fc49c
Compare
|
I think I made it unnecessarily complicated in the previous iteration. Given that our main goal is that global registry element shouldn't become null registry during adoption, I think we can simply include this category (global registry) to use document's registry's effective global registry, so it wouldn't be getting null from parent. Does this make sense? Or perhaps I'm missing something here. |
annevk
left a comment
There was a problem hiding this comment.
Yeah I think this works. I'll re-review on Monday to be sure. If @sorvell, @rniwa, and maybe @keithamus could have a look as well that'd be great.
(Checking inclusiveDescendant's custom element registry again bothers me a little bit, but I don't see a good way out of that. I also want to double check the "DocumentFragment but not ShadowRoot" language.)
|
@annevk Went through this PR again and I think it still works. Do we want to merge this PR first while wrapping up web-platform-tests/wpt#56423 |
|
Also, now that "keep custom element registry null" is part of this PR, it depends on whatwg/html#12000 so we should mention that in the commit message and get that PR finished as well. |
|
I updated the commit message so it mentions the new concept that will be defined in whatwg/html#12000. I'll prioritize getting this adoption logic PR landed and will for sure get the attribute PR finished next. Let me know if you prefer me to take "keep custom elemetn registry null" idea out of this PR for now; I can also land this PR without the concept and put it together with attribute PR. |
|
Let's keep it out of this PR then. |
7e87fef to
1e6abda
Compare
|
@annevk Thanks for the review and the nit! I don't seem to have the permission to merge the PR. Mind landing this PR for me? |
|
Ryosuke said he'd make time for the tests this week and I'd like to wait for that as we land tests and specification changes around the same time. |
1e6abda to
d1bdc30
Compare
Fixes whatwg#1429 by making sure elements get the correct scoped custom element registry upon adoption.
d1bdc30 to
e3c3983
Compare
This is for whatwg/dom#1437. Co-authored-by: Jayson Chen <jaysonchen@microsoft.com> Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
… upon adoption, a=testonly Automatic update from web-platform-tests Add test cases for null registry element upon adoption This is for whatwg/dom#1437. Co-authored-by: Jayson Chen <jaysonchen@microsoft.com> Co-authored-by: Anne van Kesteren <annevk@annevk.nl> -- wpt-commits: 94069d6fa9641c846ceb7d2a5d69a215274de0d4 wpt-pr: 56423
Fixing #1429 to make sure element is getting the correct scoped custom element registry upon adoption.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff