↓ Skip to main content

A note on the versionless HTML

·4 mins

Yes­ter­day WhatWG an­nounced to drop the ver­sion­ing of HTML. HTML is to be a liv­ing stand­ard. This comes at a very in­con­veni­ent time I fear.

Over the past few years web stand­ards have, al­beit slowly, de­veloped into some ma­ture state: Most browsers sup­port the cur­rent (x)HTML, CSS and JS stand­ards to the let­ter and can do more. How­ever, due to the fact that these stand­ards have evolved so slowly new de­vel­op­ments are not in­cluded in these stand­ards. HTML5 (W3C and WhatWG) solves a lot of these prob­lems, in­clud­ing fea­tures like <canvas> and <video>.

With WhatWG drop­ping the ver­sion num­ber of HTML I fore­see a des­cent back to the Dark Ages where every browser sup­por­ted a dif­fer­ent stand­ard and sup­por­ted the same stand­ards dif­fer­ently, one browser would sup­port fea­ture X and not Y while the other sup­ports Y but not X. This is a night­mare for de­velopers: not be­ing able to rely on the uni­form­ity of the browsers of your vis­it­ors. This cre­ated ne­ces­sit­ies as writ­ing spe­cific CSS and JS code for spe­cific browsers to `fix' cer­tain be­ha­viour. These fixes mostly had to be done for In­ter­net Ex­plorer as it had at the time by far the largest in­stall base.

Now that we have fi­nally ar­rived at an era where all browsers sup­port the same set of rather ad­vanced tech­niques we de­cide to drop ver­sions. In some cases it is not a dis­aster to not have a ver­sion num­ber. Look at CSS, the changes that have been made to the stand­ard were mostly ad­di­tions. New op­er­at­ors and new prop­er­ties and val­ues have been ad­ded. These changes re­quired a bet­ter parser, and the re­cog­ni­tion of the new fields, but never did a se­mantic change. This, to­gether with the tra­di­tion that CSS en­gines ig­nore the state­ments they don’t un­der­stand has led to de­velopers be­ing able to in­clude new tech­niques in CSS files and thus im­pli­citly set­ting the ver­sion of the CSS in the file. As noth­ing changed older and newer browsers be­haved the same at the old state­ments and only the newer browsers ac­ted on the new state­ments. So up to now the ab­sence of ex­pli­cit CSS ver­sion­ing didn’t cause any prob­lems for CSS.

How­ever, with the ab­sence of ver­sions in HTML5 we have a prob­lem. Not only does the HTML5 stand­ard de­scribe the struc­ture of HTML but it also de­scribes the JS that the browser should sup­port. These stand­ards are in con­trast to CSS sub­ject to the chan­ging of their se­mantics. For ex­ample, a JavaScript func­tion can get a dif­fer­ent in­ter­face: dif­fer­ent para­met­ers and/or re­turn val­ues, but also its se­mantic proper might change.

This chan­ging of se­mantics without ver­sion num­bers causes a new night­mare for de­velopers, as they have no way to be sure that their site will look the same across dif­fer­ent browsers as they all may sup­port a slightly dif­fer­ent in­carn­a­tion of the stand­ard and on top of that the de­veloper can­not be sure his site will look the same in the same browser a month from now, or even the next day, as the browser can switch to sup­port a newer in­stance of the stand­ard. As dif­fer­ent ver­sions of the same browser may have dif­fer­ent en­gines that sup­port dif­fer­ent in­carn­a­tions of the stand­ard you now also have to worry about the dif­fer­ences between browser ver­sions that your vis­it­ors use.

One might no­tice the pres­ence of a lot of con­di­tions in the above text and think “What is the fuss, it might all not hap­pen.”. The main ar­gu­ment I would like to make here is this: a `living’ stand­ard in­tro­duces a lot of un­cer­tain­ties. At a time where cer­tain­ties are just start­ing to come back, giv­ing de­velopers peace of mind, go­ing back to liv­ing with un­cer­tain­ties is cer­tainly a des­cent into Dark Ages in my opin­ion.

A solution?

There is of course a reason why they choose to declare this standard as `living'. It denotes the fact that the web is evolving on a faster pace than we are used to, it is quite dynamic. Having to wait several years before you can use a very nice new feature on your website is not nice, as you would like to use it as soon as it becomes defined. Therefore, instead of declaring the standard completely dynamic and deprived of versions, I suggest something like annual milestones. This way one can still compare browsers on their capabilities, new features can be expected to be available rather quickly and most importantly you provide a frame of reference for the developer.