Re: [WICG/webcomponents] [scoped-registries] Element upgrade ordering (#923)

I'm [implementing](https://chromium-review.googlesource.com/c/chromium/src/+/4888750) scoped upgrade in Chromium, and found that the upgrade order can be made even simpler:
- Elements in different documents are upgraded in frame tree order, namely, elements in a frame attached earlier will be upgraded earlier
- Everything else remains the same: upgrade in tree order in the same document, don't upgrade disconnected elements, and don't upgrade elements without a frame

And that doesn't require complicated index structure or expensive full document traversals. We only need to maintain the set of candidate elements for each scoped registry, and when upgrading, perform a bottom-up traversal from those candidates to the root to build a minimal subtree containing every one of them, so that we can sort them.

In fact, the current (non-scoped) registry in Chromium is already doing that, and it's straightforward to extend that to work for multiple tree scopes and multiple documents.

Since there's no implementation issues, I think we should simplify the resolution into using frame tree order when there are multiple documents.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/923#issuecomment-1734857170
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/923/1734857170@github.com>

Received on Tuesday, 26 September 2023 05:33:01 UTC