Commit 7eddb864 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Allow setting fontWeight to empty string.

parent f51c19b9
......@@ -935,19 +935,13 @@ static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
/* fontWeight can only be one of the following */
if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(styleBold, v) == 0 ||
strcmpiW(styleBolder, v) == 0 || strcmpiW(styleLighter, v) == 0 ||
strcmpiW(style100, v) == 0 || strcmpiW(style200, v) == 0 ||
strcmpiW(style300, v) == 0 || strcmpiW(style400, v) == 0 ||
strcmpiW(style500, v) == 0 || strcmpiW(style600, v) == 0 ||
strcmpiW(style700, v) == 0 || strcmpiW(style800, v) == 0 ||
strcmpiW(style900, v) == 0
)
{
return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
}
if(v && *v && strcmpiW(szNormal, v) && strcmpiW(styleBold, v) && strcmpiW(styleBolder, v)
&& strcmpiW(styleLighter, v) && strcmpiW(style100, v) && strcmpiW(style200, v)
&& strcmpiW(style300, v) && strcmpiW(style400, v) && strcmpiW(style500, v) && strcmpiW(style600, v)
&& strcmpiW(style700, v) && strcmpiW(style800, v) && strcmpiW(style900, v))
return E_INVALIDARG;
return E_INVALIDARG;
return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
}
static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
......
......@@ -823,6 +823,16 @@ static void test_body_style(IHTMLStyle *style)
ok(!strcmp_wa(str, "900"), "str != style900\n");
SysFreeString(str);
str = a2bstr("");
hres = IHTMLStyle_put_fontWeight(style, str);
ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
SysFreeString(str);
hres = IHTMLStyle_get_fontWeight(style, &str);
ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
ok(!str, "str != NULL\n");
SysFreeString(str);
hres = IHTMLStyle_put_fontWeight(style, sDefault);
ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
SysFreeString(sDefault);
......
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