Commit 4aad315a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

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

parent 58d4f541
......@@ -1108,7 +1108,15 @@ static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
TRACE("(%p)->(%p)\n", iface, p);
*p = SysAllocString(This->outer_window && This->outer_window->url ? This->outer_window->url : L"about:blank");
if(This->window && !This->window->base.outer_window) {
WARN("detached document\n");
return E_FAIL;
}
if(This->window && This->window->base.outer_window->url)
*p = SysAllocString(This->window->base.outer_window->url);
else
*p = SysAllocString(L"about:blank");
return *p ? S_OK : E_OUTOFMEMORY;
}
......
......@@ -119,7 +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.URL; }, true);
expect_exception(function() { origDoc.URL; });
next_test();
});
......
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