[PATCH] Implement IHTMLStyle get/put posWidth
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Mon Dec 8 04:08:17 CST 2008
---
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 d81fdb5..b612f6a 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 c7fcc74..cf8f8f0 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);
--
1.5.4.3
--------------040501060904030701070209--
More information about the wine-patches
mailing list