⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287881 in webkit


Ignore:
Timestamp:
Jan 11, 2022, 8:20:06 AM (5 years ago)
Author:
graouts@webkit.org
Message:

css/css-transitions/KeyframeEffect-setKeyframes.tentative.html is a failure
https://bugs.webkit.org/show_bug.cgi?id=235062

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progressions.

  • web-platform-tests/css/css-transitions/KeyframeEffect-setKeyframes.tentative-expected.txt:

Source/WebCore:

The WPT at css/css-transitions/KeyframeEffect-setKeyframes.tentative.html, which checks
the behavior of programmatically changing keyframes for a CSS Transition, highlighted
three failures:

  1. we did not flush pending style changes as setKeyframes() was called for an animation created fromm CSS (CSS Transition or CSS Animation),
  2. we did not use the style from the last style update to computed the before-change style if available, but rather the computed style generated _after_ the last style update,
  3. we did not apply _all_ animations as we compute the before-change style to consider new transitions to run, but only animations matching the current property.

We've corrected all of those errors and this test now passes save for one failure, which
seems to be a different type of problem and will be looked at in a future patch.

  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::setBindingsKeyframes):

  • style/Styleable.cpp:

(WebCore::updateCSSTransitionsForStyleableAndProperty):

Location:
trunk
Files:
5 edited

