From e64ab65a5e6e3e0e079413132861ee132916a4e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Tue, 13 Sep 2022 19:57:37 +0300 Subject: [PATCH] mshtml: Don't expose document.onstorage for IE9+ modes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmldoc.c | 6 +++++- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 413a3a4054e..aa3efe27c68 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5978,6 +5978,10 @@ 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 document6_ie9_hooks[] = { + {DISPID_IHTMLDOCUMENT6_ONSTORAGE}, + {DISPID_UNKNOWN} + }; HTMLDOMNode_init_dispex_info(info, mode); @@ -5992,7 +5996,7 @@ static void HTMLDocumentNode_init_dispex_info(dispex_data_t *info, compat_mode_t dispex_info_add_interface(info, IHTMLDocument3_tid, NULL); dispex_info_add_interface(info, IHTMLDocument6_tid, NULL); }else { - dispex_info_add_interface(info, IHTMLDocument6_tid, NULL); + 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, IHTMLDocument2_tid, document2_hooks); diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 8cc1da534e6..91d5e38c59a 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -312,6 +312,7 @@ sync_test("doc_props", function() { var v = document.documentMode; + test_exposed("onstorage", v < 9); test_exposed("textContent", v >= 9); test_exposed("prefix", v >= 9); test_exposed("defaultView", v >= 9);