From c9f4c2298ab3535dae8f91f45d11c58a5c0eb3ef Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sun, 1 Mar 2009 16:53:52 +1100 Subject: [PATCH] mshtml: Implement IHTMLStyle get/put textDecorationNone. --- dlls/mshtml/htmlstyle.c | 15 ++++++++++----- dlls/mshtml/tests/dom.c | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index ce5dba2aff7..293ddf0fd88 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -156,6 +156,8 @@ static const WCHAR valUnderline[] = {'u','n','d','e','r','l','i','n','e',0}; static const WCHAR szNormal[] = {'n','o','r','m','a','l',0}; +static const WCHAR styleNone[] = + {'n','o','n','e',0}; static const WCHAR px_formatW[] = {'%','d','p','x',0}; static const WCHAR emptyW[] = {0}; @@ -436,7 +438,6 @@ static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p) static BOOL is_valid_border_style(BSTR v) { - static const WCHAR styleNone[] = {'n','o','n','e',0}; static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0}; static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0}; static const WCHAR styleSolid[] = {'s','o','l','i','d',0}; @@ -935,15 +936,19 @@ static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p) static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->(%x)\n", This, v); - return E_NOTIMPL; + + TRACE("(%p)->(%x)\n", This, v); + + return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? styleNone : emptyW, 0); } static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return check_style_attr_value(This, STYLEID_TEXT_DECORATION, styleNone, p); } static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 37cc5496fa5..86c25b0ac0a 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2750,6 +2750,22 @@ static void test_default_style(IHTMLStyle *style) hres = IHTMLStyle_put_textDecorationLineThrough(style, VARIANT_FALSE); ok(hres == S_OK, "put_textDecorationLineThrough failed: %08x\n", hres); + b = 0xfefe; + hres = IHTMLStyle_get_textDecorationNone(style, &b); + ok(hres == S_OK, "get_textDecorationNone failed: %08x\n", hres); + ok(b == VARIANT_FALSE, "textDecorationNone = %x\n", b); + + hres = IHTMLStyle_put_textDecorationNone(style, VARIANT_TRUE); + ok(hres == S_OK, "put_textDecorationNone failed: %08x\n", hres); + ok(b == VARIANT_FALSE, "textDecorationNone = %x\n", b); + + hres = IHTMLStyle_get_textDecorationNone(style, &b); + ok(hres == S_OK, "get_textDecorationNone failed: %08x\n", hres); + ok(b == VARIANT_TRUE, "textDecorationNone = %x\n", b); + + hres = IHTMLStyle_put_textDecorationNone(style, VARIANT_FALSE); + ok(hres == S_OK, "put_textDecorationNone failed: %08x\n", hres); + hres = IHTMLStyle_get_posWidth(style, NULL); ok(hres == E_POINTER, "get_posWidth failed: %08x\n", hres); -- 2.11.4.GIT