HTML5 – Netscape/IE 3 all over again?

I attended two in-depth sessions on HTML5 at Oredev 2010 last week, which completely changed my perspective at it. After watching Giorgio Sardo present Microsoft’s plans for HTML5 and Robert Nyman present different HTML5 APIs, I feel that we’re moving ahead in technology but fear that we’re going back to the browser incompatibility horrors of a decade ago.

Microsoft is committed to HTML5

Giorgio Sardo, a senior technical evangelist at Microsoft, started by saying that “Microsoft is committed to HTML5, and this is not a marketing message”. On the many compatibility tests out there that measured Microsoft’s browser support for the new standards well below the competitors, he said that they want to ensure that “HTML5 needs to be done the right way”. Sardo compared that to IE6, which was “built listening to developers”, bringing many features that were not standard or “ready to be standardised”, and now causing lots of compatibility problems.

Sardo insisted that IE9 won’t have any HTML5 “specific markup that works only in IE”, and that they want to wait for specifications to be standardised before supporting them in IE9. That relates to about 150 specifications that are under development by W3C and ECMA working groups. “HTML5 is one of them, but the others are important as well – for example SVG. Some are already standardised, some are working drafts and recommendations”, said Sardo, adding that Microsoft doesn’t agree with all of the specifications. For example, they will not implement WebSQL, but prefer the IndexedDb specification.

But HTML5 isn’t just HTML5

Robert Nyman, an independent consultant, said that HTML5 is a “collection term for all the new things happening on the web“, and comes packed with different APIs. These different APIs are what Sardo referred as 150 specifications. Having the two presenters refer to HTML5 with completely different meanings, the former looking at it as just one of 150 specifications and the latter looking at it as an umbrella for all those APIs, wasn’t really encouraging.

Both presentations gave me a bit of a mixed message. Looking at the examples from a purely developer perspective, I see how these new APIs could help me build better web applications easier.

  • Semantic elements such as header/navigation/caption will allow search engines and smart devices to make better use of web content and improve accessibility.
  • @media queries in CSS3 will make it easier to support different resolutions
  • JSon lambda expressions and the new object model will standardise some commonly needed functionality and could reduce our reliance on third party libraries and frameworks.
  • video tag will provide better control over video playback (but unfortunately not compatibility – see below)
  • Cross-document messages should allow cross-domain communication in a controlled way and help us build more integrated applications with improved security
  • web workers should allow us to create more responsive applications by pushing processing to background threads
  • HTML cache manifests should provide us with better ways to handle network disruptions and even create offline apps
  • Websockets could reduce our reliance on third party plugins for data push from servers to browsers
  • History API should allow us to better integrate AJAX into browser controls and provide users with a better experience
  • WebGL could bring 3D graphics capabilities to browser applications and reduce our reliance on third party plugins

The big promise of most of these new APIs, for me, is to reduce our reliance on Flash, Silverlight, JQuery and other third party toolkits and browser plugins and standardise functionality that many applications need. But I’m worried that they will just replace that problem with another one and make web applications even more reliant on a different kind of third party libraries.

Will we really be less reliant on frameworks?

Sardo’s statement on Microsoft being committed to HTML5 is encouraging, but I’m not really sure what they are committed to. Is it just the list of tags and the new HTML5 document object model, or does that commitment extend to the functionality that all those new shiny APIs will support? Some of these specifications aren’t really going to materalise in browsers anytime soon, and some don’t seem to be up to the task. “IndexedDb is going to happen but it’s going to take some time“, said Nyman. Among other things, he showcased drag and drop support which was, according to him, reverse engineered into a specification from IE features and it is a “fucking disaster”.

The slides with code in both presentations reminded me very much of the web applications I was developing 10 years ago, with so much browser incompatibility that we wasted an enormous amount of time tweaking HTML and JavaScript to work with particular browser versions and sub-versions. At that time we only had to write for a few versions of Netscape and IE – the situation now is much more complex. Fair enough, there won’t be any browser specific tags, but both presenters showed a ton of compatibility related code. For example, although video is a standardised tag, different browsers support different formats. Even within a format they support different codecs. Checking for video codec and format compatibility by specification returns ‘no’, ‘maybe’ and ‘probably’, which doesn’t really sound encouraging. And most people releasing apps with HTML5 code will have to provide fallback on other technologies for older browsers. The code that both presenters showed for video playback was more complex that the tag for embedding Flash which I use now. Speaking about the video tag, Nyman said “the idea is to make it better, but I’m semi-hopeful”.

I guess a large part of my gut-feel about this is caused by the fact that there are 150+ specifications about “all the new things happening on the web”, as Nyman called it. If anyone came to me with 150 specifications and asked me to lead a project to implement that I’d throw him out straight away. In order to get the compatibility across browsers, that project has to succeed not once, but several times in different companies and opensource communities. The fact that they won’t all try to implement the same specifications makes it even more confusing. For example, Nyman said that WebSQL is in supported in Webkit and Opera, but it is not going into Firefox and IE, which will probably implement IndexedDb for storage.

A possible solution for this might be programming against third party libraries that will provide backward compatibility and cross-browser functionality, so I wouldn’t be surprised if web development becomes even more reliant on various opensource frameworks. Nyman and Sardo already mentioned a few:

  • explorercanvas provides basic canvas support for IE8 with VML
  • Raphaël javascript library uses svg or vml for graphics depending on browser features
  • visitmix.com/lab has a plugin to export from Adobe Illustrator to canvas format

To end this on a more positive note, here are some nice links from both presentations that showcase new HTML5 features or libraries:

Tags: