mshtml: Properly return NULL parentElement.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2015-12-08 15:14:05 +01:00 committed by Alexandre Julliard
parent 05d1618afd
commit 7b5e8497bf
2 changed files with 7 additions and 0 deletions

View file

@ -848,6 +848,11 @@ static HRESULT WINAPI HTMLElement_get_parentElement(IHTMLElement *iface, IHTMLEl
if(FAILED(hres))
return hres;
if(!node) {
*p = NULL;
return S_OK;
}
hres = IHTMLDOMNode_QueryInterface(node, &IID_IHTMLElement, (void**)p);
IHTMLDOMNode_Release(node);
if(FAILED(hres))

View file

@ -5267,6 +5267,8 @@ static void test_insert_adjacent_elems(IHTMLDocument2 *doc, IHTMLElement *parent
static const elem_type_t br_div_br[] = {ET_BR, ET_DIV, ET_BR};
elem = test_create_elem(doc, "BR");
elem2 = test_elem_get_parent((IUnknown*)elem);
ok(!elem2, "get_parentElement returned %p\n", elem2);
insert_adjacent_elem(parent, "BeforeEnd", elem);
IHTMLElement_Release(elem);