HTML5: the war on the mandatory 'alt'

By crisp on Sunday 04 May 2008 01:28 - Comments (12)
Category: HTML5, Views: 12.466

I don't think there is one subject that has had so many attention on the html-public mailinglist as the alt-attribute for the IMG-element. It's a regular warzone with the pragmatic on one side and the accessibilitas on the other. Main question is: should (a small part of) accesibility requirements be forced by means of a machine-checkable syntax-addition in the HTML5 specification?

Fact is that the 'alt'-attribute is mandatory in HTML4. Fact is also that many authors don't pay much attention to this mandatory attribute, and those that seek technical conformance with the HTML specification just include it with bogus information or as an empty string as a 'talisman' in order to be compliant.

This presents us with a problem: how do we tell images that may have some significance apart from images that have no actual significance on a page when the author did not specify an alternative for either of those? HTML5 makes that distinction based upon the very presence of the alt-attribute where alt="" means: this image is not a critical part of this page's content, and the omission of the attribute means: this image may be a critical part of this page's content but no alternative is available or has been given.

Now this started the war because the accessibilitas feel that leaving the alt-attribute optional (as a machine-checkable criterium for HTML-conformance) will hurt accessibility. I wonder how though?

Even though not mandating alt may make more pages technically conformant to HTML5, they still will not be conformant in the literal sense. Point is that it is something that is just not machine-checkable, just like correct semantic use of elements is not machine-checkable but still a conformance-criterium.

I do think that the current HTML5 requirements for the 'alt' attribute makes sense since it covers more use-cases. I don't think that WCAG-compliance requirements need to be forced for this particular case through HTML5 syntax requirements - those should be seperate issues.

I do however think that it should be feasible to almost always supply an appropriate 'alt'-attribute if you think about the meaning of the image within the current page instead of think about 'alt' as being an alternative description of the image itself, something that can best be solved using 'longdesc' or 'aria:described-by'. If the image really has no meaning at all in the page than it probably should have been a CSS-background-image ;)

In short: HTML5 conformance should be about HTML5 covering syntax (machine-checkable) and semantics (not machine-checkable). Accessibility has it's own conformance requirements by means of the WCAG specifications. HTML5 technical conformance doesn't mean full HTML5 conformance, and full HTML5 conformance doesn't automatically mean WCAG conformance. Keeping 'alt' mandatory won't change that nor will it change author behaviour, but making it optional allows for better distinction in the long run.

Volgende: IE6 fucking up BASE (again)? 05-'08 IE6 fucking up BASE (again)?
Volgende: IE8: Operation (now silently) Aborted 04-'08 IE8: Operation (now silently) Aborted

Comments


By Ian Hickson, Sunday 04 May 2008 09:46

You pretty much nailed the whole issue in a nutshell, at least as far as I've understood it.


By Tweakers user Ma.rkus.nl, Sunday 04 May 2008 13:51

Imho keeping the alt attribute mandatory for img elements actually isn't such a bad idea, because it goes perfectly with the separation between content and markup we already use today: HTML for content, CSS for markup. As a result, "irrelevant" images (e.g. the little folder icons in the Categories/Archives list on this page) don't even make use of the img element anymore. Thus, if only relevant images use it, the alt attribute should always be added and defined (so nothing of that alt="" gibberish).

You did mention this in your post but you kind of waved it off; I think it is the reason to make alt mandatory.

By Tweakers user Ma.rkus.nl, Sunday 04 May 2008 14:01

...the above is of course written while keeping in mind that both disabled users and search engines can not "read" images and that the alt attribute is (with current technology) the only way to provide them with a means of distinguishing what is depicted on them. That's why I think it should always be used.

By steve faulkner, Sunday 04 May 2008 18:10

"the pragmatic on one side and the accessibilitas on the other"

a more accurate description of the 2 camps would be the

"the browser vendor advocates on one side and the use advocates on the other"


"Fact is also that many authors don't pay much attention to this mandatory attribute, and those that seek technical conformance with the HTML specification just include it with bogus information or as an empty string as a 'talisman' in order to be compliant."

This is not a "fact" it's an opinion.

"and the omission of the attribute means: this image may be a critical part of this page's content but no alternative is available or has been given."

this is incorrect, as the per the specification there is no "maybe" about it:

"When the alt attribute is missing, the image represents a key part of the content. "
http://www.w3.org/html/wg/html5/#the-img

But as it is known that the vast majority of html documents on the web are not valid HTML and there is no reason why this will change substantially in the future, the there is no reliable meaning or significance that can be assigned an img without alt, therefore it must remain a syntactic requirement just as the img src attribute is.

"HTML5 conformance should be about HTML5 covering syntax (machine-checkable) and semantics (not machine-checkable)."

The current spec requires alt in the majority of cases, so all those documents that get the html5 validator stamp of approval will in all probability be non conforming due to the lack of alt text on images.

By Tweakers user crisp, Sunday 04 May 2008 23:53

