Archive for May, 2010

After chatting with my mate Mike about my previous investigations into HTML5, he responded with:

"This, IS what is going to suck about HTML 5.0. You know this is going to cause compatibility hacks to make things work for your video tags, or you are going to keep using flash or silverlight (probably flash)."

For video it’s pretty simple. You can to cater for any browsers you want to support… you have to encode the video multiple times but the browser goes through until it finds one it can handle.

e.g..

<video width="320" height="240">
<source src=".....mp4"...>
<source src=".....ogv"...>
</video>

As far as the other compatibilty issues go, there’s a javascript library called Modernizr that can take care of all that for you.. e.g.

if (Modernizr.video && Modernizr.video.ogg){
// preload ogg video assets
}
else if (Modernizr.video && Modernizr.video.h264){
// preload h264 assets
}

or for Geolocation for example:

if (Modernizr.geolocation){
navigator.geolocation.getCurrentPosition(function(position) {
// pass the lat and long values to an application
// e.g. a setUserLatandLong() function may find the closest bodega
setUserLatandLong(position.coords.latitude,position.coords.longitude);
});
}

It’s all pretty cool. There’s even a JS library out there to help with the IE compatibility (http://code.google.com/p/html5shiv/)..

Better yet, have a read of http://www.diveintohtml5.org/. It should fill in any gaps… ones that can be filled at this stage anyway

As mentioned previously, browser support is a bit iffy, but there are ways to hack them into shape. I’ve heard it suggested that one of the ways of going about it is to code in HTML5 and hack everything else to fit, so that when the browsers catch up you won’t have to work as hard to make it compliant.

Comments 1 Comment »

Over the weekend I thought I’d see what all the fuss was about HTML5.. I’ve read a dozen or so articles and I’m still not that clear. At the moment it seems not that many browsers support that many aspects of it, with the nightly builds of ones like Chrome being the most advanced (supporting <section&gt, <header&gt and other semantic ones.. It’s got some functional new tags (<video>, <audio>,<canvas>, etc).. and some semantic ones (<header>,<nav>,<footer>, etc) which at the moment are more like glorified <div> tags..

I digress.. of the articles I’ve read the best one so far is http://diveintohtml5.org/, written by Mark Pilgrim which is more of an online book than an article. The way it reads is similar to Masters of Doom about the rise and fall of iD software. It has a large section on the history of HTML and how it came to be, as well as how it relates to xHTML and standards groups in general.

I’m only about 3 chapters in and we finally get to see some HTML5 in action. At this stage Pilgrim is hillarious. He starts of the chapter:

“This chapter will take an HTML page that has absolutely nothing wrong with it, and improve it. Parts of it will become shorter. Parts will become longer. All of it will become more semantic. It’ll be awesome.”

A little bit later he’s talking about DOCTYPEs and how they can tell the browser how far to break the standards as far as rendering a web page goes. In particular he mentions how, when Microsoft were developing IE5 for Mac, they built it so it was to the HTML standard. However that didn’t render web pages correctly so they had to introduce ‘quirks’ mode. And it grew from there. Various browser have different quirks modes, etc.

“The last time I tried to count, there were 5 doctypes that triggered “almost standards mode,” and 73 that triggered “quirks mode.” But I probably missed some, and I’m not even going to talk about the crazy shit that Internet Explorer 8 does to switch between its four — four! — different rendering modes. Here’s a flowchart. Kill it. Kill it with fire.)”

Comments No Comments »