Hides a bunch of functions that were removed in IE11 from IE11 mode
-- v2: mshtml: Hide things that were removed in IE11 mshtml: Add tests for things removed in IE11
From: Evan Tang etang@codeweavers.com
PS Elements installer needs this, as it picks attachEvent over addEventListener if it exists, and then tries to use it with a function that only works with addEventListener (needs the event object passed) --- dlls/mshtml/tests/documentmode.js | 52 ++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 18 deletions(-)
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 5da89349d6d..2f02e17ba6c 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -264,15 +264,18 @@ sync_test("builtin_toString", function() { sync_test("elem_props", function() { var elem = document.documentElement;
- function test_exposed(prop, expect) { + function test_exposed(prop, expect, is_todo) { + var ok_ = is_todo ? todo_wine.ok : ok; if(expect) - ok(prop in elem, prop + " not found in element."); + ok_(prop in elem, prop + " not found in element."); else - ok(!(prop in elem), prop + " found in element."); + ok_(!(prop in elem), prop + " found in element."); }
var v = document.documentMode;
+ test_exposed("attachEvent", v < 11, v >= 11); + test_exposed("detachEvent", v < 11, v >= 11); test_exposed("doScroll", v < 11); test_exposed("readyState", v < 11); test_exposed("clientTop", true); @@ -285,7 +288,7 @@ sync_test("elem_props", function() { test_exposed("getElementsByClassName", v >= 9); test_exposed("removeAttributeNS", v >= 9); test_exposed("addEventListener", v >= 9); - if (v != 8 /* todo_wine */) test_exposed("hasAttribute", v >= 8); + test_exposed("hasAttribute", v >= 8, v === 8); test_exposed("removeEventListener", v >= 9); test_exposed("dispatchEvent", v >= 9); test_exposed("msSetPointerCapture", v >= 10); @@ -300,19 +303,28 @@ sync_test("elem_props", function() { test_exposed("readyState", v < 11); test_exposed("styleSheet", v < 11); test_exposed("classList", v >= 10); + + elem = document.createElement("img"); + test_exposed("fileSize", v < 11, v >= 11); });
sync_test("doc_props", function() { - function test_exposed(prop, expect) { + function test_exposed(prop, expect, is_todo) { + var ok_ = is_todo ? todo_wine.ok : ok; if(expect) - ok(prop in document, prop + " not found in document."); + ok_(prop in document, prop + " not found in document."); else - ok(!(prop in document), prop + " found in document."); + ok_(!(prop in document), prop + " found in document."); }
var v = document.documentMode; ok(document.mimeType === external.getExpectedMimeType("text/html"), "mimeType = " + document.mimeType);
+ test_exposed("attachEvent", v < 11, v >= 11); + test_exposed("detachEvent", v < 11, v >= 11); + test_exposed("createStyleSheet",v < 11, v >= 11); + test_exposed("fileSize", v < 11, v >= 11); + test_exposed("selection", v < 11, v >= 11); test_exposed("onstorage", v < 9); test_exposed("textContent", v >= 9); test_exposed("prefix", v >= 9); @@ -343,15 +355,20 @@ sync_test("docfrag_props", function() { });
sync_test("window_props", function() { - function test_exposed(prop, expect) { + function test_exposed(prop, expect, is_todo) { + var ok_ = is_todo ? todo_wine.ok : ok; if(expect) - ok(prop in window, prop + " not found in window."); + ok_(prop in window, prop + " not found in window."); else - ok(!(prop in window), prop + " found in window."); + ok_(!(prop in window), prop + " found in window."); }
var v = document.documentMode;
+ test_exposed("attachEvent", v < 11, v >= 11); + test_exposed("detachEvent", v < 11, v >= 11); + test_exposed("execScript", v < 11, v >= 11); + test_exposed("createPopup", v < 11, v >= 11); test_exposed("postMessage", true); test_exposed("sessionStorage", true); test_exposed("localStorage", true); @@ -587,11 +604,12 @@ sync_test("createElement_inline_attr", function() { sync_test("JS objs", function() { var g = window;
- function test_exposed(func, obj, expect) { + function test_exposed(func, obj, expect, is_todo) { + var ok_ = is_todo ? todo_wine.ok : ok; if(expect) - ok(func in obj, func + " not found in " + obj); + ok_(func in obj, func + " not found in " + obj); else - ok(!(func in obj), func + " found in " + obj); + ok_(!(func in obj), func + " found in " + obj); }
function test_parses(code, expect) { @@ -622,11 +640,9 @@ sync_test("JS objs", function() { test_exposed("map", Array.prototype, v >= 9);
/* FIXME: IE8 implements weird semi-functional property descriptors. */ - if(v != 8) { - test_exposed("getOwnPropertyDescriptor", Object, v >= 8); - test_exposed("defineProperty", Object, v >= 8); - test_exposed("defineProperties", Object, v >= 8); - } + test_exposed("getOwnPropertyDescriptor", Object, v >= 8, v === 8); + test_exposed("defineProperty", Object, v >= 8, v === 8); + test_exposed("defineProperties", Object, v >= 9);
test_exposed("getPrototypeOf", Object, v >= 9);
From: Evan Tang etang@codeweavers.com
--- dlls/mshtml/htmldoc.c | 17 +++++++++++++++-- dlls/mshtml/htmlelem.c | 6 ++++-- dlls/mshtml/htmlimg.c | 17 +++++++++++++++-- dlls/mshtml/htmlwindow.c | 21 ++++++++++++++++++--- dlls/mshtml/tests/documentmode.js | 24 ++++++++++++------------ 5 files changed, 64 insertions(+), 21 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 81960f53400..85f2e0eaace 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -6149,6 +6149,19 @@ static void HTMLDocumentNode_init_dispex_info(dispex_data_t *info, compat_mode_t {DISPID_IHTMLDOCUMENT2_LOCATION, HTMLDocumentNode_location_hook}, {DISPID_UNKNOWN} }; + static const dispex_hook_t document2_ie11_hooks[] = { + {DISPID_IHTMLDOCUMENT2_URL, NULL, L"URL"}, + {DISPID_IHTMLDOCUMENT2_LOCATION, HTMLDocumentNode_location_hook}, + {DISPID_IHTMLDOCUMENT2_CREATESTYLESHEET, NULL}, + {DISPID_IHTMLDOCUMENT2_FILESIZE, NULL}, + {DISPID_IHTMLDOCUMENT2_SELECTION, NULL}, + {DISPID_UNKNOWN} + }; + static const dispex_hook_t document3_ie11_hooks[] = { + {DISPID_IHTMLDOCUMENT3_ATTACHEVENT, NULL}, + {DISPID_IHTMLDOCUMENT3_DETACHEVENT, NULL}, + {DISPID_UNKNOWN} + }; static const dispex_hook_t document6_ie9_hooks[] = { {DISPID_IHTMLDOCUMENT6_ONSTORAGE}, {DISPID_UNKNOWN} @@ -6168,9 +6181,9 @@ static void HTMLDocumentNode_init_dispex_info(dispex_data_t *info, compat_mode_t dispex_info_add_interface(info, IHTMLDocument6_tid, NULL); }else { dispex_info_add_interface(info, IHTMLDocument6_tid, mode >= COMPAT_MODE_IE9 ? document6_ie9_hooks : NULL); - dispex_info_add_interface(info, IHTMLDocument3_tid, NULL); + dispex_info_add_interface(info, IHTMLDocument3_tid, mode >= COMPAT_MODE_IE11 ? document3_ie11_hooks : NULL); } - dispex_info_add_interface(info, IHTMLDocument2_tid, document2_hooks); + dispex_info_add_interface(info, IHTMLDocument2_tid, mode >= COMPAT_MODE_IE11 ? document2_ie11_hooks : document2_hooks); }
static dispex_static_data_t HTMLDocumentNode_dispex = { diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index f1b039f05e5..541806fa8b2 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -7185,8 +7185,10 @@ void HTMLElement_init_dispex_info(dispex_data_t *info, compat_mode_t mode) {DISPID_UNKNOWN} }; static const dispex_hook_t elem2_ie11_hooks[] = { - {DISPID_IHTMLELEMENT2_DOSCROLL, NULL}, - {DISPID_IHTMLELEMENT2_READYSTATE, NULL}, + {DISPID_IHTMLELEMENT2_ATTACHEVENT, NULL}, + {DISPID_IHTMLELEMENT2_DETACHEVENT, NULL}, + {DISPID_IHTMLELEMENT2_DOSCROLL, NULL}, + {DISPID_IHTMLELEMENT2_READYSTATE, NULL}, {DISPID_UNKNOWN} };
diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index 966ea3f39c0..e779dd2dec7 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -24,6 +24,7 @@ #include "winbase.h" #include "winuser.h" #include "ole2.h" +#include "mshtmdid.h"
#include "wine/debug.h"
@@ -727,15 +728,27 @@ static const NodeImplVtbl HTMLImgElementImplVtbl = {
static const tid_t HTMLImgElement_iface_tids[] = { HTMLELEMENT_TIDS, - IHTMLImgElement_tid, 0 }; + +static void HTMLImgElement_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + static const dispex_hook_t img_ie11_hooks[] = { + {DISPID_IHTMLIMGELEMENT_FILESIZE, NULL}, + {DISPID_UNKNOWN} + }; + + HTMLElement_init_dispex_info(info, mode); + + dispex_info_add_interface(info, IHTMLImgElement_tid, mode >= COMPAT_MODE_IE11 ? img_ie11_hooks : NULL); +} + static dispex_static_data_t HTMLImgElement_dispex = { L"HTMLImageElement", NULL, DispHTMLImg_tid, HTMLImgElement_iface_tids, - HTMLElement_init_dispex_info + HTMLImgElement_init_dispex_info };
HRESULT HTMLImgElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index c2475afd1f6..baaedb6b6d4 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3952,10 +3952,25 @@ static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compa {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, {DISPID_UNKNOWN} }; + static const dispex_hook_t window2_ie11_hooks[] = { + {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, + {DISPID_IHTMLWINDOW2_EXECSCRIPT, NULL}, + {DISPID_UNKNOWN} + }; static const dispex_hook_t window3_hooks[] = { {DISPID_IHTMLWINDOW3_SETTIMEOUT, IHTMLWindow3_setTimeout_hook}, {DISPID_UNKNOWN} }; + static const dispex_hook_t window3_ie11_hooks[] = { + {DISPID_IHTMLWINDOW3_SETTIMEOUT, IHTMLWindow3_setTimeout_hook}, + {DISPID_IHTMLWINDOW3_ATTACHEVENT, NULL}, + {DISPID_IHTMLWINDOW3_DETACHEVENT, NULL}, + {DISPID_UNKNOWN} + }; + static const dispex_hook_t window4_ie11_hooks[] = { + {DISPID_IHTMLWINDOW4_CREATEPOPUP, NULL}, + {DISPID_UNKNOWN} + };
if(compat_mode >= COMPAT_MODE_IE9) dispex_info_add_interface(info, IHTMLWindow7_tid, NULL); @@ -3965,8 +3980,9 @@ static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compa dispex_info_add_interface(info, IWineHTMLWindowPrivate_tid, NULL);
dispex_info_add_interface(info, IHTMLWindow5_tid, NULL); - dispex_info_add_interface(info, IHTMLWindow3_tid, window3_hooks); - dispex_info_add_interface(info, IHTMLWindow2_tid, window2_hooks); + dispex_info_add_interface(info, IHTMLWindow4_tid, compat_mode >= COMPAT_MODE_IE11 ? window4_ie11_hooks : NULL); + dispex_info_add_interface(info, IHTMLWindow3_tid, compat_mode >= COMPAT_MODE_IE11 ? window3_ie11_hooks : window3_hooks); + dispex_info_add_interface(info, IHTMLWindow2_tid, compat_mode >= COMPAT_MODE_IE11 ? window2_ie11_hooks : window2_hooks); EventTarget_init_dispex_info(info, compat_mode); }
@@ -3996,7 +4012,6 @@ static const event_target_vtbl_t HTMLWindow_event_target_vtbl = { };
static const tid_t HTMLWindow_iface_tids[] = { - IHTMLWindow4_tid, IHTMLWindow6_tid, 0 }; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 2f02e17ba6c..6b74094110f 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -274,8 +274,8 @@ sync_test("elem_props", function() {
var v = document.documentMode;
- test_exposed("attachEvent", v < 11, v >= 11); - test_exposed("detachEvent", v < 11, v >= 11); + test_exposed("attachEvent", v < 11); + test_exposed("detachEvent", v < 11); test_exposed("doScroll", v < 11); test_exposed("readyState", v < 11); test_exposed("clientTop", true); @@ -305,7 +305,7 @@ sync_test("elem_props", function() { test_exposed("classList", v >= 10);
elem = document.createElement("img"); - test_exposed("fileSize", v < 11, v >= 11); + test_exposed("fileSize", v < 11); });
sync_test("doc_props", function() { @@ -320,11 +320,11 @@ sync_test("doc_props", function() { var v = document.documentMode; ok(document.mimeType === external.getExpectedMimeType("text/html"), "mimeType = " + document.mimeType);
- test_exposed("attachEvent", v < 11, v >= 11); - test_exposed("detachEvent", v < 11, v >= 11); - test_exposed("createStyleSheet",v < 11, v >= 11); - test_exposed("fileSize", v < 11, v >= 11); - test_exposed("selection", v < 11, v >= 11); + test_exposed("attachEvent", v < 11); + test_exposed("detachEvent", v < 11); + test_exposed("createStyleSheet",v < 11); + test_exposed("fileSize", v < 11); + test_exposed("selection", v < 11); test_exposed("onstorage", v < 9); test_exposed("textContent", v >= 9); test_exposed("prefix", v >= 9); @@ -365,10 +365,10 @@ sync_test("window_props", function() {
var v = document.documentMode;
- test_exposed("attachEvent", v < 11, v >= 11); - test_exposed("detachEvent", v < 11, v >= 11); - test_exposed("execScript", v < 11, v >= 11); - test_exposed("createPopup", v < 11, v >= 11); + test_exposed("attachEvent", v < 11); + test_exposed("detachEvent", v < 11); + test_exposed("execScript", v < 11); + test_exposed("createPopup", v < 11); test_exposed("postMessage", true); test_exposed("sessionStorage", true); test_exposed("localStorage", true);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126249
Your paranoid android.
=== w8adm (testbot log) ===
WineRunTask.pl:error: The previous 1 run(s) terminated abnormally
This merge request was approved by Jacek Caban.