From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 6 +++--- dlls/mshtml/tests/navigation.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 45618ad3eba..b0872207819 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1160,12 +1160,12 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p) return E_NOTIMPL; }
- if(This->outer_window && !This->outer_window->uri) + if(This->window && (!This->window->base.outer_window || !This->window->base.outer_window->uri)) return E_FAIL;
nsAString_Init(&nsstr, NULL); nsres = nsIDOMHTMLDocument_GetDomain(This->html_document, &nsstr); - if(NS_SUCCEEDED(nsres) && This->outer_window && This->outer_window->uri) { + if(NS_SUCCEEDED(nsres) && This->window) { const PRUnichar *str; HRESULT hres;
@@ -1173,7 +1173,7 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p) if(!*str) { TRACE("Gecko returned empty string, fallback to loaded URL.\n"); nsAString_Finish(&nsstr); - hres = IUri_GetHost(This->outer_window->uri, p); + hres = IUri_GetHost(This->window->base.outer_window->uri, p); return FAILED(hres) ? hres : S_OK; } } diff --git a/dlls/mshtml/tests/navigation.js b/dlls/mshtml/tests/navigation.js index fb8d1d5de5b..ad10372b4c6 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.domain; }); expect_exception(function() { origDoc.frames; }); expect_exception(function() { origDoc.readyState; }, true); expect_exception(function() { origDoc.URL; });