Changeset 289426 in webkit


Ignore:
Timestamp:
Feb 8, 2022 2:06:14 PM (5 months ago)
Author:
graouts@webkit.org
Message:

[css-logical] [css-animations] changing "direction" or "writing-mode" should recompute keyframes
https://bugs.webkit.org/show_bug.cgi?id=236293

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progressions.

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

Source/WebCore:

We need to recompute keyframes based on the matching @keyframes rule in case an element running
a CSS Animation changes either "direction" or "writing-mode".

  • 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

    r289424 r289426  
     12022-02-08  Antoine Quint  <graouts@webkit.org>
     2
     3        [css-logical] [css-animations] changing "direction" or "writing-mode" should recompute keyframes
     4        https://bugs.webkit.org/show_bug.cgi?id=236293
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark WPT progressions.
     9
     10        * web-platform-tests/css/css-logical/animation-002-expected.txt:
     11
    1122022-02-08  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-002-expected.txt

    r289181 r289426  
    88PASS Physical properties and logical properties can be mixed
    99PASS Declaration order is respected on each keyframe individually
    10 FAIL Animations update when the writing-mode is changed assert_equals: expected "50px" but got "0px"
    11 FAIL Filling animations update when the writing-mode is changed assert_equals: expected "100px" but got "0px"
    12 FAIL The number of interpolating properties can be increased when the writing-mode is changed assert_equals: expected "50px" but got "0px"
    13 FAIL The number of interpolating properties can be decreased when the writing-mode is changed assert_equals: expected "150px" but got "200px"
    14 FAIL Animations update when the writing-mode is changed through a CSS variable assert_equals: expected "50px" but got "0px"
     10PASS Animations update when the writing-mode is changed
     11PASS Filling animations update when the writing-mode is changed
     12PASS The number of interpolating properties can be increased when the writing-mode is changed
     13PASS The number of interpolating properties can be decreased when the writing-mode is changed
     14PASS Animations update when the writing-mode is changed through a CSS variable
    1515PASS Logical shorthand with variable references animates correctly
    16 FAIL Animations update when the direction is changed assert_equals: expected "0px" but got "50px"
     16PASS Animations update when the direction is changed
    1717
  • trunk/Source/WebCore/ChangeLog

    r289425 r289426  
     12022-02-08  Antoine Quint  <graouts@webkit.org>
     2
     3        [css-logical] [css-animations] changing "direction" or "writing-mode" should recompute keyframes
     4        https://bugs.webkit.org/show_bug.cgi?id=236293
     5
     6        Reviewed by Dean Jackson.
     7
     8        We need to recompute keyframes based on the matching @keyframes rule in case an element running
     9        a CSS Animation changes either "direction" or "writing-mode".
     10
     11        * animation/KeyframeEffect.cpp:
     12        (WebCore::KeyframeEffect::propertyAffectingLogicalPropertiesDidChange):
     13        * animation/KeyframeEffect.h:
     14        * animation/KeyframeEffectStack.cpp:
     15        (WebCore::KeyframeEffectStack::applyKeyframeEffects):
     16
    1172022-02-08  Alan Bujtas  <zalan@apple.com>
    218
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r289226 r289426  
    17021702}
    17031703
    1704 void KeyframeEffect::propertyAffectingLogicalPropertiesDidChange()
    1705 {
    1706     if (m_blendingKeyframesSource == BlendingKeyframesSource::WebAnimation)
     1704void KeyframeEffect::propertyAffectingLogicalPropertiesDidChange(RenderStyle& unanimatedStyle, const Style::ResolutionContext& resolutionContext)
     1705{
     1706    switch (m_blendingKeyframesSource) {
     1707    case BlendingKeyframesSource::CSSTransition:
     1708        return;
     1709    case BlendingKeyframesSource::CSSAnimation:
     1710        computeCSSAnimationBlendingKeyframes(unanimatedStyle, resolutionContext);
     1711        return;
     1712    case BlendingKeyframesSource::WebAnimation:
    17071713        clearBlendingKeyframes();
     1714        return;
     1715    }
    17081716}
    17091717
  • trunk/Source/WebCore/animation/KeyframeEffect.h

    r289226 r289426  
    127127    void animationTimingDidChange();
    128128    void transformRelatedPropertyDidChange();
    129     void propertyAffectingLogicalPropertiesDidChange();
     129    void propertyAffectingLogicalPropertiesDidChange(RenderStyle&, const Style::ResolutionContext&);
    130130    OptionSet<AcceleratedActionApplicationResult> applyPendingAcceleratedActions();
    131131
  • trunk/Source/WebCore/animation/KeyframeEffectStack.cpp

    r289226 r289426  
    137137        || previousLastStyleChangeEventStyle.writingMode() != targetStyle.writingMode();
    138138
     139    auto unanimatedStyle = RenderStyle::clone(targetStyle);
     140
    139141    for (const auto& effect : sortedEffects()) {
    140142        ASSERT(effect->animation());
    141143
    142144        if (propertyAffectingLogicalPropertiesChanged)
    143             effect->propertyAffectingLogicalPropertiesDidChange();
     145            effect->propertyAffectingLogicalPropertiesDidChange(unanimatedStyle, resolutionContext);
    144146
    145147        effect->animation()->resolve(targetStyle, resolutionContext);
Note: See TracChangeset for help on using the changeset viewer.