The IEBlog let the world know how you're going to have to opt in for their third (and counting) rendering mode that IE8 will support. You know, the one that should support CSS2 the way other browsers already do without such a mode. Put the following into your <head> section of your page and you'll get IE8's "super standards" mode.
<meta http-equiv="X-UA-Compatible" content="IE=8" />
There are, of course, many many unanswered questions... For those who can't be bothered to read my whole post, please see the main point. For others with patience,
First, the basics:
- IE8 will render existing content in either "quirks mode" (without a DOCTYPE) or IE7's "standard mode" (with a STRICT DOCTYPE)
- IE8 will use "super standards" mode if it sees a <meta> tag with "IE=8" (what "super standards" mode entails is not entirely clear yet, but it should mean substantial improvement to CSS support at a minimum - I'm keeping my fingers crossed for fully compliant HTML and DOM2 support as well)
- IE6 and IE7 will dutifully ignore the <meta> tag
Now what the above means is that if you've got existing pages that work around IE's poor support of standards today that you need do nothing in order for them to continue to work in IE8. If you want to start coding HTML 4.01 for IE8 that truly supports standards you either add the <meta> tag with "IE=8" or update your web server to serve it to IE.
It looks like this solution was developed in coordination with the the Web Standards Project. This article describes in more detail the rationale and intracacies of the solution. Furthermore, they "hope other browser vendors join Microsoft in implementing this functionality".
Second, there is, as usual, tons of wailing and moaning and predictions of a web apocalypse, with many people yammering that this tag should work in the opposite way ("super standards" mode should be default in IE8 and all existing web pages would need to be updated to include a tag if they want IE8 to use the old IE7 "standards" mode).
Unfortunately, this suggestion has the potential to break pages for users. Let's say your page is doing browser sniffing and if it's Internet Explorer, you're going to use attachEvent() instead of the standards-compliant addEventListener() which all other browsers support. If IE8 supports addEventListener() and no longer supports the non-standard attachEvent(), then guess what: your page is broken in IE8 "super standards" mode. Of course, there hasn't been any mention of DOM-support from the IEBlog yet, but I'm keeping my fingers crossed.
Call me naïve, but I intend to give Microsoft the benefit of the doubt here and say this was the best possible solution in a very difficult situation. I believe opt-in is the only possible solution Microsoft could have for existing content (read: HTML4). Hear me out, there are some important facts that aren't widely known yet:
- If IE8+ sees the meta tag with "IE=edge", it will always use its latest, bleeding edge standards support. This will be useful for those sites which have zero IE-specific hacks, though Microsoft does not recommend it.
- If IE8 sees the meta tag with "IE=9", it will do "best effort", which means IE8's "super standards" mode
- And most importantly: if IE8 sees a not-yet-widely-deployed DOCTYPE (like HTML5's), it will use "super standards mode"
This last one is a big deal to all the wailers out there. This means anyone coding to new standards (like the newly published draft of HTML5) will not have to use this meta tag. Let me repeat that: If you want to start coding in HTML5, then IE8 will not require any <meta> tag. Ian Hickson and Anne van Kesteren might not yet be aware of this.
Some final notes:
- other browsers will likely ignore this new tag too (at least indications are that Mozilla and WebKit will not)
- IE10 will need to support IE7- quirks mode, IE7- standards mode, IE7 super-standards mode, IE8 super-standards mode, IE9 super-standards mode and IE10 super-standards mode - WTF? Chris does explain that eventually IE7 mode will have to go away at some point many years in the future when the amount of content has dropped below some threshold...
- No official word yet on whether IE8 will support XHTML and its MIME type (but if it did, this would be a new DOCTYPE and would not need any <meta> tag). A year and a half ago, Chris told Mary Jo that XHTML would probably not happen in IE8 - but that was a year and a half ago...
- No word yet on whether IE8 will support SVG (again, if it did, no need for a special flag to indicate "super standards mode")
So all in all, the story is not so bleak. As HTML5 becomes the defacto standard of the web, IE8+ will not require any <meta> tagginess. I think the IEBlog should post a follow-up explanation with some of these facts (and more disclosure about what will be included in "super standards" mode). I wonder why Chris chose to post this just before his birthday, it certainly made his day off less enjoyable - unless he gets a kick out of all the bitterness and vitriol...
“Call me naïve”
Okay, you’re naïve. When IE9 comes out then the argument will be “we need a new switch to take care of all those publishers whose hosting providers or editing tools turned on IE=edge but coded to IE8 bugs.”
If pages have browser sniffing code instead of feature sniffing code then those pages were built with the knowledge that they’re relying on browser-specific behaviour. That means the authors implicitly have to agree to maintain the pages for new browsers.
I am glad to hear about the DOCTYPE choosing the more correct rendering mode. That’s a sensible choice that co-exists with other user agents.
What about the conditional comments? How does IE8 interact with those?
The reality is – we all code to browser bugs – no one codes without testing. Every browser has their own set of bugs and if you care that your pages are viewable in a browser, you’ll test them there. AND you’ll adjust your code so that it works in the browser too. You might pull some features out because they don’t work in one browser, you might write some fallback content, you might write some JS that tests for a feature or an agent string, you might add some browser-specific CSS properties. I’ve done that in every non-trivial web page or web application that I’ve written. It’s just that, at the moment, IE’s set of bugs (where bugs can also be “missing features”) are so much larger than the others because they let it bitrot.
This X-UA-Compatible meta tag gives IE8 a way to start fresh for those users who want HTML4 to render according to standards. The HTML5 DOCTYPE thing is another way. Presumably there would not be such a wide gap between IE8 and IE9 support of HTML 4 (but if there is, and people have used IE=edge everywhere, then yes – there will be a problem). For HTML5 and other types (XHTML, SVG) this would not be a problem because the only mode for those is “super standards” mode.
“but it should mean substantial improvement to CSS support at a minimum” – well that is encouraging. Hope it is a reality.
All right, you could use the HTML 5 DOCTYPE instead of a meta tag, but DO NOT RELY ON BROWSER BUGS IN THIS CASE.
@Lionel: “DO NOT RELY ON BROWSER BUGS”
What do you do when something doesn’t work in Firefox? Do you just say that browser must fix its bugs and Firefox users are left out in the cold until the browser pushes a fix? Or do you try to work around the bug?
The HTML5 DOCTYPE triggering IE8 mode is all very well for IE8, but what about IE9?
@Ian: Obviously I can’t answer your (possibly rhetorical) question other than with speculation. I am assuming that IE9 will by default use its “best effort” rendering (IE9’s “super standards mode”) when confronted with the same DOCTYPE. That’s the only thing that makes sense to me. If this is not the case, if IE9 really used IE8’s “super standards” mode, when confronted with the HTML5 DOCTYPE and no X-UA-Compatible meta tag, then I definitely have to question Microsoft on that. I think we all agree that we need to hear more than the single comment from Chris Wilson on this issue.
I’m assuming several factors will affect this decision as well: the market share of IE8, the prevalence of DOCTYPE’d HTML5, the difference in rendering between IE8 and IE9. We might not be able to get answers on these until 2010 at the rate MS is going.
“If IE8 supports addEventListener() and no longer supports the non-standard attachEvent()”
Is there any indication that if IE started supporting a standard function they would drop the corresponding non-standard function? That doesn’t make any sense to me. I don’t know, maybe this is something the IE team would do, but this would be a terrible idea. The proper way to preserve backwards capability is to keep these old behaviors- as long as they don’t impose on any standards.
I have found the problems in IE7 to be more along the lines of lack of support for a behavior rather than improper behavior, with a few exceptions. I know it’s likely that I have not dug as deep into CSS 2.1 and the DOM as others have, but nonetheless, I have some serious doubts that IE8 really requires an opt-in method.
About IE8 turning “super standards mode” on when confronted with HTML5 documents:
As far as I know, IE8 will not support HTML5. Based on this presumption, it is clear to me this leads to catastrophe. If IE, at any later point in time, adopts HTML5, the “default” for all HTML5 documents will be IE8/IE9-rendering. Because implementing HTML5 would mean a lot of change in the treatment of HTML5 documents, wouldn’t it. And MS will have to freeze status in such a case, parallel to what is happening now with HTML4: http://lists.w3.org/Archives/Public/public-html/2007Apr/0651.html
So I think this is rather negative, unless HTML5 changes (i.e. adopt a “versioned” doctype) or MS policy changes or IE8/IE9 simply don’t get adopted in years. All of which I find unlikely. But I’m always open for surprises.
One thing is I don’t think if Microsoft added addEventListener(), they’d take out attachEvent(). That’s not how they operate. After all, they still have document.all, how many years after starting to support document.getElementById()? And have you seen the Windows API lately? A lot of obsolete, redundant functions from the Win95 era.
@Keith: You have a point. But if Microsoft CAN make a strong break with their non-standard stuff (via this “super-standards” mode), wouldn’t it be kind of a good thing? With this opt-in approach they can actually do that… (again, I’m only trying to be an optimist here)
The term “super standards” is really ridiculous, seems more like “bread and butter standards” to me…
IE8 has some bugs too although it is more stable than IE7 and IE6`:*