I was at the
2008 European Perl Conference recently and one of the talks I heard was about HTML 5.0. It may seem odd to have such a talk at a Perl conference, but web development is one of the things Perl is used quite heavily for. I went along not really expecting to come away particularly excited. Instead, I came away feeling that they really are going down the right lines.
The thing I like about HTML 5.0 is its pragmatism. It accepts that various things just, well, are the way they are. Whether you think any of the following are points are OK, they are pretty much reality.
- Most web pages don't specify a document type
- Of those that do, plenty of pages don't comply with the document type anyway and a validator would say they were invalid
- Despite this situation, end users expect that web pages that in the eyes of a validator are invalid will still be rendered; any browser that only renders compliant pages will not be able to provide access to much of the web and wouldn't be used by anyone anyway
- Most people producing web pages don't care whether they meet standards - if it looks right in all of the browsers then it's fine enough for them
Right now we have a bunch of standards that say what compliant pages will look like and how to interpret them. But it turns out this isn't so much use in a world when most pages aren't valid anyway.
HTML 5.0 takes a different stance. It defines what compliant markup will look like, but then it goes a step further: it states how to handle markup that doesn't comply with the specification too, so anyone making a new browser has a chance of implementing something that will do the same as other browsers when it encounters a page with non-compliant HTML in it. Furthermore, the specification is actually based upon what real browsers do today. This means that rather than trying to make Yet Another Specification with a bunch of new features and demands (though there are both of these in HTML 5.0), it starts out by trying to draw together what does work cross-browser today, even when it's not really valid.
So does this mean that we're now embracing sloppiness? It was a question that was raised at the talk, and it's a good one. Personally I think the answer is "not really"; the people who have cared up to now about writing valid HTML will continue to do so, and the people who haven't cared will likely also continue to not care (and if we forced them to care or made a spec that punished the tiniest mistakes, they'd just not use it, so it would fail anyway). The difference with HTML 5.0 is that there is some hope that browsers will be able to consistently handle all pages - valid or invalid - the same way. It's a pragmatic approach, and I think it has a good chance of working out.