« Progress in the W3C ECMAScript 4 again »

On X-UA-Compatible

January 23rd, 2008 by liorean

This decision seems to have stricken a chord on many a harp. I for one think Microsoft have considered the options, and chosen the only viable one where they can actually move onwards with implementing standards.

The main priority in releasing a browser is that it renders the majority of the web. The majority of the web today has either a quirks mode or a standards mode triggering doctype - about half of the top sites use standards mode. These standards mode sites generally rely on Mozilla, Safari and Opera to all render them to the best of their standards compliancy. However, they at the same time rely on Internet Explorer to render them the way IE6 and/or IE7 render them. They rely on the HTML parsing, CSS and DOM to behave like it does in IE6/7. They rely on bugs or sometimes a lack of features in IE6/7. In other words, Microsoft can’t fix some bugs or implement new features in Standards Mode because too much live content would break if they did. Also, none of these sites that rely on the bugs and lack of implementation of features have some specific code opting out of getting the newest and best standards support, so if Microsoft makes improvements in standards support, these sites must not be affected.

Microsoft had the choices of either having some opt-in to improved standards support, or not improving standards at all. An opt-out wasn’t an option, because live content isn’t using that opt-out. Now, every angry and disappointed web developer out there, if you look at it that way, which one would you prefer? Standards with an opt-in or no standards at all? Sure, there’s Jeremy’s argument that “Unless you explicitly declare that you want IE8 to behave as IE8, it will behave as IE7.”. I’d argue that this was the only solution that was acceptable for Microsoft, and the reason for that is not that Microsoft is trying to make web developer’s lives harder or anything. The reason for that is that most of the live content is coded for Internet Explorer to behave like IE7 does. Do you have any idea how much breakage the web would take if IE8, say, fixed the implementation of getElementById in it’s default mode? Or how much breakage of the web would happen if they fixed their events model to match the W3C DOM2Events spec?

Having to opt-in to the best rendering mode of IE8 is a cheap cost for web developers. And even that opt-in can be eliminated in a few ways. For example, you won’t be locked down to the IE7 handling of your document if you use the HTML5 doctype. Whether that means the HTML5 doctype will be treated as IE-edge or IE8, that remains to be seen, but I’m just saying: this is not a bad choice by Microsoft.

Posted in CSS, DOM, HTML, Javascript |

You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.


