mshtml: Added support for non-integer values in get_nsstyle_pixel_val.

This commit is contained in:
Jacek Caban 2013-01-10 14:20:16 +01:00 committed by Alexandre Julliard
parent 7bb36372c8
commit b93e29f0ee
2 changed files with 17 additions and 1 deletions

View file

@ -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 {

View file

@ -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);