Commit f7a6c512 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

mshtml: Implement IHTMLStyle_put_textDecoration.

parent ec1d6aa6
......@@ -924,8 +924,18 @@ static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
/* textDecoration can only be one of the following */
if(!v || strcmpiW(styleNone, v) == 0 || strcmpiW(valUnderline, v) == 0 ||
strcmpiW(valOverline, v) == 0 || strcmpiW(valLineThrough, v) == 0 ||
strcmpiW(valBlink, v) == 0)
{
return set_style_attr(This, STYLEID_TEXT_DECORATION , v, 0);
}
return E_INVALIDARG;
}
static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
......
......@@ -2798,6 +2798,48 @@ static void test_default_style(IHTMLStyle *style)
hres = IHTMLStyle_put_textDecorationBlink(style, VARIANT_FALSE);
ok(hres == S_OK, "textDecorationBlink failed: %08x\n", hres);
hres = IHTMLStyle_get_textDecoration(style, &sDefault);
ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
str = a2bstr("invalid");
hres = IHTMLStyle_put_textDecoration(style, str);
ok(hres == E_INVALIDARG, "put_textDecoration failed: %08x\n", hres);
SysFreeString(str);
str = a2bstr("none");
hres = IHTMLStyle_put_textDecoration(style, str);
ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
SysFreeString(str);
str = a2bstr("underline");
hres = IHTMLStyle_put_textDecoration(style, str);
ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
SysFreeString(str);
str = a2bstr("overline");
hres = IHTMLStyle_put_textDecoration(style, str);
ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
SysFreeString(str);
str = a2bstr("line-through");
hres = IHTMLStyle_put_textDecoration(style, str);
ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
SysFreeString(str);
str = a2bstr("blink");
hres = IHTMLStyle_put_textDecoration(style, str);
ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
SysFreeString(str);
hres = IHTMLStyle_get_textDecoration(style, &str);
ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
ok(!strcmp_wa(str, "blink"), "str != blink\n");
SysFreeString(str);
hres = IHTMLStyle_put_textDecoration(style, sDefault);
ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
SysFreeString(sDefault);
hres = IHTMLStyle_get_posWidth(style, NULL);
ok(hres == E_POINTER, "get_posWidth 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