[whatwg] Please consider simplifying authoring guidance for the <img> alt attribute

On Tue, 2010-08-03 at 11:58 +0200, Markus Ernst wrote:

> Am 02.08.2010 20:54 schrieb Ashley Sheridan:
> > On Mon, 2010-08-02 at 17:19 +0200, Markus Ernst wrote:
> >> - search engines should generally ignore text in the alt attribute, but
> >> evaluate the title attribute instead
> >>
> >> Rationale:
> >>
> >> 4.8.1.1.12 says: "A corollary to this is that the alt attribute's value
> >> should never contain text that could be considered the image's caption,
> >> title, or legend. It is supposed to contain replacement text that could
> >> be used by users instead of the image; it is not meant to supplement the
> >> image. The title attribute can be used for supplemental information."
> > 
> > What you said doesn't make sense. The alt text is to be used instead of 
> > the image, and the title is for supplemental content. Therefore, search 
> > engines should use alt text, as that is what they are attempting to 
> > convey in the lost (in the sense that search engines don't process 
> > images like they do text) image. If they used the title, one can only 
> > imagine the trouble.
> 
> Ok, maybe the search engine aspect obfuscates the main statement I 
> wanted to make; let's just drop it and try to be some more specific.
> 
> 4.8.1.1 says: "Except where otherwise specified, the alt attribute must 
> be specified and its value must not be empty; the value must be an 
> appropriate replacement for the image. The specific requirements for the 
> alt attribute depend on what the image is intended to represent, as 
> described in the following sections."
> 
> In the sub sections, many cases are stated where the alt attribute must 
> be set to the empty string, and some cases where the alt attribute can 
> even be omitted. These seem to be the ones that are considered to be too 
> complicated.
> 
> My point is, that it would simplify things (e.g. the cases treated in 
> the links Tantek provided) a lot to do it the other way around:
> - Declare the alt attribute as optional, and default a missing alt 
> attribute to alt=""
> - Explicitly specify the cases where the alt attribute must be set 
> (e.g.: if the image is the only child of an <a> or <h1-6> element)
> - Update some of the authoring guidance in the sense of encouraging 
> authors to apply alt text where appropriate, and omit it where not (I 
> specially think of 4.8.1.1.9 here; I will post a separate proposal about 
> this section)
> 
> I doubt that there is much benefit in the requirement for the alt 
> attribute, for the following reasons:
> - The paedagogig aspect of making a document invalid if an alt attribute 
> is omitted is obsolete, as authors have got used to just insert alt="" 
> if they are too lazy to write an alternative text, and many authoring 
> tools even insert the empty string by default if the author does not 
> specify an alt text. Bad authoring cannot be prevented by structural 
> specification.
> - I have no personal experience using screen readers or text-only 
> browsers, but I am quite sure that unnecessary (not speaking of 
> inadequate) alt text is not helpful, but even harmful as it interrupts 
> the reading or listening flow. (If screen reader or braille browser 
> users contradict me here, I am happy to learn, of course.)


If the content of the alt attribute is interrupting the flow of the
text, then it is either not describing the image it represents well, or
the image is not something which should appear in the flow of text at
that position. HTML5 brings many new layout devices which can help lay
out the code in a logical and coherent manner, while still rendering on
screen in the traditional manner. I do test thing in text browsers, and
frequently see bad alt text markup on sites along the lines of
alt="Company Logo" or somesuch, where in-fact it should have read
alt="ACME Trading Co." because that is the text that was on the image
anyway.

I agree that there is a lot of bad markup out there with lots of empty
alt attributes, inserted only to pass the validators, but I think making
the attribute optional would just cause further accessibility issues.
Better to improve the validators to give warnings about empty alt
attributes (only warnings rather than outright errors) to notify the
developer that there could be a potential issue with the markup.

Thanks,
Ash
http://www.ashleysheridan.co.uk


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100803/15ad7750/attachment-0001.htm>

Received on Tuesday, 3 August 2010 03:07:50 UTC