Jacek Caban : mshtml: Added IHTMLDocument4::focus implementation.
Module: wine Branch: master Commit: a0ba631d86a97e6f900c25282701276cdc1b799e URL: http://source.winehq.org/git/wine.git/?a=commit;h=a0ba631d86a97e6f900c252827... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Oct 13 14:49:37 2008 -0500 mshtml: Added IHTMLDocument4::focus implementation. --- dlls/mshtml/htmldoc3.c | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmldoc3.c b/dlls/mshtml/htmldoc3.c index b0efb7c..533dedd 100644 --- a/dlls/mshtml/htmldoc3.c +++ b/dlls/mshtml/htmldoc3.c @@ -569,8 +569,33 @@ static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdM static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface) { HTMLDocument *This = HTMLDOC4_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + nsIDOMNSHTMLElement *nselem; + nsIDOMHTMLElement *nsbody; + nsresult nsres; + + TRACE("(%p)->()\n", This); + + nsres = nsIDOMHTMLDocument_GetBody(This->nsdoc, &nsbody); + if(NS_FAILED(nsres) || !nsbody) { + ERR("GetBody failed: %08x\n", nsres); + return E_FAIL; + } + + nsres = nsIDOMHTMLElement_QueryInterface(nsbody, &IID_nsIDOMNSHTMLElement, (void**)&nselem); + nsIDOMHTMLElement_Release(nsbody); + if(NS_FAILED(nsres)) { + ERR("Could not get nsIDOMNSHTMLElement: %08x\n", nsres); + return E_FAIL; + } + + nsres = nsIDOMNSHTMLElement_focus(nselem); + nsIDOMNSHTMLElement_Release(nselem); + if(NS_FAILED(nsres)) { + ERR("Focus failed: %08x\n", nsres); + return E_FAIL; + } + + return S_OK; } static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
participants (1)
-
Alexandre Julliard