mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 20:50:02 +00:00
mshtml: Correctly handle documents with no window associated in IHTMLDocument2::get_location.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7e0e55f76f
commit
fc1bdc65a7
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue