Commit e402bb56 authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

mshtml: Add IHTMLStyle::pixelTop property implementation.

parent 042b881b
...@@ -2460,15 +2460,19 @@ static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p) ...@@ -2460,15 +2460,19 @@ static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v) static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
{ {
HTMLStyle *This = impl_from_IHTMLStyle(iface); 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_TOP, v);
} }
static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p) static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p)
{ {
HTMLStyle *This = impl_from_IHTMLStyle(iface); 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_TOP, p);
} }
static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v) static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v)
......
...@@ -1210,6 +1210,17 @@ static void test_body_style(IHTMLStyle *style) ...@@ -1210,6 +1210,17 @@ static void test_body_style(IHTMLStyle *style)
f == 4.9f, /* IE8 */ f == 4.9f, /* IE8 */
"expected 4.0 or 4.9 (IE8) got %f\n", f); "expected 4.0 or 4.9 (IE8) got %f\n", f);
hres = IHTMLStyle_put_pixelTop(style, 6);
ok(hres == S_OK, "put_pixelTop failed: %08x\n", hres);
l = 0xdeadbeef;
hres = IHTMLStyle_get_pixelTop(style, &l);
ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
ok(l == 6, "pixelTop = %d\n", l);
hres = IHTMLStyle_get_pixelTop(style, NULL);
ok(hres == E_POINTER, "get_pixelTop failed: %08x\n", hres);
V_VT(&v) = VT_BSTR; V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("3px"); V_BSTR(&v) = a2bstr("3px");
hres = IHTMLStyle_put_top(style, v); hres = IHTMLStyle_put_top(style, v);
...@@ -1227,6 +1238,11 @@ static void test_body_style(IHTMLStyle *style) ...@@ -1227,6 +1238,11 @@ static void test_body_style(IHTMLStyle *style)
ok(hres == S_OK, "get_posTop failed: %08x\n", hres); ok(hres == S_OK, "get_posTop failed: %08x\n", hres);
ok(f == 3.0, "expected 3.0 got %f\n", f); ok(f == 3.0, "expected 3.0 got %f\n", f);
l = 0xdeadbeef;
hres = IHTMLStyle_get_pixelTop(style, &l);
ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
ok(l == 3, "pixelTop = %d\n", l);
V_VT(&v) = VT_NULL; V_VT(&v) = VT_NULL;
hres = IHTMLStyle_put_top(style, v); hres = IHTMLStyle_put_top(style, v);
ok(hres == S_OK, "put_top failed: %08x\n", hres); ok(hres == S_OK, "put_top failed: %08x\n", hres);
...@@ -1238,6 +1254,11 @@ static void test_body_style(IHTMLStyle *style) ...@@ -1238,6 +1254,11 @@ static void test_body_style(IHTMLStyle *style)
ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n"); ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
VariantClear(&v); VariantClear(&v);
l = 0xdeadbeef;
hres = IHTMLStyle_get_pixelTop(style, &l);
ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
ok(!l, "pixelTop = %d\n", l);
/* Test posHeight */ /* Test posHeight */
hres = IHTMLStyle_get_posHeight(style, NULL); hres = IHTMLStyle_get_posHeight(style, NULL);
ok(hres == E_POINTER, "get_posHeight failed: %08x\n", hres); ok(hres == E_POINTER, "get_posHeight 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