diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 6a225a6bffc..f036077f642 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -119,6 +119,8 @@ static const WCHAR attrVisibility[] = {'v','i','s','i','b','i','l','i','t','y',0}; static const WCHAR attrWidth[] = {'w','i','d','t','h',0}; +static const WCHAR attrWordWrap[] = + {'w','o','r','d','-','w','r','a','p',0}; static const WCHAR attrZIndex[] = {'z','-','i','n','d','e','x',0}; @@ -168,6 +170,7 @@ static const struct{ {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN}, {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY}, {attrWidth, DISPID_IHTMLSTYLE_WIDTH}, + {attrWordWrap, DISPID_IHTMLSTYLE3_WORDWRAP}, {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX} }; diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index 596f5793f31..307824e5c5d 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -77,6 +77,7 @@ typedef enum { STYLEID_VERTICAL_ALIGN, STYLEID_VISIBILITY, STYLEID_WIDTH, + STYLEID_WORD_WRAP, STYLEID_Z_INDEX } styleid_t; diff --git a/dlls/mshtml/htmlstyle3.c b/dlls/mshtml/htmlstyle3.c index ce1d56e197d..505e91e01d1 100644 --- a/dlls/mshtml/htmlstyle3.c +++ b/dlls/mshtml/htmlstyle3.c @@ -117,15 +117,19 @@ static HRESULT WINAPI HTMLStyle3_get_zoom(IHTMLStyle3 *iface, VARIANT *p) static HRESULT WINAPI HTMLStyle3_put_wordWrap(IHTMLStyle3 *iface, BSTR v) { HTMLStyle *This = HTMLSTYLE3_THIS(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + return set_nsstyle_attr(This->nsstyle, STYLEID_WORD_WRAP, v, 0); } static HRESULT WINAPI HTMLStyle3_get_wordWrap(IHTMLStyle3 *iface, BSTR *p) { HTMLStyle *This = HTMLSTYLE3_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_nsstyle_attr(This->nsstyle, STYLEID_WORD_WRAP, p); } static HRESULT WINAPI HTMLStyle3_put_textUnderlinePosition(IHTMLStyle3 *iface, BSTR v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index a153a1456a3..97102db02dd 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2627,6 +2627,28 @@ static void test_style2(IHTMLStyle2 *style2) SysFreeString(str); } +static void test_style3(IHTMLStyle3 *style3) +{ + BSTR str; + HRESULT hres; + + str = (void*)0xdeadbeef; + hres = IHTMLStyle3_get_wordWrap(style3, &str); + ok(hres == S_OK, "get_wordWrap failed: %08x\n", hres); + ok(!str, "str != NULL\n"); + + str = a2bstr("break-word"); + hres = IHTMLStyle3_put_wordWrap(style3, str); + ok(hres == S_OK, "put_wordWrap failed: %08x\n", hres); + SysFreeString(str); + + str = NULL; + hres = IHTMLStyle3_get_wordWrap(style3, &str); + ok(hres == S_OK, "get_wordWrap failed: %08x\n", hres); + ok(!strcmp_wa(str, "break-word"), "get_wordWrap returned %s\n", dbgstr_w(str)); + SysFreeString(str); +} + static void test_style4(IHTMLStyle4 *style4) { HRESULT hres; @@ -2655,6 +2677,7 @@ static void test_style4(IHTMLStyle4 *style4) static void test_default_style(IHTMLStyle *style) { IHTMLStyle2 *style2; + IHTMLStyle3 *style3; IHTMLStyle4 *style4; VARIANT_BOOL b; VARIANT v; @@ -3637,6 +3660,13 @@ static void test_default_style(IHTMLStyle *style) IHTMLStyle2_Release(style2); } + hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle3, (void**)&style3); + ok(hres == S_OK, "Could not get IHTMLStyle3 iface: %08x\n", hres); + if(SUCCEEDED(hres)) { + test_style3(style3); + IHTMLStyle3_Release(style3); + } + hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle4, (void**)&style4); ok(hres == S_OK, "Could not get IHTMLStyle4 iface: %08x\n", hres); if(SUCCEEDED(hres)) {