mshtml: Use get_element helper in IHTMLDocument2::elementFromPoint 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:24:51 +01:00 committed by Alexandre Julliard
parent 7de7f9af9f
commit 567f911fcf
1 changed files with 5 additions and 6 deletions

View File

@ -1594,11 +1594,11 @@ static HRESULT WINAPI HTMLDocument_get_onselectstart(IHTMLDocument2 *iface, VARI
}
static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG x, LONG y,
IHTMLElement **elementHit)
IHTMLElement **elementHit)
{
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
nsIDOMElement *nselem;
HTMLDOMNode *node;
HTMLElement *element;
nsresult nsres;
HRESULT hres;
@ -1615,14 +1615,13 @@ static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG
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**)elementHit);
node_release(node);
return hres;
*elementHit = &element->IHTMLElement_iface;
return S_OK;
}
static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTMLWindow2 **p)