共用方式為


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

  • Anonymous
    July 30, 2009
    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.

  • Anonymous
    November 03, 2009
    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?

  • Anonymous
    January 29, 2010
    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

  • Anonymous
    March 28, 2010
    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.

  • Anonymous
    May 25, 2010
    Shame you didn't comply with standards originally then there wouldn't have been a problem. Why the delay?

  • Anonymous
    June 11, 2010
    The comment has been removed

  • Anonymous
    August 27, 2010
    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

  • Anonymous
    September 22, 2010
    The comment has been removed

  • Anonymous
    September 22, 2010
    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!

  • Anonymous
    September 23, 2010
    The comment has been removed

  • Anonymous
    September 23, 2010
    The comment has been removed

  • Anonymous
    September 24, 2010
    The comment has been removed

  • Anonymous
    September 26, 2010
    @GregThanks 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.

  • Anonymous
    September 27, 2010
    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?

  • Anonymous
    January 18, 2011
    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?

  • Anonymous
    April 11, 2011
    The comment has been removed

  • Anonymous
    May 17, 2011
    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.

  • Anonymous
    July 06, 2011
    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.

  • Anonymous
    October 25, 2011
    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.

  • Anonymous
    April 02, 2013
    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..?

  • Anonymous
    August 19, 2013
    i just install this page i don,t no how it work

  • Anonymous
    January 02, 2014
    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?

  • Anonymous
    February 06, 2014
    @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.

  • Anonymous
    February 18, 2014
    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)

  • Anonymous
    March 17, 2014
    @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).

  • Anonymous
    September 26, 2014
    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).

  • Anonymous
    February 17, 2015
    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?