Changeset 289453 in webkit


Ignore:
Timestamp:
Feb 8, 2022 10:22:01 PM (5 months ago)
Author:
graouts@webkit.org
Message:

[web-animations] Animation.commitStyles() should use the non-animated style
https://bugs.webkit.org/show_bug.cgi?id=236315

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progression.

  • web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt:

Source/WebCore:

  • animation/WebAnimation.cpp:

(WebCore::WebAnimation::commitStyles):

Location:
trunk
Files:
4 edited

Legend:

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

    r289451 r289453  
     12022-02-08  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] Animation.commitStyles() should use the non-animated style
     4        https://bugs.webkit.org/show_bug.cgi?id=236315
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark WPT progression.
     9
     10        * web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt:
     11
    1122022-02-08  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt

    r289216 r289453  
    1515PASS Commits "none" transform
    1616PASS Commits the intermediate value of an animation in the middle of stack
    17 FAIL Commit composites on top of the underlying value assert_approx_equals: expected 0.5 +/- 0.0001 but got 1
     17PASS Commit composites on top of the underlying value
    1818PASS Triggers mutation observers when updating style
    1919FAIL Does NOT trigger mutation observers when the change to style is redundant assert_equals: Should have no mutation records expected 0 but got 1
  • trunk/Source/WebCore/ChangeLog

    r289451 r289453  
     12022-02-08  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] Animation.commitStyles() should use the non-animated style
     4        https://bugs.webkit.org/show_bug.cgi?id=236315
     5
     6        Reviewed by Dean Jackson.
     7
     8        * animation/WebAnimation.cpp:
     9        (WebCore::WebAnimation::commitStyles):
     10
    1112022-02-08  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebCore/animation/WebAnimation.cpp

    r289357 r289453  
    14521452    // animation whose effect target is target.
    14531453
    1454     auto& style = renderer->style();
     1454    auto unanimatedStyle = [&]() {
     1455        if (auto styleable = Styleable::fromRenderer(*renderer)) {
     1456            if (auto* lastStyleChangeEventStyle = styleable->lastStyleChangeEventStyle())
     1457                return RenderStyle::clone(*lastStyleChangeEventStyle);
     1458        }
     1459        // If we don't have a style for the last style change event, then the
     1460        // current renderer style cannot be animated.
     1461        return RenderStyle::clone(renderer->style());
     1462    }();
     1463
    14551464    auto computedStyleExtractor = ComputedStyleExtractor(&styledElement);
    14561465    auto inlineStyle = styledElement.document().createCSSStyleDeclaration();
     
    14721481        // We actually perform those steps in a different way: instead of building a copy of the effect stack and then removing stuff, we iterate through the
    14731482        // effect stack and stop when we've found this animation's effect or when we've found an effect associated with an animation with a higher composite order.
    1474         auto animatedStyle = RenderStyle::clonePtr(style);
     1483        auto animatedStyle = RenderStyle::clonePtr(unanimatedStyle);
    14751484        for (const auto& effectInStack : keyframeStack.sortedEffects()) {
    14761485            if (effectInStack->animation() != this && !compareAnimationsByCompositeOrder(*effectInStack->animation(), *this))
Note: See TracChangeset for help on using the changeset viewer.