Commit fc1bdc65 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Correctly handle documents with no window associated in IHTMLDocument2::get_location.

parent 7e0e55f7
......@@ -745,12 +745,12 @@ static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p)
static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation **p)
{
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface)->doc_node;
TRACE("(%p)->(%p)\n", This, p);
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
if(!This->nsdoc || !This->window) {
WARN("NULL window\n");
return E_UNEXPECTED;
}
......
......@@ -6921,7 +6921,9 @@ static void test_dom_implementation(IHTMLDocument2 *doc)
hres = IHTMLDOMImplementation_QueryInterface(dom_implementation, &IID_IHTMLDOMImplementation2,
(void**)&dom_implementation2);
if(SUCCEEDED(hres)) {
IHTMLDocument2 *new_document2;
IHTMLDocument7 *new_document;
IHTMLLocation *location;
str = a2bstr("test");
hres = IHTMLDOMImplementation2_createHTMLDocument(dom_implementation2, str, &new_document);
......@@ -6930,6 +6932,13 @@ static void test_dom_implementation(IHTMLDocument2 *doc)
test_disp((IUnknown*)new_document, &DIID_DispHTMLDocument, &CLSID_HTMLDocument, "[object]");
test_ifaces((IUnknown*)new_document, doc_node_iids);
hres = IHTMLDocument7_QueryInterface(new_document, &IID_IHTMLDocument2, (void**)&new_document2);
ok(hres == S_OK, "Could not get IHTMLDocument2 iface: %08x\n", hres);
hres = IHTMLDocument2_get_location(new_document2, &location);
ok(hres == E_UNEXPECTED, "get_location returned: %08x\n", hres);
IHTMLDocument2_Release(new_document2);
IHTMLDocument7_Release(new_document);
IHTMLDOMImplementation2_Release(dom_implementation2);
}else {
......
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