From 20108162408c7cf571e6424b35b573bb1a098dfb Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 24 Mar 2014 13:47:56 +0100 Subject: [PATCH] mshtml: Added IHTMLStyle::listStyleType property implementation. --- dlls/mshtml/htmlstyle.c | 15 +++++++++++---- dlls/mshtml/htmlstyle.h | 1 + dlls/mshtml/tests/style.c | 16 ++++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index c85e4dbdbe4..d2d2fc88baf 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -126,6 +126,8 @@ static const WCHAR attrLetterSpacing[] = {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0}; static const WCHAR attrLineHeight[] = {'l','i','n','e','-','h','e','i','g','h','t',0}; +static const WCHAR attrListStyleType[] = + {'l','i','s','t','-','s','t','y','l','e','-','t','y','p','e',0}; static const WCHAR attrMargin[] = {'m','a','r','g','i','n',0}; static const WCHAR attrMarginBottom[] = @@ -241,6 +243,7 @@ static const style_tbl_entry_t style_tbl[] = { {attrLeft, DISPID_IHTMLSTYLE_LEFT}, {attrLetterSpacing, DISPID_IHTMLSTYLE_LETTERSPACING}, {attrLineHeight, DISPID_IHTMLSTYLE_LINEHEIGHT}, + {attrListStyleType, DISPID_IHTMLSTYLE_LISTSTYLETYPE}, {attrMargin, DISPID_IHTMLSTYLE_MARGIN}, {attrMarginBottom, DISPID_IHTMLSTYLE_MARGINBOTTOM}, {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT}, @@ -2168,15 +2171,19 @@ static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p) static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + return set_style_attr(This, STYLEID_LISTSTYLETYPE, v, 0); } static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_style_attr(This, STYLEID_LISTSTYLETYPE, p); } static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v) diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index 92940156318..030d8a1026c 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -78,6 +78,7 @@ typedef enum { STYLEID_LEFT, STYLEID_LETTER_SPACING, STYLEID_LINE_HEIGHT, + STYLEID_LISTSTYLETYPE, STYLEID_MARGIN, STYLEID_MARGIN_BOTTOM, STYLEID_MARGIN_LEFT, diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c index 2df585ad362..3c68f613c89 100644 --- a/dlls/mshtml/tests/style.c +++ b/dlls/mshtml/tests/style.c @@ -2092,6 +2092,22 @@ static void test_body_style(IHTMLStyle *style) ok(!strcmp_wa(str, "nowrap"), "whiteSpace = %s\n", wine_dbgstr_w(str)); SysFreeString(str); + /* listStyleType */ + hres = IHTMLStyle_get_listStyleType(style, &str); + ok(hres == S_OK, "get_listStyleType failed: %08x\n", hres); + ok(!str, "listStyleType = %s\n", wine_dbgstr_w(str)); + + str = a2bstr("square"); + hres = IHTMLStyle_put_listStyleType(style, str); + ok(hres == S_OK, "put_listStyleType failed: %08x\n", hres); + SysFreeString(str); + + str = NULL; + hres = IHTMLStyle_get_listStyleType(style, &str); + ok(hres == S_OK, "get_listStyleType failed: %08x\n", hres); + ok(!strcmp_wa(str, "square"), "listStyleType = %s\n", wine_dbgstr_w(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)) {