Module: wine Branch: master Commit: 0f940bccd4156e3a56d1c81704a1714cbe15b9dd URL: http://source.winehq.org/git/wine.git/?a=commit;h=0f940bccd4156e3a56d1c81704...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Dec 14 01:03:15 2009 +0100
mshtml: Added IHTMLStyle::marginTop implementation.
---
dlls/mshtml/htmlstyle.c | 12 ++++++++---- dlls/mshtml/tests/dom.c | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 7a43701..467464a 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -1219,15 +1219,19 @@ static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p) static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->(v%d)\n", This, V_VT(&v)); - return E_NOTIMPL; + + TRACE("(%p)->(v%d)\n", This, V_VT(&v)); + + return set_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, &v, 0); }
static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p) { HTMLStyle *This = HTMLSTYLE_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_MARGIN_TOP, p, 0); }
static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index e32e2fd..9dce419 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -3802,6 +3802,24 @@ static void test_default_style(IHTMLStyle *style) hres = IHTMLStyle_put_margin(style, NULL); ok(hres == S_OK, "put_margin failed: %08x\n", hres);
+ str = (void*)0xdeadbeef; + hres = IHTMLStyle_get_marginTop(style, &v); + ok(hres == S_OK, "get_marginTop failed: %08x\n", hres); + ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v)); + ok(!V_BSTR(&v), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v))); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = a2bstr("6px"); + hres = IHTMLStyle_put_marginTop(style, v); + SysFreeString(V_BSTR(&v)); + ok(hres == S_OK, "put_marginTop failed: %08x\n", hres); + + str = (void*)0xdeadbeef; + hres = IHTMLStyle_get_marginTop(style, &v); + ok(hres == S_OK, "get_marginTop failed: %08x\n", hres); + ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v)); + ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v))); + str = NULL; hres = IHTMLStyle_get_border(style, &str); ok(hres == S_OK, "get_border failed: %08x\n", hres);