Legend:

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

    r287878 r287881  
     12022-01-11  Antoine Quint  <graouts@webkit.org>
     2
     3        css/css-transitions/KeyframeEffect-setKeyframes.tentative.html is a failure
     4        https://bugs.webkit.org/show_bug.cgi?id=235062
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark WPT progressions.
     9
     10        * web-platform-tests/css/css-transitions/KeyframeEffect-setKeyframes.tentative-expected.txt:
     11
    1122022-01-11  Tim Nguyen  <ntim@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/KeyframeEffect-setKeyframes.tentative-expected.txt

    r287553 r287881  
    44PASS A transition with no keyframes still returns the original transitionProperty
    55PASS A transition with replaced keyframes animating the same property still exhibits normal reversing behavior.
    6 FAIL A transition with replaced keyframes animating a different property still exhibits normal reversing behavior  (reversing from the base value). undefined is not an object (evaluating 'reversedTransition.effect')
    7 FAIL A transition with replaced keyframes animating nothing still exhibits normal reversing behavior (reversing from the base value). undefined is not an object (evaluating 'reversedTransition.effect')
     6PASS A transition with replaced keyframes animating a different property still exhibits normal reversing behavior  (reversing from the base value).
     7PASS A transition with replaced keyframes animating nothing still exhibits normal reversing behavior (reversing from the base value).
    88FAIL A transition with replaced keyframes animating nothing on a property being controlled by another modified transition exhibits normal reversing behavior and reverses from the other transition's current value. assert_equals: The reversed transition gets its start value from the other transition controlling left expected "280px" but got "200px"
    9 FAIL A transition with replaced kefyrames and composite 'add' exhibits normal reversing behavior, and the effect is not double counted when calculating the before change style assert_equals: The start value matches the 'before change' value expected "175px" but got "150px"
     9PASS A transition with replaced kefyrames and composite 'add' exhibits normal reversing behavior, and the effect is not double counted when calculating the before change style
    1010
  • trunk/Source/WebCore/ChangeLog

    r287880 r287881  
     12022-01-11  Antoine Quint  <graouts@webkit.org>
     2
     3        css/css-transitions/KeyframeEffect-setKeyframes.tentative.html is a failure
     4        https://bugs.webkit.org/show_bug.cgi?id=235062
     5
     6        Reviewed by Dean Jackson.
     7
     8        The WPT at css/css-transitions/KeyframeEffect-setKeyframes.tentative.html, which checks
     9        the behavior of programmatically changing keyframes for a CSS Transition, highlighted
     10        three failures:
     11
     12        1. we did not flush pending style changes as setKeyframes() was called for an animation
     13           created fromm CSS (CSS Transition or CSS Animation),
     14        2. we did not use the style from the last style update to computed the before-change style
     15           if available, but rather the computed style generated _after_ the last style update,
     16        3. we did not apply _all_ animations as we compute the before-change style to consider
     17           new transitions to run, but only animations matching the current property.
     18
     19        We've corrected all of those errors and this test now passes save for one failure, which
     20        seems to be a different type of problem and will be looked at in a future patch.
     21
     22        * animation/KeyframeEffect.cpp:
     23        (WebCore::KeyframeEffect::setBindingsKeyframes):
     24        * style/Styleable.cpp:
     25        (WebCore::updateCSSTransitionsForStyleableAndProperty):
     26
    1272022-01-11  Andres Gonzalez  <andresg_22@apple.com>
    228
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r287877 r287881  
    820820ExceptionOr<void> KeyframeEffect::setBindingsKeyframes(JSGlobalObject& lexicalGlobalObject, Strong<JSObject>&& keyframesInput)
    821821{
     822    if (is<DeclarativeAnimation>(animation()))
     823        downcast<DeclarativeAnimation>(*animation()).flushPendingStyleChanges();
    822824    auto retVal = setKeyframes(lexicalGlobalObject, WTFMove(keyframesInput));
    823825    if (!retVal.hasException() && is<CSSAnimation>(animation()))
  • trunk/Source/WebCore/style/Styleable.cpp

    r287769 r287881  
    411411    // any styles derived from declarative animations such as CSS Transitions, CSS Animations, and SMIL Animations updated to the current time.
    412412    auto beforeChangeStyle = [&]() -> const RenderStyle {
    413         if (animation && animation->isRelevant()) {
    414             auto animatedStyle = RenderStyle::clone(currentStyle);
    415             // If a transition has not yet started or started when animations were last updated, use the timeline time at its creation
    416             // as its start time to ensure that it will produce a style with progress > 0.
    417             bool shouldUseTimelineTimeAtCreation = is<CSSTransition>(animation) && (!animation->startTime() || *animation->startTime() == styleable.element.document().timeline().currentTime());
    418             animation->resolve(animatedStyle, { nullptr }, shouldUseTimelineTimeAtCreation ? downcast<CSSTransition>(*animation).timelineTimeAtCreation() : std::nullopt);
    419             return animatedStyle;
    420         }
    421 
    422         // If it exists, use the recorded RenderStyle for this element during a previous call to Style::TreeResolver::createAnimatedElementUpdate().
    423         if (auto* lastStyleChangeEventStyle = styleable.lastStyleChangeEventStyle())
    424             return RenderStyle::clone(*lastStyleChangeEventStyle);
    425 
    426         // If we haven't computed styles from animations for this element, the before-change style is the previously resolved style for this element.
     413        if (auto* lastStyleChangeEventStyle = styleable.lastStyleChangeEventStyle()) {
     414            auto style = RenderStyle::clone(*lastStyleChangeEventStyle);
     415            if (auto* keyframeEffectStack = styleable.keyframeEffectStack()) {
     416                for (const auto& effect : keyframeEffectStack->sortedEffects()) {
     417                    auto* effectAnimation = effect->animation();
     418                    bool shouldUseTimelineTimeAtCreation = is<CSSTransition>(effectAnimation) && (!effectAnimation->startTime() || *effectAnimation->startTime() == styleable.element.document().timeline().currentTime());
     419                    effectAnimation->resolve(style, { nullptr }, shouldUseTimelineTimeAtCreation ? downcast<CSSTransition>(*effectAnimation).timelineTimeAtCreation() : std::nullopt);
     420                }
     421            }
     422            return style;
     423        }
    427424        return RenderStyle::clone(currentStyle);
    428425    }();
Note: See TracChangeset for help on using the changeset viewer.