Module: wine Branch: master Commit: cdb264e871c273abb70022a40dbf890de45bc483 URL: https://source.winehq.org/git/wine.git/?a=commit;h=cdb264e871c273abb70022a40...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Mar 10 14:59:20 2021 +0100
mshtml: Add animationstart and animationend event support.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/mshtml/htmlevent.c | 6 ++++++ dlls/mshtml/htmlevent.h | 2 ++ dlls/mshtml/tests/dom.js | 14 ++++++++++++++ 3 files changed, 22 insertions(+)
diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 1befd94c742..da2d59bc894 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -109,6 +109,10 @@ typedef struct { static const event_info_t event_info[] = { {L"abort", EVENT_TYPE_EVENT, DISPID_EVMETH_ONABORT, EVENT_BIND_TO_TARGET}, + {L"animationend", EVENT_TYPE_EVENT, DISPID_EVPROP_ONANIMATIONEND, + EVENT_DEFAULTLISTENER | EVENT_BUBBLES}, + {L"animationstart", EVENT_TYPE_EVENT, DISPID_EVPROP_ONANIMATIONSTART, + EVENT_DEFAULTLISTENER | EVENT_BUBBLES}, {L"beforeactivate", EVENT_TYPE_EVENT, DISPID_EVMETH_ONBEFOREACTIVATE, EVENT_FIXME | EVENT_BUBBLES | EVENT_CANCELABLE}, {L"beforeunload", EVENT_TYPE_EVENT, DISPID_EVMETH_ONBEFOREUNLOAD, @@ -185,6 +189,8 @@ static const event_info_t event_info[] = { EVENT_FIXME} };
+C_ASSERT(ARRAY_SIZE(event_info) == EVENTID_LAST); + static eventid_t str_to_eid(const WCHAR *str) { int i; diff --git a/dlls/mshtml/htmlevent.h b/dlls/mshtml/htmlevent.h index c5d9753722a..69655d2a4ee 100644 --- a/dlls/mshtml/htmlevent.h +++ b/dlls/mshtml/htmlevent.h @@ -18,6 +18,8 @@
typedef enum { EVENTID_ABORT, + EVENTID_ANIMATIONEND, + EVENTID_ANIMATIONSTART, EVENTID_BEFOREACTIVATE, EVENTID_BEFOREUNLOAD, EVENTID_BLUR, diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 0064690ee36..7fc6b87882c 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -401,3 +401,17 @@ sync_test("storage", function() { ok(typeof(window.localStorage) === "object", "typeof(window.localStorage) = " + typeof(window.localStorage)); }); + +async_test("animation", function() { + document.body.innerHTML = + "<style>" + + " @keyframes testAnimation {0% { opacity: 0; } 100% { opacity: 1; }}" + + " .testAnimation { animation-name: testAnimation; animation-duration: 0.01s; }" + + "</style>"; + var div = document.createElement("div"); + div.addEventListener("animationstart", function() { + div.addEventListener("animationend", next_test); + }); + document.body.appendChild(div); + div.className = "testAnimation"; +});