[whatwg] alt and title attribute exception
philipj at opera.com
Wed Aug 1 05:05:15 PDT 2012
On Tue, 31 Jul 2012 14:03:02 +0200, Steve Faulkner
<faulkner.steve at gmail.com> wrote:
> title has differing semantics to alt. In situations where alt it not
> present on an img but title is, in webkit based browsers the title
> attribute content is displayed on mouse hover and is also displayed in
> place of the image when images are disabled or not available. This
> implementation appears to contradict the must requirement in the spec.
> User agents must not present the contents of the alt attribute in the
>> way as content of the title attribute.
> As there is no way visual distinction between title content being
> and of alt content in this case.
To be very clear, you agree with the spec, think that WebKit is wrong and
would not offer any applause if Opera were to use the title attribute to
replace images when images are disabled and there is no alt attribute?
> you wrote:
>> but I'm confused -- is falling back to title a Good Thing that people
> browsers to implement, or is it just a quirk that some legacy browser
> Given that there is a semantic distinction in the spec between what alt
> content is and what title content is and a swathe of normative
> requirements/advice based on this distinction it would appear unwise to
> promote the use of title as fallback without providing normative
> requirements on provision of a method to distinguish between the two.
> *Note:* in terms of the accessible name calculation for an img element,
> the image does not have aria-label or an aria-labelledby or an alt
> attribute, but does have a title attribute, then the title attribute is
> used as the accessible name. From an accessibility API perspective, no
> distinction is indicated as to the source of the accessible name (apart
> from in the Mac AX API).
> The last point is another reason why making the title attribute on images
> (without alt) conforming is that the semantics, for all users, are
Yes, the semantic difference is clear. What I wanted to add to this
discussion is confirmation that the title attribute is inaccessibly to
mobile browser users and likely to remain so. I don't know what
conclusions to draw or what the spec should say, but to me it seems unwise
to use the title attribute at all...
More information about the whatwg