mshtml: Return failure in IHTMLDocument2::frames for detached documents.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
Gabriel Ivăncescu 2023-12-05 19:42:19 +02:00 committed by Alexandre Julliard
parent ffb7ace4df
commit 2e77a62f1d
2 changed files with 5 additions and 2 deletions

View file

@ -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)

View file

@ -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"; });