-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Are all uses of the title
attribute discouraged?
#10875
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
Comments
I think the note is accurate? As in, it seems fine to use it if the information is otherwise available or not that important, but you cannot rely on the end user having access to it. The most commonly used device to access the web does generally not expose |
I think there are some valid use cases for the
|
What about adding this then: "Relying on the title attribute to provide additional information about an element via a user-agent tooltip is currently discouraged as many user agents do not expose the attribute in an accessible manner as required by this specification". This would make the note clearer to me. Reading this, I know when the title attribute is discouraged, and when it isn't. |
I think for the elements where the |
Thanks for your patience—it took me a while to return to this. Thanks for the clarifications. The narrow question of 'is
|
I think the specification is already pretty clear about why it is not encouraged, in particular due to parenthetical. I think the suggestion would make the parenthetical confusing, but some revision might be okay. "Currently" just refers to the situation as it is today and that it indeed could change if user agents were to implement something to handle this. |
Btw, this is really a side issue, but note that the W3C discourages use of (any) attributes for natural language text, because it is not possible to label the language or direction of the Fwiw, XHTML 2.0 would have replaced the title attribute with a sub-element, but that markup language didn't get adoption. It was felt that HTML5's title attribute was too ingrained in the Web to be changed in the early days. I'm not expecting that to change, but did want to mention this additional consideration which needs to be borne in mind when talking about attributes that contain natural language text. I hope that we bear that in mind as we develop new markup in the future. hth |
What is the issue with the HTML Standard?
The
title
attribute section contains this note:(It also appears a few other places, such as the requirements for providing text alternatives section.)
Do the editors wish to discourage authors from all uses of the
title
attribute?As someone working on documentation for the web platform, I don't know how to describe the condition of this feature. Unlike other features in this and other web platform specifications, it's unclear if the
title
attribute is under the umbrella of things that the spec wishes for authors to not use in new web content.There's an additional layer of uncertainty here, given by "currently." I took this to mean the note was anticipating changes, except it's 12 years old (commit). I couldn't find any open issues discussing the
title
attribute.It'd be helpful if the spec could be rather more specific in this note, both with respect to when the note applies and to whom. I don't have an opinion about what the actual position of the editors ought to be, but I'd like to know what it is.
To resolve this, I'd expect the note to say something along the lines of "Authors should not use the
title
attribute because…. Authors should instead…" or "Authors should not use thetitle
attribute unless…" depending on what y'all think the answer is. Or if it's really serious, to listtitle
amongst the obsolete features.For background, this came came up while trying to summarize feature information for developers in the web-features project: web-platform-dx/web-features#2461.
This is my first time filing an issue with WHATWG, so please let me know if I've missed anything. And thank you for considering this issue.
The text was updated successfully, but these errors were encountered: