Jacek Caban : mshtml: Added IHTMLStyle2::bottom implementation.
Alexandre Julliard
julliard at winehq.org
Mon Apr 16 13:35:46 CDT 2012
Module: wine
Branch: master
Commit: 53adfe77d39f6ae3e0ad86d915cbaee6fccea631
URL: http://source.winehq.org/git/wine.git/?a=commit;h=53adfe77d39f6ae3e0ad86d915cbaee6fccea631
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Apr 16 13:48:22 2012 +0200
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 e3bd22f..d85ea97 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 9c7da84..cecdd20 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)
More information about the wine-cvs
mailing list