Module: wine Branch: master Commit: d898f27af4f6e84fbdad403a0940eda1c6e88aad URL: http://source.winehq.org/git/wine.git/?a=commit;h=d898f27af4f6e84fbdad403a09...
Author: Jacek Caban jacek@codeweavers.com Date: Tue Sep 4 13:59:09 2012 +0200
mshtml: Added IHTMLStyle::put_pixelWidth implementation.
---
dlls/mshtml/htmlstyle.c | 15 +++++++++++++-- dlls/mshtml/tests/style.c | 10 ++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 1e068b1..cb164dc 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -594,6 +594,15 @@ static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value) return set_style_attr(This, sid, szValue, 0); }
+static HRESULT set_style_pxattr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LONG value) +{ + WCHAR value_str[16]; + + sprintfW(value_str, px_formatW, value); + + return set_nsstyle_attr(nsstyle, sid, value_str, 0); +} + static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p) { nsAString str_value; @@ -2376,8 +2385,10 @@ static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p) static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + + TRACE("(%p)->()\n", This); + + return set_style_pxattr(This->nsstyle, STYLEID_WIDTH, v); }
static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p) diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c index b44950c..0584ef4 100644 --- a/dlls/mshtml/tests/style.c +++ b/dlls/mshtml/tests/style.c @@ -826,6 +826,16 @@ static void test_body_style(IHTMLStyle *style) ok(!strcmp_wa(V_BSTR(&v), "100px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v))); VariantClear(&v);
+ hres = IHTMLStyle_put_pixelWidth(style, 50); + ok(hres == S_OK, "put_pixelWidth failed: %08x\n", hres); + + 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(!strcmp_wa(V_BSTR(&v), "50px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v))); + VariantClear(&v); + /* margin tests */ str = (void*)0xdeadbeef; hres = IHTMLStyle_get_margin(style, &str);