Commit 567f911f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use get_element helper in IHTMLDocument2::elementFromPoint implementation.

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