Understanding Compatibility Modes in Internet Explorer 8


Hi everyone!


With the release of IE 8, we felt that providing a little more detail around the different Compatibility Modes might be useful, so here goes!


A fundamental problem discussed during each and every Internet Explorer release is balancing new features and functionality with site compatibility for the existing Web. On the one hand, new features and functionality push the Web forward. On the other hand, the Web is a large expanse; requiring every legacy page to support the “latest and greatest” browser version immediately at product launch just isn’t feasible.


Internet Explorer 8 addresses this challenge by introducing compatibility modes which gives a way to introduce new features and stricter compliance to standards while enabling it to be backward compliant.


In this post I would like to discuss how compatibility mode can be specified and how IE determines which mode to use in different scenarios.


Rendering Modes


Internet Explorer 8 determines the rendering mode based on the two main factors, value of compatibility mode and value of the !DOCTYPE switch.


Webpage can specify compatibility mode either by using a Meta tag or by sending a http header. Meta tag takes precedence over http header when both are present.


1) META Tag – You can place the following HTML tag in the HEAD element of your web page:


<meta http-equiv=“X-UA-Compatible” content=“IE=7” />


2) HTTP Header – You can configure your server so that the following HTTP Header is sent with each page


X-UA-Compatible: IE=7


Note: The meta tag should be placed in the head section before any script or CSS.


The following table illustrates the possible values for specifying the compatibility mode.


Table 1: Compatibility Mode Values































Common Name


Compatibility Mode Value


Description


Quirks*


IE=5


IE 5.5 (Quirks) rendering mode


IE 7 Standards*


IE=7


IE 7 standards rendering mode


IE 7 Emulation


IE=EmulateIE7


IE 7 standards or Quirks rendering, depending on DOCTYPE


IE 8 Standards*


IE=8


IE 8 standards rendering mode


IE 8 Emulation


IE=EmulateIE8


IE 8 standards or Quirks rendering, depending on DOCTYPE


Latest Mode*


IE=edge


Always use the latest standards rendering mode


* These Compatibility Modes do not depend on the DOCTYPE in determining the rendering mode to use.


You can also specify multiple modes and highest known mode will be used


<meta http-equiv=“X-UA-Compatible” content=“IE=7; IE=8” />


The following table summarizes the rendering modes. Compatibility Mode Value is the value you set using either meta tag or by sending a http header.


Table 2: Compatibility Mode Values







































Compatibility Mode Value


None


IE=5


IE=7


IE=EmulateIE7


IE=8


IE=EmulateIE8


IE=edge


No DOCTYPE


5


5


7


5


8


5


8


Quirks DOCTYPE


5


5


7


5


8


5


8


Known standards and unknown DOCTYPE


8*


5


7


7


8


8


8


* For Intranet pages, 7 (IE 7 Standards) rendering mode is used by default and can be changed



Compatibility Lists (“Emulate IE7” mode)


A Compatibility List lists all sites (domains) that it should display using Internet Explorer 7 Emulation mode (aka “Emulate IE7” mode).  Internet Explorer 8 maintains two Compatibility Lists.


– Compatibility View List (user defined)


– Microsoft Maintained Site Compatibility List (Microsoft maintained)


Emulate IE7 mode causes IE8 to do three things:


1) Use IE 7 Standards mode for standards mode document


2) Send the IE7 User agent string


3) Sets the right internal parameters to process conditional comments as IE 7 would.


As you can see, it does more than just setting the HTML document’s compatibility-mode.


User Defined List


User can maintain a custom compatibility list by using the Compatibility View button (Figure1, icon next to address bar displays a broken page image) or by adding the site to the compatibility view list (Tools menu -> Compatibility View Settings, Figure 2).


Figure 1:


clip_image002


Figure 2:


clip_image004


You will see that on the Compatibility View Settings dialog an option to use Compatibility View for all Intranet sites. This option is enabled by default. A large number of internal business web sites are optimized for Internet Explorer 7 so this default exception preserves that compatibility.


On this dialog you can also choose to display all website in compatibility view.


Local machine zone pages by default emulate IE8.


Again if a Meta tag or http header is used to set a compatibility mode to the document it will override these settings.


Removing from the List:


Web sites that are late in adopting to IE 8 Standards need a way to be easily removed from user’s Compatibility View Lists. IE 8 has several ways in which a site can be removed from this list:


1) Deselecting the “Emulate IE7” button


2) Directly editing the compatibility list


3) Deleting the browsing history


4) Overriding from the site


Overriding from the site can successfully remove the entry from the list if the following conditions are met:


– The META tag or HTTP header that results in IE8 Standards mode


– The top level domain is in the compatibility list (when it is not there in the list , no need to remove it)


– The presence of the \IEStandards.xml file on the server (note it’s in the root directory)


– IEStandards.xml file contains a tag labeled “IE8StandardsMode”.


Note: IE8 checks for the presence of IEStandards.xml file only if it hasn’t been requested in the last 30 days for that domain.


These conditions ensure that the top level domain can be removed if you’re visiting a sub domain. For instance, if foo.com was on the list and you visit mail.foo.com, that sub domain may be updated, but we need additional checks to sure that the entire foo.com can be removed by looking for the IEStandards.xml file.


