mshtml: Added IHTMLCSSStyleDeclaration::backgroundClip property implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-09-06 16:15:04 +02:00 committed by Alexandre Julliard
parent db2d831600
commit 6ebfbcc687
3 changed files with 32 additions and 5 deletions

View File

@ -39,6 +39,8 @@ static const WCHAR backgroundW[] =
{'b','a','c','k','g','r','o','u','n','d',0};
static const WCHAR background_attachmentW[] =
{'b','a','c','k','g','r','o','u','n','d','-','a','t','t','a','c','h','m','e','n','t',0};
static const WCHAR background_clipW[] =
{'b','a','c','k','g','r','o','u','n','d','-','c','l','i','p',0};
static const WCHAR background_colorW[] =
{'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
static const WCHAR background_imageW[] =
@ -333,6 +335,7 @@ typedef struct {
static const style_tbl_entry_t style_tbl[] = {
{backgroundW, DISPID_IHTMLSTYLE_BACKGROUND},
{background_attachmentW, DISPID_IHTMLSTYLE_BACKGROUNDATTACHMENT},
{background_clipW, DISPID_UNKNOWN},
{background_colorW, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR, ATTR_HEX_INT},
{background_imageW, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE, ATTR_FIX_URL},
{background_positionW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION},
@ -7290,15 +7293,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_cssFloat(IHTMLCSSStyleDeclarat
static HRESULT WINAPI HTMLCSSStyleDeclaration_put_backgroundClip(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_BACKGROUND_CLIP, v);
}
static HRESULT WINAPI HTMLCSSStyleDeclaration_get_backgroundClip(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_BACKGROUND_CLIP, p);
}
static HRESULT WINAPI HTMLCSSStyleDeclaration_put_backgroundOrigin(IHTMLCSSStyleDeclaration *iface, BSTR v)
@ -7760,7 +7763,7 @@ static HRESULT HTMLStyle_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags,
const style_tbl_entry_t *style_entry;
style_entry = lookup_style_tbl(name);
if(style_entry) {
if(style_entry && style_entry->dispid != DISPID_UNKNOWN) {
*dispid = style_entry->dispid;
return S_OK;
}

View File

@ -36,6 +36,7 @@ struct HTMLStyle {
typedef enum {
STYLEID_BACKGROUND,
STYLEID_BACKGROUND_ATTACHMENT,
STYLEID_BACKGROUND_CLIP,
STYLEID_BACKGROUND_COLOR,
STYLEID_BACKGROUND_IMAGE,
STYLEID_BACKGROUND_POSITION,

View File

@ -736,6 +736,26 @@ static void test_style6(IHTMLStyle6 *style)
SysFreeString(str);
}
static void test_css_style_declaration(IHTMLCSSStyleDeclaration *css_style)
{
BSTR str;
HRESULT hres;
hres = IHTMLCSSStyleDeclaration_get_backgroundClip(css_style, &str);
ok(hres == S_OK, "get_backgroundClip failed: %08x\n", hres);
ok(!str, "backgroundClip = %s\n", wine_dbgstr_w(str));
str = a2bstr("border-box");
hres = IHTMLCSSStyleDeclaration_put_backgroundClip(css_style, str);
ok(hres == S_OK, "put_backgroundClip failed: %08x\n", hres);
SysFreeString(str);
hres = IHTMLCSSStyleDeclaration_get_backgroundClip(css_style, &str);
ok(hres == S_OK, "get_backgroundClip failed: %08x\n", hres);
ok(!strcmp_wa(str, "border-box"), "backgroundClip = %s\n", wine_dbgstr_w(str));
SysFreeString(str);
}
static void test_body_style(IHTMLStyle *style)
{
IHTMLCSSStyleDeclaration *css_style;
@ -2817,6 +2837,9 @@ static void test_body_style(IHTMLStyle *style)
win_skip("IHTMLStyle6 not available\n");
}
if(compat_mode >= COMPAT_IE9)
test_css_style_declaration(css_style);
if(css_style)
IHTMLCSSStyleDeclaration_Release(css_style);
}