Module: wine Branch: master Commit: 957a1f0216995c14c3a3fe737358578a506af707 URL: https://source.winehq.org/git/wine.git/?a=commit;h=957a1f0216995c14c3a3fe737...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Feb 7 18:32:22 2019 +0100
mshtml: Add style.borderCollapse property implementation.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/mshtml/htmlstyle.c | 27 +++++++++++++++++++-------- dlls/mshtml/htmlstyle.h | 1 + dlls/mshtml/tests/style.c | 16 ++++++++++++++++ 3 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 7b82349..d260db1 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -63,6 +63,8 @@ static const WCHAR border_bottom_styleW[] = {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0}; static const WCHAR border_bottom_widthW[] = {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0}; +static const WCHAR border_collapseW[] = + {'b','o','r','d','e','r','-','c','o','l','l','a','p','s','e',0}; static const WCHAR border_colorW[] = {'b','o','r','d','e','r','-','c','o','l','o','r',0}; static const WCHAR border_leftW[] = @@ -416,6 +418,11 @@ static const style_tbl_entry_t style_tbl[] = { ATTR_FIX_PX }, { + border_collapseW, + DISPID_IHTMLCSSSTYLEDECLARATION_BORDERCOLLAPSE, + DISPID_IHTMLSTYLE2_BORDERCOLLAPSE + }, + { border_colorW, DISPID_IHTMLCSSSTYLEDECLARATION_BORDERCOLOR, DISPID_IHTMLSTYLE_BORDERCOLOR @@ -3629,15 +3636,19 @@ static HRESULT WINAPI HTMLStyle2_get_tableLayout(IHTMLStyle2 *iface, BSTR *p) static HRESULT WINAPI HTMLStyle2_put_borderCollapse(IHTMLStyle2 *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle2(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + return set_style_property(This, STYLEID_BORDER_COLLAPSE, v); }
static HRESULT WINAPI HTMLStyle2_get_borderCollapse(IHTMLStyle2 *iface, BSTR *p) { HTMLStyle *This = impl_from_IHTMLStyle2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_style_property(This, STYLEID_BORDER_COLLAPSE, p); }
static HRESULT WINAPI HTMLStyle2_put_direction(IHTMLStyle2 *iface, BSTR v) @@ -6258,15 +6269,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_tableLayout(IHTMLCSSStyleDecla static HRESULT WINAPI HTMLCSSStyleDeclaration_put_borderCollapse(IHTMLCSSStyleDeclaration *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + return set_style_property(This, STYLEID_BORDER_COLLAPSE, v); }
static HRESULT WINAPI HTMLCSSStyleDeclaration_get_borderCollapse(IHTMLCSSStyleDeclaration *iface, BSTR *p) { HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, p); + return get_style_property(This, STYLEID_BORDER_COLLAPSE, p); }
static HRESULT WINAPI HTMLCSSStyleDeclaration_put_direction(IHTMLCSSStyleDeclaration *iface, BSTR v) diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index 8cc1b3b..971a3dc 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -49,6 +49,7 @@ typedef enum { STYLEID_BORDER_BOTTOM_COLOR, STYLEID_BORDER_BOTTOM_STYLE, STYLEID_BORDER_BOTTOM_WIDTH, + STYLEID_BORDER_COLLAPSE, STYLEID_BORDER_COLOR, STYLEID_BORDER_LEFT, STYLEID_BORDER_LEFT_COLOR, diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c index ae3b2a4..44e4c83 100644 --- a/dlls/mshtml/tests/style.c +++ b/dlls/mshtml/tests/style.c @@ -516,6 +516,22 @@ static void test_style2(IHTMLStyle2 *style2) ok(hres == S_OK, "get_tableLayout failed: %08x\n", hres); ok(!strcmp_wa(str, "fixed"), "tableLayout = %s\n", wine_dbgstr_w(str)); SysFreeString(str); + + /* borderCollapse */ + str = (void*)0xdeadbeef; + hres = IHTMLStyle2_get_borderCollapse(style2, &str); + ok(hres == S_OK, "get_borderCollapse failed: %08x\n", hres); + ok(!str, "borderCollapse = %s\n", wine_dbgstr_w(str)); + + str = a2bstr("separate"); + hres = IHTMLStyle2_put_borderCollapse(style2, str); + ok(hres == S_OK, "put_borderCollapse failed: %08x\n", hres); + SysFreeString(str); + + hres = IHTMLStyle2_get_borderCollapse(style2, &str); + ok(hres == S_OK, "get_borderCollapse failed: %08x\n", hres); + ok(!strcmp_wa(str, "separate"), "borderCollapse = %s\n", wine_dbgstr_w(str)); + SysFreeString(str); }
static void test_style3(IHTMLStyle3 *style3, IHTMLCSSStyleDeclaration *css_style)