Jacek Caban : mshtml: Added IHTMLImgElement::get_complete implementation.

Alexandre Julliard julliard at winehq.org
Wed Oct 17 14:32:28 CDT 2012


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Oct 17 12:20:24 2012 +0200

mshtml: Added IHTMLImgElement::get_complete implementation.

---

 dlls/mshtml/htmlimg.c   |   15 +++++++++++++--
 dlls/mshtml/tests/dom.c |   14 ++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c
index 4ca02fc..e5f94d1 100644
--- a/dlls/mshtml/htmlimg.c
+++ b/dlls/mshtml/htmlimg.c
@@ -358,8 +358,19 @@ static HRESULT WINAPI HTMLImgElement_get_readyState(IHTMLImgElement *iface, BSTR
 static HRESULT WINAPI HTMLImgElement_get_complete(IHTMLImgElement *iface, VARIANT_BOOL *p)
 {
     HTMLImgElement *This = impl_from_IHTMLImgElement(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    cpp_bool complete;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsres = nsIDOMHTMLImageElement_GetComplete(This->nsimg, &complete);
+    if(NS_FAILED(nsres)) {
+        ERR("GetComplete failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    *p = complete ? VARIANT_TRUE : VARIANT_FALSE;
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLImgElement_put_loop(IHTMLImgElement *iface, VARIANT v)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index ea54b4d..ef036da 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -2504,6 +2504,19 @@ static void _test_img_name(unsigned line, IUnknown *unk, const char *pValue)
     SysFreeString(sName);
 }
 
+#define test_img_complete(a,b) _test_img_complete(__LINE__,a,b)
+static void _test_img_complete(unsigned line, IHTMLElement *elem, VARIANT_BOOL exb)
+{
+    IHTMLImgElement *img = _get_img_iface(line, (IUnknown*)elem);
+    VARIANT_BOOL b = 100;
+    HRESULT hres;
+
+    hres = IHTMLImgElement_get_complete(img, &b);
+    ok_(__FILE__,line) (hres == S_OK, "get_complete failed: %08x\n", hres);
+    ok_(__FILE__,line) (b == exb, "complete = %x, expected %x\n", b, exb);
+    IHTMLImgElement_Release(img);
+}
+
 static void test_dynamic_properties(IHTMLElement *elem)
 {
     static const WCHAR attr1W[] = {'a','t','t','r','1',0};
@@ -5703,6 +5716,7 @@ static void test_elems(IHTMLDocument2 *doc)
         test_img_alt((IUnknown*)elem, NULL);
         test_img_set_alt((IUnknown*)elem, "alt test");
         test_img_name((IUnknown*)elem, "WineImg");
+        test_img_complete(elem, VARIANT_FALSE);
         IHTMLElement_Release(elem);
     }
 




More information about the wine-cvs mailing list