mshtml: Use get_element helper in IHTMLDocument3::get_documentElement implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-02-20 13:25:22 +01:00 committed by Alexandre Julliard
parent 62335569c4
commit cff4612646
1 changed files with 3 additions and 4 deletions

View File

@ -1993,7 +1993,7 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
{
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
nsIDOMElement *nselem = NULL;
HTMLDOMNode *node;
HTMLElement *element;
nsresult nsres;
HRESULT hres;
@ -2020,13 +2020,12 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
return S_OK;
}
hres = get_node((nsIDOMNode *)nselem, TRUE, &node);
hres = get_element(nselem, &element);
nsIDOMElement_Release(nselem);
if(FAILED(hres))
return hres;
hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
node_release(node);
*p = &element->IHTMLElement_iface;
return hres;
}