Skip to content

Allow more characters in custom element names #7991

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 2 commits into from
Jun 9, 2025
Merged

Allow more characters in custom element names #7991

merged 2 commits into from
Jun 9, 2025

Conversation

domenic
Copy link
Member

@domenic domenic commented Jun 7, 2022

@domenic domenic added normative change topic: custom elements Relates to custom elements (as defined in DOM and HTML) labels Jun 7, 2022
@domenic domenic requested a review from annevk June 7, 2022 16:24
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

This looks good to me. I like how this simplifies things quite a bit and reduces our reliance on ABNF and derivatives.

@annevk
Copy link
Member

annevk commented Jun 8, 2022

Hmm, I guess 0th is technically correct, but I wonder if we are using that consistently. Perhaps we should support string[0] to make it less confusing?

@domenic
Copy link
Member Author

domenic commented Jun 8, 2022

I doubt we are using it consistently. But the algorithms in https://infra.spec.whatwg.org/#strings use it indirectly quite a lot, e.g. "Let potentialPrefixCodeUnit be the ith code unit of potentialPrefix." where i can be 0. And the plus side is that nobody will be confused by 0th, although they might be confused by first.

Allowing string[0] is a bit tricky IMO because it doesn't clarify whether that's code point or code unit. Maybe string[0]cu and string[0]cp, but that feels a bit like adding notation for notation's sake...

@domenic domenic added the needs tests Moving the issue forward requires someone to write tests label Jun 14, 2022
@josepharhar
Copy link
Contributor

Thanks for removing the EBNF, it is much easier for me to read and implement this way!

@domenic
Copy link
Member Author

domenic commented May 19, 2025

I've rebased this onto main. It was pretty straightforward.

aarongable pushed a commit to chromium/chromium that referenced this pull request Jun 5, 2025
This patch changes the parsing of custom element names in DOM APIs to
allow more flexibility and better parity with the HTML parser.

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I516de464254c5413e5610aedc3a70a73ea236616
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6559428
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1470050}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 5, 2025
This patch changes the parsing of custom element names in DOM APIs to
allow more flexibility and better parity with the HTML parser.

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I516de464254c5413e5610aedc3a70a73ea236616
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6559428
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1470050}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 5, 2025
This patch changes the parsing of custom element names in DOM APIs to
allow more flexibility and better parity with the HTML parser.

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I516de464254c5413e5610aedc3a70a73ea236616
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6559428
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1470050}
@josepharhar
Copy link
Contributor

Here is a new WPT: web-platform-tests/wpt#52982

And here are WPT changes which haven't been upstreamed yet: https://chromium-review.googlesource.com/c/chromium/src/+/6615057

@domenic domenic removed the needs tests Moving the issue forward requires someone to write tests label Jun 6, 2025
@domenic
Copy link
Member Author

domenic commented Jun 6, 2025

I'll plan on merging this and github.com/whatwg/dom/pull/1079 on Monday or Tuesday. Thanks @josepharhar for helping finish this up!!

@domenic domenic merged commit 78d2678 into main Jun 9, 2025
2 of 3 checks passed
@domenic domenic deleted the pcne-loosening branch June 9, 2025 04:47
aarongable pushed a commit to chromium/chromium that referenced this pull request Jun 13, 2025
Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I216706db819aee655c7e05fd492eed546f449a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6615057
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1473709}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 13, 2025
Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I216706db819aee655c7e05fd492eed546f449a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6615057
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1473709}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 13, 2025
Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I216706db819aee655c7e05fd492eed546f449a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6615057
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1473709}
lando-prod-mozilla bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Jun 19, 2025
…names, a=testonly

Automatic update from web-platform-tests
Allow more characters in custom element names

This patch changes the parsing of custom element names in DOM APIs to
allow more flexibility and better parity with the HTML parser.

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I516de464254c5413e5610aedc3a70a73ea236616
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6559428
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1470050}

--

wpt-commits: 1f3beebca7401634153d6d14c00742b29edbd072
wpt-pr: 52982
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jun 19, 2025
…names, a=testonly

Automatic update from web-platform-tests
Allow more characters in custom element names

This patch changes the parsing of custom element names in DOM APIs to
allow more flexibility and better parity with the HTML parser.

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I516de464254c5413e5610aedc3a70a73ea236616
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6559428
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1470050}

--

wpt-commits: 1f3beebca7401634153d6d14c00742b29edbd072
wpt-pr: 52982
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jun 21, 2025
…names, a=testonly

Automatic update from web-platform-tests
Allow more characters in custom element names

