Module: wine Branch: master Commit: 0ba543acb4fda46ec045ebac39b2445bf7fcf572 URL: https://gitlab.winehq.org/wine/wine/-/commit/0ba543acb4fda46ec045ebac39b2445...
Author: Evan Tang etang@codeweavers.com Date: Wed Nov 16 15:21:27 2022 -0600
mshtml: Hide things that were removed in IE11.
---
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);