mshtml: Implement IHTMLStyle get/put backgroundRepeat.

This commit is contained in:
Alistair Leslie-Hughes 2009-02-25 15:50:33 +11:00 committed by Alexandre Julliard
parent e3009fec39
commit 63c8939cdd
3 changed files with 61 additions and 4 deletions

View File

@ -41,6 +41,8 @@ static const WCHAR attrBackgroundColor[] =
{'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
static const WCHAR attrBackgroundImage[] =
{'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
static const WCHAR attrBackgroundRepeat[] =
{'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
static const WCHAR attrBorder[] =
{'b','o','r','d','e','r',0};
static const WCHAR attrBorderBottomStyle[] =
@ -113,6 +115,7 @@ static const struct{
{attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
{attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
{attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
{attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
{attrBorder, DISPID_IHTMLSTYLE_BORDER},
{attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
{attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
@ -803,15 +806,30 @@ static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
static const WCHAR styleRepeat[] = {'r','e','p','e','a','t',0};
static const WCHAR styleNoRepeat[] = {'n','o','-','r','e','p','e','a','t',0};
static const WCHAR styleRepeatX[] = {'r','e','p','e','a','t','-','x',0};
static const WCHAR styleRepeatY[] = {'r','e','p','e','a','t','-','y',0};
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
/* fontWeight can only be one of the following */
if(!v || strcmpiW(styleRepeat, v) == 0 || strcmpiW(styleNoRepeat, v) == 0 ||
strcmpiW(styleRepeatX, v) == 0 || strcmpiW(styleRepeatY, v) == 0 )
{
return set_style_attr(This, STYLEID_BACKGROUND_REPEAT , v, 0);
}
return E_INVALIDARG;
}
static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(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_BACKGROUND_REPEAT, p);
}
static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)

View File

@ -38,6 +38,7 @@ typedef enum {
STYLEID_BACKGROUND,
STYLEID_BACKGROUND_COLOR,
STYLEID_BACKGROUND_IMAGE,
STYLEID_BACKGROUND_REPEAT,
STYLEID_BORDER,
STYLEID_BORDER_BOTTOM_STYLE,
STYLEID_BORDER_LEFT,

View File

@ -3184,6 +3184,44 @@ static void test_default_style(IHTMLStyle *style)
hres = IHTMLStyle_put_paddingLeft(style, vDefault);
ok(hres == S_OK, "get_paddingLeft: %08x\n", hres);
/* BackgroundRepeat */
hres = IHTMLStyle_get_backgroundRepeat(style, &sDefault);
ok(hres == S_OK, "get_backgroundRepeat failed: %08x\n", hres);
str = a2bstr("invalid");
hres = IHTMLStyle_put_backgroundRepeat(style, str);
ok(hres == E_INVALIDARG, "put_backgroundRepeat failed: %08x\n", hres);
SysFreeString(str);
str = a2bstr("repeat");
hres = IHTMLStyle_put_backgroundRepeat(style, str);
ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
SysFreeString(str);
str = a2bstr("no-repeat");
hres = IHTMLStyle_put_backgroundRepeat(style, str);
ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
SysFreeString(str);
str = a2bstr("repeat-x");
hres = IHTMLStyle_put_backgroundRepeat(style, str);
ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
SysFreeString(str);
str = a2bstr("repeat-y");
hres = IHTMLStyle_put_backgroundRepeat(style, str);
ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
SysFreeString(str);
hres = IHTMLStyle_get_backgroundRepeat(style, &str);
ok(hres == S_OK, "get_backgroundRepeat failed: %08x\n", hres);
ok(!strcmp_wa(str, "repeat-y"), "str=%s\n", dbgstr_w(str));
SysFreeString(str);
hres = IHTMLStyle_put_backgroundRepeat(style, sDefault);
ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
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)) {