Changeset 289226 in webkit


Ignore:
Timestamp:
Feb 7, 2022 9:46:17 AM (5 months ago)
Author:
graouts@webkit.org
Message:

[css-logical] [web-animations] changing direction or writing-mode should clear computed keyframes
https://bugs.webkit.org/show_bug.cgi?id=236241

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progressions.

  • web-platform-tests/css/css-logical/animation-001-expected.txt:

Source/WebCore:

Any time the "direction" or "writing-mode" property changes, we must clear the computed keyframes
as we should re-resolve any logical properties used on the source keyframes.

  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::propertyAffectingLogicalPropertiesDidChange):

  • animation/KeyframeEffect.h:
  • animation/KeyframeEffectStack.cpp:

(WebCore::KeyframeEffectStack::applyKeyframeEffects):

Location:
trunk
Files:
6 edited

Legend:

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

    r289222 r289226  
     12022-02-07  Antoine Quint  <graouts@webkit.org>
     2
     3        [css-logical] [web-animations] changing direction or writing-mode should clear computed keyframes
     4        https://bugs.webkit.org/show_bug.cgi?id=236241
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark WPT progressions.
     9
     10        * web-platform-tests/css/css-logical/animation-001-expected.txt:
     11
    1122022-02-07  Antti Koivisto  <antti@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-001-expected.txt

    r289216 r289226  
    1616FAIL Physical shorthands and logical shorthands can be mixed assert_equals: expected "250px" but got "150px"
    1717PASS Physical properties win over logical properties even when some keyframes only have logical properties
    18 FAIL Animations update when the writing-mode is changed assert_equals: expected "50px" but got "0px"
    19 FAIL Filling animations update when the writing-mode is changed assert_equals: expected "100px" but got "0px"
    20 FAIL Animations with implicit from values update when the writing-mode is changed assert_equals: expected "200px" but got "100px"
    21 FAIL Animations with overlapping physical and logical properties update when the writing-mode is changed assert_equals: expected "50px" but got "0px"
    22 FAIL Animations update when the writing-mode is changed through a CSS variable assert_equals: expected "50px" but got "0px"
    23 FAIL Animations update when the direction is changed assert_equals: expected "0px" but got "50px"
     18PASS Animations update when the writing-mode is changed
     19PASS Filling animations update when the writing-mode is changed
     20PASS Animations with implicit from values update when the writing-mode is changed
     21PASS Animations with overlapping physical and logical properties update when the writing-mode is changed
     22PASS Animations update when the writing-mode is changed through a CSS variable
     23PASS Animations update when the direction is changed
    2424FAIL Logical shorthand with variable references animates correctly assert_equals: expected "250px" but got "auto"
    2525PASS writing-mode is not animatable
  • trunk/Source/WebCore/ChangeLog

    r289225 r289226  
     12022-02-07  Antoine Quint  <graouts@webkit.org>
     2
     3        [css-logical] [web-animations] changing direction or writing-mode should clear computed keyframes
     4        https://bugs.webkit.org/show_bug.cgi?id=236241
     5
     6        Reviewed by Dean Jackson.
     7
     8        Any time the "direction" or "writing-mode" property changes, we must clear the computed keyframes
     9        as we should re-resolve any logical properties used on the source keyframes.
     10
     11        * animation/KeyframeEffect.cpp:
     12        (WebCore::KeyframeEffect::propertyAffectingLogicalPropertiesDidChange):
     13        * animation/KeyframeEffect.h:
     14        * animation/KeyframeEffectStack.cpp:
     15        (WebCore::KeyframeEffectStack::applyKeyframeEffects):
     16
    1172022-02-07  Antoine Quint  <graouts@webkit.org>
    218
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r289216 r289226  
    17021702}
    17031703
     1704void KeyframeEffect::propertyAffectingLogicalPropertiesDidChange()
     1705{
     1706    if (m_blendingKeyframesSource == BlendingKeyframesSource::WebAnimation)
     1707        clearBlendingKeyframes();
     1708}
     1709
    17041710void KeyframeEffect::animationWasCanceled()
    17051711{
  • trunk/Source/WebCore/animation/KeyframeEffect.h

    r289211 r289226  
    127127    void animationTimingDidChange();
    128128    void transformRelatedPropertyDidChange();
     129    void propertyAffectingLogicalPropertiesDidChange();
    129130    OptionSet<AcceleratedActionApplicationResult> applyPendingAcceleratedActions();
    130131
  • trunk/Source/WebCore/animation/KeyframeEffectStack.cpp

    r287769 r289226  
    134134    }();
    135135
     136    auto propertyAffectingLogicalPropertiesChanged = previousLastStyleChangeEventStyle.direction() != targetStyle.direction()
     137        || previousLastStyleChangeEventStyle.writingMode() != targetStyle.writingMode();
     138
    136139    for (const auto& effect : sortedEffects()) {
    137140        ASSERT(effect->animation());
     141
     142        if (propertyAffectingLogicalPropertiesChanged)
     143            effect->propertyAffectingLogicalPropertiesDidChange();
     144
    138145        effect->animation()->resolve(targetStyle, resolutionContext);
    139146
Note: See TracChangeset for help on using the changeset viewer.