Commit 35d0fda0 authored by Dmitry Kislyuk's avatar Dmitry Kislyuk Committed by Alexandre Julliard

mshtml: Fix NULL offset parent handling in IHTMLElement::get_offsetParent.

parent 7b52ece4
......@@ -1628,7 +1628,7 @@ static HRESULT WINAPI HTMLElement_get_offsetParent(IHTMLElement *iface, IHTMLEle
if(!nsparent) {
*p = NULL;
hres = S_OK;
return S_OK;
}
hres = get_element(nsparent, &parent);
......
......@@ -1299,11 +1299,14 @@ static void _test_elem_offset(unsigned line, IUnknown *unk, const WCHAR *parent_
hres = IHTMLElement_get_offsetParent(elem, &off_parent);
ok_(__FILE__,line) (hres == S_OK, "get_offsetParent failed: %08x\n", hres);
_test_elem_tag(line, (IUnknown*)off_parent, parent_tag);
IHTMLElement_Release(off_parent);
IHTMLElement_Release(elem);
if(off_parent) {
_test_elem_tag(line, (IUnknown*)off_parent, parent_tag);
IHTMLElement_Release(off_parent);
}else {
ok_(__FILE__,line) (parent_tag == NULL, "Offset parent is NULL. %s expected\n", wine_dbgstr_w(parent_tag));
}
}
#define test_elem_source_index(a,b) _test_elem_source_index(__LINE__,a,b)
......@@ -8937,6 +8940,10 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElement_Release(elem);
}
elem = doc_get_body(doc);
test_elem_offset((IUnknown*)elem, NULL);
IHTMLElement_Release(elem);
elem = get_elem_by_id(doc, L"sc", TRUE);
if(elem) {
IHTMLScriptElement *script;
......
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