Jactry Zeng : mshtml: Add IHTMLStyle::get_pixelWidth implementation.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Sep 9 14:09:52 CDT 2014
Module: wine
Branch: master
Commit: 7152077b050c2bb3092c8447ba9b129cb05db4c2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7152077b050c2bb3092c8447ba9b129cb05db4c2
Author: Jactry Zeng <wine at jactry.com>
Date: Tue Sep 9 18:50:36 2014 +0800
mshtml: Add IHTMLStyle::get_pixelWidth implementation.
---
dlls/mshtml/htmlstyle.c | 6 ++++--
dlls/mshtml/tests/style.c | 18 ++++++++++++++++++
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 170db72..270f1fa 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -2501,8 +2501,10 @@ static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
static HRESULT WINAPI HTMLStyle_get_pixelWidth(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_WIDTH, p);
}
static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index 64b4fe9..2a22f2f 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -963,6 +963,11 @@ static void test_body_style(IHTMLStyle *style)
f == 2.2f, /* IE8 */
"f = %f\n", f);
+ l = 0xdeadbeef;
+ hres = IHTMLStyle_get_pixelWidth(style, &l);
+ ok(hres == S_OK, "get_pixelWidth failed: %08x\n", hres);
+ ok(l == 2, "pixelWidth = %d\n", l);
+
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("auto");
hres = IHTMLStyle_put_width(style, v);
@@ -981,6 +986,11 @@ static void test_body_style(IHTMLStyle *style)
hres = IHTMLStyle_put_width(style, v);
ok(hres == S_OK, "put_width failed: %08x\n", hres);
+ l = 0xdeadbeef;
+ hres = IHTMLStyle_get_pixelWidth(style, &l);
+ ok(hres == S_OK, "get_pixelWidth failed: %08x\n", hres);
+ ok(l == 100, "pixelWidth = %d\n", l);
+
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_width(style, &v);
ok(hres == S_OK, "get_width failed: %08x\n", hres);
@@ -991,6 +1001,14 @@ static void test_body_style(IHTMLStyle *style)
hres = IHTMLStyle_put_pixelWidth(style, 50);
ok(hres == S_OK, "put_pixelWidth failed: %08x\n", hres);
+ l = 0xdeadbeef;
+ hres = IHTMLStyle_get_pixelWidth(style, &l);
+ ok(hres == S_OK, "get_pixelWidth failed: %08x\n", hres);
+ ok(l == 50, "pixelWidth = %d\n", l);
+
+ hres = IHTMLStyle_get_pixelWidth(style, NULL);
+ ok(hres == E_POINTER, "get_pixelWidth failed: %08x\n", hres);
+
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_width(style, &v);
ok(hres == S_OK, "get_width failed: %08x\n", hres);
More information about the wine-cvs
mailing list