Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE8 browser mode vs document mode

Can someone please explain the difference between IE8 browser mode and document mode in simple terms?

  • What causes the browser mode to change?
  • What causes the document mode to change?

  • If a user changes the mode(s) via developer tools, does the change remain even if the page is refreshed?

I am asking this because we are doing some IE8 testing here, and different people have different combinations of the modes, and i want to try to figure out how this is happening.

like image 545
mkoryak Avatar asked Jun 01 '10 14:06

mkoryak


People also ask

What is IE document mode emulated?

Document Mode in Internet Explorer 11 In the Emulation tab in the Developers tools, you will see Mode, Display and Geolocation settings. The Document Mode selection lets you choose how Internet Explorer interprets the page, and can be useful for diagnosing compatibility issues.

How do I change the document mode in Internet Explorer?

In your Internet Explorer web browser, press F12 to open the Developer Tools window. Click Browser Mode and select the version of your web browser. Click Document Mode, and select the Internet Explorer standards for your Internet Explorer release.

How do I change the document mode to Internet Explorer 9 standards?

Change the Document Mode to Internet Explorer 9 Standards and try to view the content again. To change the Document Mode, press F12, click Document Mode: , and then select Internet Explorer 9 Standards."


1 Answers

From this article on the IE8 blog, entitled How IE8 Determines Document Mode

  1. The Developer Tools settings override all Document Modes for pages displayed in a tab.
  2. The X-UA-Compatible meta tag and then header override Compatibility View Settings and the doctype unless the X-UA-Compatible value is EmulateIE7 or EmulateIE8.
  3. The user’s Compatibility View Settings override the Microsoft Compatibility View List.
  4. If none of the above rules apply, the doctype determines whether the webpage renders in IE8 Standards, IE8 Almost Standards or Quirks Mode.

So from that we get the following answers to your questions:

Q. What is the difference between browser mode and document mode in simple terms?
A. Browser mode is set in the developer tools to emulate different IE browser version behaviors while document mode is defined on the web page to tell IE to render the site differently for compatibility purposes.

Q. What causes the browser mode to change?
A. The user changes the browser mode in the dev tools.

Q. What causes the document mode to change?
A. The Doctype and the X-UA-Compatible meta tag and header set by the web developer.

Q. If a user changes the mode(s) via developer tools, does the change remain even if the page is refreshed?
A. The Browser Mode will stay, but if you change the Doctype and X-UA-Compatible, they will go back to what is defined on the page.

UPDATE: As Adrien Be points out below, IE9+ adds the ability to change the document mode in the dev tools via a setting which will persist on refresh.

like image 108
Bradley Mountford Avatar answered Sep 24 '22 08:09

Bradley Mountford