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

Is the title attribute discouraged? #2461

Open
ddbeck opened this issue Dec 18, 2024 · 3 comments
Open

Is the title attribute discouraged? #2461

ddbeck opened this issue Dec 18, 2024 · 3 comments
Labels
feature definition Creating or defining new features or groups of features.

Comments

@ddbeck
Copy link
Collaborator

ddbeck commented Dec 18, 2024

This is an interesting boundary case for discouraged (also known as deprecated, see #2388), prompted by the authoring of title-attr in #2423.

From the spec:

Relying on the title attribute is currently discouraged as many user agents do not expose the attribute in an accessible manner as required by this specification (e.g., requiring a pointing device such as a mouse to cause a tooltip to appear, which excludes keyboard-only users and touch-only users, such as anyone with a modern phone or tablet).

Should we interpret this to mean that the title global HTML attribute is a discouraged feature?

I think we should discuss the question here, make a decision, and then (as a nice-to-have) file an issue with WHATWG, asking them to revising the note to clarify this point, so it's no longer a boundary case.

@ddbeck ddbeck added the feature definition Creating or defining new features or groups of features. label Dec 18, 2024
@ddbeck
Copy link
Collaborator Author

ddbeck commented Dec 18, 2024

My take: I think it's probably not discouraged, but only barely. The admonition here seems to say to not rely on the attribute, rather than to not use the attribute. That is, I've interpreted it as meaning it's not OK to use it alone, but it's OK to use it alongside alt text and captions and so on.

But this is a pretty conditional reading; I don't think it would be unreasonable to take the note as a general admonition against using the title attribute in new content.

@captainbrosset
Copy link
Contributor

and then (as a nice-to-have) file an issue with WHATWG, asking them to revising the note to clarify this point, so it's no longer a boundary case.

I would actually start this now, and not add a discouraged flag on the web-feature before the spec editors and WG participants have had time to come to a conclusion.
This note has seemingly been in the spec since at least 2012 (see this commit). It's fair to assume that it's not been a topic of recent conversation on the WG, and I'd love to hear from the WG directly what they think the note means exactly. Is it discouraged to even use the attribute? Or is it discouraged to use it as the sole accessibility technique for an image or a link, but otherwise fine to use for other things?

@ddbeck
Copy link
Collaborator Author

ddbeck commented Dec 19, 2024

Good idea, @captainbrosset. I've sent whatwg/html#10875.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

No branches or pull requests

2 participants