10 Responses to “On X-UA-Compatible”

  1. Tom Says:
    January 23rd, 2008 at 2:51 pm

    It’s always been a bad idea to rely on bugs in a browser. Webmasters who have done this in a way that is not easy for them to take out when the time comes are no better than those who succumb to putting this Microsoft-approved IE-specific code in their pages — which they’ll be forced to update every time Microsoft makes changes in the future.

    Good scripters code their sites based on behavior differences (such as missing functions) rather than browser differences (IE vs. Firefox). These people will probably not need to change their sites at all once IE8 comes and the bugs are fixed.

  2. Guy Fraser Says:
    January 28th, 2008 at 7:45 pm

    To illustrate the absurdity of “default to the wrong way”:

    I rely on people dashing out of the way when I drive on pavements. Quick, let’s make all the cars drive on pavements by default!

    I mean, you wouldn’t want people to drive on the roads would you? That would be the correct thing to do and therefore must be avoided at all costs because of the minority of people who drive on pavements. You’d have to opt-in to safe driving with a meta tag on your driving license. Because the un-insured Luddites driving on the pavements wouldn’t even have bothered to get a license. So they must be right, eh?

    Think about it, that’s exactly what MS are saying.

    Some simple facts:

    * companies can choose not to roll out IE8
    * if they do roll out IE8, they can roll out a flag in the registry that says “default to bugs for our buggy intranet”
    * if random sites fail to work in IE8, add a meta tag that says “please run in bug mode” to the browser
    * big public sites can be added to a list of known bug-dependant sites (of course, those sites already being happy to lose 20-30% of standards-compliant browser users wouldn’t really mind if they lost all their visitors would they?)

    Oh, and why does this dilemma only affect M$? Strange that, eh? It absolutely could not be anything to do with them wanting to try and protect their declining browser monopoly from all the other standards compliant browsers that have sprung up to replace the Brontosaur that is IE? No, M$ would never do something evil like that, would they?

  3. Mathieu 'p01' Henri Says:
    January 29th, 2008 at 9:04 pm

    ” These standards mode sites generally rely on Mozilla, Safari and Opera to all render them to the best of their standards compliancy. However, they at the same time rely on Internet Explorer to render them the way IE6 and/or IE7 render them. They rely on the HTML parsing, CSS and DOM to behave like it does in IE6/7. They rely on bugs or sometimes a lack of features in IE6/7. In other words, Microsoft can’t fix some bugs or implement new features in Standards Mode because too much live content would break if they did. ”

    But if MicroSoft gets IE8 right, meaning implementing correctly CSS, DOM, (x)HTML, … and the parsers that go with them, and stick to the good old DOCTYPE trigger, said web sites will NOT break.

    The CSS hacks and DOM fixes built on IE’s broken parsers and sub-standard implementation will become dead code. Web developers won’t have to change anything. The entire web would benefit from that.

    So why adding complexity, and potential lock in, where there is none to be. I just don’t get it, or see how people can think this MicroSoft meta tag is a good idea.

  4. liorean Says:
    January 30th, 2008 at 9:30 am

    p01: Actually I think you’re wrong there. If Microsoft correct bugs, and completes their support for various web standards to levels similar to the other major browsers, they will break most live web content that uses standards mode. They will break sites unless they remove pretty much every mechanism of distinguishing IE from the other browsers that exists - or at least any mechanism that is used for HTML browser detection (conditional comments mostly); feature based filtering or exploitation of bugs for hacks in CSS; JScript engine detection (conditional compilation, script engine data interfaces); object, feature or browser detection in BOM/DOM (ActiveXObject, clientInformation, attachEvent, appName, userAgent, DOM interfaces, etc. the list is to long to compile…); HTTP based browser detection.

    Microsoft aren’t doing this because they want to. I’m most certain they would prefer not to do it for reasons of it impeding developing, testing and quality assurance and thus for economical reasons. The increased development cost is something they are willing to take because they do not think they could improve their standards support and still be able to render not only new content, but old content. Sure, they are only delaying the inevitable breaking of the web that will happen when they finally drop IE7 mode (and hopefully Quirks mode with it), perhaps indefinitely, but I believe they do not see a viable alternative. Making standards mode opt-out is not an option for the simple reason that the content that most need the opt-out is the content that is already written, not content that will be written in the future, and that already written content doesn’t contain such an opt-out. (Well, except for the opt out of triggering quirks mode. But they would need an opt-out for already written standards mode content too, and such an opt-out just isn’t present in live code.)

    In other words, I do not believe that fixing standards support in IE would make that code you mention “dead code”. It would only make it so that sites end up in a part-of-tit-part-of-tat situation, which means breakage of the web. (As illustrated by the IE7 improvements to CSS breaking much live content.)

    Another point I would make is that I really don’t see this alleged lock-in. The other browsers do not implement their Quirks Mode the same way as IE. Current Standards Mode is not implemented the same in other browsers either. Some content is indeed only compatible with IE, but most content in Standards Mode works in those other browsers by virtue of being coded for and tested in them primarily, then tweaked for the oddities of IE. If the content was never tweaked for IE in the first place, instead only using the subset that is common to all major browsers, then this switch wouldn’t be needed. As the situation is, I don’t see any other solution that would be acceptable from a don’t-break-the-web point of view.

  5. Matt Says:
    January 30th, 2008 at 7:46 pm

    To those of you who insist that Microsoft’s use of a meta switch is a bad idea:

    Microsoft has experience with this problem. Recent experience. Faced with a buggy piece of software, which was backwards compatible with its earliest versions, they realized the only way to improve was to re-do some of the broken code, remove some of the old hacks. This allowed them to go forward and produce a better product. So they proceeded to make this new software, and through its development told the world that they needed to start thinking in a new way, and upgrade their old stuff. Some of the world listened, some did not. When time came to release their new software, sure enough, it broke hardware and software based on old bugs. Well written code, even from the old days, still ran, but stuff that was based on exploits was doomed. This product was meet with massive consumer rejection. The lifetime of its successor was extended, and they even implemented a downgrade program so that users could opt-out to their comfy old version.

    By now most of you all can guess of what I speak, Windows Vista.

    Microsoft, despite what all the apple freaks of the world think, is trying to be a forward thinking company. It was their forward thinking about CSS that got this whole mess started. But the corporate giants of the world do not buy Apple, they buy Microsoft, specifically for its support and reliability. Apple can afford to break the web, because it can simply force its users to upgrade. Apple does not worry that much about backwards compatibility. And its cool. Microsoft cares about the home user, but they also care about the giant corporations (and if you all think you wouldn’t if you were them, how many of you would think it was cool to be bought by Google? How many of you would structure your business such that this would be easier or more likely?). Giant corporations do not ‘just decide to roll IE8′. It’s a major decision to them. One that they prefer to make on their time, when they want to. Microsoft realizes that backwards compatibility, like it or not, is their game, and they have to do everything to protect it.

    So they introduce a new way for web designers to allow their current sites to work, but access more correct functionality. Eventually, as IE6 and 7 become obsolete, the need for opt-in will be removed, and IE 10 or so will probably begin defaulting to correct rendering mode, and shortly after that, version switches will disappear again, and the world will be happy and using compliant browsers.

    Recognizing that today is not that day, unlike their failure with vista, is an important step for them, and will allow them to implement a real, standards compliant browser, and, hopefully, eliminate cross browser issues down the line.

    Hats off to Microsoft.

    ps- This post was written in Windows Vista, by an author who actually listened to Microsoft when they said they were changing it up. How many of you can run OS 8 on your brand new Mac book air? Doesn’t work does it? This machine can run Windows 1.0.

  6. AJenbo Says:
    January 31st, 2008 at 10:49 am

    Even more ironic I would expect a Mac book air to be able to run Windows 1.0 x)

  7. Mathieu 'p01' Henri Says:
    January 31st, 2008 at 2:28 pm

    An option for not breaking the web is to make IE8 a standalone application. This way people tied to IE7- specific sites/applications can stick to IE7- until the sites/applications get the upgraded they deserve and comply to the web standards.

    Microsoft’s “Don’t break the web” is a joke. They’ve been breaking the web for years by going against the very foundation of the web standards. What about stopping to break the web by fixing IE, for real this time. This mean using satndard mode by default, instead of IE7, and have developers opt-in for previous, broken, implementations. Opting out of IE7 mode to opt in for standards is complete nonsense.

    Having IE7 as default mode may not break the old web, but it surely cripples the future web.

    What do we do when when or pops out ? How are end users and other browser vendors supposed to deal with IE8 specific content ? Will browser vendors have to reverse enginneer, again, IE’s bugs in order to make such content accessible to ALL users ? This is complete nonsense. I know the reality is not as it ought be but there should be only one web, not the WWW and the IE-web. This META tag and IE7 as default mode reinforce the split of the web.

    All/most the modern content ( web pages/apps, CSS hacks, JS frameworks, … ) use a correct DOCTYPE and feature detection + parser bugs to work around IE’s flaws ( and other browsers differences ). Such techniques constitute opt-in to fix non-standard mode. They will become dead code the day IE’s standard support finally come close to that of its competitors.

    Content using quirks DOCTYPE can be treated as IE4 if they want. But the default mode MUST be standard and there is no need for this META tag.

  8. Mathieu 'p01' Henri Says:
    January 31st, 2008 at 2:32 pm

    Doh, the coment monster ate the META tags in my previous comment. Let’s try with encoding the tag manually.

    s/when or/when <meta http-equiv=”X-UA-Compatible” content=”IE=8.1″ /> or <meta http-equiv=”X-UA-Compatible” content=â€?IE=9″ /> or

  9. Michael Zed Says:
    February 1st, 2008 at 10:19 pm

    There’s so much talk about what Microsoft should or should not do. It may be our Web, but it’s their browser. The IE 7 update broke 50% of the top 200 websites. Many of these are big corporations which spend $100Ks on Microsoft products. If 200 or even 2,000 developers complain on blogs, they may listen sympathetically, but I doubt they will change this plan.

    The interesting thing is that they only noticed after they broke the websites. Their marketers and managers are so disconnected from what the Web is that they were surprised. Either they didn’t bother testing those 200 websites, or more likely, the decision-makers just read the executive summary and pretended to understand. The IE engineers worked very hard to improve standards compliance, but the managers had no idea how crappy IE 6 was after languishing unfinished for five years. They’re only paying attention now because they accidentally “broke” the IE 6 web!

    If they keep mismanaging their web browser’s development this way, it eventually won’t matter what new tags they introduce.

  10. Criação de sites Says:
    February 12th, 2008 at 6:55 pm

    The internet explorer 8 avaiable to download(beta)?

Leave a Reply