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
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
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
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
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
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
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
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?

Comment on lines +1810 to +1812
"relax_dom_valid_names": {
"__compat": {
"description": "Allow more characters in DOM names and namespaces",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ditto for all these cases too

Suggested change
"relax_dom_valid_names": {
"__compat": {
"description": "Allow more characters in DOM names and namespaces",
"dom_names_match_html_parser": {
"__compat": {
"description": "DOM names and namespace characters match HTML parser",

"relax_dom_valid_names": {
"__compat": {
"description": "Allow more characters in custom element names",
"spec_url": "https://dom.spec.whatwg.org/#namespaces",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note, was getting lint error on missing spec. I have made all these point to the section on name validation.

@hamishwillee hamishwillee requested a review from ddbeck March 23, 2026 01:53
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.

3 participants