Module: wine Branch: master Commit: b93e29f0ee0006e4469782db740f20cdae6b5be2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b93e29f0ee0006e4469782db74...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Jan 10 14:20:16 2013 +0100
mshtml: Added support for non-integer values in get_nsstyle_pixel_val.
---
dlls/mshtml/htmlstyle.c | 7 ++++++- dlls/mshtml/tests/style.c | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 2cf252d..8d3148c 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -664,9 +664,14 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p) if(value) { *p = strtolW(value, &ptr, 10);
+ if(*ptr == '.') { + /* Skip all digits. We have tests showing that we should not round the value. */ + while(isdigitW(*++ptr)); + } + if(*ptr && strcmpW(ptr, pxW)) { nsAString_Finish(&str_value); - FIXME("only px values are currently supported\n"); + FIXME("%s: only px values are currently supported\n", debugstr_w(value)); hres = E_NOTIMPL; } }else { diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c index 8ec69a6..3e2ef89 100644 --- a/dlls/mshtml/tests/style.c +++ b/dlls/mshtml/tests/style.c @@ -961,6 +961,17 @@ static void test_body_style(IHTMLStyle *style) ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v))); VariantClear(&v);
+ V_VT(&v) = VT_BSTR; + V_BSTR(&v) = a2bstr("4.99"); + hres = IHTMLStyle_put_left(style, v); + ok(hres == S_OK, "put_left failed: %08x\n", hres); + VariantClear(&v); + + l = 0xdeadbeef; + hres = IHTMLStyle_get_pixelLeft(style, &l); + ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres); + ok(l == 4, "pixelLeft = %d\n", l); + V_VT(&v) = VT_NULL; hres = IHTMLStyle_put_left(style, v); ok(hres == S_OK, "put_left failed: %08x\n", hres);