Jacek Caban : mshtml: Add IHTMLCSSStyleDeclaration2::columnCount property semi-stub implementation.

Alexandre Julliard julliard at winehq.org
Tue Jun 9 15:27:48 CDT 2020


Module: wine
Branch: master
Commit: 06db253e7596a7f4227d5f7e1950cdf353e00779
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=06db253e7596a7f4227d5f7e1950cdf353e00779

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Jun  9 16:15:44 2020 +0200

mshtml: Add IHTMLCSSStyleDeclaration2::columnCount property semi-stub 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 | 34 +++++++++++++++++++++++++++++++++-
 3 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index af6a0ce458..348eacc7e0 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -548,6 +548,11 @@ static const style_tbl_entry_t style_tbl[] = {
         DISPID_A_COLOR,
         ATTR_HEX_INT
     },
+    {
+        L"column-count",
+        DISPID_IHTMLCSSSTYLEDECLARATION2_COLUMNCOUNT,
+        DISPID_UNKNOWN
+    },
     {
         cursorW,
         DISPID_IHTMLCSSSTYLEDECLARATION_CURSOR,
@@ -8794,15 +8799,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration2_get_colorInterpolationFilters(IHT
 static HRESULT WINAPI HTMLCSSStyleDeclaration2_put_columnCount(IHTMLCSSStyleDeclaration2 *iface, VARIANT v)
 {
     CSSStyle *This = impl_from_IHTMLCSSStyleDeclaration2(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
+    WARN("(%p)->(%s) semi-stub\n", This, debugstr_variant(&v));
+    return set_style_property_var(This, STYLEID_COLUMN_COUNT, &v);
 }
 
 static HRESULT WINAPI HTMLCSSStyleDeclaration2_get_columnCount(IHTMLCSSStyleDeclaration2 *iface, VARIANT *p)
 {
     CSSStyle *This = impl_from_IHTMLCSSStyleDeclaration2(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    WARN("(%p)->(%p) semi-stub\n", This, p);
+    return get_style_property_var(This, STYLEID_COLUMN_COUNT, p);
 }
 
 static HRESULT WINAPI HTMLCSSStyleDeclaration2_put_columnWidth(IHTMLCSSStyleDeclaration2 *iface, VARIANT v)
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 662227cd99..25dc12b69f 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -81,6 +81,7 @@ typedef enum {
     STYLEID_CLEAR,
     STYLEID_CLIP,
     STYLEID_COLOR,
+    STYLEID_COLUMN_COUNT,
     STYLEID_CURSOR,
     STYLEID_DIRECTION,
     STYLEID_DISPLAY,
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index e8771838f4..1b481354fc 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -19,7 +19,6 @@
 #define COBJMACROS
 #define CONST_VTABLE
 
-#include <wine/test.h>
 #include <stdarg.h>
 #include <stdio.h>
 
@@ -29,6 +28,7 @@
 #include "mshtml.h"
 #include "mshtmhst.h"
 #include "docobj.h"
+#include "wine/test.h"
 
 static BOOL is_ie9plus;
 
@@ -831,6 +831,7 @@ static void test_css_style_declaration(IHTMLCSSStyleDeclaration *css_style)
 
 static void test_css_style_declaration2(IHTMLCSSStyleDeclaration2 *css_style)
 {
+    VARIANT v;
     BSTR str;
     HRESULT hres;
 
@@ -889,6 +890,37 @@ static void test_css_style_declaration2(IHTMLCSSStyleDeclaration2 *css_style)
     ok(hres == S_OK, "get_transition failed: %08x\n", hres);
     ok(!wcsncmp(str, L"marigin-right 1s", wcslen(L"marigin-right 1s")), "transition = %s\n", wine_dbgstr_w(str));
     SysFreeString(str);
+
+    V_VT(&v) = VT_ERROR;
+    hres = IHTMLCSSStyleDeclaration2_get_columnCount(css_style, &v);
+    ok(hres == S_OK, "get_columnCount failed: %08x\n", hres);
+    ok(V_VT(&v) == VT_BSTR && !V_BSTR(&v), "columnCount = %s\n", wine_dbgstr_variant(&v));
+    VariantClear(&v);
+
+    V_VT(&v) = VT_I4;
+    V_I4(&v) = 2;
+    hres = IHTMLCSSStyleDeclaration2_put_columnCount(css_style, v);
+    ok(hres == S_OK, "put_columnCount failed: %08x\n", hres);
+
+    V_VT(&v) = VT_ERROR;
+    hres = IHTMLCSSStyleDeclaration2_get_columnCount(css_style, &v);
+    ok(hres == S_OK, "get_columnCount failed: %08x\n", hres);
+    todo_wine
+    ok(V_VT(&v) == VT_BSTR && V_BSTR(&v) && !lstrcmpW(V_BSTR(&v), L"2"), "columnCount = %s\n", wine_dbgstr_variant(&v));
+    VariantClear(&v);
+
+    V_VT(&v) = VT_BSTR;
+    V_BSTR(&v) = SysAllocString(L"auto");
+    hres = IHTMLCSSStyleDeclaration2_put_columnCount(css_style, v);
+    ok(hres == S_OK, "put_columnCount failed: %08x\n", hres);
+    VariantClear(&v);
+
+    V_VT(&v) = VT_ERROR;
+    hres = IHTMLCSSStyleDeclaration2_get_columnCount(css_style, &v);
+    ok(hres == S_OK, "get_columnCount failed: %08x\n", hres);
+    todo_wine
+    ok(V_VT(&v) == VT_BSTR && V_BSTR(&v) && !lstrcmpW(V_BSTR(&v), L"auto"), "columnCount = %s\n", wine_dbgstr_variant(&v));
+    VariantClear(&v);
 }
 
 static void test_body_style(IHTMLStyle *style)




More information about the wine-cvs mailing list