Tuesday, January 22nd, 2008

IE8 Compatibility with X-UA-Compatible

Category: Browsers, IE

If you want compatibility to work well in IE8 and lower, then it is time to get to know the X-UA-Compatible header. This is according to Chris Wilson in his post on compatibility and IE8.

He links to Aaron Gustafson’s new article on the issue, and summarizes himself:

Aaron Gustafson, one of the members of the WaSP-Microsoft Task Force wrote an article detailing where we ended up that was posted on A List Apart today; I highly recommend reading it for a different perspective. I’ll summarize, though, that:

  1. “Quirks mode” remains the same, and compatible with current content.
  2. “Standards mode” remains the same as IE7, and compatible with current content.
  3. If you (the page developer) really want the best standards support IE8 can give, you can get it by inserting a simple <meta> element. Aaron gives more details on this in his article.

We believe this approach has the best blend of allowing web developers to easily write code to interoperable web standards while not causing compatibility problems with current content. We also think this approach allows developers to opt in to standards behavior on their own schedule and as it makes sense to them, instead of forcing developers into a responsive mode when a new version of IE has different behavior on their current pages. I’m excited by all the standards work we’re doing in IE8; I’m even more excited that we won’t cause a lot of compatibility problems for our users and web developers.

Sam Ruby has chimed in saying that he just wants IE to do the right thing, as best as it can, and thus put the following in his .htaccess:

BrowserMatch MSIE best-standards-support
Header set X-UA-Compatible IE=edge env=best-standards-support

He finished with some questions:

  • What is MySpace supposed to do? Users copy/paste input into text areas and the result is wrapped in a template. Multiply this question by all of the sites (Blogger, WordPress, etc.) that do similarly.
  • How does this affect feed aggregators? Use xhtml:meta as extension elements? How are planet / river of news aggregators supposed to cope?

Then, Eric Meyer came out to talk about switches versus targets:

The second major difference between browser sniffing and version targeting is that browser sniffing looks forward while version targeting looks back. Looking forward is one big reason browser sniffing is fragile: it’s hard to predict the future. To pick one example, Safari’s inclusion of “like Gecko” in its user-agent identifier broke a fair number of sniffer scripts—even those that were comparatively well done. The authors of those scripts had simply failed to predict that a non-Gecko browser from Apple would include the word “Gecko” in its user-agent identifier.

And PPK of quirksmode spoke of the different between versions and browser sniffing.

Posted by Dion Almaer at 12:30 pm

3.2 rating from 29 votes


Comments feed TrackBack URI

If only they would have made the opt-in for standards mode default and the opt-out optional… It would have been so rediculously simple to make a webserver that serves your “Ie 6 sp1.2a compatible” intranet site automatically (or by meta in templates) serve the compatibility header. That way, everyone but microsoft and the guru’s would be happy.

The web should evolve with every new browser release, not develove…

Comment by SchizoDuckie — January 22, 2008

It owuld have been far better to enable the new “better” stanards in regular standards mode becuase really IE7 standards mode is not that much better than IE6.

Comment by SiteSmart — January 23, 2008

So let me get this straight. The excuse Chris Wilson gave at the AJAX Experience for IE7 running in standards compliant mode not being really standards compliant was because MS was worried it would break his momma’s banking site cause those developers didn’t really know what they were doing when they used the strict doctype.

Now that IE8 claims to be actually standards compliant the reason we developers have to use IE8 specific meta-tags to turn it on (in addition to the doctype for the other browsers) is because MS is worried it will break IE7?

Give me a break MS!

BTW what is the behavior if a developer uses this meta tag but forgets the doc-type, a standards mode page in IE8 but a quirks mode page in IE7 & other browsers?

Comment by Chris Phillips — January 23, 2008

I’m not against the meta tag itself… what I hate is being forced to deal with it if I want to run in standards mode… on the latest engine.

I could accept that a document that is HTML 4.0 (even strict if need be) or lower is defaulted to “IE7” complience… However as for XHTML 1.0 strict and HTML5… the default should be as started by the doctype… meaning their equivalent of defining it as “edge”.

Let’s not start off these new standards on the wrong foot especially in the “strict” modes.

Comment by Jerome Lapointe — January 23, 2008

There’s probably something I dont understand… they can’t possibly mean that IE7& or IE8 will be the default engine for all doctypes… even those yet to be written…
HTML9 (when it comes out) will default to IE7?

What we’re doing is going back to pre-standard ERA… and we will be building for the browser, not the standard. People are gonna start posting these ridiculous little icons saying “Optimized for IEx”, “Works best in FFx”… You build you site for something the industry agree’s on not for a particular browser.

This is a very insidious proposal.
It’s a bandaid to support old-web… don’t compromise new-web for it… unless what you really want is to return to the old days of browser specific sites.
There’s ways you can tell if someone intends his site to be up to date on the latest standards… you do not need them to opt out to be able to server their site with the lastest engine.

Comment by Jerome Lapointe — January 23, 2008

Leave a comment

You must be logged in to post a comment.