Jacek Caban : mshtml: Added IHTMLImgElement::width property implementation.

Alexandre Julliard julliard at winehq.org
Tue Feb 9 10:37:55 CST 2010


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Feb  8 21:47:21 2010 +0100

mshtml: Added IHTMLImgElement::width property implementation.

---

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

diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c
index 296db23..8fbfcae 100644
--- a/dlls/mshtml/htmlimg.c
+++ b/dlls/mshtml/htmlimg.c
@@ -460,15 +460,35 @@ static HRESULT WINAPI HTMLImgElement_get_name(IHTMLImgElement *iface, BSTR *p)
 static HRESULT WINAPI HTMLImgElement_put_width(IHTMLImgElement *iface, LONG v)
 {
     HTMLImgElement *This = HTMLIMG_THIS(iface);
-    FIXME("(%p)->(%d)\n", This, v);
-    return E_NOTIMPL;
+    nsresult nsres;
+
+    TRACE("(%p)->(%d)\n", This, v);
+
+    nsres = nsIDOMHTMLImageElement_SetWidth(This->nsimg, v);
+    if(NS_FAILED(nsres)) {
+        ERR("SetWidth failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLImgElement_get_width(IHTMLImgElement *iface, LONG *p)
 {
     HTMLImgElement *This = HTMLIMG_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    PRInt32 width;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsres = nsIDOMHTMLImageElement_GetWidth(This->nsimg, &width);
+    if(NS_FAILED(nsres)) {
+        ERR("GetWidth failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    *p = width;
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLImgElement_put_height(IHTMLImgElement *iface, LONG v)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index f6e4cf9..db16b99 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -1145,8 +1145,8 @@ static void _test_img_width(unsigned line, IHTMLImgElement *img, const long exp)
     HRESULT hres;
 
     hres = IHTMLImgElement_get_width(img, &found);
-    todo_wine ok_(__FILE__,line) (hres == S_OK, "get_width failed: %08x\n", hres);
-    todo_wine ok_(__FILE__,line) (found == exp, "width=%d\n", found);
+    ok_(__FILE__,line) (hres == S_OK, "get_width failed: %08x\n", hres);
+    ok_(__FILE__,line) (found == exp, "width=%d\n", found);
 }
 
 #define test_img_put_width(o,w) _test_img_put_width(__LINE__,o,w)
@@ -1155,7 +1155,7 @@ static void _test_img_put_width(unsigned line, IHTMLImgElement *img, const long
     HRESULT hres;
 
     hres = IHTMLImgElement_put_width(img, width);
-    todo_wine ok(hres == S_OK, "put_width failed: %08x\n", hres);
+    ok(hres == S_OK, "put_width failed: %08x\n", hres);
 
     _test_img_width(line, img, width);
 }




More information about the wine-cvs mailing list