Jacek Caban : mshtml: Added IHTMLCSSStyleDeclaration:: backgroundClip property implementation.
Alexandre Julliard
julliard at winehq.org
Thu Sep 6 15:51:51 CDT 2018
Module: wine
Branch: master
Commit: 6ebfbcc6872c4099f75d210b661ef5f653b47d15
URL: https://source.winehq.org/git/wine.git/?a=commit;h=6ebfbcc6872c4099f75d210b661ef5f653b47d15
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Sep 6 16:15:04 2018 +0200
mshtml: Added IHTMLCSSStyleDeclaration::backgroundClip property implementation.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mshtml/htmlstyle.c | 13 ++++++++-----
dlls/mshtml/htmlstyle.h | 1 +
dlls/mshtml/tests/style.c | 23 +++++++++++++++++++++++
3 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 2454d86..6f59250 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -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;
}
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 9fb96f2..1a83d4f 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -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,
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index 8c6ad20..309ca40 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -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);
}
More information about the wine-cvs
mailing list