[PATCH] mshtml: Added IHTMLCSSStyleDeclaration::backgroundSize property implementation.

Hans Leidekker hans at codeweavers.com
Fri Apr 29 07:53:35 CDT 2022


Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/mshtml/htmlstyle.c   | 13 +++++++++----
 dlls/mshtml/htmlstyle.h   |  1 +
 dlls/mshtml/tests/style.c | 16 ++++++++++++++++
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 11a66369c39..44ac21c5f97 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -181,6 +181,11 @@ static const style_tbl_entry_t style_tbl[] = {
         DISPID_A_BACKGROUNDREPEAT,
         0, background_repeat_values
     },
+    {
+        L"background-size",
+        DISPID_IHTMLCSSSTYLEDECLARATION_BACKGROUNDSIZE,
+        DISPID_A_IE9_BACKGROUNDSIZE,
+    },
     {
         L"border",
         DISPID_IHTMLCSSSTYLEDECLARATION_BORDER,
@@ -7628,15 +7633,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_backgroundOrigin(IHTMLCSSStyle
 static HRESULT WINAPI HTMLCSSStyleDeclaration_put_backgroundSize(IHTMLCSSStyleDeclaration *iface, BSTR v)
 {
     CSSStyle *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_SIZE, v);
 }
 
 static HRESULT WINAPI HTMLCSSStyleDeclaration_get_backgroundSize(IHTMLCSSStyleDeclaration *iface, BSTR *p)
 {
     CSSStyle *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_SIZE, p);
 }
 
 static HRESULT WINAPI HTMLCSSStyleDeclaration_put_boxShadow(IHTMLCSSStyleDeclaration *iface, BSTR v)
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 25f87c802b2..e14c1274360 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -55,6 +55,7 @@ typedef enum {
     STYLEID_BACKGROUND_POSITION_X,
     STYLEID_BACKGROUND_POSITION_Y,
     STYLEID_BACKGROUND_REPEAT,
+    STYLEID_BACKGROUND_SIZE,
     STYLEID_BORDER,
     STYLEID_BORDER_BOTTOM,
     STYLEID_BORDER_BOTTOM_COLOR,
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index bc9afda7617..4b72d144354 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -793,6 +793,22 @@ static void test_css_style_declaration(IHTMLCSSStyleDeclaration *css_style)
     ok(!lstrcmpW(str, L"border-box"), "backgroundClip = %s\n", wine_dbgstr_w(str));
     SysFreeString(str);
 
+    str = (BSTR)0xdeadbeef;
+    hres = IHTMLCSSStyleDeclaration_get_backgroundSize(css_style, &str);
+    ok(hres == S_OK, "get_backgroundSize failed: %08lx\n", hres);
+    ok(str == NULL, "got %s\n", wine_dbgstr_w(str));
+    SysFreeString(str);
+
+    str = SysAllocString(L"100% 100%");
+    hres = IHTMLCSSStyleDeclaration_put_backgroundSize(css_style, str);
+    ok(hres == S_OK, "put_backgroundSize failed: %08lx\n", hres);
+    SysFreeString(str);
+
+    hres = IHTMLCSSStyleDeclaration_get_backgroundSize(css_style, &str);
+    ok(hres == S_OK, "get_backgroundSize failed: %08lx\n", hres);
+    ok(!lstrcmpW(str, L"100% 100%"), "backgroundSize = %s\n", wine_dbgstr_w(str));
+    SysFreeString(str);
+
     hres = IHTMLCSSStyleDeclaration_get_opacity(css_style, &v);
     ok(hres == S_OK, "get_opacity failed: %08lx\n", hres);
     test_var_bstr(&v, NULL);
-- 
2.30.2




More information about the wine-devel mailing list