Changeset 274198 in webkit


Ignore:
Timestamp:
Mar 9, 2021 10:20:46 PM (17 months ago)
Author:
graouts@webkit.org
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):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r274167 r274198  
     12021-03-09  Antoine Quint  <graouts@webkit.org>
     2
     3        Correctly blend the flex-basis CSS property
     4        https://bugs.webkit.org/show_bug.cgi?id=222981
     5
     6        Reviewed by Dean Jackson.
     7
     8        Add an extra 14 PASS results. We now pass all the flex-basis interpolation tests.
     9
     10        * web-platform-tests/css/css-flexbox/animation/flex-basis-composition-expected.txt:
     11        * web-platform-tests/css/css-flexbox/animation/flex-basis-interpolation-expected.txt:
     12
    1132021-03-09  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/animation/flex-basis-composition-expected.txt

    r274038 r274198  
    99FAIL 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 "
    1010FAIL Compositing: property <flex-basis> underlying [100px] from add [10px] to add [2px] at (1) should be [102px] assert_equals: expected "102px " but got "2px "
    11 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 "
     11FAIL 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 "
    1212FAIL 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 "
    1313FAIL 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 "
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/animation/flex-basis-interpolation-expected.txt

    r272904 r274198  
    3131PASS CSS Transitions: property <flex-basis> from [initial] to [2%] at (1) should be [2%]
    3232PASS CSS Transitions: property <flex-basis> from [initial] to [2%] at (1.5) should be [2%]
    33 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 "
    34 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 "
    35 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 "
     33PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (-0.3) should be [2%]
     34PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (0) should be [2%]
     35PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (0.3) should be [2%]
    3636PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (0.5) should be [2%]
    3737PASS CSS Transitions with transition: all: property <flex-basis> from [initial] to [2%] at (0.6) should be [2%]
     
    8383PASS CSS Transitions: property <flex-basis> from [unset] to [2%] at (1) should be [2%]
    8484PASS CSS Transitions: property <flex-basis> from [unset] to [2%] at (1.5) should be [2%]
    85 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 "
    86 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 "
    87 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 "
     85PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (-0.3) should be [2%]
     86PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (0) should be [2%]
     87PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (0.3) should be [2%]
    8888PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (0.5) should be [2%]
    8989PASS CSS Transitions with transition: all: property <flex-basis> from [unset] to [2%] at (0.6) should be [2%]
     
    104104PASS Web Animations: property <flex-basis> from [unset] to [2%] at (1) should be [2%]
    105105PASS Web Animations: property <flex-basis> from [unset] to [2%] at (1.5) should be [2%]
    106 FAIL CSS Transitions: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px] assert_equals: expected "0px " but got "- 30px "
     106PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px]
    107107PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (0) should be [0px]
    108108PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (0.4) should be [40px]
     
    110110PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (1) should be [100px]
    111111PASS CSS Transitions: property <flex-basis> from [0px] to [100px] at (1.5) should be [150px]
    112 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 "
     112PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px]
    113113PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (0) should be [0px]
    114114PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (0.4) should be [40px]
     
    116116PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (1) should be [100px]
    117117PASS CSS Transitions with transition: all: property <flex-basis> from [0px] to [100px] at (1.5) should be [150px]
    118 FAIL CSS Animations: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px] assert_equals: expected "0px " but got "- 30px "
     118PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px]
    119119PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (0) should be [0px]
    120120PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (0.4) should be [40px]
     
    122122PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (1) should be [100px]
    123123PASS CSS Animations: property <flex-basis> from [0px] to [100px] at (1.5) should be [150px]
    124 FAIL Web Animations: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px] assert_equals: expected "0px " but got "- 30px "
     124PASS Web Animations: property <flex-basis> from [0px] to [100px] at (-0.3) should be [0px]
    125125PASS Web Animations: property <flex-basis> from [0px] to [100px] at (0) should be [0px]
    126126PASS Web Animations: property <flex-basis> from [0px] to [100px] at (0.4) should be [40px]
     
    128128PASS Web Animations: property <flex-basis> from [0px] to [100px] at (1) should be [100px]
    129129PASS Web Animations: property <flex-basis> from [0px] to [100px] at (1.5) should be [150px]
    130 FAIL CSS Transitions: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%] assert_equals: expected "0 % " but got "- 30 % "
     130PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%]
    131131PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (0) should be [0%]
    132132PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (0.4) should be [40%]
     
    134134PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (1) should be [100%]
    135135PASS CSS Transitions: property <flex-basis> from [0%] to [100%] at (1.5) should be [150%]
    136 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 % "
     136PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%]
    137137PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (0) should be [0%]
    138138PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (0.4) should be [40%]
     
    140140PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (1) should be [100%]
    141141PASS CSS Transitions with transition: all: property <flex-basis> from [0%] to [100%] at (1.5) should be [150%]
    142 FAIL CSS Animations: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%] assert_equals: expected "0 % " but got "- 30 % "
     142PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%]
    143143PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (0) should be [0%]
    144144PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (0.4) should be [40%]
     
    146146PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (1) should be [100%]
    147147PASS CSS Animations: property <flex-basis> from [0%] to [100%] at (1.5) should be [150%]
    148 FAIL Web Animations: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%] assert_equals: expected "0 % " but got "- 30 % "
     148PASS Web Animations: property <flex-basis> from [0%] to [100%] at (-0.3) should be [0%]
    149149PASS Web Animations: property <flex-basis> from [0%] to [100%] at (0) should be [0%]
    150150PASS Web Animations: property <flex-basis> from [0%] to [100%] at (0.4) should be [40%]
  • trunk/Source/WebCore/ChangeLog

    r274197 r274198  
     12021-03-09  Antoine Quint  <graouts@webkit.org>
     2
     3        Correctly blend the flex-basis CSS property
     4        https://bugs.webkit.org/show_bug.cgi?id=222981
     5
     6        Reviewed by Dean Jackson.
     7
     8        To correctly support blending of flex-basis we must ensure that negative values aren't
     9        allowed but also ensure that "flex" doesn't interpolate if flex-basis can't either.
     10
     11        * animation/CSSPropertyAnimation.cpp:
     12        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     13
    1142021-03-09  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r274147 r274198  
    15731573    }
    15741574
     1575    bool canInterpolate(const RenderStyle* a, const RenderStyle* b) const override
     1576    {
     1577        return a->flexGrow() != b->flexGrow() && a->flexShrink() != b->flexShrink() && canInterpolateLengths(a->flexBasis(), b->flexBasis(), false);
     1578    }
     1579
    15751580    void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const override
    15761581    {
     
    19691974        new PropertyWrapperVisitedAffectedColor(CSSPropertyTextDecorationColor, &RenderStyle::textDecorationColor, &RenderStyle::setTextDecorationColor, &RenderStyle::visitedLinkTextDecorationColor, &RenderStyle::setVisitedLinkTextDecorationColor),
    19701975
    1971         new LengthPropertyWrapper(CSSPropertyFlexBasis, &RenderStyle::flexBasis, &RenderStyle::setFlexBasis),
     1976        new LengthPropertyWrapper(CSSPropertyFlexBasis, &RenderStyle::flexBasis, &RenderStyle::setFlexBasis, { LengthPropertyWrapper::Flags::NegativeLengthsAreInvalid }),
    19721977        new NonNegativeFloatPropertyWrapper(CSSPropertyFlexGrow, &RenderStyle::flexGrow, &RenderStyle::setFlexGrow),
    19731978        new NonNegativeFloatPropertyWrapper(CSSPropertyFlexShrink, &RenderStyle::flexShrink, &RenderStyle::setFlexShrink),
Note: See TracChangeset for help on using the changeset viewer.