Skip to content

Add Scoped Custom Element Registries #1341

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

Merged
merged 6 commits into from
Apr 14, 2025

Conversation

annevk
Copy link
Member

@annevk annevk commented Dec 17, 2024

Please do not comment directly on this PR unless asked. It's a big change and we want to keep it manageable. Use #1339 instead.

HTML PR: whatwg/html#10869.

Tests: web-platform-tests/wpt#50790.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

annevk added a commit to whatwg/html that referenced this pull request Dec 17, 2024
Do not comment directly on this PR while it is in draft state. Use #10854 instead.

DOM PR: whatwg/dom#1341.

Tests: ...
@annevk annevk marked this pull request as ready for review December 19, 2024 09:51
@annevk annevk added topic: custom elements Relates to custom elements (as defined in DOM and HTML) addition/proposal New features or enhancements topic: shadow Relates to shadow trees (as defined in DOM) topic: nodes labels Dec 19, 2024
@annevk annevk force-pushed the annevk/scoped-custom-element-registries branch from 66f3a02 to dacf095 Compare December 19, 2024 10:05
annevk added a commit to whatwg/html that referenced this pull request Dec 19, 2024
@annevk annevk force-pushed the annevk/scoped-custom-element-registries branch from dacf095 to 7e04bae Compare February 21, 2025 09:40
annevk added a commit to whatwg/html that referenced this pull request Feb 21, 2025
annevk added a commit to web-platform-tests/wpt that referenced this pull request Feb 21, 2025
annevk added a commit to web-platform-tests/wpt that referenced this pull request Feb 22, 2025
annevk added a commit to web-platform-tests/wpt that referenced this pull request Feb 25, 2025
annevk added a commit to web-platform-tests/wpt that referenced this pull request Feb 25, 2025
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 28, 2025
…nly (and invert its value), a=testonly

Automatic update from web-platform-tests
DOM: rename importNode()'s deep to selfOnly (and invert its value)

Part of whatwg/dom#1341.

--

wpt-commits: 5bcf44cb07a74e284893af96926d932ec09705e7
wpt-pr: 50860
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 28, 2025
…ith scoped registries, a=testonly

Automatic update from web-platform-tests
DOM: createElement and createElementNS with scoped registries

For whatwg/dom#1341.
--

wpt-commits: a52f97983743aae5fdd5172c9938b47743dc7146
wpt-pr: 50925
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Feb 28, 2025
…nly (and invert its value), a=testonly

Automatic update from web-platform-tests
DOM: rename importNode()'s deep to selfOnly (and invert its value)

Part of whatwg/dom#1341.

--

wpt-commits: 5bcf44cb07a74e284893af96926d932ec09705e7
wpt-pr: 50860
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Feb 28, 2025
…ith scoped registries, a=testonly

Automatic update from web-platform-tests
DOM: createElement and createElementNS with scoped registries

For whatwg/dom#1341.
--

wpt-commits: a52f97983743aae5fdd5172c9938b47743dc7146
wpt-pr: 50925
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Mar 1, 2025
…nly (and invert its value), a=testonly

Automatic update from web-platform-tests
DOM: rename importNode()'s deep to selfOnly (and invert its value)

Part of whatwg/dom#1341.

--

wpt-commits: 5bcf44cb07a74e284893af96926d932ec09705e7
wpt-pr: 50860

UltraBlame original commit: 4a4c1689ebd912108057f71fa24393009d4ab18a
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Mar 1, 2025
…ith scoped registries, a=testonly

Automatic update from web-platform-tests
DOM: createElement and createElementNS with scoped registries

For whatwg/dom#1341.
--

wpt-commits: a52f97983743aae5fdd5172c9938b47743dc7146
wpt-pr: 50925

UltraBlame original commit: 78ef3074b0082c9e95d840a8010b34661973a847
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Mar 1, 2025
…nly (and invert its value), a=testonly

Automatic update from web-platform-tests
DOM: rename importNode()'s deep to selfOnly (and invert its value)

Part of whatwg/dom#1341.

--

wpt-commits: 5bcf44cb07a74e284893af96926d932ec09705e7
wpt-pr: 50860

UltraBlame original commit: 4a4c1689ebd912108057f71fa24393009d4ab18a
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Mar 1, 2025
…ith scoped registries, a=testonly

Automatic update from web-platform-tests
DOM: createElement and createElementNS with scoped registries

For whatwg/dom#1341.
--

wpt-commits: a52f97983743aae5fdd5172c9938b47743dc7146
wpt-pr: 50925

UltraBlame original commit: 78ef3074b0082c9e95d840a8010b34661973a847
Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editorial review done.

