Title: [255996] trunk/LayoutTests
Revision
255996
Author
[email protected]
Date
2020-02-06 18:07:25 -0800 (Thu, 06 Feb 2020)

Log Message

Add slot based test for the accelerated animations freezing bug (201048)
https://bugs.webkit.org/show_bug.cgi?id=207359

Reviewed by Ryosuke Niwa.

201048 had a simpler test case but it is good to add one for the original problem too.

Based on the original test by Tim Guan-tin Chien.

* webanimations/accelerated-animation-slot-invalidation-expected.html: Added.
* webanimations/accelerated-animation-slot-invalidation.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (255995 => 255996)


--- trunk/LayoutTests/ChangeLog	2020-02-07 01:41:21 UTC (rev 255995)
+++ trunk/LayoutTests/ChangeLog	2020-02-07 02:07:25 UTC (rev 255996)
@@ -1,3 +1,17 @@
+2020-02-06  Antti Koivisto  <[email protected]>
+
+        Add slot based test for the accelerated animations freezing bug (201048)
+        https://bugs.webkit.org/show_bug.cgi?id=207359
+
+        Reviewed by Ryosuke Niwa.
+
+        201048 had a simpler test case but it is good to add one for the original problem too.
+
+        Based on the original test by Tim Guan-tin Chien.
+
+        * webanimations/accelerated-animation-slot-invalidation-expected.html: Added.
+        * webanimations/accelerated-animation-slot-invalidation.html: Added.
+
 2020-02-06  Jason Lawrence  <[email protected]>
 
         [ Mac ] inspector/css/pseudo-creation.html is flaky failing.

Added: trunk/LayoutTests/webanimations/accelerated-animation-slot-invalidation-expected.html (0 => 255996)


--- trunk/LayoutTests/webanimations/accelerated-animation-slot-invalidation-expected.html	                        (rev 0)
+++ trunk/LayoutTests/webanimations/accelerated-animation-slot-invalidation-expected.html	2020-02-07 02:07:25 UTC (rev 255996)
@@ -0,0 +1,15 @@
+<style>
+div {
+    background-color: rebeccapurple;
+    width: 100px;
+    height: 100px;
+}
+
+#test{
+    position: absolute;
+    top: 200px;
+    left: 200px;
+}
+
+</style>
+<div id=test></div>

Added: trunk/LayoutTests/webanimations/accelerated-animation-slot-invalidation.html (0 => 255996)


--- trunk/LayoutTests/webanimations/accelerated-animation-slot-invalidation.html	                        (rev 0)
+++ trunk/LayoutTests/webanimations/accelerated-animation-slot-invalidation.html	2020-02-07 02:07:25 UTC (rev 255996)
@@ -0,0 +1,88 @@
+<style>
+
+div {
+    background-color: rebeccapurple;
+    width: 100px;
+    height: 100px;
+}
+
+#first {
+    position: absolute;
+    top: 10px;
+    left: 10px;
+}
+
+#second {
+    position: absolute;
+    top: 200px;
+    left: 200px;
+}
+
+.animate-class {
+    animation: 1s linear 0s 1 normal scale;
+}
+
+.first-letter::first-letter {
+    color:red;
+}
+
+@keyframes scale {
+    0% {
+        transform: scale(0);
+    }
+
+    10% {
+        transform: scale(1);
+    }
+
+    100% {
+        transform: scale(1);
+    }
+}
+
+</style>
+<script>
+
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+window._onload_ = async function() {
+    let shadowRoot = document.body.attachShadow({ mode: "open" });
+
+    // Put a named slot and assign an element to it.
+    shadowRoot.innerHTML = `<slot name="first"></slot>`;
+    let firstElement = document.body.appendChild(document.createElement("div"));
+    firstElement.slot = "first";
+    firstElement.id = "first";
+
+    await new Promise(resolve => requestAnimationFrame(resolve));
+
+    // Create another named slot and assign another element to it.
+    let secondSlot = shadowRoot.appendChild(document.createElement("slot"));
+    secondSlot.name = "second";
+
+    // Start animation in the seconds slot.
+    let secondElement = document.body.appendChild(document.createElement("div"));
+    secondElement.slot = "second";
+    secondElement.className = "animate-class";
+    secondElement.id = "second";
+
+    const animation = secondElement.getAnimations()[0];
+
+    await animation.ready;
+
+    await new Promise(resolve => requestAnimationFrame(resolve));
+    await new Promise(resolve => requestAnimationFrame(resolve));
+
+    firstElement.remove();
+
+    // Wait until animation has progressed some before snapshotting the test result.
+    while (animation.currentTime < 100)
+        await new Promise(resolve => requestAnimationFrame(resolve));
+
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+</script>
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to