Web browser controls, when used within applications, often require specific compatibility settings to support the rendering of web content. FEATURE_BROWSER_EMULATION is a registry setting that allows developers to control the browser mode that the web browser control uses. However, certain values set for this feature can cause emulation issues.
A user encountered a situation where setting FEATURE_BROWSER_EMULATION to IE10 or IE11 values caused a web browser control to malfunction. Specifically, a month date picker on the Dojo Toolkit calendar demo site ceased to function. The control worked correctly without any FEATURE_BROWSER_EMULATION setting or when set to IE9 emulation.
The problem was resolved by disabling the FEATURE_NINPUT_LEGACY_MODE registry setting along with optimizations and enhancements for the WebBrowser control. Here's a detailed examination of the implemented changes:
The following code sample demonstrates how to set these registry values in C#:
<code class="c#">const string FEATURE_BROWSER_EMULATION = @"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\"; Registry.SetValue(FEATURE_BROWSER_EMULATION + "FEATURE_BROWSER_EMULATION", appName, GetBrowserEmulationMode(), RegistryValueKind.DWord); Registry.SetValue(FEATURE_BROWSER_EMULATION + "FEATURE_ENABLE_CLIPCHILDREN_OPTIMIZATION", appName, 1, RegistryValueKind.DWord); Registry.SetValue(FEATURE_BROWSER_EMULATION + "FEATURE_AJAX_CONNECTIONEVENTS", appName, 1, RegistryValueKind.DWord); Registry.SetValue(FEATURE_BROWSER_EMULATION + "FEATURE_GPU_RENDERING", appName, 1, RegistryValueKind.DWord); Registry.SetValue(FEATURE_BROWSER_EMULATION + "FEATURE_WEBOC_DOCUMENT_ZOOM", appName, 1, RegistryValueKind.DWord); Registry.SetValue(FEATURE_BROWSER_EMULATION + "FEATURE_NINPUT_LEGACYMODE", appName, 0, RegistryValueKind.DWord);</code>
The above is the detailed content of Why Does Setting FEATURE_BROWSER_EMULATION to IE10 or IE11 Cause Web Browser Control Malfunction?. For more information, please follow other related articles on the PHP Chinese website!