@@ -6499,6 +6678,26 @@ null), and boolean <var>synchronousCustomElements</var> (default false):
<li><p>Return <var>result</var>.
</ol>

<p>To <dfn>create an element internal</dfn> given a <a for=/>document</a> <var>document</var>, an
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually am not sure what effect the noexport attribute has, but it's used elsewhere in DOM for spec-internal stuff, so:

Suggested change
<p>To <dfn>create an element internal</dfn> given a <a for=/>document</a> <var>document</var>, an
<p>To <dfn noexport>create an element internal</dfn> given a <a for=/>document</a> <var>document</var>, an

Also, I first thought this might be related to ElementInternals, so a name like "internal create element steps" or "inner create element steps" would help avoid that. Not a big deal though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly stopped using that as it doesn't have an effect. Except maybe to emphasize but I don't think that's needed here.


<li><p>Assert: <var>result</var>'s <a for=Element>custom element state</a> and
<a for=Element>custom element definition</a> are initialized.
<li><p><a for=map>Set</a> the <a>surrounding agent</a>'s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's very hard to follow the diff here inside "create an element", so for any other reviews, I think the main things are:

  • Refactoring to use a "creating an element internal" helper, which takes the registry as an argument.
  • A bunch of steps nested one more level under "Run these steps while catching any exceptions", ending with the added "Set result’s custom element registry to registry."

Basically searching for "registry" within the steps shows the interesting stuff.

And I can't find anything wrong :)

glandium pushed a commit to mozilla-firefox/firefox that referenced this pull request Apr 1, 2025
…nly (and invert its value), a=testonly

Automatic update from web-platform-tests
DOM: rename importNode()'s deep to selfOnly (and invert its value)

Part of whatwg/dom#1341.

--

wpt-commits: 5bcf44cb07a74e284893af96926d932ec09705e7
wpt-pr: 50860
glandium pushed a commit to mozilla-firefox/firefox that referenced this pull request Apr 1, 2025
…ith scoped registries, a=testonly

Automatic update from web-platform-tests
DOM: createElement and createElementNS with scoped registries

For whatwg/dom#1341.
--

wpt-commits: a52f97983743aae5fdd5172c9938b47743dc7146
wpt-pr: 50925
@annevk annevk force-pushed the annevk/scoped-custom-element-registries branch from 5a1943c to 595a156 Compare April 7, 2025 13:55
annevk added a commit to whatwg/html that referenced this pull request Apr 7, 2025
annevk added a commit to web-platform-tests/wpt that referenced this pull request Apr 11, 2025
…gistry into registries

And rename away from .tentative for the Revamped Scoped Custom Element Registry tests as whatwg/html#10869 and whatwg/dom#1341 are about to land.
annevk added a commit to web-platform-tests/wpt that referenced this pull request Apr 14, 2025
…gistry into registries

And rename away from .tentative for the Revamped Scoped Custom Element Registry tests as whatwg/html#10869 and whatwg/dom#1341 are about to land.
annevk added a commit to whatwg/html that referenced this pull request Apr 14, 2025
<li><p>Let <var>is</var> be null.

<li>
<p>If <var>options</var> is a dictionary:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're missing the alternate case here, for when options is a string - is is never set to options AFAICT.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct? It never was either.

@annevk annevk merged commit 388779b into main Apr 14, 2025
2 checks passed
@annevk annevk deleted the annevk/scoped-custom-element-registries branch April 14, 2025 15:51
aarongable pushed a commit to chromium/chromium that referenced this pull request Apr 14, 2025
This implements the IDL definitions per the spec issue[1], however
all methods are basic stubs and do not execute any logic - the logic
will come with later patches.

I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/um-9YjJWyEQ/m/MhKN0L7FAgAJ

Spec PRs:

HTML: whatwg/html#10869
DOM: whatwg/dom#1341

[1]: whatwg/html#10854

Bug: 409577162
Change-Id: Ieee709ff15c13bdd0b1d7598e27031867062b592
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6443776
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Keith Cirkel <[email protected]>
Commit-Queue: David Baron <[email protected]>
Auto-Submit: Keith Cirkel <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1446589}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Apr 14, 2025
This implements the IDL definitions per the spec issue[1], however
all methods are basic stubs and do not execute any logic - the logic
will come with later patches.

I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/um-9YjJWyEQ/m/MhKN0L7FAgAJ

Spec PRs:

HTML: whatwg/html#10869
DOM: whatwg/dom#1341

[1]: whatwg/html#10854

