Commit 1dedd90e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added support for non-pixel style values in IHTMLStyle::get_pixel* functions.

parent 2f0de6a1
...@@ -700,7 +700,7 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p) ...@@ -700,7 +700,7 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p)
hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value); hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
if(hres == S_OK) { if(hres == S_OK) {
WCHAR *ptr; WCHAR *ptr = NULL;
const PRUnichar *value; const PRUnichar *value;
nsAString_GetData(&str_value, &value); nsAString_GetData(&str_value, &value);
...@@ -711,15 +711,10 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p) ...@@ -711,15 +711,10 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p)
/* Skip all digits. We have tests showing that we should not round the value. */ /* Skip all digits. We have tests showing that we should not round the value. */
while(isdigitW(*++ptr)); while(isdigitW(*++ptr));
} }
}
if(*ptr && strcmpW(ptr, pxW)) { if(!ptr || (*ptr && strcmpW(ptr, pxW)))
nsAString_Finish(&str_value);
FIXME("%s: only px values are currently supported\n", debugstr_w(value));
hres = E_NOTIMPL;
}
}else {
*p = 0; *p = 0;
}
} }
nsAString_Finish(&str_value); nsAString_Finish(&str_value);
......
...@@ -1099,6 +1099,11 @@ static void test_body_style(IHTMLStyle *style) ...@@ -1099,6 +1099,11 @@ static void test_body_style(IHTMLStyle *style)
ok(!strcmp_wa(V_BSTR(&v), "auto"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v))); ok(!strcmp_wa(V_BSTR(&v), "auto"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v); VariantClear(&v);
l = 0xdeadbeef;
hres = IHTMLStyle_get_pixelWidth(style, &l);
ok(hres == S_OK, "get_pixelWidth failed: %08x\n", hres);
ok(!l, "pixelWidth = %d\n", l);
V_VT(&v) = VT_I4; V_VT(&v) = VT_I4;
V_I4(&v) = 100; V_I4(&v) = 100;
hres = IHTMLStyle_put_width(style, v); hres = IHTMLStyle_put_width(style, v);
...@@ -1361,6 +1366,17 @@ static void test_body_style(IHTMLStyle *style) ...@@ -1361,6 +1366,17 @@ static void test_body_style(IHTMLStyle *style)
ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres); ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
ok(l == 3, "pixelTop = %d\n", l); ok(l == 3, "pixelTop = %d\n", l);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("100%");
hres = IHTMLStyle_put_top(style, v);
ok(hres == S_OK, "put_top failed: %08x\n", hres);
VariantClear(&v);
l = 0xdeadbeef;
hres = IHTMLStyle_get_pixelTop(style, &l);
ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
ok(!l, "pixelTop = %d\n", l);
V_VT(&v) = VT_NULL; V_VT(&v) = VT_NULL;
hres = IHTMLStyle_put_top(style, v); hres = IHTMLStyle_put_top(style, v);
ok(hres == S_OK, "put_top failed: %08x\n", hres); ok(hres == S_OK, "put_top failed: %08x\n", hres);
...@@ -1433,6 +1449,17 @@ static void test_body_style(IHTMLStyle *style) ...@@ -1433,6 +1449,17 @@ static void test_body_style(IHTMLStyle *style)
ok(l == 70, "pixelHeight = %d\n", l); ok(l == 70, "pixelHeight = %d\n", l);
V_VT(&v) = VT_BSTR; V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("50%");
hres = IHTMLStyle_put_height(style, v);
ok(hres == S_OK, "put_height failed: %08x\n", hres);
VariantClear(&v);
l = 0xdeadbeef;
hres = IHTMLStyle_get_pixelHeight(style, &l);
ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
ok(!l, "pixelHeight = %d\n", l);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = NULL; V_BSTR(&v) = NULL;
hres = IHTMLStyle_put_height(style, v); hres = IHTMLStyle_put_height(style, v);
ok(hres == S_OK, "put_height failed: %08x\n", hres); ok(hres == S_OK, "put_height failed: %08x\n", hres);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment