mshtml: Implement IHTMLStyle get/put backgroundPositionX.

This commit is contained in:
Alistair Leslie-Hughes 2009-03-05 20:24:24 +11:00 committed by Alexandre Julliard
parent 48cbc036a3
commit 6937ddca8e
3 changed files with 27 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 attrBackgroundPositionX[] =
{'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',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[] =
@ -119,6 +121,7 @@ static const struct{
{attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
{attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
{attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
{attrBackgroundPositionX, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX},
{attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
{attrBorder, DISPID_IHTMLSTYLE_BORDER},
{attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
@ -874,15 +877,15 @@ static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *
static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(v%d)\n", This, V_VT(&v));
return E_NOTIMPL;
TRACE("(%p)->(v%d)\n", This, V_VT(&v));
return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_X, &v, 0);
}
static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_X, p, 0);
}
static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)

View File

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

View File

@ -3429,6 +3429,25 @@ static void test_default_style(IHTMLStyle *style)
ok(hres == S_OK, "put_borderLeft failed: %08x\n", hres);
SysFreeString(sDefault);
/* backgroundPositionX */
hres = IHTMLStyle_get_backgroundPositionX(style, &vDefault);
ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("10px");
hres = IHTMLStyle_put_backgroundPositionX(style, v);
ok(hres == S_OK, "put_backgroundPositionX failed: %08x\n", hres);
VariantClear(&v);
hres = IHTMLStyle_get_backgroundPositionX(style, &v);
ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
VariantClear(&v);
hres = IHTMLStyle_put_backgroundPositionX(style, vDefault);
ok(hres == S_OK, "put_backgroundPositionX failed: %08x\n", hres);
VariantClear(&vDefault);
hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2);
ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres);
if(SUCCEEDED(hres)) {