mshtml: Use SCRIPTLANGUAGEVERSION_5_7 for IE7 and IE5 compatibility mode.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
667b3f0dff
commit
be897e2d92
|
@ -114,9 +114,10 @@ static void set_script_prop(ScriptHost *script_host, DWORD property, VARIANT *va
|
|||
|
||||
static BOOL init_script_engine(ScriptHost *script_host)
|
||||
{
|
||||
compat_mode_t compat_mode;
|
||||
IObjectSafety *safety;
|
||||
SCRIPTSTATE state;
|
||||
DWORD supported_opts=0, enabled_opts=0;
|
||||
DWORD supported_opts=0, enabled_opts=0, script_mode;
|
||||
VARIANT var;
|
||||
HRESULT hres;
|
||||
|
||||
|
@ -149,8 +150,10 @@ static BOOL init_script_engine(ScriptHost *script_host)
|
|||
if(FAILED(hres))
|
||||
return FALSE;
|
||||
|
||||
compat_mode = lock_document_mode(script_host->window->doc);
|
||||
script_mode = compat_mode < COMPAT_MODE_IE8 ? SCRIPTLANGUAGEVERSION_5_7 : SCRIPTLANGUAGEVERSION_5_8;
|
||||
V_VT(&var) = VT_I4;
|
||||
V_I4(&var) = lock_document_mode(script_host->window->doc) == COMPAT_MODE_QUIRKS ? 1 : 2;
|
||||
V_I4(&var) = script_mode;
|
||||
set_script_prop(script_host, SCRIPTPROP_INVOKEVERSIONING, &var);
|
||||
|
||||
V_VT(&var) = VT_BOOL;
|
||||
|
|
|
@ -106,6 +106,25 @@ function test_xhr_props() {
|
|||
next_test();
|
||||
}
|
||||
|
||||
function test_javascript() {
|
||||
var g = window;
|
||||
|
||||
function test_exposed(func, obj, expect) {
|
||||
if(expect)
|
||||
ok(func in obj, func + " not found in " + obj);
|
||||
else
|
||||
ok(!(func in obj), func + " found in " + obj);
|
||||
}
|
||||
|
||||
var v = document.documentMode;
|
||||
|
||||
test_exposed("ScriptEngineMajorVersion", g, true);
|
||||
|
||||
test_exposed("JSON", g, v >= 8);
|
||||
|
||||
next_test();
|
||||
}
|
||||
|
||||
function test_elem_by_id() {
|
||||
document.body.innerHTML = '<form id="testid" name="testname"></form>';
|
||||
|
||||
|
@ -196,6 +215,7 @@ var tests = [
|
|||
test_elem_props,
|
||||
test_doc_props,
|
||||
test_window_props,
|
||||
test_javascript,
|
||||
test_xhr_props,
|
||||
test_elem_by_id,
|
||||
test_conditional_comments
|
||||
|
|
Loading…
Reference in New Issue