WCAG 2.0 – when I want beer, don’t give me shandy. Excellent write-up of the new web accessibility guidelines by Bruce Lawson, prompting me to write:
I had some thoughts on semantic HTML and Ajax (basically – HTML is a markup language for text documents. Does it have any semantic meaning when you start using it to mark up application user interfaces?)
Patrick Lauke pointed out, quite rightly, that HTML is the only language understood by existing user agents, so we’re stuck with it anyway. He started a discussion on accessify forum but I thought it might be helpful (for me at least) if I expanded on what my original thoughts were.
HTML is a fairly simple, generic markup language that was invented by high-energy physics geeks so that they could share dry academic papers that noone really reads anyway. As such, it contains tags describing structural elements of documents such as nested headings, paragraphs, various types of lists and quotations.This is what makes the web so powerful – anyone can quickly grasp the basics of HTML and use it to mark-up and publish a web page without much by way of specialist technical knowledge.
We all want our HTML documents to be accessible to the widest range of web browsing software. To this end, we should be using HTML as a descriptive markup language, rather than a presentational markup language ie. our markup should be telling people what the different parts of our documents are (headings, paragraphs, lists etc.) not what they look like (indented, larger typeface, italicised etc.)
For this reason, advice on publishing accessible web pages tends to talk about semantic markup – markup which describes the meaning of a piece of content, rather than its appearance on the page. Fair enough, but what if you have a web page which isn’t made up of the relatively simple structural elements contained in HTML?
We’re seeing the appearance on the web now of complex pages (or applications, even) such as Google Maps. Semantic elements to describe things like the Google Maps magnification slider don’t really exist in HTML. We could use the generic <div> element to markup these parts of our user interfaces, which lie outside the range of elements defined by HTML, but that doesn’t do much for users of screenreaders, for example. The div element is so generic as to be practically useless in assigning meaning to a part of the page.
I think, and this is purely my opinion, that when you mark up a page in HTML you shouldn’t get too hung up on the semantic meaning of the elements. HTML is not really a semantic markup language. What you should be concerned about (and if you’re not someone should open a big can of standards-based whoop-ass on your presentational-code-loving butt) is describing your page elements in such a way as to make them easier to use by screen readers, keyboard-based browsers etc. For example, don’t ask ‘is this set of elements really an unordered list?’ but do ask ‘if I mark up this set of elements as an unordered list, does that make my page more accessible and easier to use?’
I’m probably splitting hairs on the difference between descriptive and semantic markup, and may well be talking complete bollocks. I’d be interested in your thoughts…
I agree that HTML has serious shortcomings as semantic markup language (I wrote the article at semantic humanities that you linked to on the subject).
And you make a good point about html being stretched to have to define both document structure and application interface – often on the same page.
Yes, HTML is relatively poor in meaningfully descriptive tags, but we do have pretty good patches for these problems in the form of Microformats and RDFa.
But I disagree with your closing point on Accessibility over Semantic Markup. This may very well be academic as I cannot think of an example of semantic markup hindering accessibility – indeed I firmly believe that semantic markup is the one true route to real Accessibility.
I reckon that with web development in general, you should try to avoid going for the moving targets of optimising for specific user agents (* okay, we all have to cater to the whims of IE to some extent), and instead adhere to common principles that will work in the long term. User Agents will change and develop, and they will do so (I’d hope) in the direction of semantic markup.
Making your html as semantic as you can (possibly with RDFa and/or microformats) opens up your content to all kinds of as-yet uncharted possibilities.