mshtml: Added IHTMLDocument2::get_activeElement implementation.

oldstable
Jacek Caban 2014-02-14 11:20:14 +01:00 committed by Alexandre Julliard
parent d3aba2d635
commit 1918d7223e
1 changed files with 29 additions and 2 deletions

View File

@ -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)