Jactry Zeng : mshtml: Add IHTMLStyle::pixelHeight property implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Sep 9 14:09:52 CDT 2014


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

Author: Jactry Zeng <wine at jactry.com>
Date:   Tue Sep  9 18:50:46 2014 +0800

mshtml: Add IHTMLStyle::pixelHeight property implementation.

---

 dlls/mshtml/htmlstyle.c   | 12 ++++++++----
 dlls/mshtml/tests/style.c | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 270f1fa..7f82905 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -2510,15 +2510,19 @@ static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
 {
     HTMLStyle *This = impl_from_IHTMLStyle(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%d)\n", This, v);
+
+    return set_style_pxattr(This->nsstyle, STYLEID_HEIGHT, v);
 }
 
 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, LONG *p)
 {
     HTMLStyle *This = impl_from_IHTMLStyle(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return get_nsstyle_pixel_val(This, STYLEID_HEIGHT, p);
 }
 
 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index 2a22f2f..eda62ef 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -1254,6 +1254,11 @@ static void test_body_style(IHTMLStyle *style)
     ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
     ok(f == 0.0, "expected 0.0 got %f\n", f);
 
+    l = 0xdeadbeef;
+    hres = IHTMLStyle_get_pixelHeight(style, &l);
+    ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
+    ok(!l, "pixelHeight = %d\n", l);
+
     hres = IHTMLStyle_put_posHeight(style, 4.9f);
     ok(hres == S_OK, "put_posHeight failed: %08x\n", hres);
 
@@ -1263,6 +1268,13 @@ static void test_body_style(IHTMLStyle *style)
        f == 4.9f, /* IE8 */
        "expected 4.0 or 4.9 (IE8) got %f\n", f);
 
+    l = 0xdeadbeef;
+    hres = IHTMLStyle_get_pixelHeight(style, &l);
+    ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
+    ok(l == 4 ||
+       l == 5, /* IE8 */
+       "pixelHeight = %d\n", l);
+
     V_VT(&v) = VT_BSTR;
     V_BSTR(&v) = a2bstr("70px");
     hres = IHTMLStyle_put_height(style, v);
@@ -1276,6 +1288,11 @@ static void test_body_style(IHTMLStyle *style)
     ok(!strcmp_wa(V_BSTR(&v), "70px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
     VariantClear(&v);
 
+    l = 0xdeadbeef;
+    hres = IHTMLStyle_get_pixelHeight(style, &l);
+    ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
+    ok(l == 70, "pixelHeight = %d\n", l);
+
     V_VT(&v) = VT_BSTR;
     V_BSTR(&v) = NULL;
     hres = IHTMLStyle_put_height(style, v);
@@ -1289,6 +1306,22 @@ static void test_body_style(IHTMLStyle *style)
     ok(!V_BSTR(&v), "V_BSTR(v) = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(&v)));
     VariantClear(&v);
 
+    l = 0xdeadbeef;
+    hres = IHTMLStyle_get_pixelHeight(style, &l);
+    ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
+    ok(!l, "pixelHeight = %d\n", l);
+
+    hres = IHTMLStyle_put_pixelHeight(style, 50);
+    ok(hres == S_OK, "put_pixelHeight failed: %08x\n", hres);
+
+    l = 0xdeadbeef;
+    hres = IHTMLStyle_get_pixelHeight(style, &l);
+    ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
+    ok(l == 50, "pixelHeight = %d\n", l);
+
+    hres = IHTMLStyle_get_pixelHeight(style, NULL);
+    ok(hres == E_POINTER, "get_pixelHeight failed: %08x\n", hres);
+
     V_VT(&v) = VT_I4;
     V_I4(&v) = 64;
     hres = IHTMLStyle_put_height(style, v);
@@ -1305,6 +1338,11 @@ static void test_body_style(IHTMLStyle *style)
     ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
     ok(f == 64.0, "expected 64.0 got %f\n", f);
 
+    l = 0xdeadbeef;
+    hres = IHTMLStyle_get_pixelHeight(style, &l);
+    ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
+    ok(l == 64, "pixelHeight = %d\n", l);
+
     str = (void*)0xdeadbeef;
     hres = IHTMLStyle_get_cursor(style, &str);
     ok(hres == S_OK, "get_cursor failed: %08x\n", hres);




More information about the wine-cvs mailing list