Skip to content

Add customElements.getName(constructor) - #9195

Merged
zcorpan merged 8 commits into
whatwg:mainfrom
keithamus:add-customelements-getname-constructor
Jun 30, 2023
Merged

zcorpan merged 8 commits into
whatwg:mainfrom
keithamus:add-customelements-getname-constructor

Conversation

@keithamus

@keithamus keithamus commented Apr 21, 2023 •

Copy link
Copy Markdown
Member

In CustomElements v0 you could use the .name field to get the defined tag name, but CustomElements v1 does not offer such a field. localName can be used within an instance but this prohibits use in, for example, static methods.

This was discussed in the WCCG F2F, tracked in
WICG/webcomponents#566. The conclusion of the F2F was to write up a spec change and WPT tests.

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


/acknowledgements.html ( diff )
/custom-elements.html ( diff )

In CustomElements v0 you could use the `.name` field to get the defined
tag name, but CustomElements v1 does not offer such a field. `localName`
can be used within an instance but this prohibits use in, for example,
static methods.

This was discussed in the WCCG F2F, tracked in
WICG/webcomponents#566. The conclusion of the
F2F was to write up a spec change and WPT tests.
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
@keithamus
keithamus marked this pull request as ready for review June 8, 2023 22:12
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 17, 2023
The spec change [1] hasn't landed yet, so the tests can only be
tentative.

This also prevents affecting interop2023 [2].

[1] whatwg/html#9195
[2] web-platform-tests/interop#358

Bug: 1435389
Change-Id: I1e35d7f06bcf2b005304cdc182a67cfa69b74de1
aarongable pushed a commit to chromium/chromium that referenced this pull request Jun 20, 2023
The spec change [1] hasn't landed yet, so the tests can only be
tentative.

This also prevents affecting interop2023 [2].

[1] whatwg/html#9195
[2] web-platform-tests/interop#358

Bug: 1435389
Change-Id: I1e35d7f06bcf2b005304cdc182a67cfa69b74de1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4621660
Auto-Submit: Xiaocheng Hu <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Xiaocheng Hu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1160209}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 20, 2023
The spec change [1] hasn't landed yet, so the tests can only be
tentative.

This also prevents affecting interop2023 [2].

[1] whatwg/html#9195
[2] web-platform-tests/interop#358

Bug: 1435389
Change-Id: I1e35d7f06bcf2b005304cdc182a67cfa69b74de1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4621660
Auto-Submit: Xiaocheng Hu <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Xiaocheng Hu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1160209}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 20, 2023
The spec change [1] hasn't landed yet, so the tests can only be
tentative.

This also prevents affecting interop2023 [2].

[1] whatwg/html#9195
[2] web-platform-tests/interop#358

Bug: 1435389
Change-Id: I1e35d7f06bcf2b005304cdc182a67cfa69b74de1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4621660
Auto-Submit: Xiaocheng Hu <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Xiaocheng Hu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1160209}
@keithamus

Copy link
Copy Markdown
Member Author

@annevk @rniwa @zcorpan how happy are we to merge this? Is there a gate before doing so? I2S on Chrome has been posted: https://groups.google.com/a/chromium.org/g/blink-dev/c/vOadD_Up5B0/m/3Ezs2SxRDAAJ and Safari TP includes it. Is there anything more I can do?

mnutt pushed a commit to movableink/webkit that referenced this pull request Jun 28, 2023
https://bugs.webkit.org/show_bug.cgi?id=257759

Reviewed by Chris Dumez.

Update the implementation of CustomElementsRegistry.prototype.getName to match the latest PR.
Namely, it now returns DOMString? instead of (DOMString or undefined):
whatwg/html#9195
web-platform-tests/wpt#39640

* LayoutTests/imported/w3c/web-platform-tests/custom-elements/CustomElementRegistry-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/custom-elements/CustomElementRegistry.html:
* Source/WebCore/dom/CustomElementRegistry.cpp:
(WebCore::CustomElementRegistry::getName):
* Source/WebCore/dom/CustomElementRegistry.h:
* Source/WebCore/dom/CustomElementRegistry.idl:

Canonical link: https://commits.webkit.org/264916@main
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jun 28, 2023
…ts to a tentative test file, a=testonly

Automatic update from web-platform-tests
Move CustomElementRegistry.getName() tests to a tentative test file

The spec change [1] hasn't landed yet, so the tests can only be
tentative.

This also prevents affecting interop2023 [2].

[1] whatwg/html#9195
[2] web-platform-tests/interop#358

Bug: 1435389
Change-Id: I1e35d7f06bcf2b005304cdc182a67cfa69b74de1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4621660
Auto-Submit: Xiaocheng Hu <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Xiaocheng Hu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1160209}

--

