Module: wine Branch: master Commit: a3f4878f529b6a7288bc5caa7203e380dcd830d6 URL: https://gitlab.winehq.org/wine/wine/-/commit/a3f4878f529b6a7288bc5caa7203e38...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Dec 1 15:54:16 2023 +0100
mshtml: Return failure in IHTMLDocument2::put_URL for detached documents.
---
dlls/mshtml/htmldoc.c | 5 +++-- dlls/mshtml/tests/navigation.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 504e0b9fc10..002d2553e4f 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1094,12 +1094,13 @@ static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->outer_window) { + if(!This->window || !This->window->base.outer_window) { FIXME("No window available\n"); return E_FAIL; }
- return navigate_url(This->outer_window, v, This->outer_window->uri, BINDING_NAVIGATED); + return navigate_url(This->window->base.outer_window, v, + This->window->base.outer_window->uri, BINDING_NAVIGATED); }
static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p) diff --git a/dlls/mshtml/tests/navigation.js b/dlls/mshtml/tests/navigation.js index 71bda9ea2a5..402d933a54a 100644 --- a/dlls/mshtml/tests/navigation.js +++ b/dlls/mshtml/tests/navigation.js @@ -120,6 +120,7 @@ function detached_iframe_doc() { expect_exception(function() { origDoc.toString; }, true); expect_exception(function() { origDoc.toString(); }, true); expect_exception(function() { origDoc.URL; }); + expect_exception(function() { origDoc.URL = "blank.html"; });
next_test(); });