Microsoft Maintained Site Compatibility List


Microsoft maintains a site compatibility list to minimize user involvement when sites don’t display properly. This list is maintained in a binary file and is updated automatically via Windows Update.


More information about this can be found here.


Web Browser Control Hosts:


By default, all web browser control hosts run in Internet Explorer 7 Emulation mode. Web browser control hosts may opt-in to Internet Explorer 8 Standards behavior via the feature control key, FEATURE_BROWSER_EMULATION.


[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]


“iexplore.exe” = dword:8


(possible values of 7 or 8)



More information:


A Compatibility View list update that is dated March 19, 2009 is available for Windows Internet Explorer 8 (KB968220)


This blog was provided by Bhasker Konakanchi. A Senior Support Escalation Engineer on the IE Support Team.


Regards,


The IE Support Team

Comments (27)

  1. Kevin C says:

    What "compatability mode" does IE8 Render pages that are in the Compatability List? If we had a page that renders correctly when added to that list would we use =IE7 or =EmulateIE7 ?

    Thanks.

  2. Pat Albrecht says:

    I’ve noticed on x64 machines that the FeatureControl registry key is in both the regular location as well as in Wow6432node. If I’m running a 32 bit app that uses the web browser control on an x64 machine, which reg key should I set?

  3. Scott says:

    Can someone explain how to set the browser to render for 5.5? Is there a way to set it for all sites? My goal is to set the compatibility mode for the 5/6 engine. Thx

  4. Nuno gomes says:

    The registry values for the ‘iexplorer.exe’ entry are not correct. You can find the correct ones at http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx.

  5. Chris says:

    Shame you didn't comply with standards originally then there wouldn't have been a problem. Why the delay?

  6. Jason says:

    IE8 defaults to compatibility mode when viewing a local file. In fact the compatibility mode button doesn't even display! Horrible idea. I built a whole site only to get blind sided when I uploaded it and all the errors in my css were revealed.

    What was the rationale behind this? Now I have to force IE7 rendering until I can fix it. Lame.

  7. Vrish says:

    We've JRE 1.6.05 production version which for some reason we can not change and the IE8 rollout is planned what should be our options? We never had IE7. We are jumping from IE6 to IE8

  8. Rich says:

    What the hell is all this about?!

    I write standards-compliant web pages, yet IE gets to decide which 'mode' to display the page to the user in based on…what?

    My DocType is xhtml strict, no messing about, no quirks, no workarounds.

    Why is the behaviour inconsistent between two users in the same office both with IE8, one gets IE8 compatibility mode (whatever that means, IE8 is compatible with IE8?????) and one gets purely IE8.

    Is this some sort of joke?

  9. Rich says:

    Whilst I'm at it….

    In my menu I have "Browser Mode" is this what you're talking about? (don't see that term in your text)

    Or are you talking about "Document Mode" 'cos I don't see that either!

    In addition, I see settings called "IE8 Compatibility View" but this isn't listing in your tables above, what is it how does it relate to the stuff in the article etc. etc.

    Incomplete and woolly information about functionality we don't want/need!

  10. Rich says:

    Seriously, I've just tried adding your meta hacks to both the page head section and to the IIS web server.

    IE8 still wants to use "IE8 Compat View", is it my DOCTYPE?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/…/xhtml1-strict.dtd"&gt;

  11. Rich says:

    Oh, I see the Developer Tools get to override everything?!

    But what are the default settings for the Dev Tools?  They appear to be wrong.

    Plus when I choose another mode in the Dev Tools it doesn't remember the setting, I have to re-choose it every time!

    Since many people will have Dev Tools what you're saying is that my pages will always get screwed up.

    Thanks very much.

  12. Greg says:

    Rick, I totally feel your pain on this. This document contains some painfully inacurate information. The sentance "Again if a Meta tag or http header is used to set a compatibility mode to the document it will override these settings." is totally incorrect. I even called Microsoft Tech support on this and they confirmed it.

    The "display intranet sites in compatibility view" check box will override any meta tag or http header you put in the server or on the web page. There is nothing you can do except uncheck that box. Yes, this is a dumb design and it runs completely contrary to all available documentation but according to MS tech support it is "by design".

    Ask for Carl if you call MS tech support. He promissed to have this web page "fixed" weeks ago and apparently dropped the ball.

  13. Rich says:

    @Greg

    Thanks for the response, good to know I'm not alone in realising that the whole thing has been:

    a) Badly thought out – just what use cases did MS run through to arrive at this flawed decision process?!

    b) Badly documented – it's inaccurate, poorly explained…perhaps a symptom of the fact that it's a poor design in the first place, it's always much easier to explain a process if the process itself makes sense!

    Even if they fix 'b' it's not going to help, we're still battling against an illogical design.

    All my stuff works in perfectly in FF, Chrome, Safari, Opera just a pity that a chunk of my users are only allowed to use IE.

  14. Greg says:

    Rich, I really wish that IE worked the way that this article describes. It is the only design that makes sense under all scenarios. The current IE design is going to cost us a lot of time and effort to work around. At this point I will be happy if they simply update this documentation to match the actual program behavior.

    My biggest issues with the whole thing is the fact that Microsoft went to all the trouble of creating the “X-UA-Compatible IE8” feature that basically does nothing for intranet sites. They even created a hard coded incompatibility between development and production environments. What’s the point of that?

  15. Dave says:

    I find valid HTML and CSS sometimes push IE8 into compatibility mode without any explanation as to why. Internet Explorer clearly has some undocumented checks which don't match the W3C standards. Rendering, switching mode and re-rendering a site ruins user experiences for unfairly affected sites.

    Are there any logs which are produced to explain why compatibility mode was enforced?

  16. Peter says:

    Turn off the IE Compatibility mode for Intranet Zones.

    IE8: Intranet Always in Compatibility Mode

    The culprit, was a little setting in the IE8 Tools menu called Compatibility View Settings, more specifically it was a checkbox in the resulting dialog labeled "Display local intranet sites in compibility view" that was automatically forcing every page on every server in my local intranet to automatically use compatibility mode without even displaying the broken page icon in the address bar.

    From:  http://www.develobert.info/…/ie8-intranet-always-in-compatibility.html

    Automated via command line:

    @Echo off

    REM  Turn off for this user

    CMD /C reg add "HKCUSoftwareMicrosoftInternet ExplorerBrowserEmulation" /v IntranetCompatibilityMode /t REG_SZ CMD /C reg add /d 0 /f

    REM  Set in the default user hive for anyone else

    reg load HKLMDfltUsr C:UsersDefaultNTUSER.dat

    CMD /C reg add "HKLMDfltUsrSoftwareMicrosoftInternet ExplorerBrowserEmulation" /v IntranetCompatibilityMode /t REG_SZ CMD /C reg add /d 0 /f

    reg unload HKLMDfltUsr

  17. Stol says:

    Just check the doctype and the metatag in the source of a site where the compatibility button doesn't appear and use those. For the rest, just wait another year until IE is completely lost it's market share.

  18. exacrom says:

    I can't believe that this article is still giving wrong information after almost a year. I've been trying to change the Document Mode for an INTRANET site to "IE8 Standards Mode" and even when this article states:

    "Again if a Meta tag or http header is used to set a compatibility mode to the document it will override these settings."

    This is so NOT TRUE.

    I've added a Meta Tag to all pages on my application and even changed the web.config to include the <httpProtocol><customHeaders> section but THIS IS JUST NOT WORKING.

    The only way I have managed to control the Document Mode is by adding the Custom Header directly to the Properties of the Website in the IIS.

    PLEASE UPDATE THIS ARTICLE!!!!. You're just misleading people with wrong information.

  19. Jim says:

    Including the X-UA-Compatible:IE=EmulateIE8 http header changes the rendering mode and prevents the compatbility mode button from appearing as expected. However, if the user has previously enabled compatability mode for the domain, the browser continues to include MSIE 7.0 in the user agent string during future requests and browser sessions. This should be fixed.

  20. Smith says:

    I have used <meta id="Meta1" runat="server" http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" /> before all the css and js. But still now my pages are rendered in compatibility mode. I should force the IE to render it only in standard modes. Can anyone give me a clear solution..?

  21. earnes robinson says:

    i just install this page i don,t no how it work

  22. pat says:

    I'm trying to get into my intrapost for Canada Post and it says my internet explorer 8 is not compatible. What do I need to do?

  23. AxelRMSFT says:

    @pat  

    It sounds like the site is sniffing the ua agent string and sending you the message. Can you update your browser to the latest IE Version?

    You may want to add the site to the Intranet Zone or to the IE Compact View Settings and see if that helps.

  24. Antony says:

    Hi, i am working on a web application using asp.net vb, where i am using a master page too. in master page, my header should be fixed but the content can be scrolled. this task is working perfectly on chrome. but not working on IE6. If anyone have the answer please mail the solution to my e-mail id (antony.nce@gmail.com)

  25. AxelRMSFT says:

    @Antony  

    Your site may be loading in the Intranet Site, which is the default and in IE 7 Compatible mode.

    From your IE Browser, you may want to change the following setting while developing and testing your web application: From Tools / Compatibility View Settings /  Deselect the Display Intranet sites in Compatibility View and reload your page.  The default behavior in IE is that if your site is loaded in the intranet site, it will load in IE Compatible mode(IE7).

  26. From your IE Browser, you may want to change the following setting while developing and testing your web application: From Tools / Compatibility View Settings / Deselect the Display Intranet sites in Compatibility View and reload your page. The default be says:

    From your IE Browser, you may want to change the following setting while developing and testing your web application: From Tools / Compatibility View Settings /  Deselect the Display Intranet sites in Compatibility View and reload your page.  The default behavior in IE is that if your site is loaded in the intranet site, it will load in IE Compatible mode(IE7).

  27. Mark B says:

    Curious… Why does IE8 default different compatibility modes between Internet & Intranet sites? Example, use the IP address and computability mode is on, use the host name the site is treated as Internet and compatibility is off.

    Why have they done this?