Skip to content
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

"HTML syntax" attribute names #5144

Open
jakearchibald opened this issue Dec 11, 2019 · 7 comments
Open

"HTML syntax" attribute names #5144

jakearchibald opened this issue Dec 11, 2019 · 7 comments

Comments

@jakearchibald
Copy link
Collaborator

@jakearchibald jakearchibald commented Dec 11, 2019

https://html.spec.whatwg.org/multipage/syntax.html#syntax-attribute-name

In the HTML syntax, attribute names, even those for foreign elements, may be written with any mix of ASCII lower and ASCII upper alphas.

This could be read to mean that attribute names may only be ASCII lower and upper alphas (not numbers etc etc). I believe the intent is something like:

If the document is an HTML document, attribute names are considered equivalent if they are an ASCII case-insensitive match.

@jakearchibald

This comment has been minimized.

Copy link
Collaborator Author

@jakearchibald jakearchibald commented Dec 12, 2019

@domenic

This comment has been minimized.

Copy link
Member

@domenic domenic commented Dec 12, 2019

A pull request would be welcome!

@domenic

This comment has been minimized.

Copy link
Member

@domenic domenic commented Dec 12, 2019

Note that this only matters for data-* attributes; no other valid attribute name contains non-ASCII alphas, I believe.

@annevk

This comment has been minimized.

Copy link
Member

@annevk annevk commented Dec 13, 2019

It should probably say something to the effect of that in the HTML syntax names cannot contain ASCII upper alphas and if they are written with them, those will become lower alphas due to ASCII lowercase being performed on them.

@jakearchibald

This comment has been minimized.

Copy link
Collaborator Author

@jakearchibald jakearchibald commented Dec 13, 2019

@domenic what's the intent here for attributes on custom elements. Should they all be data-* unless they're defined in the HTML spec?

@annevk

This comment has been minimized.

Copy link
Member

@annevk annevk commented Dec 13, 2019

They allow much more per https://html.spec.whatwg.org/#custom-elements-core-concepts, though this is a bit contested as it's not exactly recommending a forward compatible pattern.

@kosek

This comment has been minimized.

Copy link

@kosek kosek commented Dec 18, 2019

I haven't been watching this area closely in past year but I thought that same syntax for custom elements has been already adopted for attributes as well, i.e. prefix-attribute naming pattern is allowed for custom attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.