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