Jacek Caban : mshtml: Add IHTMLCSSStyleDeclaration2::perspective implementation.

Alexandre Julliard julliard at winehq.org
Wed Jun 10 16:09:43 CDT 2020


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Jun 10 18:21:59 2020 +0200

mshtml: Add IHTMLCSSStyleDeclaration2::perspective 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 | 18 ++++++++++++++++++
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 6df930e19a..02de13580f 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -812,6 +812,11 @@ static const style_tbl_entry_t style_tbl[] = {
         DISPID_IHTMLCSSSTYLEDECLARATION_PAGEBREAKBEFORE,
         DISPID_A_PAGEBREAKBEFORE
     },
+    {
+        L"perspective",
+        DISPID_IHTMLCSSSTYLEDECLARATION2_PERSPECTIVE,
+        DISPID_UNKNOWN
+    },
     {
         positionW,
         DISPID_IHTMLCSSSTYLEDECLARATION_POSITION,
@@ -9709,15 +9714,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration2_get_backfaceVisibility(IHTMLCSSSt
 static HRESULT WINAPI HTMLCSSStyleDeclaration2_put_perspective(IHTMLCSSStyleDeclaration2 *iface, VARIANT v)
 {
     CSSStyle *This = impl_from_IHTMLCSSStyleDeclaration2(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
+    TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return set_style_property_var(This, STYLEID_PERSPECTIVE, &v);
 }
 
 static HRESULT WINAPI HTMLCSSStyleDeclaration2_get_perspective(IHTMLCSSStyleDeclaration2 *iface, VARIANT *p)
 {
     CSSStyle *This = impl_from_IHTMLCSSStyleDeclaration2(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    TRACE("(%p)->(%p)\n", This, p);
+    return get_style_property_var(This, STYLEID_PERSPECTIVE, p);
 }
 
 static HRESULT WINAPI HTMLCSSStyleDeclaration2_put_perspectiveOrigin(IHTMLCSSStyleDeclaration2 *iface, BSTR v)
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 8746558fde..a21dfe88d3 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -128,6 +128,7 @@ typedef enum {
     STYLEID_PADDING_TOP,
     STYLEID_PAGE_BREAK_AFTER,
     STYLEID_PAGE_BREAK_BEFORE,
+    STYLEID_PERSPECTIVE,
     STYLEID_POSITION,
     STYLEID_RIGHT,
     STYLEID_TABLE_LAYOUT,
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index 2ed6ef2e22..69f1e61cac 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -1088,6 +1088,24 @@ static void test_css_style_declaration2(IHTMLCSSStyleDeclaration2 *css_style)
     hres = IHTMLCSSStyleDeclaration2_get_columnRule(css_style, &str);
     ok(hres == S_OK, "get_columnRule failed: %08x\n", hres);
     ok(!str, "columnRule = %s\n", wine_dbgstr_w(str));
+
+    V_VT(&v) = VT_ERROR;
+    hres = IHTMLCSSStyleDeclaration2_get_perspective(css_style, &v);
+    ok(hres == S_OK, "get_perspective failed: %08x\n", hres);
+    ok(V_VT(&v) == VT_BSTR && !V_BSTR(&v), "perspective = %s\n", wine_dbgstr_variant(&v));
+    VariantClear(&v);
+
+    V_VT(&v) = VT_BSTR;
+    V_BSTR(&v) = SysAllocString(L"100px");
+    hres = IHTMLCSSStyleDeclaration2_put_perspective(css_style, v);
+    ok(hres == S_OK, "put_perspective failed: %08x\n", hres);
+    VariantClear(&v);
+
+    V_VT(&v) = VT_ERROR;
+    hres = IHTMLCSSStyleDeclaration2_get_perspective(css_style, &v);
+    ok(hres == S_OK, "get_perspective failed: %08x\n", hres);
+    ok(V_VT(&v) == VT_BSTR && V_BSTR(&v) && !lstrcmpW(V_BSTR(&v), L"100px"), "perspective = %s\n", wine_dbgstr_variant(&v));
+    VariantClear(&v);
 }
 
 static void test_body_style(IHTMLStyle *style)




More information about the wine-cvs mailing list