Commit 7b5e8497 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Properly return NULL parentElement.

parent 05d1618a
...@@ -848,6 +848,11 @@ static HRESULT WINAPI HTMLElement_get_parentElement(IHTMLElement *iface, IHTMLEl ...@@ -848,6 +848,11 @@ static HRESULT WINAPI HTMLElement_get_parentElement(IHTMLElement *iface, IHTMLEl
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
if(!node) {
*p = NULL;
return S_OK;
}
hres = IHTMLDOMNode_QueryInterface(node, &IID_IHTMLElement, (void**)p); hres = IHTMLDOMNode_QueryInterface(node, &IID_IHTMLElement, (void**)p);
IHTMLDOMNode_Release(node); IHTMLDOMNode_Release(node);
if(FAILED(hres)) if(FAILED(hres))
......
...@@ -5267,6 +5267,8 @@ static void test_insert_adjacent_elems(IHTMLDocument2 *doc, IHTMLElement *parent ...@@ -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}; static const elem_type_t br_div_br[] = {ET_BR, ET_DIV, ET_BR};
elem = test_create_elem(doc, "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); insert_adjacent_elem(parent, "BeforeEnd", elem);
IHTMLElement_Release(elem); IHTMLElement_Release(elem);
......
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