Title: [274198] trunk
Revision
274198
Author
[email protected]
Date
2021-03-09 22:20:46 -0800 (Tue, 09 Mar 2021)

Log Message

Correctly blend the flex-basis CSS property
https://bugs.webkit.org/show_bug.cgi?id=222981

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Add an extra 14 PASS results. We now pass all the flex-basis interpolation tests.

* web-platform-tests/css/css-flexbox/animation/flex-basis-composition-expected.txt:
* web-platform-tests/css/css-flexbox/animation/flex-basis-interpolation-expected.txt:

Source/WebCore:

To correctly support blending of flex-basis we must ensure that negative values aren't
allowed but also ensure that "flex" doesn't interpolate if flex-basis can't either.

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

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (274197 => 274198)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-03-10 05:30:39 UTC (rev 274197)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-03-10 06:20:46 UTC (rev 274198)
@@ -1,3 +1,15 @@
+2021-03-09  Antoine Quint  <[email protected]>
+
+        Correctly blend the flex-basis CSS property
+        https://bugs.webkit.org/show_bug.cgi?id=222981
+
+        Reviewed by Dean Jackson.
+
+        Add an extra 14 PASS results. We now pass all the flex-basis interpolation tests.
+
+        * web-platform-tests/css/css-flexbox/animation/flex-basis-composition-expected.txt:
+        * web-platform-tests/css/css-flexbox/animation/flex-basis-interpolation-expected.txt:
+
 2021-03-09  Chris Dumez  <[email protected]>
 
         Resync web-platform-tests/dom tests from upstream

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/animation/flex-basis-composition-expected.txt (274197 => 274198)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/animation/flex-basis-composition-expected.txt	2021-03-10 05:30:39 UTC (rev 274197)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/animation/flex-basis-composition-expected.txt	2021-03-10 06:20:46 UTC (rev 274198)
@@ -8,7 +8,7 @@
 FAIL Compositing: property <flex-basis> underlying [100px] from add [10px] to add [2px] at (0) should be [110px] assert_equals: expected "110px " but got "10px "
 FAIL Compositing: property <flex-basis> underlying [100px] from add [10px] to add [2px] at (0.5) should be [106px] assert_equals: expected "106px " but got "6px "
 FAIL Compositing: property <flex-basis> underlying [100px] from add [10px] to add [2px] at (1) should be [102px] assert_equals: expected "102px " but got "2px "
-FAIL Compositing: property <flex-basis> underlying [100px] from add [10px] to add [2px] at (1.5) should be [98px] assert_equals: expected "98px " but got "- 2px "
+FAIL Compositing: property <flex-basis> underlying [100px] from add [10px] to add [2px] at (1.5) should be [98px] assert_equals: expected "98px " but got "0px "
 FAIL Compositing: property <flex-basis> underlying [10%] from add [100px] to add [20%] at (-0.3) should be [calc(130px + 4%)] assert_equals: expected "calc ( 4 % + 130px ) " but got "100px "
 FAIL Compositing: property <flex-basis> underlying [10%] from add [100px] to add [20%] at (0) should be [calc(100px + 10%)] assert_equals: expected "calc ( 10 % + 100px ) " but got "100px "
 FAIL Compositing: property <flex-basis> underlying [10%] from add [100px] to add [20%] at (0.5) should be [calc(50px + 20%)] assert_equals: expected "calc ( 20 % + 50px ) " but got "20 % "

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/animation/flex-basis-interpolation-expected.txt (274197 => 274198)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/animation/flex-basis-interpolation-expected.txt	2021-03-10 05:30:39 UTC (rev 274197)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/animation/flex-basis-interpolation-expected.txt	2021-03-10 06:20:46 UTC (rev 274198)
@@ -30,9 +30,9 @@
 PASS CSS Transitions: property <flex-basis> from [initial] to [2%] at (0.6) should be [2%]
 PASS CSS Transitions: property <flex-basis> from [initial] to [2%] at (1) should be [2%]
 PASS CSS Transitions: property <flex-basis> from [initial] to [2%] at (1.5) should be [2%]
-FAIL CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (-0.3) should be [2%] assert_equals: expected "2 % " but got "auto "
-FAIL CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (0) should be [2%] assert_equals: expected "2 % " but got "auto "
-FAIL CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (0.3) should be [2%] assert_equals: expected "2 % " but got "auto "
+PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (-0.3) should be [2%]
+PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (0) should be [2%]
+PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (0.3) should be [2%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (0.5) should be [2%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (0.6) should be [2%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (1) should be [2%]
@@ -82,9 +82,9 @@
 PASS CSS Transitions: property <flex-basis> from [unset] to [2%] at (0.6) should be [2%]
 PASS CSS Transitions: property <flex-basis> from [unset] to [2%] at (1) should be [2%]
 PASS CSS Transitions: property <flex-basis> from [unset] to [2%] at (1.5) should be [2%]
-FAIL CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (-0.3) should be [2%] assert_equals: expected "2 % " but got "auto "
-FAIL CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (0) should be [2%] assert_equals: expected "2 % " but got "auto "
-FAIL CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (0.3) should be [2%] assert_equals: expected "2 % " but got "auto "
+PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (-0.3) should be [2%]
+PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (0) should be [2%]
+PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (0.3) should be [2%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (0.5) should be [2%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (0.6) should be [2%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (1) should be [2%]
@@ -103,49 +103,49 @@
 PASS Web Animations: property <flex-basis> from [unset] to [2%] at (0.6) should be [2%]
 PASS Web Animations: property <flex-basis> from [unset] to [2%] at (1) should be [2%]
 PASS Web Animations: property <flex-basis> from [unset] to [2%] at (1.5) should be [2%]
-FAIL CSS Transitions: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px] assert_equals: expected "0px " but got "- 30px "
+PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px]
 PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (0) should be [0px]
 PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (0.4) should be [40px]
 PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (0.6) should be [60px]
 PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (1) should be [100px]
 PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (1.5) should be [150px]
-FAIL CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px] assert_equals: expected "0px " but got "- 30px "
+PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px]
 PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (0) should be [0px]
 PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (0.4) should be [40px]
 PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (0.6) should be [60px]
 PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (1) should be [100px]
 PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (1.5) should be [150px]
-FAIL CSS Animations: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px] assert_equals: expected "0px " but got "- 30px "
+PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px]
 PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (0) should be [0px]
 PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (0.4) should be [40px]
 PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (0.6) should be [60px]
 PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (1) should be [100px]
 PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (1.5) should be [150px]
