Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 086d3e1d9aebb93b28201fdc219a1bafde5c3028
      
https://github.com/WebKit/WebKit/commit/086d3e1d9aebb93b28201fdc219a1bafde5c3028
  Author: Antoine Quint <[email protected]>
  Date:   2024-11-30 (Sat, 30 Nov 2024)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-timeline-ignored.tentative-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/progress-based-animation-animation-longhand-properties.tentative-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/effect-updateTiming-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/intrinsic-iteration-duration.tentative-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/scroll-animation-effect-fill-modes.tentative-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/scroll-animation-effect-phases.tentative-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/setting-timeline.tentative-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/zero-intrinsic-iteration-duration.tentative-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/scroll-timeline-overallProgress.tentative-expected.txt
    M LayoutTests/platform/gtk/TestExpectations
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/animation/AnimationEffect.cpp
    M Source/WebCore/animation/AnimationEffect.h
    M Source/WebCore/animation/AnimationEffectTiming.cpp
    M Source/WebCore/animation/AnimationEffectTiming.h
    M Source/WebCore/animation/CSSAnimation.cpp
    M Source/WebCore/animation/CSSTransition.cpp
    M Source/WebCore/animation/EffectTiming.h
    M Source/WebCore/animation/KeyframeEffect.cpp
    M Source/WebCore/animation/KeyframeEffect.h
    M Source/WebCore/animation/WebAnimation.cpp
    M Source/WebCore/animation/WebAnimationTime.cpp
    M Source/WebCore/animation/WebAnimationTime.h
    M Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in

  Log Message:
  -----------
  [scroll-animations] account for start and end delays for progress-based 
animations
https://bugs.webkit.org/show_bug.cgi?id=283790
rdar://140650005

Reviewed by Dean Jackson.

So far, we have always assumed start and end delays for progress-based 
animations are irrelevant.
However, the procedure to normalize specified timing [0], which we partially 
implemented under
`AnimationEffect::normalizeSpecifiedTiming()`, calls out how to implement this. 
This incomplete
implementation causes a number of WPT failures.

To correctly normalize specified timing, we need to add the notion of a 
"specified start delay",
"specified end delay" and "specified iteration duration". Those are the values 
that come through
the JavaScript API or the relevant CSS properties. Normalizing the specified 
timing relies on those
properties as well as the animation playback rate, the timeline duration and 
the iteration count.

To correctly normalize the specified timing when required, we now add a new 
`m_timingDidMutate`
instance variable to `AnimationEffect` to track when one of those properties 
has been changed.
Then, we call `updateComputedTimingPropertiesIfNeeded()` when any of the timing 
properties that
depend on those is queried. This means that some methods that used to be 
`const` no longer are.

This in itself is an improvement because it allows us to remove the 
poorly-named public method
`AnimationEffect::updateStaticTimingProperties()` which was called outside of 
`AnimationEffect`
when other parts of the code assumed that timing may have been changed and 
computed properties
needed an update. Additionally, we remove the 
`AnimationEffect::normalizeSpecifiedTiming()`
method since this should be within the purview of the supporting 
`AnimationEffectTiming` object.

Now, `AnimationEffectTiming::updateComputedProperties()` deals with the 
normalization step as a
prelude to computing the "active duration" and the "end time". Correctly 
dealing with delays for
progress-based animations also allows us to remove some special casing for 
percentage timing values
throughout the rest of `AnimationEffectTiming`.

This yields significant WPT progress with 57 new PASS results, one unskipped 
reftest on macOS and one
flaky test now proving to be stable on all platforms.

[0] https://drafts.csswg.org/web-animations-2/#normalize-specified-timing

* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-timeline-ignored.tentative-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/progress-based-animation-animation-longhand-properties.tentative-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/effect-updateTiming-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/intrinsic-iteration-duration.tentative-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/scroll-animation-effect-fill-modes.tentative-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/scroll-animation-effect-phases.tentative-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/setting-timeline.tentative-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/zero-intrinsic-iteration-duration.tentative-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/scroll-timeline-overallProgress.tentative-expected.txt:
* LayoutTests/platform/gtk/TestExpectations:
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::getBindingsTiming const):
(WebCore::AnimationEffect::getBasicTiming):
(WebCore::AnimationEffect::getBindingsComputedTiming):
(WebCore::AnimationEffect::getComputedTiming):
(WebCore::AnimationEffect::updateTiming):
(WebCore::AnimationEffect::setIterations):
(WebCore::AnimationEffect::delay):
(WebCore::AnimationEffect::setDelay):
(WebCore::AnimationEffect::endDelay):
(WebCore::AnimationEffect::setEndDelay):
(WebCore::AnimationEffect::iterationDuration):
(WebCore::AnimationEffect::setIterationDuration):
(WebCore::AnimationEffect::activeDuration):
(WebCore::AnimationEffect::endTime):
(WebCore::AnimationEffect::timeToNextTick):
(WebCore::AnimationEffect::animationTimelineDidChange):
(WebCore::AnimationEffect::animationPlaybackRateDidChange):
(WebCore::AnimationEffect::updateComputedTimingPropertiesIfNeeded):
(WebCore::durationAPIValue): Deleted.
(WebCore::AnimationEffect::getBasicTiming const): Deleted.
(WebCore::AnimationEffect::getBindingsComputedTiming const): Deleted.
(WebCore::AnimationEffect::getComputedTiming const): Deleted.
(WebCore::AnimationEffect::normalizeSpecifiedTiming): Deleted.
(WebCore::AnimationEffect::updateStaticTimingProperties): Deleted.
(WebCore::AnimationEffect::timeToNextTick const): Deleted.
* Source/WebCore/animation/AnimationEffect.h:
(WebCore::AnimationEffect::specifiedDelay const):
(WebCore::AnimationEffect::specifiedEndDelay const):
(WebCore::AnimationEffect::specifiedIterationDuration const):
(WebCore::AnimationEffect::delay const): Deleted.
(WebCore::AnimationEffect::endDelay const): Deleted.
(WebCore::AnimationEffect::iterationDuration const): Deleted.
(WebCore::AnimationEffect::activeDuration const): Deleted.
(WebCore::AnimationEffect::endTime const): Deleted.
* Source/WebCore/animation/AnimationEffectTiming.cpp:
(WebCore::AnimationEffectTiming::updateComputedProperties):
(WebCore::AnimationEffectTiming::getBasicTiming const):
(WebCore::AnimationEffectTiming::resolve const):
* Source/WebCore/animation/AnimationEffectTiming.h:
* Source/WebCore/animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
* Source/WebCore/animation/CSSTransition.cpp:
(WebCore::CSSTransition::setTimingProperties):
* Source/WebCore/animation/EffectTiming.h:
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::backingAnimationForCompositedRenderer):
(WebCore::KeyframeEffect::timeToNextTick):
(WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): Deleted.
(WebCore::KeyframeEffect::timeToNextTick const): Deleted.
* Source/WebCore/animation/KeyframeEffect.h:
* Source/WebCore/animation/WebAnimation.cpp:
(WebCore::WebAnimation::setPlaybackRate):
(WebCore::WebAnimation::applyPendingPlaybackRate):
(WebCore::WebAnimation::playState const):
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::overallProgress const):
* Source/WebCore/animation/WebAnimationTime.cpp:
(WebCore::WebAnimationTime::isNaN const):
(WebCore::WebAnimationTime::matchingInfinity const):
* Source/WebCore/animation/WebAnimationTime.h:
* Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp:
(WebCore::buildObjectForEffect):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/287181@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to