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: Re-use existing attribute names for similar concepts #281

Closed
LeaVerou opened this issue Jan 31, 2021 · 5 comments · Fixed by #326
Closed

HTML: Re-use existing attribute names for similar concepts #281

LeaVerou opened this issue Jan 31, 2021 · 5 comments · Fixed by #326
Assignees
Labels
Agenda+ Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project) Topic: HTML

Comments

@LeaVerou
Copy link
Member

New elements should try to re-use existing attribute names for similar concepts.

Examples:

  • The multiple attribute is used in both <select> and <input type=file>
  • The open attribute was introduced in <details> and re-used for <dialog>
  • The for attribute is used in both <label> and <output>

(I did not include the numerous cases of the same attribute being used across multiple elements for the same thing, e.g. src or type)

@annevk
Copy link
Member

annevk commented Jan 31, 2021

(type might be a case where it has been reused too much as its value space is not consistent across elements.)

@LeaVerou
Copy link
Member Author

(type might be a case where it has been reused too much as its value space is not consistent across elements.)

Ooooh good point. This should be mentioned as an antipattern.

@LeaVerou
Copy link
Member Author

LeaVerou commented Feb 3, 2021

This came up in w3ctag/design-reviews#599

Context: The proposal introduced an anchor attribute (<popup anchor="someId">), I recommended they use for as this is very similar usage to <label for> and <output for>.

@torgo torgo added this to the 2021-04-05-week milestone Apr 4, 2021
@torgo torgo added Agenda+ Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project) labels Jun 8, 2021
@torgo torgo modified the milestones: 2021-04-12-week, 2021-07-05-week Jun 8, 2021
@torgo
Copy link
Member

torgo commented Jun 8, 2021

@LeaVerou will make a go of writing a PR for this.

@LeaVerou
Copy link
Member Author

LeaVerou commented Jul 7, 2021

@LeaVerou will make a go of writing a PR for this.

Done: #326

@torgo torgo modified the milestones: 2021-07-05-week, 2021-08-02-week Aug 1, 2021
@torgo torgo closed this as completed in #326 Aug 2, 2021
torgo pushed a commit that referenced this issue Aug 2, 2021
* Add HTML section, add attribute re-use subsection

Related to #281

* Fix section id
hober pushed a commit that referenced this issue Apr 20, 2023
* Add HTML section, add attribute re-use subsection

Related to #281

* Fix section id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agenda+ Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project) Topic: HTML
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants