From 158471960460a969e3bef42387815d53893cdda7 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 13 Jan 2009 18:40:01 +1100 Subject: [PATCH] mshtml: Implement IHTMLStyle get/put borderTopStyle. --- dlls/mshtml/htmlstyle.c | 15 +++++++++++---- dlls/mshtml/htmlstyle.h | 1 + dlls/mshtml/tests/dom.c | 4 ++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index a33bd002bec..f252c703648 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -51,6 +51,8 @@ static const WCHAR attrBorderLeftStyle[] = {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0}; static const WCHAR attrBorderRightStyle[] = {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0}; +static const WCHAR attrBorderTopStyle[] = + {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0}; static const WCHAR attrBorderWidth[] = {'b','o','r','d','e','r','-','w','i','d','t','h',0}; static const WCHAR attrColor[] = @@ -114,6 +116,7 @@ static const struct{ {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT}, {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE}, {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE}, + {attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE}, {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH}, {attrColor, DISPID_IHTMLSTYLE_COLOR}, {attrCursor, DISPID_IHTMLSTYLE_CURSOR}, @@ -1466,15 +1469,19 @@ static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p) static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + if(!is_valid_border_style(v)) + return E_INVALIDARG; + + return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0); } static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, p); + return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p); } static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v) diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index efcdff5d46f..b5433803cf7 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -39,6 +39,7 @@ typedef enum { STYLEID_BORDER_LEFT, STYLEID_BORDER_LEFT_STYLE, STYLEID_BORDER_RIGHT_STYLE, + STYLEID_BORDER_TOP_STYLE, STYLEID_BORDER_WIDTH, STYLEID_COLOR, STYLEID_CURSOR, diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 56483ba4c0c..777c425877f 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2900,6 +2900,10 @@ static void test_default_style(IHTMLStyle *style) test_border_styles(style, str); SysFreeString(str); + str = a2bstr("bordertopstyle"); + test_border_styles(style, str); + SysFreeString(str); + hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2); ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres); if(SUCCEEDED(hres)) {