From b6fa5a21009fb11d9ae3d4f394cad0506e7e7f49 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 8 Dec 2008 21:08:17 +1100 Subject: [PATCH] mshtml: Implement IHTMLStyle get/put posWidth. --- dlls/mshtml/htmlstyle.c | 18 ++++++++++++++---- dlls/mshtml/tests/dom.c | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index d81fdb5a34..b612f6ad27 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -1909,15 +1909,25 @@ static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p) static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + + TRACE("(%p)->(%f)\n", This, v); + + return set_style_pos(This, STYLEID_WIDTH, v); } static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + if(!p) + return E_POINTER; + + if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK) + *p = 0.0f; + + return S_OK; } static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index c7fcc7403c..cf8f8f054c 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2340,12 +2340,26 @@ static void test_default_style(IHTMLStyle *style) ok(hres == S_OK, "get_textDecorationLineThrough failed: %08x\n", hres); ok(b == VARIANT_FALSE, "textDecorationLineThrough = %x\n", b); + hres = IHTMLStyle_get_posWidth(style, NULL); + ok(hres == E_POINTER, "get_posWidth failed: %08x\n", hres); + + hres = IHTMLStyle_get_posWidth(style, &f); + ok(hres == S_OK, "get_posWidth failed: %08x\n", hres); + ok(f == 0.0f, "f = %f\n", f); + V_VT(&v) = VT_EMPTY; hres = IHTMLStyle_get_width(style, &v); ok(hres == S_OK, "get_width failed: %08x\n", hres); ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v)); ok(!V_BSTR(&v), "V_BSTR(v)=%p\n", V_BSTR(&v)); + hres = IHTMLStyle_put_posWidth(style, 2.2); + ok(hres == S_OK, "get_posWidth failed: %08x\n", hres); + + hres = IHTMLStyle_get_posWidth(style, &f); + ok(hres == S_OK, "get_posWidth failed: %08x\n", hres); + ok(f == 2.0f, "f = %f\n", f); + V_VT(&v) = VT_BSTR; V_BSTR(&v) = a2bstr("auto"); hres = IHTMLStyle_put_width(style, v); -- 2.33.8