1

From this article Interoperable HTML5 Quirks Mode in IE10, the HTML5-based quirks mode is the default quirks mode in IE10 for those pages without a DOCTYPE or X-UA-Compatible tag. IE's legacy quirks mode is now referred to as Internet Explorer 5 quirks.

In the official IE10, it is. But not in the WebBrowser control. The default quirks mode is IE5 quirks in the WebBrowser control application.

For example: for a simplest html page that without DOCTYPE or X-UA-Compatible tag:

<html>
<head>
<meta charset="UTF-8" />
<title>Get documentMode!</title>
</head>
<body>
<h2>document.documentMode</h2>
<p>
<script>
document.write(document.documentMode);
</script>
<p>
</body>
</html>

The documentMode = 10 in Official IE10, but the documentMode = 5 in WebBrowser control application ( before test, I have added the registry item value: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\MyApp.exe to 10000, or 10001 in decimal).

Why the behavior is different?

How can I configure the default quirks mode of WebBrowser control application to "HTML5-based quirks mode" ?

Thanks for your reply in advance.

leo.zhang
  • 105
  • 3
  • 10
  • Why aren't you declaring a Doctype? – Rowland Shaw Jan 15 '14 at 10:36
  • I cannot modify the site pages. – leo.zhang Jan 16 '14 at 01:55
  • From the article Interoperable HTML5 Quirks Mode in IE10, IE5 quirks mode only used for those pages without a DOCTYPE, and with the opt-in via X-UA-Compatible. I think the document mode of my simplest html page in WBC application should be HTML5-based quirks, because it has no DOCTYPE, and has no X-UA-Compatible tag (IE=5) also. But its value is IE5 quirks. Can I have some method to let my WebBBrowser Control application has the same quirks mode without modifying the web pages? – leo.zhang Jan 16 '14 at 03:06
  • Possible duplicate: http://stackoverflow.com/q/646742/50447 – Rowland Shaw Jan 16 '14 at 08:39
  • Hi, Rowland. I think it isn't a duplicated question. I have added my application registry key into "FEATURE_BROWSER_EMULATION". My question is concerned on "why official IE10 is HTML5 Quirks Mode in default, but my application is IE5 Quirks Mode in default". I have no right to modify the web pages (add DOCTYPE or X-UA-Compatible meta tag etc.). – leo.zhang Jan 17 '14 at 03:00

2 Answers2

2

If you want to IE10 web browser control to show page without doctype, you need to set both of the following registry keys to make it work.

Key: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
Value: yourappname.exe
Type: (DWORD_32Bit value)
Data: 0x2711

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_USE_QME_FOR_TOPLEVEL_DOCS
Value: yourappname.exe
Type: REG_DWORD (DWORD_32Bit value)
Data: 1

aaron cheung
  • 532
  • 2
  • 10
  • Yes, adding the hidden registry key “FEATURE_USE_QME_FOR_TOPLEVEL_DOCS” works. Thank you for your reply. But there is side effect. The application crashes often after adding this key. Any suggestions? – leo.zhang Mar 25 '14 at 07:00
  • @aaron - Where in the world did you learn about FEATURE_USE_QME_FOR_TOPLEVEL_DOCS? The only reference I see to it on the web is from your post. Did you raise a support issue? – donaddon Oct 15 '15 at 14:37
1

To force documents to display in IE10 standards mode in a web browser control (irrespective of DOCTYPE), the DWORD value of the registry key HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\MyApp.exe (where MyApp.exe is the name of your application's exe file) should be 0x2711.

If that is not working for you, I would suggest using a tool like regmon to confirm that it is reading your application's registry key.

Rowland Shaw
  • 37,700
  • 14
  • 97
  • 166
  • I have test the application with value 0x2711. It doesn't work. According to your suggestion, I confirmed with the tool [Procmon](http://technet.microsoft.com/en-us/sysinternals/bb896645) that the registry value was read. – leo.zhang Jan 17 '14 at 02:41
  • Yes, the registry key was read。 Is there some other settings to control the behavior? – leo.zhang Jan 20 '14 at 03:02