Re: mshtml: Implement IHTMLStyle4 get/put textOverflow
Forget this patch, missed the todo_wine "Alistair Leslie-Hughes" <leslie_alistair(a)hotmail.com> wrote in message news:4A7AA9A2.9060301(a)hotmail.com...
Hi,
Changelog: mshtml: Implement IHTMLStyle4 get/put textOverflow
Best Regards Alistair Leslie-Hughes
--------------------------------------------------------------------------------
From 4f121dd9918252af3f1a46eeb1c1826a4830d0a8 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed, 18 Feb 2009 22:43:39 +1100 Subject: [PATCH] Implement IHTMLStyle4 get/put textOverflow To: wine-patches <wine-patches(a)winehq.org>
--- dlls/mshtml/htmlstyle.c | 3 +++ dlls/mshtml/htmlstyle.h | 1 + dlls/mshtml/htmlstyle3.c | 18 ++++++++++++++---- dlls/mshtml/tests/dom.c | 30 ++++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index f036077..82ddf58 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -111,6 +111,8 @@ static const WCHAR attrTextAlign[] = {'t','e','x','t','-','a','l','i','g','n',0}; static const WCHAR attrTextDecoration[] = {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0}; +static const WCHAR attrTextOverflow[] = + {'t','e','x','t','-','o','v','e','r','f','l','o','w',0}; static const WCHAR attrTop[] = {'t','o','p',0}; static const WCHAR attrVerticalAlign[] = @@ -166,6 +168,7 @@ static const struct{ {attrPosition, DISPID_IHTMLSTYLE2_POSITION}, {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN}, {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION}, + {attrTextOverflow, DISPID_IHTMLSTYLE4_TEXTOVERFLOW}, {attrTop, DISPID_IHTMLSTYLE_TOP}, {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN}, {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY}, diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index 307824e..b6bdcab 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -73,6 +73,7 @@ typedef enum { STYLEID_POSITION, STYLEID_TEXT_ALIGN, STYLEID_TEXT_DECORATION, + STYLEID_TEXT_OVERFLOW, STYLEID_TOP, STYLEID_VERTICAL_ALIGN, STYLEID_VISIBILITY, diff --git a/dlls/mshtml/htmlstyle3.c b/dlls/mshtml/htmlstyle3.c index 505e91e..84b914b 100644 --- a/dlls/mshtml/htmlstyle3.c +++ b/dlls/mshtml/htmlstyle3.c @@ -399,15 +399,25 @@ static HRESULT WINAPI HTMLStyle4_Invoke(IHTMLStyle4 *iface, DISPID dispIdMember, static HRESULT WINAPI HTMLStyle4_put_textOverflow(IHTMLStyle4 *iface, BSTR v) { HTMLStyle *This = HTMLSTYLE4_THIS(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + static const WCHAR styleEllipsis[] = {'e','l','l','i','p','s','i','s',0}; + static const WCHAR styleClip[] = {'c','l','i','p',0}; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + /* textOverflow can only be one of the following */ + if(!v || strcmpiW(styleEllipsis, v) == 0 || strcmpiW(styleClip, v) == 0) + { + return set_nsstyle_attr(This->nsstyle, STYLEID_TEXT_OVERFLOW, v, 0); + } + + return E_INVALIDARG; }
static HRESULT WINAPI HTMLStyle4_get_textOverflow(IHTMLStyle4 *iface, BSTR *p) { HTMLStyle *This = HTMLSTYLE4_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, p); + return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_OVERFLOW, p); }
static HRESULT WINAPI HTMLStyle4_put_minHeight(IHTMLStyle4 *iface, VARIANT v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 4846848..1d283e4 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2654,6 +2654,8 @@ static void test_style4(IHTMLStyle4 *style4) HRESULT hres; VARIANT v; VARIANT vdefault; + BSTR sdefault; + BSTR str;
hres = IHTMLStyle4_get_minHeight(style4, &vdefault); ok(hres == S_OK, "get_minHeight failed: %08x\n", hres); @@ -2672,6 +2674,34 @@ static void test_style4(IHTMLStyle4 *style4) hres = IHTMLStyle4_put_minHeight(style4, vdefault); ok(hres == S_OK, "put_minHeight failed: %08x\n", hres); VariantClear(&vdefault); + + /* textOverflow */ + hres = IHTMLStyle4_get_textOverflow(style4, &sdefault); + ok(hres == S_OK, "get_minHeight failed: %08x\n", hres); + + str = a2bstr("invalid"); + hres = IHTMLStyle4_put_textOverflow(style4, str); + ok(hres == E_INVALIDARG, "put_textOverflow passed: %08x\n", hres); + SysFreeString(str); + + str = a2bstr("ellipsis"); + hres = IHTMLStyle4_put_textOverflow(style4, str); + ok(hres == S_OK, "put_textOverflow failed: %08x\n", hres); + SysFreeString(str); + + str = a2bstr("clip"); + hres = IHTMLStyle4_put_textOverflow(style4, str); + ok(hres == S_OK, "put_textOverflow failed: %08x\n", hres); + SysFreeString(str); + + hres = IHTMLStyle4_get_textOverflow(style4, &str); + ok(hres == S_OK, "get_textOverflow failed: %08x\n", hres); + todo_wine ok( !strcmp_wa(str, "clip"), "expect clip got (%s)\n", dbgstr_w(str)); + SysFreeString(str); + + hres = IHTMLStyle4_put_textOverflow(style4, sdefault); + ok(hres == S_OK, "put_textOverflow failed: %08x\n", hres); + SysFreeString(sdefault); }
static void test_default_style(IHTMLStyle *style) -- 1.5.4.3
--------------------------------------------------------------------------------
participants (1)
-
Alistair Leslie-Hughes