This patch changes the parsing of custom element names in DOM APIs to
allow more flexibility and better parity with the HTML parser.

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I516de464254c5413e5610aedc3a70a73ea236616
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6559428
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1470050}

--

wpt-commits: 1f3beebca7401634153d6d14c00742b29edbd072
wpt-pr: 52982
lando-prod-mozilla bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Jun 23, 2025
…names, a=testonly

Automatic update from web-platform-tests
Update tests for relaxed custom element names

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I216706db819aee655c7e05fd492eed546f449a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6615057
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1473709}

--

wpt-commits: 2548f608722cd9df1243e8ed396e54ef18e44f0a
wpt-pr: 53130
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jun 23, 2025
…names, a=testonly

Automatic update from web-platform-tests
Update tests for relaxed custom element names

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I216706db819aee655c7e05fd492eed546f449a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6615057
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1473709}

--

wpt-commits: 2548f608722cd9df1243e8ed396e54ef18e44f0a
wpt-pr: 53130
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jun 24, 2025
…names, a=testonly

Automatic update from web-platform-tests
Update tests for relaxed custom element names

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I216706db819aee655c7e05fd492eed546f449a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6615057
Reviewed-by: David Baron <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1473709}

--

wpt-commits: 2548f608722cd9df1243e8ed396e54ef18e44f0a
wpt-pr: 53130
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jun 24, 2025
…names, a=testonly

Automatic update from web-platform-tests
Allow more characters in custom element names

This patch changes the parsing of custom element names in DOM APIs to
allow more flexibility and better parity with the HTML parser.

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I516de464254c5413e5610aedc3a70a73ea236616
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6559428
Reviewed-by: Mason Freed <masonfchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1470050}

--

wpt-commits: 1f3beebca7401634153d6d14c00742b29edbd072
wpt-pr: 52982

UltraBlame original commit: 5f66415665cd00458acf241f316cedd1bc60aa34
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jun 24, 2025
…names, a=testonly

Automatic update from web-platform-tests
Update tests for relaxed custom element names

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I216706db819aee655c7e05fd492eed546f449a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6615057
Reviewed-by: David Baron <dbaronchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1473709}

--

wpt-commits: 2548f608722cd9df1243e8ed396e54ef18e44f0a
wpt-pr: 53130

UltraBlame original commit: aacdeef158c7a37fb012b1d57748456534927886
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jun 24, 2025
…names, a=testonly

Automatic update from web-platform-tests
Allow more characters in custom element names

This patch changes the parsing of custom element names in DOM APIs to
allow more flexibility and better parity with the HTML parser.

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I516de464254c5413e5610aedc3a70a73ea236616
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6559428
Reviewed-by: Mason Freed <masonfchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1470050}

--

wpt-commits: 1f3beebca7401634153d6d14c00742b29edbd072
wpt-pr: 52982

UltraBlame original commit: 5f66415665cd00458acf241f316cedd1bc60aa34
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jun 24, 2025
…names, a=testonly

Automatic update from web-platform-tests
Update tests for relaxed custom element names

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I216706db819aee655c7e05fd492eed546f449a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6615057
Reviewed-by: David Baron <dbaronchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1473709}

--

wpt-commits: 2548f608722cd9df1243e8ed396e54ef18e44f0a
wpt-pr: 53130

UltraBlame original commit: aacdeef158c7a37fb012b1d57748456534927886
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jun 24, 2025
…names, a=testonly

Automatic update from web-platform-tests
Allow more characters in custom element names

This patch changes the parsing of custom element names in DOM APIs to
allow more flexibility and better parity with the HTML parser.

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I516de464254c5413e5610aedc3a70a73ea236616
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6559428
Reviewed-by: Mason Freed <masonfchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1470050}

--

wpt-commits: 1f3beebca7401634153d6d14c00742b29edbd072
wpt-pr: 52982

UltraBlame original commit: 5f66415665cd00458acf241f316cedd1bc60aa34
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jun 24, 2025
…names, a=testonly

Automatic update from web-platform-tests
Update tests for relaxed custom element names

Spec PR: whatwg/html#7991

Bug: 40122442, 40228234
Change-Id: I216706db819aee655c7e05fd492eed546f449a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6615057
Reviewed-by: David Baron <dbaronchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1473709}

--

wpt-commits: 2548f608722cd9df1243e8ed396e54ef18e44f0a
wpt-pr: 53130

UltraBlame original commit: aacdeef158c7a37fb012b1d57748456534927886
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
normative change topic: custom elements Relates to custom elements (as defined in DOM and HTML)
Development

Successfully merging this pull request may close these issues.

3 participants