Commit 042b881b authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

mshtml: Add IHTMLStyle::pixelHeight property implementation.

parent 7152077b
......@@ -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)
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment