HTML5: the war on the mandatory 'alt'
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.
You did mention this in your post but you kind of waved it off; I think it is the reason to make alt mandatory.
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. "
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.
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 not a "fact" it's an opinion.
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'.this is incorrect, as the per the specification there is no "maybe" about it:
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="".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
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 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...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.
[Comment edited on Sunday 04 May 2008 23:55]
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.
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?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 [...]
[Comment edited on Tuesday 06 May 2008 00:41]
But seriously, this is way too tedious...
As empty alt attributes don't hurt, I agree with keeping them mandatory.
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