deborah: Kirkus Reviews: OM NOM NOM BRAINS (kirkus)
deborah ([personal profile] deborah) wrote in [site community profile] dw_accessibility2010-07-13 12:47 am

Title attribute and userpics

There's been a brief but meaty discussion going on in bug 2773 about what we should put in the title attribute of image elements used for userpics. This is only tangentially an accessibility issue: most screenreader users and all keyboard-only users never see the title attribute (screenreader users can configure their screenreaders to read the title attribute, but I've been told this is rare in practice). However, it was a conversation around accessibility which led to some concerns about userpic's use of the title attribute, as it was very difficult for non-screenreader/text-only browser users to have any idea of what descriptive text was for userpics. That descriptive text (the "alt" attribute) was information to which several users wanted easier access.

So what is the "title" attribute? The HTML 4 standard says that This attribute offers advisory information about the element for which it is set. The HTML 5 standard is slightly more informative, saying The title attribute represents advisory information for the element, such as would be appropriate for a tooltip. On a link, this could be the title or a description of the target resource; on an image, it could be the image credit or a description of the image; on a paragraph, it could be a footnote or commentary on the text; on a citation, it could be further information about the source; and so forth.

Because of limitations with browsers and screenreaders and their implementation of the attribute, the title attribute is one of the most controversial parts of HTML that I have seen accessibility experts argue about. In practice, almost the only people who will ever see the title attribute our mouse users who are hovering over an image or link. In that case, modern browsers will show the title attribute as a tooltip. (Many used to show the alt attribute if title wasn't set, but I'm not sure if any browsers do so anymore.) Because the information in the attribute isn't available to most screenreader and all keyboard-only users, it's important that the title attribute only be used for information which is accessible in some other fashion as well.

Web accessibility experts will get in knockdown, drag out fights over whether title should just be abolished, alt and title should be identical, or alt and title should be different. Often it comes down to the difference between what the HTML standard says is best practice, and the reality of what actually happens in browsers and screenreaders. In my occasionally humble opinion, Dreamwidth be striking a middle ground: following the standards wherever they help and do not hinder our users.

So what does that mean for us? It does seem that, contrary to common practice, there is a desire among many users to have access to that descriptive information that is provided in the alt text of a userpic. For one thing, that descriptive information often reports the context of an image: the fandom; the character; the pet.

Right now, that title attribute shows the keyword. Just as some users have the desire to see the alt text, other users have expressed the continuing desire to see the keyword, because it shows why the posting user chose that userpic, or how the posting user catalogs his or her userpics. However, there has been some user confusion because the tooltip shows similar but different text from the description in the alt text, which is making it more difficult for non-screenreader users to understand which text is which.

But wait! What about that last piece of information we have about each userpic: the comment! It has also been pointed out that comments, which by convention include icon credits, would also be really useful advisory information to show up in a tooltip.


So after that ridiculously wordy preamble, here's a proposal:

title = "Image keyword: " + $keyword + $description + $comment

In other words, the title, primarily available as a mouse-hover tooltip, should contain the image keyword, the alt text description if available, and the comment if available. On the one hand, this might make for somewhat long hovers. On the other hand, descriptive text shouldn't be getting crazy long anyway.

What do people think? This is clearly a usability design issue primarily for people who use the mouse-hover feature. Again, its accessibility issues are primarily tangential, in how we can potentially expose high-value accessibility features to people who don't need them.
foxfirefey: A wee rat holds a paw to its mouth. Oh, the shock! (myword)

[personal profile] foxfirefey 2010-07-14 06:13 pm (UTC)(link)
Hey--is there a reason this is marked 18-and-above only? I think it may have been an accident!