Jacek Caban : mshtml: Added IHTMLDocument4::hasFocus implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jan 6 14:50:57 CST 2016


Module: wine
Branch: master
Commit: 67014b7cf96821081e33ba983ec462607baf289a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=67014b7cf96821081e33ba983ec462607baf289a

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Jan  6 15:05:42 2016 +0100

mshtml: Added IHTMLDocument4::hasFocus implementation.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmldoc.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index cdeb371..8e59e98 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -2549,8 +2549,21 @@ static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
 static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
 {
     HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%p)\n", This, pfFocus);
-    return E_NOTIMPL;
+    cpp_bool has_focus;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, pfFocus);
+
+    if(!This->doc_node->nsdoc) {
+        FIXME("Unimplemented for fragments.\n");
+        return E_NOTIMPL;
+    }
+
+    nsres = nsIDOMHTMLDocument_HasFocus(This->doc_node->nsdoc, &has_focus);
+    assert(nsres == NS_OK);
+
+    *pfFocus = has_focus ? VARIANT_TRUE : VARIANT_FALSE;
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v)




More information about the wine-cvs mailing list