Commit d898f27a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLStyle::put_pixelWidth implementation.

parent f63da13c
...@@ -594,6 +594,15 @@ static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value) ...@@ -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); 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) static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
{ {
nsAString str_value; nsAString str_value;
...@@ -2376,8 +2385,10 @@ static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p) ...@@ -2376,8 +2385,10 @@ static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p)
static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v) static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
{ {
HTMLStyle *This = impl_from_IHTMLStyle(iface); 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) static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
......
...@@ -826,6 +826,16 @@ static void test_body_style(IHTMLStyle *style) ...@@ -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))); ok(!strcmp_wa(V_BSTR(&v), "100px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&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 */ /* margin tests */
str = (void*)0xdeadbeef; str = (void*)0xdeadbeef;
hres = IHTMLStyle_get_margin(style, &str); hres = IHTMLStyle_get_margin(style, &str);
......
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