REGRESSION: hardware-accelerated animation fails on inline element
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2018 19:24:44 +0000 (19:24 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2018 19:24:44 +0000 (19:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186981
<rdar://problem/41418697>

Reviewed by Dean Jackson.

Source/WebCore:

Ensure we only queue accelerated actions when we have a renderer so we don't attempt
to start an accelerated animation too soon.

Test: webanimations/opacity-animation-yields-compositing-span.html

* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState):

LayoutTests:

* platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* webanimations/opacity-animation-yields-compositing-expected.txt:
* webanimations/opacity-animation-yields-compositing-span-expected.txt:
* webanimations/opacity-animation-yields-compositing-span.html: Added.
* webanimations/opacity-animation-yields-compositing.html:

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

LayoutTests/ChangeLog
LayoutTests/platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt
LayoutTests/platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt
LayoutTests/webanimations/opacity-animation-yields-compositing-expected.txt
LayoutTests/webanimations/opacity-animation-yields-compositing-span-expected.txt [new file with mode: 0644]
LayoutTests/webanimations/opacity-animation-yields-compositing-span.html [new file with mode: 0644]
LayoutTests/webanimations/opacity-animation-yields-compositing.html
Source/WebCore/ChangeLog
Source/WebCore/animation/KeyframeEffectReadOnly.cpp

index b72e342..08b97b2 100644 (file)
@@ -1,3 +1,18 @@
+2018-06-25  Antoine Quint  <graouts@apple.com>
+
+        REGRESSION: hardware-accelerated animation fails on inline element
+        https://bugs.webkit.org/show_bug.cgi?id=186981
+        <rdar://problem/41418697>
+
+        Reviewed by Dean Jackson.
+
+        * platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
+        * platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
+        * webanimations/opacity-animation-yields-compositing-expected.txt:
+        * webanimations/opacity-animation-yields-compositing-span-expected.txt:
+        * webanimations/opacity-animation-yields-compositing-span.html: Added.
+        * webanimations/opacity-animation-yields-compositing.html:
+
 2018-06-25  Youenn Fablet  <youenn@apple.com>
 
         Add API to control mock media devices
index 0239cb6..6b3ff75 100644 (file)
@@ -140,7 +140,7 @@ PASS filter: drop-shadow function
 FAIL filter: percentage or numeric-specifiable functions (number value) assert_equals: The value should be brightness(0.3) contrast(0.3) grayscale(0.3) invert(0.3) opacity(0.3) saturate(0.3) sepia(0.3) at 500ms expected "brightness(0.3) contrast(0.3) grayscale(0.3) invert(0.3) opacity(0.3) saturate(0.3) sepia(0.3)" but got "brightness(0.30000000000000004) contrast(0.30000000000000004) grayscale(0.30000000000000004) invert(0.30000000000000004) opacity(0.30000000000000004) saturate(0.30000000000000004) sepia(0.30000000000000004)"
 FAIL filter: percentage or numeric-specifiable functions (percentage value) assert_equals: The value should be brightness(0.3) contrast(0.3) grayscale(0.3) invert(0.3) opacity(0.3) saturate(0.3) sepia(0.3) at 500ms expected "brightness(0.3) contrast(0.3) grayscale(0.3) invert(0.3) opacity(0.3) saturate(0.3) sepia(0.3)" but got "brightness(0.30000000000000004) contrast(0.30000000000000004) grayscale(0.30000000000000004) invert(0.30000000000000004) opacity(0.30000000000000004) saturate(0.30000000000000004) sepia(0.30000000000000004)"
 FAIL filter: interpolate different length of filter-function-list with function which lacuna value is 1 assert_equals: The value should be grayscale(0.5) brightness(0.5) contrast(0.5) opacity(0.5) saturate(0.5) at 500ms expected "grayscale(0.5) brightness(0.5) contrast(0.5) opacity(0.5) saturate(0.5)" but got "grayscale(1) brightness(0) contrast(0) opacity(0) saturate(0)"
-FAIL filter: interpolate different length of filter-function-list with function which lacuna value is 0 assert_equals: The value should be opacity(0.5) grayscale(0.5) invert(0.5) sepia(0.5) blur(5px) at 500ms expected "opacity(0.5) grayscale(0.5) invert(0.5) sepia(0.5) blur(5px)" but got "opacity(0.25) grayscale(0.75) invert(0.75) sepia(0.75) blur(7.5px)"
+PASS filter: interpolate different length of filter-function-list with function which lacuna value is 0 
 FAIL filter: interpolate different length of filter-function-list with drop-shadow function assert_equals: The value should be blur(5px) drop-shadow(rgba(85, 0, 170, 0.6) 5px 5px 5px at 500ms expected "blur(5px) drop-shadow(rgba(85, 0, 170, 0.6) 5px 5px 5px" but got "blur(10px) drop-shadow(rgba(0, 0, 255, 0.8) 10px 10px 10px)"
 PASS filter: interpolate from none 
 FAIL filter: url function (interpoalte as discrete) assert_equals: The value should be blur(0px) url("#f1") at 499ms expected "blur(0px) url(\"#f1\")" but got "blur(4.989999771118164px) url(\"#f1\")"
index 90af75f..ebc8a58 100644 (file)
@@ -140,7 +140,7 @@ PASS filter: drop-shadow function
 FAIL filter: percentage or numeric-specifiable functions (number value) assert_equals: The value should be brightness(0.3) contrast(0.3) grayscale(0.3) invert(0.3) opacity(0.3) saturate(0.3) sepia(0.3) at 500ms expected "brightness(0.3) contrast(0.3) grayscale(0.3) invert(0.3) opacity(0.3) saturate(0.3) sepia(0.3)" but got "brightness(0.30000000000000004) contrast(0.30000000000000004) grayscale(0.30000000000000004) invert(0.30000000000000004) opacity(0.30000000000000004) saturate(0.30000000000000004) sepia(0.30000000000000004)"
 FAIL filter: percentage or numeric-specifiable functions (percentage value) assert_equals: The value should be brightness(0.3) contrast(0.3) grayscale(0.3) invert(0.3) opacity(0.3) saturate(0.3) sepia(0.3) at 500ms expected "brightness(0.3) contrast(0.3) grayscale(0.3) invert(0.3) opacity(0.3) saturate(0.3) sepia(0.3)" but got "brightness(0.30000000000000004) contrast(0.30000000000000004) grayscale(0.30000000000000004) invert(0.30000000000000004) opacity(0.30000000000000004) saturate(0.30000000000000004) sepia(0.30000000000000004)"
 FAIL filter: interpolate different length of filter-function-list with function which lacuna value is 1 assert_equals: The value should be grayscale(0.5) brightness(0.5) contrast(0.5) opacity(0.5) saturate(0.5) at 500ms expected "grayscale(0.5) brightness(0.5) contrast(0.5) opacity(0.5) saturate(0.5)" but got "grayscale(1) brightness(0) contrast(0) opacity(0) saturate(0)"
-FAIL filter: interpolate different length of filter-function-list with function which lacuna value is 0 assert_equals: The value should be opacity(0.5) grayscale(0.5) invert(0.5) sepia(0.5) blur(5px) at 500ms expected "opacity(0.5) grayscale(0.5) invert(0.5) sepia(0.5) blur(5px)" but got "opacity(0.25) grayscale(0.75) invert(0.75) sepia(0.75) blur(7.5px)"
+PASS filter: interpolate different length of filter-function-list with function which lacuna value is 0 
 FAIL filter: interpolate different length of filter-function-list with drop-shadow function assert_equals: The value should be blur(5px) drop-shadow(rgba(85, 0, 170, 0.6) 5px 5px 5px at 500ms expected "blur(5px) drop-shadow(rgba(85, 0, 170, 0.6) 5px 5px 5px" but got "blur(10px) drop-shadow(rgba(0, 0, 255, 0.8) 10px 10px 10px)"
 PASS filter: interpolate from none 
 FAIL filter: url function (interpoalte as discrete) assert_equals: The value should be blur(0px) url("#f1") at 499ms expected "blur(0px) url(\"#f1\")" but got "blur(4.989999771118164px) url(\"#f1\")"
index 2fc6d00..7d33979 100644 (file)
@@ -9,6 +9,7 @@
         (GraphicsLayer
           (position 8.00 8.00)
           (bounds 100.00 100.00)
+          (opacity 0.50)
           (contentsOpaque 1)
         )
       )
diff --git a/LayoutTests/webanimations/opacity-animation-yields-compositing-span-expected.txt b/LayoutTests/webanimations/opacity-animation-yields-compositing-span-expected.txt
new file mode 100644 (file)
index 0000000..356027d
--- /dev/null
@@ -0,0 +1,19 @@
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 25.00 18.00)
+          (opacity 0.50)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+Foo
diff --git a/LayoutTests/webanimations/opacity-animation-yields-compositing-span.html b/LayoutTests/webanimations/opacity-animation-yields-compositing-span.html
new file mode 100644 (file)
index 0000000..cdd8f9e
--- /dev/null
@@ -0,0 +1,16 @@
+<pre id="results"></pre>
+<span id="target">Foo</span>
+<script>
+
+testRunner.waitUntilDone();
+testRunner.dumpAsText();
+
+document.getElementById("target").animate([
+    { opacity: 0.5 },
+    { opacity: 0 }
+], 1000 * 60).ready.then(() => {
+    document.getElementById("results").innerText = internals.layerTreeAsText(document);
+    testRunner.notifyDone();
+});
+
+</script>
index a0782ae..0278af7 100644 (file)
@@ -2,12 +2,15 @@
 <div id="target" style="width: 100px; height: 100px; background-color: black;"></div>
 <script>
 
+testRunner.waitUntilDone();
+testRunner.dumpAsText();
+
 document.getElementById("target").animate([
-    { opacity: 1 },
+    { opacity: 0.5 },
     { opacity: 0 }
-], 1000);
-
-testRunner.dumpAsText();
-document.getElementById("results").innerText = internals.layerTreeAsText(document);
+], 1000 * 60).ready.then(() => {
+    document.getElementById("results").innerText = internals.layerTreeAsText(document);
+    testRunner.notifyDone();
+});
 
 </script>
index c6dfa23..041728d 100644 (file)
@@ -1,3 +1,19 @@
+2018-06-25  Antoine Quint  <graouts@apple.com>
+
+        REGRESSION: hardware-accelerated animation fails on inline element
+        https://bugs.webkit.org/show_bug.cgi?id=186981
+        <rdar://problem/41418697>
+
+        Reviewed by Dean Jackson.
+
+        Ensure we only queue accelerated actions when we have a renderer so we don't attempt
+        to start an accelerated animation too soon.
+
+        Test: webanimations/opacity-animation-yields-compositing-span.html
+
+        * animation/KeyframeEffectReadOnly.cpp:
+        (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState):
+
 2018-06-25  David Kilzer  <ddkilzer@apple.com>
 
         REGRESSION (r233140): v2: Windows build failure due to incomplete DocumentAnimationScheduler type
index 9639695..caf57bc 100644 (file)
@@ -1164,6 +1164,9 @@ void KeyframeEffectReadOnly::updateAcceleratedAnimationState()
     if (!m_shouldRunAccelerated)
         return;
 
+    if (!renderer())
+        return;
+
     auto localTime = animation()->currentTime();
 
     // If we don't have a localTime or localTime < 0, we either don't have a start time or we're before the startTime