-FAIL Web Animations: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px] assert_equals: expected "0px " but got "- 30px "
+PASS Web Animations: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px]
 PASS Web Animations: property <flex-basis> from [0px] to [100px] at (0) should be [0px]
 PASS Web Animations: property <flex-basis> from [0px] to [100px] at (0.4) should be [40px]
 PASS Web Animations: property <flex-basis> from [0px] to [100px] at (0.6) should be [60px]
 PASS Web Animations: property <flex-basis> from [0px] to [100px] at (1) should be [100px]
 PASS Web Animations: property <flex-basis> from [0px] to [100px] at (1.5) should be [150px]
-FAIL CSS Transitions: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%] assert_equals: expected "0 % " but got "- 30 % "
+PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%]
 PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (0) should be [0%]
 PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (0.4) should be [40%]
 PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (0.6) should be [60%]
 PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (1) should be [100%]
 PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (1.5) should be [150%]
-FAIL CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%] assert_equals: expected "0 % " but got "- 30 % "
+PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (0) should be [0%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (0.4) should be [40%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (0.6) should be [60%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (1) should be [100%]
 PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (1.5) should be [150%]
-FAIL CSS Animations: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%] assert_equals: expected "0 % " but got "- 30 % "
+PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%]
 PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (0) should be [0%]
 PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (0.4) should be [40%]
 PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (0.6) should be [60%]
 PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (1) should be [100%]
 PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (1.5) should be [150%]
-FAIL Web Animations: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%] assert_equals: expected "0 % " but got "- 30 % "
+PASS Web Animations: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%]
 PASS Web Animations: property <flex-basis> from [0%] to [100%] at (0) should be [0%]
 PASS Web Animations: property <flex-basis> from [0%] to [100%] at (0.4) should be [40%]
 PASS Web Animations: property <flex-basis> from [0%] to [100%] at (0.6) should be [60%]

Modified: trunk/Source/WebCore/ChangeLog (274197 => 274198)


--- trunk/Source/WebCore/ChangeLog	2021-03-10 05:30:39 UTC (rev 274197)
+++ trunk/Source/WebCore/ChangeLog	2021-03-10 06:20:46 UTC (rev 274198)
@@ -1,3 +1,16 @@
+2021-03-09  Antoine Quint  <[email protected]>
+
+        Correctly blend the flex-basis CSS property
+        https://bugs.webkit.org/show_bug.cgi?id=222981
+
+        Reviewed by Dean Jackson.
+
+        To correctly support blending of flex-basis we must ensure that negative values aren't
+        allowed but also ensure that "flex" doesn't interpolate if flex-basis can't either.
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+
 2021-03-09  Alex Christensen  <[email protected]>
 
         HTTPS upgrade should allow same-site redirects from HTTPS to HTTP

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (274197 => 274198)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-03-10 05:30:39 UTC (rev 274197)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-03-10 06:20:46 UTC (rev 274198)
@@ -1572,6 +1572,11 @@
         return a->flexBasis() == b->flexBasis() && a->flexGrow() == b->flexGrow() && a->flexShrink() == b->flexShrink();
     }
 
+    bool canInterpolate(const RenderStyle* a, const RenderStyle* b) const override
+    {
+        return a->flexGrow() != b->flexGrow() && a->flexShrink() != b->flexShrink() && canInterpolateLengths(a->flexBasis(), b->flexBasis(), false);
+    }
+
     void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
     {
         dst->setFlexBasis(blendFunc(anim, a->flexBasis(), b->flexBasis(), progress));
@@ -1968,7 +1973,7 @@
         new PropertyWrapper<TextUnderlineOffset>(CSSPropertyTextUnderlineOffset, &RenderStyle::textUnderlineOffset, &RenderStyle::setTextUnderlineOffset),
         new PropertyWrapperVisitedAffectedColor(CSSPropertyTextDecorationColor, &RenderStyle::textDecorationColor, &RenderStyle::setTextDecorationColor, &RenderStyle::visitedLinkTextDecorationColor, &RenderStyle::setVisitedLinkTextDecorationColor),
 
-        new LengthPropertyWrapper(CSSPropertyFlexBasis, &RenderStyle::flexBasis, &RenderStyle::setFlexBasis),
+        new LengthPropertyWrapper(CSSPropertyFlexBasis, &RenderStyle::flexBasis, &RenderStyle::setFlexBasis, { LengthPropertyWrapper::Flags::NegativeLengthsAreInvalid }),
         new NonNegativeFloatPropertyWrapper(CSSPropertyFlexGrow, &RenderStyle::flexGrow, &RenderStyle::setFlexGrow),
         new NonNegativeFloatPropertyWrapper(CSSPropertyFlexShrink, &RenderStyle::flexShrink, &RenderStyle::setFlexShrink),
         new PropertyWrapper<int>(CSSPropertyOrder, &RenderStyle::order, &RenderStyle::setOrder),
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to