Title: [276639] trunk
Revision
276639
Author
[email protected]
Date
2021-04-27 08:29:29 -0700 (Tue, 27 Apr 2021)

Log Message

Fix animation of the visibility CSS property between "hidden" and "collapse"
https://bugs.webkit.org/show_bug.cgi?id=225103

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Mark 1 WPT progression.

* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:

Source/WebCore:

The Web Animations spec details the special behavior when animating the visibility property
in https://drafts.csswg.org/web-animations-1/#animating-visibility. There it says that when
interpolating between non-visible values, we should use discrete interpolation formula.

* animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (276638 => 276639)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-04-27 14:25:59 UTC (rev 276638)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-04-27 15:29:29 UTC (rev 276639)
@@ -1,5 +1,16 @@
 2021-04-27  Antoine Quint  <[email protected]>
 
+        Fix animation of the visibility CSS property between "hidden" and "collapse"
+        https://bugs.webkit.org/show_bug.cgi?id=225103
+
+        Reviewed by Antti Koivisto.
+
+        Mark 1 WPT progression.
+
+        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:
+
+2021-04-27  Antoine Quint  <[email protected]>
+
         Correctly specify interpolation of page-break-* properties
         https://bugs.webkit.org/show_bug.cgi?id=225098
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt (276638 => 276639)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt	2021-04-27 14:25:59 UTC (rev 276638)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt	2021-04-27 15:29:29 UTC (rev 276639)
@@ -225,7 +225,7 @@
 PASS visibility (type: visibility) has testInterpolation function
 PASS visibility uses visibility animation when animating from "visible" to "hidden"
 PASS visibility uses visibility animation when animating from "hidden" to "visible"
-FAIL visibility uses visibility animation when animating from "hidden" to "collapse" assert_equals: The value should be hidden at 0ms expected "hidden" but got "collapse"
+PASS visibility uses visibility animation when animating from "hidden" to "collapse"
 PASS visibility uses visibility animation when animating from "visible" to "hidden" with easeInOutBack easing
 PASS white-space (type: discrete) has testInterpolation function
 PASS white-space uses discrete animation when animating between "pre" and "nowrap" with linear easing

Modified: trunk/Source/WebCore/ChangeLog (276638 => 276639)


--- trunk/Source/WebCore/ChangeLog	2021-04-27 14:25:59 UTC (rev 276638)
+++ trunk/Source/WebCore/ChangeLog	2021-04-27 15:29:29 UTC (rev 276639)
@@ -1,5 +1,19 @@
 2021-04-27  Antoine Quint  <[email protected]>
 
+        Fix animation of the visibility CSS property between "hidden" and "collapse"
+        https://bugs.webkit.org/show_bug.cgi?id=225103
+
+        Reviewed by Antti Koivisto.
+
+        The Web Animations spec details the special behavior when animating the visibility property
+        in https://drafts.csswg.org/web-animations-1/#animating-visibility. There it says that when
+        interpolating between non-visible values, we should use discrete interpolation formula.
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::blendFunc):
+
+2021-04-27  Antoine Quint  <[email protected]>
+
         Correctly specify interpolation of page-break-* properties
         https://bugs.webkit.org/show_bug.cgi?id=225098
 

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (276638 => 276639)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-04-27 14:25:59 UTC (rev 276638)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-04-27 15:29:29 UTC (rev 276639)
@@ -379,6 +379,9 @@
 
 static inline Visibility blendFunc(Visibility from, Visibility to, const CSSPropertyBlendingContext& context)
 {
+    if (from != Visibility::Visible && to != Visibility::Visible)
+        return context.progress < 0.5 ? from : to;
+
     // Any non-zero result means we consider the object to be visible. Only at 0 do we consider the object to be
     // invisible. The invisible value we use (Visibility::Hidden vs. Visibility::Collapse) depends on the specified from/to values.
     double fromVal = from == Visibility::Visible ? 1. : 0.;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to