mshtml: Added IHTMLDocument2::get_activeElement implementation.
This commit is contained in:
parent
d3aba2d635
commit
1918d7223e
|
@ -186,8 +186,35 @@ static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement
|
|||
static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p)
|
||||
{
|
||||
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMElement *nselem;
|
||||
HTMLElement *elem;
|
||||
nsresult nsres;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!This->doc_node->nsdoc) {
|
||||
*p = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: Gecko may return an active element even if the document is not visible.
|
||||
* IE returns NULL in this case.
|
||||
*/
|
||||
nsres = nsIDOMHTMLDocument_GetActiveElement(This->doc_node->nsdoc, &nselem);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetActiveElement failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
hres = get_elem(This->doc_node, nselem, &elem);
|
||||
nsIDOMElement_Release(nselem);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
*p = &elem->IHTMLElement_iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
||||
|
|
Loading…
Reference in New Issue