Alistair Leslie-Hughes : mshtml: Implement IHTMLStyle_put_textDecoration.
Alexandre Julliard
julliard at winehq.org
Wed Mar 4 09:00:52 CST 2009
Module: wine
Branch: master
Commit: f7a6c512a0c7a7fd103ddc83ddec44ebfddcad33
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f7a6c512a0c7a7fd103ddc83ddec44ebfddcad33
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Sun Mar 1 20:26:59 2009 +1100
mshtml: Implement IHTMLStyle_put_textDecoration.
---
dlls/mshtml/htmlstyle.c | 14 ++++++++++++--
dlls/mshtml/tests/dom.c | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index a7eff56..90ff089 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -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)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index c0fb009..6674024 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -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);
More information about the wine-cvs
mailing list