From 53adfe77d39f6ae3e0ad86d915cbaee6fccea631 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 16 Apr 2012 13:48:22 +0200 Subject: [PATCH] mshtml: Added IHTMLStyle2::bottom implementation. --- dlls/mshtml/htmlstyle2.c | 12 ++++++++---- dlls/mshtml/tests/style.c | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlstyle2.c b/dlls/mshtml/htmlstyle2.c index e3bd22fa024..d85ea978283 100644 --- a/dlls/mshtml/htmlstyle2.c +++ b/dlls/mshtml/htmlstyle2.c @@ -205,15 +205,19 @@ static HRESULT WINAPI HTMLStyle2_get_unicodeBidi(IHTMLStyle2 *iface, BSTR *p) static HRESULT WINAPI HTMLStyle2_put_bottom(IHTMLStyle2 *iface, VARIANT v) { HTMLStyle *This = impl_from_IHTMLStyle2(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + return set_nsstyle_attr_var(This->nsstyle, STYLEID_BOTTOM, &v, 0); } static HRESULT WINAPI HTMLStyle2_get_bottom(IHTMLStyle2 *iface, VARIANT *p) { HTMLStyle *This = impl_from_IHTMLStyle2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_nsstyle_attr_var(This->nsstyle, STYLEID_BOTTOM, p, 0); } static HRESULT WINAPI HTMLStyle2_put_right(IHTMLStyle2 *iface, VARIANT v) diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c index 9c7da84fd90..cecdd20fffd 100644 --- a/dlls/mshtml/tests/style.c +++ b/dlls/mshtml/tests/style.c @@ -52,6 +52,16 @@ static BSTR a2bstr(const char *str) return ret; } +#define test_var_bstr(a,b) _test_var_bstr(__LINE__,a,b) +static void _test_var_bstr(unsigned line, const VARIANT *v, const char *expect) +{ + ok_(__FILE__,line)(V_VT(v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(v)); + if(expect) + ok_(__FILE__,line)(!strcmp_wa(V_BSTR(v), expect), "V_BSTR(v) = %s, expected %s\n", wine_dbgstr_w(V_BSTR(v)), expect); + else + ok_(__FILE__,line)(!V_BSTR(v), "V_BSTR(v) = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(v))); +} + #define get_elem2_iface(u) _get_elem2_iface(__LINE__,u) static IHTMLElement2 *_get_elem2_iface(unsigned line, IUnknown *unk) { @@ -305,6 +315,22 @@ static void test_style2(IHTMLStyle2 *style2) ok(hres == S_OK, "get_direction failed: %08x\n", hres); ok(!strcmp_wa(str, "ltr"), "str = %s\n", wine_dbgstr_w(str)); SysFreeString(str); + + /* bottom */ + V_VT(&v) = VT_EMPTY; + hres = IHTMLStyle2_get_bottom(style2, &v); + ok(hres == S_OK, "get_bottom failed: %08x\n", hres); + test_var_bstr(&v, NULL); + + V_VT(&v) = VT_I4; + V_I4(&v) = 4; + hres = IHTMLStyle2_put_bottom(style2, v); + ok(hres == S_OK, "put_bottom failed: %08x\n", hres); + + V_VT(&v) = VT_EMPTY; + hres = IHTMLStyle2_get_bottom(style2, &v); + ok(hres == S_OK, "get_bottom failed: %08x\n", hres); + test_var_bstr(&v, "4px"); } static void test_style3(IHTMLStyle3 *style3) -- 2.11.4.GIT