开发者

Determining IE8's Document Mode diagram is wrong, or am I missing something?

I'm kind of lost with how IE8 determines the document mode. I got contradictions.

Setup

This is what a generated web page header looks like on my website, please note the doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head">
    <meta id="IE8" http-equiv="X-UA-Compatible" content="IE=8" />
    ...
开发者_Go百科

I'm using the meta http-equiv setted to X-UA-Compatible to force it to render in "standard mode", because this website has been made so. The website is on another machine in the company LAN (10.1.x.x).

Everything is ok up to now, but I'm having difficulties with the compatibility settings window:

Results:

When nothing is checked and listed in compatibility settings, user agent is:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E) [ok]

When only "Display all websites in Compatibility View" is checked:

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E) [coherent but not expected]

When only "Display intranet sites in Compatibility View" is checked:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E) [not ok]

When the URL is added to the list of "Websites you've added to Compatibility View":

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E) [coherent but not expected]

According to the following IE blog entry diagram, if the meta tag X-UA-Compatible is present and value is IE=8, the renderer is setted to "Standards mode". As just described, that is not the case. Meta was always IE=8 but the user agent changed. The diagram takes care of the compatibility view settings after the X-UA-Compatible meta check. In my case, it looks like the opposite. Is the diagram wrong?

Questions:

  • Why the user agent is msie 8.0 when "Display intranet sites in Compatibility View" is checked?! (is it because of my meta? Is http://10.1.x.x/ really considered as an intranet website?)

  • Why the user agent is msie 7.0 when "Display all websites in Compatibility View" is checked??? (this override my meta ? but not according to diagram)

  • Why the user agent is msie 7.0 when the site is added to the compatibility list ?

According to the diagram, my doctype falls in the "Almost Standards Mode" category. Seems there's a better meta to force IE8 standard mode, but according to the doctype:

<meta id="IE8" http-equiv="X-UA-Compatible" content="**IE=EmulateIE8**" />

Is it better to use it, or the one I'm currently using (force IE=8)? Seems Almost Standards Mode is exactly the Standard Mode with a subtle change for the rendering of images in a table, ok but... which one should I pick?

Then again the diagram mention "IE=Emulate8" but this article talks about "IE=EmulateIE8", seems like the later is the correct version according to the documentation of http-equiv.

Is there a way to detect (client side/network) if IE is in "Almost Standards Mode" or "Standards Mode" ?

A few links worth mentioning:

http://blogs.msdn.com/b/ie/archive/2008/08/27/introducing-compatibility-view.aspx

http://blogs.msdn.com/b/ie/archive/2009/02/16/just-the-facts-recap-of-compatibility-view.aspx

http://msdn.microsoft.com/en-us/library/ms533876(VS.85).aspx

http://msdn.microsoft.com/fr-fr/library/cc288325(VS.85).aspx

http://blog.strictly-software.com/2009/03/detecting-ie-8-compatibility-modes-with.html

http://phrogz.net/ie8-intranet-compatibility-view

http://hsivonen.iki.fi/doctype/ -> http://hsivonen.iki.fi/doctype/ie8-mode.png

javascript:alert(navigator.userAgent)
javascript:alert(document.compatMode);
javascript:alert(document.documentMode);


IE Dev tools indicate which rendering engine is being used.

Determining IE8's Document Mode diagram is wrong, or am I missing something?

Don't rely on the User Agent string to determine the rendering engine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