Changeset 269963 in webkit
- Timestamp:
- Nov 18, 2020 9:51:39 AM (20 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webanimations/scheduling-of-animation-without-keyframes-expected.txt (added)
-
LayoutTests/webanimations/scheduling-of-animation-without-keyframes.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/KeyframeEffect.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r269962 r269963 1 2020-11-18 Antoine Quint <graouts@webkit.org> 2 3 [Web Animations] Ensure we don't schedule animation udpates when there are no styles to update 4 https://bugs.webkit.org/show_bug.cgi?id=219071 5 6 Reviewed by Simon Fraser. 7 8 Add a test that creates animations with various empty keyframes parameters to check that we don't 9 schedule animation update for them. 10 11 * webanimations/scheduling-of-animation-without-keyframes-expected.txt: Added. 12 * webanimations/scheduling-of-animation-without-keyframes.html: Added. 13 1 14 2020-11-18 Antoine Quint <graouts@webkit.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r269962 r269963 1 2020-11-18 Antoine Quint <graouts@webkit.org> 2 3 [Web Animations] Ensure we don't schedule animation udpates when there are no styles to update 4 https://bugs.webkit.org/show_bug.cgi?id=219071 5 6 Reviewed by Simon Fraser. 7 8 Test: webanimations/scheduling-of-animation-without-keyframes.html 9 10 For keyframe effects that don't interpolate any CSS property, run the same logic that we already run 11 to determine when to schedule the next animation update in the case where we are running accelerated 12 animations. 13 14 * animation/KeyframeEffect.cpp: 15 (WebCore::KeyframeEffect::timeToNextTick const): 16 1 17 2020-11-18 Antoine Quint <graouts@webkit.org> 2 18 -
trunk/Source/WebCore/animation/KeyframeEffect.cpp
r269914 r269963 1980 1980 // The effect is in its "before" phase, in this case we can wait until it enters its "active" phase. 1981 1981 return delay() - *timing.localTime; 1982 case AnimationEffectPhase::Active: 1983 if (isCompletelyAccelerated() && isRunningAccelerated()) { 1984 // Fully-accelerated running CSS Animations need to trigger "animationiteration" events, in this case we must wait until the next iteration. 1982 case AnimationEffectPhase::Active: { 1983 auto doesNotAffectStyles = m_blendingKeyframes.isEmpty() || m_blendingKeyframes.properties().isEmpty(); 1984 auto completelyAcceleratedAndRunning = isCompletelyAccelerated() && isRunningAccelerated(); 1985 if (doesNotAffectStyles || completelyAcceleratedAndRunning) { 1986 // In the case of fully accelerated running effects and effects that don't actually target any CSS property, 1987 // we do not have a need to invalidate styles. 1985 1988 if (is<CSSAnimation>(animation())) { 1989 // However, CSS Animations need to trigger "animationiteration" events, in this case we must wait until the next iteration. 1986 1990 if (auto iterationProgress = getComputedTiming().simpleIterationProgress) 1987 1991 return iterationDuration() * (1 - *iterationProgress); 1988 1992 } 1989 // Fully-accelerated running effects in the "active" phase can wait until they ended.1993 // Other running effects in the "active" phase can wait until they end. 1990 1994 return endTime() - *timing.localTime; 1991 1995 } … … 1997 2001 // Other effects in the "active" phase will need to update their animated value at the immediate next opportunity. 1998 2002 return 0_s; 2003 } 1999 2004 case AnimationEffectPhase::After: 2000 2005 // The effect is in its after phase, which means it will no longer update its value, so it doens't need a tick.
Note: See TracChangeset
for help on using the changeset viewer.