Module: wine Branch: master Commit: dffb5e0538ece9a1c08d15e63fe0f64254a9037a URL: https://gitlab.winehq.org/wine/wine/-/commit/dffb5e0538ece9a1c08d15e63fe0f64...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Tue Dec 5 19:42:19 2023 +0200
mshtml: Return failure when setting IHTMLDocument2::location for detached documents.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/htmldoc.c | 6 ++++-- dlls/mshtml/tests/navigation.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index a8edc3d0251..bc3782d54cc 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -6089,10 +6089,12 @@ static HRESULT HTMLDocumentNode_location_hook(DispatchEx *dispex, WORD flags, DI { HTMLDocumentNode *This = impl_from_DispatchEx(dispex);
- if(!(flags & DISPATCH_PROPERTYPUT) || !This->outer_window) + if(!(flags & DISPATCH_PROPERTYPUT) || !This->window) return S_FALSE; + if(!This->window->base.outer_window) + return E_FAIL;
- return IDispatchEx_InvokeEx(&This->outer_window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, + return IDispatchEx_InvokeEx(&This->window->base.outer_window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, 0, flags, dp, res, ei, caller); }
diff --git a/dlls/mshtml/tests/navigation.js b/dlls/mshtml/tests/navigation.js index 59ca6ce948b..2b32903abdb 100644 --- a/dlls/mshtml/tests/navigation.js +++ b/dlls/mshtml/tests/navigation.js @@ -124,6 +124,7 @@ function detached_iframe_doc() { expect_exception(function() { origDoc.documentElement; }); expect_exception(function() { origDoc.domain; }); expect_exception(function() { origDoc.frames; }); + expect_exception(function() { origDoc.location = "blank.html"; }); expect_exception(function() { origDoc.readyState; }, true); expect_exception(function() { origDoc.URL; }); expect_exception(function() { origDoc.URL = "blank.html"; });