wpt-commits: 99ee1f53f877610adf1f29399ea9660905e6d7a9
wpt-pr: 40606

@zcorpan zcorpan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've fixed wrapping. LGTM

@zcorpan
zcorpan merged commit 76204f7 into whatwg:main Jun 30, 2023
@keithamus
keithamus deleted the add-customelements-getname-constructor branch June 30, 2023 13:55
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jul 1, 2023
…ts to a tentative test file, a=testonly

Automatic update from web-platform-tests
Move CustomElementRegistry.getName() tests to a tentative test file

The spec change [1] hasn't landed yet, so the tests can only be
tentative.

This also prevents affecting interop2023 [2].

[1] whatwg/html#9195
[2] web-platform-tests/interop#358

Bug: 1435389
Change-Id: I1e35d7f06bcf2b005304cdc182a67cfa69b74de1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4621660
Auto-Submit: Xiaocheng Hu <xiaochenghchromium.org>
Reviewed-by: Mason Freed <masonfchromium.org>
Commit-Queue: Xiaocheng Hu <xiaochenghchromium.org>
Cr-Commit-Position: refs/heads/main{#1160209}

--

wpt-commits: 99ee1f53f877610adf1f29399ea9660905e6d7a9
wpt-pr: 40606

UltraBlame original commit: ff55e5770af6e99f114c0593f02f296318fa584f
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jul 1, 2023
…ts to a tentative test file, a=testonly

Automatic update from web-platform-tests
Move CustomElementRegistry.getName() tests to a tentative test file

The spec change [1] hasn't landed yet, so the tests can only be
tentative.

This also prevents affecting interop2023 [2].

[1] whatwg/html#9195
[2] web-platform-tests/interop#358

Bug: 1435389
Change-Id: I1e35d7f06bcf2b005304cdc182a67cfa69b74de1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4621660
Auto-Submit: Xiaocheng Hu <xiaochenghchromium.org>
Reviewed-by: Mason Freed <masonfchromium.org>
Commit-Queue: Xiaocheng Hu <xiaochenghchromium.org>
Cr-Commit-Position: refs/heads/main{#1160209}

--

wpt-commits: 99ee1f53f877610adf1f29399ea9660905e6d7a9
wpt-pr: 40606

UltraBlame original commit: ff55e5770af6e99f114c0593f02f296318fa584f
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jul 1, 2023
…ts to a tentative test file, a=testonly

Automatic update from web-platform-tests
Move CustomElementRegistry.getName() tests to a tentative test file

The spec change [1] hasn't landed yet, so the tests can only be
tentative.

This also prevents affecting interop2023 [2].

[1] whatwg/html#9195
[2] web-platform-tests/interop#358

Bug: 1435389
Change-Id: I1e35d7f06bcf2b005304cdc182a67cfa69b74de1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4621660
Auto-Submit: Xiaocheng Hu <xiaochenghchromium.org>
Reviewed-by: Mason Freed <masonfchromium.org>
Commit-Queue: Xiaocheng Hu <xiaochenghchromium.org>
Cr-Commit-Position: refs/heads/main{#1160209}

--

wpt-commits: 99ee1f53f877610adf1f29399ea9660905e6d7a9
wpt-pr: 40606

UltraBlame original commit: ff55e5770af6e99f114c0593f02f296318fa584f
foolip added a commit to web-platform-tests/wpt that referenced this pull request May 16, 2024
This test was made tentative in #40606 because the spec change hadn't landed, but it now has:
whatwg/html#9195
@Westbrook Westbrook mentioned this pull request Oct 16, 2024
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…ts to a tentative test file, a=testonly

Automatic update from web-platform-tests
Move CustomElementRegistry.getName() tests to a tentative test file

The spec change [1] hasn't landed yet, so the tests can only be
tentative.

This also prevents affecting interop2023 [2].

[1] whatwg/html#9195
[2] web-platform-tests/interop#358

Bug: 1435389
Change-Id: I1e35d7f06bcf2b005304cdc182a67cfa69b74de1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4621660
Auto-Submit: Xiaocheng Hu <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Xiaocheng Hu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1160209}

--

wpt-commits: 99ee1f53f877610adf1f29399ea9660905e6d7a9
wpt-pr: 40606
benji-cannot-code pushed a commit to benji-cannot-code/fast-vc-chromium-benchmark-run-4 that referenced this pull request Sep 25, 2026
The spec change [1] hasn't landed yet, so the tests can only be
tentative.

This also prevents affecting interop2023 [2].

[1] whatwg/html#9195
[2] web-platform-tests/interop#358

Bug: 1435389
Change-Id: I1e35d7f06bcf2b005304cdc182a67cfa69b74de1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4621660
Auto-Submit: Xiaocheng Hu <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Xiaocheng Hu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1160209}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants