mshtml: Implement IHTMLStyle_put_textDecoration.

This commit is contained in:
Alistair Leslie-Hughes 2009-03-01 20:26:59 +11:00 committed by Alexandre Julliard
parent ec1d6aa617
commit f7a6c512a0
2 changed files with 54 additions and 2 deletions

View File

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

View File

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