Make animation events non-cancelable
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Mar 2016 16:25:18 +0000 (16:25 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Mar 2016 16:25:18 +0000 (16:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78110

Reviewed by Dan Bates.

Source/WebCore:

Make the animation events non-cancelable.

Test: animations/animation-events-not-cancelable.html

* dom/AnimationEvent.cpp:
(WebCore::AnimationEvent::AnimationEvent):

LayoutTests:

* animations/animation-events-not-cancelable-expected.txt: Added.
* animations/animation-events-not-cancelable.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198837 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/animations/animation-events-not-cancelable-expected.txt [new file with mode: 0644]
LayoutTests/animations/animation-events-not-cancelable.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/AnimationEvent.cpp

index 5025a3a..bc15d54 100644 (file)
@@ -1,3 +1,13 @@
+2016-03-24  Simon Fraser  <simon.fraser@apple.com>
+
+        Make animation events non-cancelable
+        https://bugs.webkit.org/show_bug.cgi?id=78110
+
+        Reviewed by Dan Bates.
+
+        * animations/animation-events-not-cancelable-expected.txt: Added.
+        * animations/animation-events-not-cancelable.html: Added.
+
 2016-03-30  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
 
         [EFL] Mark svg zoom and pageoverlay tests to failure
diff --git a/LayoutTests/animations/animation-events-not-cancelable-expected.txt b/LayoutTests/animations/animation-events-not-cancelable-expected.txt
new file mode 100644 (file)
index 0000000..ffdb949
--- /dev/null
@@ -0,0 +1,15 @@
+Tests that animation events are not cancelable.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+animationstart:
+PASS event.cancelable is false
+animationiteration:
+PASS event.cancelable is false
+animationend:
+PASS event.cancelable is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/animations/animation-events-not-cancelable.html b/LayoutTests/animations/animation-events-not-cancelable.html
new file mode 100644 (file)
index 0000000..b258b8d
--- /dev/null
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+<style>
+#box {
+    height: 10px;
+    width: 10px;
+    background-color: blue;
+    position: relative;
+}
+#box.running {
+    animation: move 0.02s 2 linear;
+}
+@keyframes move {
+    from { left: 0px; }
+    to   { left: 10px; }
+}
+</style>
+</head>
+<body>
+<div id="box"></div>
+
+<p id="description"></p>
+<div id="console"></div>
+<script>
+jsTestIsAsync = true;
+
+description('Tests that animation events are not cancelable.');
+
+var box = document.getElementById('box');
+box.addEventListener('animationstart', function(event) {
+    debug(event.type + ':');
+    shouldBe('event.cancelable', 'false');
+}, false);
+
+box.addEventListener('animationiteration', function(event) {
+    debug(event.type + ':');
+    shouldBe('event.cancelable', 'false');
+}, false);
+
+box.addEventListener('animationend', function(event) {
+    debug(event.type + ':');
+    shouldBe('event.cancelable', 'false');
+    finishJSTest();
+}, false);
+
+box.classList.add('running');
+
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
index f5d8ba0..c22ee77 100644 (file)
@@ -1,3 +1,17 @@
+2016-03-24  Simon Fraser  <simon.fraser@apple.com>
+
+        Make animation events non-cancelable
+        https://bugs.webkit.org/show_bug.cgi?id=78110
+
+        Reviewed by Dan Bates.
+
+        Make the animation events non-cancelable.
+
+        Test: animations/animation-events-not-cancelable.html
+
+        * dom/AnimationEvent.cpp:
+        (WebCore::AnimationEvent::AnimationEvent):
+
 2016-03-30  Manuel Rego Casasnovas  <rego@igalia.com>
 
         [css-grid] Refactor positioned children code
index ead8703..cfd196c 100644 (file)
@@ -38,7 +38,7 @@ AnimationEvent::AnimationEvent(const AtomicString& type, const AnimationEventIni
 }
 
 AnimationEvent::AnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime)
-    : Event(type, true, true)
+    : Event(type, true, false)
     , m_animationName(animationName)
     , m_elapsedTime(elapsedTime)
 {