From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlanchor.c | 9 ++++++++- dlls/mshtml/htmlarea.c | 9 ++++++++- dlls/mshtml/htmlelem.c | 5 +++++ dlls/mshtml/mshtml_private.h | 1 - dlls/mshtml/tests/documentmode.js | 4 +++- 5 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c index 0e1642b07bf..dbdb86d5131 100644 --- a/dlls/mshtml/htmlanchor.c +++ b/dlls/mshtml/htmlanchor.c @@ -828,6 +828,13 @@ static const event_target_vtbl_t HTMLAnchorElement_event_target_vtbl = { .handle_event = HTMLAnchorElement_handle_event };
+static void HTMLAnchorElement_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + HTMLElement_init_dispex_info(info, mode); + if(mode >= COMPAT_MODE_IE9) + dispex_info_add_interface(info, IHTMLElement_tid, NULL); /* add toString */ +} + static const tid_t HTMLAnchorElement_iface_tids[] = { IHTMLAnchorElement_tid, HTMLELEMENT_TIDS, @@ -840,7 +847,7 @@ dispex_static_data_t HTMLAnchorElement_dispex = { .vtbl = &HTMLAnchorElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLAnchorElement_tid, .iface_tids = HTMLAnchorElement_iface_tids, - .init_info = HTMLElement_init_dispex_info, + .init_info = HTMLAnchorElement_init_dispex_info, };
HRESULT HTMLAnchorElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem) diff --git a/dlls/mshtml/htmlarea.c b/dlls/mshtml/htmlarea.c index 34e58473f72..550dd2876b8 100644 --- a/dlls/mshtml/htmlarea.c +++ b/dlls/mshtml/htmlarea.c @@ -439,6 +439,13 @@ static const event_target_vtbl_t HTMLAreaElement_event_target_vtbl = { .handle_event = HTMLAreaElement_handle_event };
+static void HTMLAreaElement_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + HTMLElement_init_dispex_info(info, mode); + if(mode >= COMPAT_MODE_IE9) + dispex_info_add_interface(info, IHTMLElement_tid, NULL); /* add toString */ +} + static const tid_t HTMLAreaElement_iface_tids[] = { HTMLELEMENT_TIDS, IHTMLAreaElement_tid, @@ -450,7 +457,7 @@ dispex_static_data_t HTMLAreaElement_dispex = { .vtbl = &HTMLAreaElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLAreaElement_tid, .iface_tids = HTMLAreaElement_iface_tids, - .init_info = HTMLElement_init_dispex_info, + .init_info = HTMLAreaElement_init_dispex_info, };
HRESULT HTMLAreaElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 1cc4b5ee6c8..dd8b58eacf2 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -6680,6 +6680,10 @@ void HTMLElement_init_dispex_info(dispex_data_t *info, compat_mode_t mode) {DISPID_IHTMLELEMENT6_IE9_SETATTRIBUTE, IHTMLElement6_setAttribute_hook}, {DISPID_UNKNOWN} }; + static const dispex_hook_t elem_ie9_hooks[] = { + {DISPID_IHTMLELEMENT_TOSTRING, NULL}, + {DISPID_UNKNOWN} + }; static const dispex_hook_t elem2_ie11_hooks[] = { {DISPID_IHTMLELEMENT2_ATTACHEVENT, NULL}, {DISPID_IHTMLELEMENT2_DETACHEVENT, NULL}, @@ -6715,6 +6719,7 @@ void HTMLElement_init_dispex_info(dispex_data_t *info, compat_mode_t mode) }
dispex_info_add_interface(info, IHTMLElement3_tid, mode >= COMPAT_MODE_IE11 ? elem3_ie11_hooks : NULL); + dispex_info_add_interface(info, IHTMLElement_tid, mode >= COMPAT_MODE_IE9 ? elem_ie9_hooks : NULL); }
const tid_t HTMLElement_iface_tids[] = { diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 52300cebac0..1d41949aca6 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1058,7 +1058,6 @@ typedef struct { #define HTMLELEMENT_TIDS \ IHTMLDOMNode_tid, \ IHTMLDOMNode2_tid, \ - IHTMLElement_tid, \ IHTMLElement4_tid, \ IHTMLUniqueName_tid
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index f5cd707fb84..b444726d3b5 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -252,11 +252,13 @@ sync_test("builtin_toString", function() {
e = document.createElement("a"); ok(e.toString() === "", "tag 'a' (without href) toString returned " + e.toString()); + ok(e + "" === "", "tag 'a' (without href) value = " + e); e.href = "https://www.winehq.org/"; test("tag 'a'", e, "HTMLAnchorElement", "https://www.winehq.org/");
e = document.createElement("area"); ok(e.toString() === "", "tag 'area' (without href) toString returned " + e.toString()); + ok(e + "" === "", "tag 'area' (without href) value = " + e); e.href = "https://www.winehq.org/"; test("tag 'area'", e, "HTMLAreaElement", "https://www.winehq.org/");
@@ -3751,7 +3753,7 @@ sync_test("prototype props", function() { ["onmscontentzoom",10], ["onmstransitionend",10], ["onmstransitionstart",10], "onpage", ["onpropertychange",11], ["onreadystatechange",11], ["onresize",11], ["onresizeend",11], ["onresizestart",11], ["onrowenter",11], ["onrowexit",11], ["onrowsdelete",11], ["onrowsinserted",11], ["removeBehavior",11], "removeExpression", ["removeFilter",10], ["scopeName",10], "setExpression", - ["tagUrn",10], "toString", ["xmsAcceleratorKey",10] + ["tagUrn",10], ["xmsAcceleratorKey",10] ]); check(HTMLUnknownElement, [ "namedRecordset", "recordset" ]); check(KeyboardEvent, [