Jacek Caban : mshtml: Added IHTMLStyle2::right implementation.
Alexandre Julliard
julliard at winehq.org
Mon Dec 14 09:51:14 CST 2009
Module: wine
Branch: master
Commit: ba394d68be30193e8adcb641b048dd149d862e74
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ba394d68be30193e8adcb641b048dd149d862e74
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Dec 14 01:03:39 2009 +0100
mshtml: Added IHTMLStyle2::right implementation.
---
dlls/mshtml/htmlstyle2.c | 12 ++++++++----
dlls/mshtml/tests/dom.c | 22 ++++++++++++++++++++++
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlstyle2.c b/dlls/mshtml/htmlstyle2.c
index ff5fff0..aa9531c 100644
--- a/dlls/mshtml/htmlstyle2.c
+++ b/dlls/mshtml/htmlstyle2.c
@@ -212,15 +212,19 @@ static HRESULT WINAPI HTMLStyle2_get_bottom(IHTMLStyle2 *iface, VARIANT *p)
static HRESULT WINAPI HTMLStyle2_put_right(IHTMLStyle2 *iface, VARIANT v)
{
HTMLStyle *This = HTMLSTYLE2_THIS(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_RIGHT, &v, 0);
}
static HRESULT WINAPI HTMLStyle2_get_right(IHTMLStyle2 *iface, VARIANT *p)
{
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_nsstyle_attr_var(This->nsstyle, STYLEID_RIGHT, p, 0);
}
static HRESULT WINAPI HTMLStyle2_put_pixelBottom(IHTMLStyle2 *iface, LONG v)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 9dce419..6f1a064 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -3390,6 +3390,7 @@ static void test_current_style(IHTMLCurrentStyle *current_style)
static void test_style2(IHTMLStyle2 *style2)
{
+ VARIANT v;
BSTR str;
HRESULT hres;
@@ -3408,6 +3409,27 @@ static void test_style2(IHTMLStyle2 *style2)
ok(hres == S_OK, "get_position failed: %08x\n", hres);
ok(!strcmp_wa(str, "absolute"), "get_position returned %s\n", wine_dbgstr_w(str));
SysFreeString(str);
+
+ /* Test right */
+ V_VT(&v) = VT_EMPTY;
+ hres = IHTMLStyle2_get_right(style2, &v);
+ ok(hres == S_OK, "get_top failed: %08x\n", hres);
+ ok(V_VT(&v) == VT_BSTR, "V_VT(right)=%d\n", V_VT(&v));
+ ok(!V_BSTR(&v), "V_BSTR(right) != NULL\n");
+ VariantClear(&v);
+
+ V_VT(&v) = VT_BSTR;
+ V_BSTR(&v) = a2bstr("3px");
+ hres = IHTMLStyle2_put_right(style2, v);
+ ok(hres == S_OK, "put_right failed: %08x\n", hres);
+ VariantClear(&v);
+
+ V_VT(&v) = VT_EMPTY;
+ hres = IHTMLStyle2_get_right(style2, &v);
+ ok(hres == S_OK, "get_right failed: %08x\n", hres);
+ ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
+ ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
+ VariantClear(&v);
}
static void test_style3(IHTMLStyle3 *style3)
More information about the wine-cvs
mailing list