Jacek Caban : mshtml: Implement IHTMLCSSStyleDeclaration2::animation property.
Alexandre Julliard
julliard at winehq.org
Wed Jan 27 15:35:04 CST 2021
Module: wine
Branch: master
Commit: ee611b198d8de1251486b505cffb9cac96f5cacf
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ee611b198d8de1251486b505cffb9cac96f5cacf
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Jan 27 19:36:38 2021 +0100
mshtml: Implement IHTMLCSSStyleDeclaration2::animation property.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mshtml/htmlstyle.c | 14 ++++++++++----
dlls/mshtml/htmlstyle.h | 1 +
dlls/mshtml/tests/style.c | 30 ++++++++++++++++++++++++++++++
3 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 43a71d6286c..0ae2dfe863e 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -120,6 +120,12 @@ typedef struct {
} style_tbl_entry_t;
static const style_tbl_entry_t style_tbl[] = {
+ {
+ L"animation",
+ DISPID_IHTMLCSSSTYLEDECLARATION2_ANIMATION,
+ DISPID_UNKNOWN,
+ ATTR_COMPAT_IE10
+ },
{
L"animation-name",
DISPID_IHTMLCSSSTYLEDECLARATION2_ANIMATIONNAME,
@@ -9689,15 +9695,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration2_get_animationIterationCount(IHTML
static HRESULT WINAPI HTMLCSSStyleDeclaration2_put_animation(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_ANIMATION, v);
}
static HRESULT WINAPI HTMLCSSStyleDeclaration2_get_animation(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_ANIMATION, p);
}
static HRESULT WINAPI HTMLCSSStyleDeclaration2_put_animationFillMode(IHTMLCSSStyleDeclaration2 *iface, BSTR v)
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index a21dfe88d38..25f87c802b2 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -44,6 +44,7 @@ struct HTMLStyle {
/* NOTE: Make sure to keep in sync with style_tbl in htmlstyle.c */
typedef enum {
+ STYLEID_ANIMATION,
STYLEID_ANIMATION_NAME,
STYLEID_BACKGROUND,
STYLEID_BACKGROUND_ATTACHMENT,
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index 69f1e61cac1..255dc7f7900 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -1106,6 +1106,36 @@ static void test_css_style_declaration2(IHTMLCSSStyleDeclaration2 *css_style)
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);
+
+ /* animation property */
+ hres = IHTMLCSSStyleDeclaration2_put_animation(css_style, NULL);
+ ok(hres == S_OK, "put_animation failed: %08x\n", hres);
+
+ str = (void*)0xdeadbeef;
+ hres = IHTMLCSSStyleDeclaration2_get_animation(css_style, &str);
+ ok(hres == S_OK, "get_animation failed: %08x\n", hres);
+ ok(!str, "animation = %s\n", wine_dbgstr_w(str));
+
+ str = SysAllocString(L"test");
+ hres = IHTMLCSSStyleDeclaration2_put_animation(css_style, str);
+ ok(hres == S_OK, "put_animation failed: %08x\n", hres);
+ SysFreeString(str);
+
+ str = (void*)0xdeadbeef;
+ hres = IHTMLCSSStyleDeclaration2_get_animation(css_style, &str);
+ ok(hres == S_OK, "get_animation failed: %08x\n", hres);
+ todo_wine
+ ok(!lstrcmpW(str, L"test"), "animation = %s\n", wine_dbgstr_w(str));
+
+ str = (void*)0xdeadbeef;
+ hres = IHTMLCSSStyleDeclaration2_get_animationName(css_style, &str);
+ ok(hres == S_OK, "get_animationName failed: %08x\n", hres);
+ ok(!lstrcmpW(str, L"test"), "animationName = %s\n", wine_dbgstr_w(str));
+
+ str = SysAllocString(L"test");
+ hres = IHTMLCSSStyleDeclaration2_put_animation(css_style, NULL);
+ ok(hres == S_OK, "put_animation failed: %08x\n", hres);
+ SysFreeString(str);
}
static void test_body_style(IHTMLStyle *style)
More information about the wine-cvs
mailing list