This is not a "fact" it's an opinion.
I'd say the probability of this 'opinion' being true is 100%, even I myself have sometimes sinned and just added alt="" without actually considering a correct alternative. Main motive for doing that is to get rid of the 'noise' from the validator in order to be able to focus on 'real errors'. (I promise to better my life from now on ok? ;))
this is incorrect, as the per the specification there is no "maybe" about it:
For a conforming document there is indeed no 'maybe', but we all know that documents are more likely not conformant. It was with that in mind that I wrote 'maybe'.
But as it is known that the vast majority of html documents on the web are not valid HTML and there is no reason why this will change substantially in the future, the there is no reliable meaning or significance that can be assigned an img without alt, therefore it must remain a syntactic requirement just as the img src attribute is
At this moment there is no way to tell if an alt="" was specified because the image can safely be ignored (when it is decorative) or to appease the validator. I think that not making this a syntactic requirement will in the long run result in more correct use of alt="".

Besides that I do still think it is totally wrong to mark ommission of alt as a technical error, it's not a technical issue at all and as such it is still 'noise' when I want to technically validate my pages to see if I have nested my elements correctly and such.
The current spec requires alt in the majority of cases, so all those documents that get the html5 validator stamp of approval will in all probability be non conforming due to the lack of alt text on images.
The validator should make sure to explain to the user that it can only check for conformance up to a certain level and should not scream "This page is valid HTML5 and here's the button you can put on your page". It should explain for instance the importance of correct use of alt and it should also make the user aware of the WCAG guidelines. Luckily Henri's HTML5 validator doesn't make the mistakes the W3 validator did and does which has led users to believe that the validator is rubberstamping approval in the first place...

[Comment edited on Sunday 04 May 2008 23:55]


By Tweakers user mOrPhie, Monday 05 May 2008 10:53

About 12 years ago (when I was 13 / 14 years old) I had the benifit of being one of the first adopters of the internet and I created a website, called a homepage. Because of the KISS principle of HTML I was able to create that website, be proud and show it to relatives and friends. I even included sound and animations (gif). It was a lot of web 1.0 stuff with the blink tag (yes, I used netscape) and marquees everywhere. I played with it for days and kept bettering the design and contents. I even added a guestbook based on an online service which allowed interaction with my homepage. The only things I did thus far where BASIC and GWBASIC.... and gaming. So for a little boy like me (back in those days) this was pretty impressive.

Consider me as a 13 year old kid, but now with the "benifit" of HTML 5 and the new "machine-checkable syntax-addition". Wow, that must be great? With every forced check which failed my website I would be frustrated. I just want to display the darn image! What is this alt thingy? Why won't my website run? Days of searching. Frustrated with my faillure, I would quit it and probably go back to gaming.

All I needed to do was to add a proper doctype and a content-type meta-tag, so that HTML 5 would allow my page to run. But that is beyond the point. I were 13 years old remember? You think I would open a book at page 1? Think again. ;)

What I'm trying to show here, is that I think the KISS principle of HTML always helped A LOT of people to create their own website. My mom for example. Myself when I were 13. Some friends. All those basic webpages where accessibility isn't an issue at all. That principle will be gone when HTML is going to validate my pages.

It's not that I don't recognize the benifits of using an alt-tag, using divs with legends, creating compliant code and keeping layout and styling as much as possible in CSS, but from a pragmatic point of view, it is important to recognize how the internet became big.... and it's not because of an elegant design (back- and fronend) of many websites.

By Tweakers user crisp, Tuesday 06 May 2008 00:31

It just doesn't stop:
To the extent that validity is a useful carrot to hold out in order to gain accessibility, and that in the default case it does in fact help [...]
The 'carrot' is more easily consumed by putting alt="" than by actually thinking about the meaning of this attribute and coming up with an appropriate value. Which practice will be prevalent? And how does it help accessibility when there are more bogus empty alt-attributes because of this 'carrot' ? It effectively devaluates the empty alt-attribute to the point of complete meaningless which again raises the question: why should it be mandatory in order to be /technically/ HTML(5)-conformant?

[Comment edited on Tuesday 06 May 2008 00:41]


By Tweakers user DOT, Tuesday 13 May 2008 19:09

I don't really care about this one. Browsers display sites correctly, regardless of whether the alt-attribute is mandatory or not. I'd say, make 'em optional. Nobody benefits from a bare-bones alt="". But it's not like they would have actually provided a correct value, had it not been mandatory. So, like I said, don't really care much about this one.

By Tweakers user DOT, Tuesday 13 May 2008 19:13

Actually, rather keep them mandatory. Some people will be persuaded to give a good description. Who cares about 80% of empty alts, when there is a 1% increase in useful alts? The empty alts won't hurt.

But seriously, this is way too tedious...

By Tweakers user Niels Sijm, Wednesday 18 June 2008 13:39

If people get notified about missing alt attributes, those who care but don't know about it will search the Internet. They will read about accessibilty, get the point, and use the alt attribute in a semantic way.

As empty alt attributes don't hurt, I agree with keeping them mandatory.

By Tweakers user crisp, Wednesday 18 June 2008 14:05

I'm not saying that people should not be made aware of the importance of good alt-texts, I'm just saying that making it a syntax-requirement is not the right way to do that and probably will do more harm than good. How many unaware authors will actually read up on accessibility when confronted with a "missing alt" error and how many will just put alt="" and be done with it? Note that webdevelopers are lazy by nature ;)

I for instance very much like the Image Report function of validator.nu; I think that's more usefull than emitting a "missing alt" error for something that is not really a syntax-issue.

Comments are closed