Module: wine Branch: master Commit: 2e77a62f1d21a7f20f2b241a1761ac29362f06d3 URL: https://gitlab.winehq.org/wine/wine/-/commit/2e77a62f1d21a7f20f2b241a1761ac2...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Tue Dec 5 19:42:19 2023 +0200
mshtml: Return failure in IHTMLDocument2::frames 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 3f844fddf8d..45618ad3eba 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -914,11 +914,13 @@ static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFrames
TRACE("(%p)->(%p)\n", This, p);
- if(!This->outer_window) { + if(!This->window) { /* Not implemented by IE */ return E_NOTIMPL; } - return IHTMLWindow2_get_frames(&This->outer_window->base.IHTMLWindow2_iface, p); + if(!This->window->base.outer_window) + return E_FAIL; + return IHTMLWindow2_get_frames(&This->window->base.outer_window->base.IHTMLWindow2_iface, p); }
static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p) diff --git a/dlls/mshtml/tests/navigation.js b/dlls/mshtml/tests/navigation.js index 84a0bbdcb5d..fb8d1d5de5b 100644 --- a/dlls/mshtml/tests/navigation.js +++ b/dlls/mshtml/tests/navigation.js @@ -119,6 +119,7 @@ function detached_iframe_doc() { expect_exception(function() { origDoc.onclick; }, true); expect_exception(function() { origDoc.toString; }, true); expect_exception(function() { origDoc.toString(); }, true); + expect_exception(function() { origDoc.frames; }); expect_exception(function() { origDoc.readyState; }, true); expect_exception(function() { origDoc.URL; }); expect_exception(function() { origDoc.URL = "blank.html"; });