Bug: 409577162
Change-Id: Ieee709ff15c13bdd0b1d7598e27031867062b592
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6443776
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Keith Cirkel <[email protected]>
Commit-Queue: David Baron <[email protected]>
Auto-Submit: Keith Cirkel <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1446589}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Apr 14, 2025
This implements the IDL definitions per the spec issue[1], however
all methods are basic stubs and do not execute any logic - the logic
will come with later patches.

I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/um-9YjJWyEQ/m/MhKN0L7FAgAJ

Spec PRs:

HTML: whatwg/html#10869
DOM: whatwg/dom#1341

[1]: whatwg/html#10854

Bug: 409577162
Change-Id: Ieee709ff15c13bdd0b1d7598e27031867062b592
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6443776
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Keith Cirkel <[email protected]>
Commit-Queue: David Baron <[email protected]>
Auto-Submit: Keith Cirkel <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1446589}
AtkinsSJ added a commit to AtkinsSJ/ladybird that referenced this pull request Apr 16, 2025
This corresponds to a couple of spec changes:

whatwg/html#10869
whatwg/dom#1341

The regressions are unfortunate and need looking into. The spec issues
I've reported mostly have fixes PRed too. Just going to wait for those.
AtkinsSJ added a commit to AtkinsSJ/ladybird that referenced this pull request Apr 22, 2025
This corresponds primarily to these spec changes, plus a few follow-up
spec fixes:

whatwg/dom#1341
whatwg/html#10869

Still looking into the test regressions. Those might be spec issues but
I'm currently assuming they're me issues. :^)
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 23, 2025
…egistry and custom-element-registry into registries, a=testonly

Automatic update from web-platform-tests
custom-elements: merge revamped-scoped-registry and custom-element-registry into registries

And rename away from .tentative for the Revamped Scoped Custom Element Registry tests as whatwg/html#10869 and whatwg/dom#1341 are about to land.

--

wpt-commits: 7087b359a1e2e306db934e5ff11218bd871cb228
wpt-pr: 51953
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 23, 2025
…ed registry, a=testonly

Automatic update from web-platform-tests
Scaffold out basic IDL for revamped scoped registry

This implements the IDL definitions per the spec issue[1], however
all methods are basic stubs and do not execute any logic - the logic
will come with later patches.

I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/um-9YjJWyEQ/m/MhKN0L7FAgAJ

Spec PRs:

HTML: whatwg/html#10869
DOM: whatwg/dom#1341

[1]: whatwg/html#10854

Bug: 409577162
Change-Id: Ieee709ff15c13bdd0b1d7598e27031867062b592
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6443776
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Keith Cirkel <[email protected]>
Commit-Queue: David Baron <[email protected]>
Auto-Submit: Keith Cirkel <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1446589}

--

wpt-commits: 9546e2007adb73a3545fb61a5e5c8f754c6587e4
wpt-pr: 51977
shtrom pushed a commit to mozilla-conduit/ff-test that referenced this pull request Apr 28, 2025
…egistry and custom-element-registry into registries, a=testonly

Automatic update from web-platform-tests
custom-elements: merge revamped-scoped-registry and custom-element-registry into registries

And rename away from .tentative for the Revamped Scoped Custom Element Registry tests as whatwg/html#10869 and whatwg/dom#1341 are about to land.

--

wpt-commits: 7087b359a1e2e306db934e5ff11218bd871cb228
wpt-pr: 51953
shtrom pushed a commit to mozilla-conduit/ff-test that referenced this pull request Apr 28, 2025
…ed registry, a=testonly

Automatic update from web-platform-tests
Scaffold out basic IDL for revamped scoped registry

This implements the IDL definitions per the spec issue[1], however
all methods are basic stubs and do not execute any logic - the logic
will come with later patches.

I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/um-9YjJWyEQ/m/MhKN0L7FAgAJ

Spec PRs:

HTML: whatwg/html#10869
DOM: whatwg/dom#1341

[1]: whatwg/html#10854

Bug: 409577162
Change-Id: Ieee709ff15c13bdd0b1d7598e27031867062b592
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6443776
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Keith Cirkel <[email protected]>
Commit-Queue: David Baron <[email protected]>
Auto-Submit: Keith Cirkel <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1446589}

--

wpt-commits: 9546e2007adb73a3545fb61a5e5c8f754c6587e4
wpt-pr: 51977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements topic: custom elements Relates to custom elements (as defined in DOM and HTML) topic: nodes topic: shadow Relates to shadow trees (as defined in DOM)
Development

Successfully merging this pull request may close these issues.

Revamped Scoped Custom Element Registries (DOM side) Revamped Scoped Custom Element Registries
4 participants