Commit cb14ca2a authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

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

parent 1f051768
......@@ -2364,9 +2364,13 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
TRACE("(%p)->(%p)\n", This, p);
if(This->outer_window && This->outer_window->readystate == READYSTATE_UNINITIALIZED) {
*p = NULL;
return S_OK;
if(This->window) {
if(!This->window->base.outer_window)
return E_FAIL;
if(This->window->base.outer_window->readystate == READYSTATE_UNINITIALIZED) {
*p = NULL;
return S_OK;
}
}
if(!This->dom_document) {
......
......@@ -121,6 +121,7 @@ function detached_iframe_doc() {
expect_exception(function() { origDoc.toString(); }, true);
expect_exception(function() { origDoc.cookie; });
expect_exception(function() { origDoc.cookie = "test=val"; });
expect_exception(function() { origDoc.documentElement; });
expect_exception(function() { origDoc.domain; });
expect_exception(function() { origDoc.frames; });
expect_exception(function() { origDoc.readyState; }, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment