Jacek Caban : mshtml: Add IHTMLCSSStyleDeclaration2::transform property implementation.
Alexandre Julliard
julliard at winehq.org
Fri Jun 5 14:16:53 CDT 2020
Module: wine
Branch: master
Commit: 8d40873d02c6613d9ccf06045d7243ddbe94aec6
URL: https://source.winehq.org/git/wine.git/?a=commit;h=8d40873d02c6613d9ccf06045d7243ddbe94aec6
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri Jun 5 18:28:48 2020 +0200
mshtml: Add IHTMLCSSStyleDeclaration2::transform property implementation.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mshtml/htmlstyle.c | 12 ++++++++----
dlls/mshtml/htmlstyle.h | 1 +
dlls/mshtml/tests/style.c | 33 ++++++++++++++++++++++++++++++++-
3 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 15e2f26303..fb58d09063 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -793,6 +793,10 @@ static const style_tbl_entry_t style_tbl[] = {
DISPID_IHTMLCSSSTYLEDECLARATION_TOP,
STDPROPID_XOBJ_TOP
},
+ {
+ L"transform",
+ DISPID_IHTMLCSSSTYLEDECLARATION2_TRANSFORM
+ },
{
vertical_alignW,
DISPID_IHTMLCSSSTYLEDECLARATION_VERTICALALIGN,
@@ -9577,15 +9581,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration2_get_msTouchSelect(IHTMLCSSStyleDe
static HRESULT WINAPI HTMLCSSStyleDeclaration2_put_transform(IHTMLCSSStyleDeclaration2 *iface, BSTR v)
{
CSSStyle *This = impl_from_IHTMLCSSStyleDeclaration2(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_TRANSFORM, v);
}
static HRESULT WINAPI HTMLCSSStyleDeclaration2_get_transform(IHTMLCSSStyleDeclaration2 *iface, BSTR *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(This, STYLEID_TRANSFORM, p);
}
static HRESULT WINAPI HTMLCSSStyleDeclaration2_put_transformOrigin(IHTMLCSSStyleDeclaration2 *iface, BSTR v)
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 7a83897043..5e7ba0b6e1 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -126,6 +126,7 @@ typedef enum {
STYLEID_TEXT_INDENT,
STYLEID_TEXT_TRANSFORM,
STYLEID_TOP,
+ STYLEID_TRANSFORM,
STYLEID_VERTICAL_ALIGN,
STYLEID_VISIBILITY,
STYLEID_WHITE_SPACE,
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index d79d1bef06..de685dd318 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -829,6 +829,34 @@ static void test_css_style_declaration(IHTMLCSSStyleDeclaration *css_style)
VariantClear(&v);
}
+static void test_css_style_declaration2(IHTMLCSSStyleDeclaration2 *css_style)
+{
+ BSTR str;
+ HRESULT hres;
+
+ str = SysAllocString(L"translate(30px, 20px)");
+ hres = IHTMLCSSStyleDeclaration2_put_transform(css_style, str);
+ ok(hres == S_OK, "put_transform failed: %08x\n", hres);
+ SysFreeString(str);
+
+ str = NULL;
+ hres = IHTMLCSSStyleDeclaration2_get_transform(css_style, &str);
+ ok(hres == S_OK, "get_transform failed: %08x\n", hres);
+ ok(!lstrcmpW(str, L"translate(30px, 20px)"), "transform = %s\n", wine_dbgstr_w(str));
+ SysFreeString(str);
+
+ str = SysAllocString(L"none");
+ hres = IHTMLCSSStyleDeclaration2_put_transform(css_style, str);
+ ok(hres == S_OK, "put_transform failed: %08x\n", hres);
+ SysFreeString(str);
+
+ str = NULL;
+ hres = IHTMLCSSStyleDeclaration2_get_transform(css_style, &str);
+ ok(hres == S_OK, "get_transform failed: %08x\n", hres);
+ ok(!lstrcmpW(str, L"none"), "transform = %s\n", wine_dbgstr_w(str));
+ SysFreeString(str);
+}
+
static void test_body_style(IHTMLStyle *style)
{
IHTMLCSSStyleDeclaration *css_style;
@@ -2977,8 +3005,11 @@ static void test_body_style(IHTMLStyle *style)
win_skip("IHTMLStyle6 not available\n");
}
- if(compat_mode >= COMPAT_IE9)
+ if(compat_mode >= COMPAT_IE9) {
test_css_style_declaration(css_style);
+ if(css_style2)
+ test_css_style_declaration2(css_style2);
+ }
if(css_style2)
IHTMLCSSStyleDeclaration2_Release(css_style2);
More information about the wine-cvs
mailing list