diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 293ddf0fd88..14de76461f8 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -158,6 +158,8 @@ static const WCHAR szNormal[] = {'n','o','r','m','a','l',0}; static const WCHAR styleNone[] = {'n','o','n','e',0}; +static const WCHAR valOverline[] = + {'o','v','e','r','l','i','n','e',0}; static const WCHAR px_formatW[] = {'%','d','p','x',0}; static const WCHAR emptyW[] = {0}; @@ -972,15 +974,19 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, V static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(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 ? valOverline : emptyW, 0); } static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(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, valOverline, p); } static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 86c25b0ac0a..bf37cfc6d3f 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2766,6 +2766,22 @@ static void test_default_style(IHTMLStyle *style) hres = IHTMLStyle_put_textDecorationNone(style, VARIANT_FALSE); ok(hres == S_OK, "put_textDecorationNone failed: %08x\n", hres); + b = 0xfefe; + hres = IHTMLStyle_get_textDecorationOverline(style, &b); + ok(hres == S_OK, "get_textDecorationOverline failed: %08x\n", hres); + ok(b == VARIANT_FALSE, "textDecorationOverline = %x\n", b); + + hres = IHTMLStyle_put_textDecorationOverline(style, VARIANT_TRUE); + ok(hres == S_OK, "put_textDecorationOverline failed: %08x\n", hres); + ok(b == VARIANT_FALSE, "textDecorationOverline = %x\n", b); + + hres = IHTMLStyle_get_textDecorationOverline(style, &b); + ok(hres == S_OK, "get_textDecorationOverline failed: %08x\n", hres); + ok(b == VARIANT_TRUE, "textDecorationOverline = %x\n", b); + + hres = IHTMLStyle_put_textDecorationOverline(style, VARIANT_FALSE); + ok(hres == S_OK, "put_textDecorationOverline failed: %08x\n", hres); + hres = IHTMLStyle_get_posWidth(style, NULL); ok(hres == E_POINTER, "get_posWidth failed: %08x\n", hres);