none
Document mode restart using X-UA-Compatible meta tag does not update the Browser Mode correctly in Developer Tools

    Question

  • 1. Using IE9

    2. Create a test html page using this content:

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
     <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
    </head>
    <body>
    	Document Mode:
    	<script type="text/javascript">
    		document.write(document.documentMode);	
    	</script>
    </body>
    </html>

    3. Make sure "Display intranet sites in Compatibility View" is checked.

     

    4. So, your page would normally load using Compatibility View because the box is checked. However, I understand that because of the meta tag, it should now load in IE9 Standards Mode. See the quote from this page:

     

    "EmulateIE9 tells IE to use the doctype to determine how to render content. Web pages with no doctype
    or a Quirks doctype are rendered in Quirks mode. All other doctypes are rendered in IE9’s Standards mode."

     

    5. With that said, I would expect in Developer Tools that the Browser Mode would say IE9 instead of IE9 Compat View. Lets find out....

     

    6. Push F12 to open Developer Tools.

    7. Click on the Script tab and watch the Console.

    8. Browse to your page using the name of the server instead of the IP address. Ex: http://mycomputer/test.htm instead of http://127.0.0.1/test.htm.

     

    9. You get the following lines showing up in the console:

     

    HTML1202: http://%YourURLHere%/test.htm is running in Compatibility View because 'Display intranet sites in Compatibility View' is checked. 
    test.htm
    HTML1113: Document mode restart from IE7 Standards to IE9 Standards 
    test.htm

    10. It appears that it first starts to load in Compatibility View but then it sees the header and switches to IE9 Standards.

    11. Look at the page where the javascript output the document.mode. It says 9.

    12. Now look at the Browser Mode in Developer Tools. It says IE9 Compat View.  Shouldn't it say just IE9 since it just switched away from Compatibility View.

    13. If I am wrong here, can someone please explain why?

     

     




    Thursday, August 11, 2011 6:06 PM

All replies