Skip to content

FF149 Allow more characters in DOM APIs#29217

Open
hamishwillee wants to merge 3 commits intomdn:mainfrom
hamishwillee:ff149_allow_more_chars_in_dom_names
Open

FF149 Allow more characters in DOM APIs#29217
hamishwillee wants to merge 3 commits intomdn:mainfrom
hamishwillee:ff149_allow_more_chars_in_dom_names

Conversation

@hamishwillee
Copy link
Copy Markdown
Contributor

@hamishwillee hamishwillee commented Mar 10, 2026

FF149 adds support for additional characters to be allowed in attribute and element names in https://bugzilla.mozilla.org/show_bug.cgi?id=1773312.

Previously you could only use the chars allowed in XML names - now the rules are less restrictive to allow the same chars as the HTML parser.

Spec update: whatwg/html#7991

Chrome states support in 143:

Webkit added support in https://bugs.webkit.org/show_bug.cgi?id=241419 but I don't think this made it to Safari yet.

Related docs work can be tracked in mdn/content#43218

@github-actions github-actions bot added data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API size:l [PR only] 101-1000 LoC changed labels Mar 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 10, 2026

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

Comment on lines +212 to +214
"relax_dom_valid_names": {
"__compat": {
"description": "Allow more characters in custom element names",
Copy link
Copy Markdown
Contributor Author

@hamishwillee hamishwillee Mar 10, 2026

Choose a reason for hiding this comment

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

I used this key and name here. We could instead do something like this. Is really a question "is the key and description reasonable".

Suggested change
"relax_dom_valid_names": {
"__compat": {
"description": "Allow more characters in custom element names",
"dom_names_match_html_parser": {
"__compat": {
"description": "Characters in custom element names match those allowed by HTML parser",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cc @ddbeck for thoughts on naming this spec evolution subfeature.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@hamishwillee can you give me an example of a name that would be invalid under the old spec and valid under the new spec? I think this would help me understand to best frame this subfeature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ddbeck My perspective is the main benefit is that the character set allowed by HTML and DOM now match for namespace, element, and attribute names.

To answer your question, from the spec issue what I saw as likely most significant was allowing emoticons in names - so this is now valid my-🎉-element but would have been blocked by XML.

From Claude, a summary of the main differences including some tags that are now valid that were not before.

Name Old (XML) New (WHATWG) Why significant
my!element ❌ InvalidCharacterError ✅ valid ! now allowed after letter start
my?tag ? now allowed
my(tag) (, ) now allowed
my🎉tag Emoji/post-Unicode-2.0 characters
tag=value (element) = allowed in element names
_tag! ! still blocked after non-letter start
my tag Whitespace always blocked
my>tag > always blocked

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ddbeck Did this answer your question?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry for the delay responding to this, Hamish. This does answer my question. The link to the spec issue was especially helpful. (The Claude output was less so; I'd rather have your prompt in the future rather than a chatbot's output.)

The way I see it, real-world use cases are emoji or extended characters like the Dutch letter ij. Punctuation and parentheses seem like consequences of the change, rather than true features. Since Unicode is the most 'legible' bit of this, so I'm going to suggest something like this:

Suggested change
"relax_dom_valid_names": {
"__compat": {
"description": "Allow more characters in custom element names",
"html_name_validity": {
"__compat": {
"description": "Emoji and more Unicode in element names (valid names match HTML parser)",

I'm not so fussed on the specific wording here, I just want to make sure we frame in terms of features for developers (you can now do X) versus doing stenography for spec editors.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @ddbeck - I take your point. Word are fine to me. I've fixed via search-replace

@hamishwillee hamishwillee requested a review from ddbeck March 23, 2026 01:53
@hamishwillee hamishwillee force-pushed the ff149_allow_more_chars_in_dom_names branch from 8b70db3 to fe9b650 Compare March 29, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API size:l [PR only] 101-1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants