Changeset 252951 in webkit
- Timestamp:
- Nov 29, 2019 2:17:00 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r252944 r252951 1 2019-11-29 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r252944. 4 https://bugs.webkit.org/show_bug.cgi?id=204709 5 6 Broke Windows Build (Requested by aakashja_ on #webkit). 7 8 Reverted changeset: 9 10 "[Web Animations] Forward-filling animations should not 11 schedule updates while filling" 12 https://bugs.webkit.org/show_bug.cgi?id=204697 13 https://trac.webkit.org/changeset/252944 14 1 15 2019-11-29 Antoine Quint <graouts@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r252950 r252951 1 2019-11-29 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r252944. 4 https://bugs.webkit.org/show_bug.cgi?id=204709 5 6 Broke Windows Build (Requested by aakashja_ on #webkit). 7 8 Reverted changeset: 9 10 "[Web Animations] Forward-filling animations should not 11 schedule updates while filling" 12 https://bugs.webkit.org/show_bug.cgi?id=204697 13 https://trac.webkit.org/changeset/252944 14 1 15 2019-11-29 Charlie Turner <cturner@igalia.com> 2 16 -
trunk/Source/WebCore/animation/DocumentTimeline.cpp
r252944 r252951 351 351 return; 352 352 353 // Updating animations and sending events may invalidate the timing of some animations, so we must set the m_animationResolutionScheduled354 // flag to false prior to running that procedure to allow animation with timing model updates to schedule updates.355 m_animationResolutionScheduled = false;356 357 353 internalUpdateAnimationsAndSendEvents(); 358 354 applyPendingAcceleratedAnimations(); 359 355 360 if (!m_animationResolutionScheduled)361 356 m_animationResolutionScheduled = false; 357 scheduleNextTick(); 362 358 } 363 359 … … 534 530 return; 535 531 532 for (const auto& animation : m_animations) { 533 if (!animation->isRunningAccelerated()) { 534 scheduleAnimationResolution(); 535 return; 536 } 537 } 538 536 539 Seconds scheduleDelay = Seconds::infinity(); 537 540 -
trunk/Source/WebCore/animation/KeyframeEffect.cpp
r252944 r252951 664 664 ExceptionOr<void> KeyframeEffect::setKeyframes(JSGlobalObject& lexicalGlobalObject, Strong<JSObject>&& keyframesInput) 665 665 { 666 auto processKeyframesResult = processKeyframes(lexicalGlobalObject, WTFMove(keyframesInput)); 667 if (!processKeyframesResult.hasException() && animation()) 668 animation()->effectTimingDidChange(); 669 return processKeyframesResult; 666 return processKeyframes(lexicalGlobalObject, WTFMove(keyframesInput)); 670 667 } 671 668 … … 1346 1343 void KeyframeEffect::addPendingAcceleratedAction(AcceleratedAction action) 1347 1344 { 1348 if (action == m_lastRecordedAcceleratedAction)1349 return;1350 1351 1345 if (action == AcceleratedAction::Stop) 1352 1346 m_pendingAcceleratedActions.clear(); … … 1388 1382 1389 1383 auto* renderer = this->renderer(); 1390 if (!renderer || !renderer->isComposited()) { 1391 // The renderer may no longer be composited because the accelerated animation ended before we had a chance to update it, 1392 // in which case if we asked for the animation to stop, we can discard the current set of accelerated actions. 1393 if (m_lastRecordedAcceleratedAction == AcceleratedAction::Stop) 1394 m_pendingAcceleratedActions.clear(); 1395 return; 1396 } 1384 if (!renderer || !renderer->isComposited()) 1385 return; 1397 1386 1398 1387 auto pendingAcceleratedActions = m_pendingAcceleratedActions; -
trunk/Source/WebCore/animation/WebAnimation.cpp
r252944 r252951 718 718 } 719 719 720 void WebAnimation::timingDidChange(DidSeek didSeek, SynchronouslyNotify synchronouslyNotify , Silently silently)720 void WebAnimation::timingDidChange(DidSeek didSeek, SynchronouslyNotify synchronouslyNotify) 721 721 { 722 722 m_shouldSkipUpdatingFinishedStateWhenResolving = false; … … 728 728 } 729 729 730 if ( silently == Silently::No &&m_timeline)730 if (m_timeline) 731 731 m_timeline->animationTimingDidChange(*this); 732 732 }; … … 980 980 981 981 // 5. Run the procedure to update an animation's finished state for animation with the did seek flag set to false, and the synchronously notify flag set to false. 982 timingDidChange(DidSeek::No, SynchronouslyNotify::No , Silently::Yes);982 timingDidChange(DidSeek::No, SynchronouslyNotify::No); 983 983 984 984 invalidateEffect(); … … 1106 1106 // 6. Run the procedure to update an animation's finished state for animation with the did seek flag set to false, and the 1107 1107 // synchronously notify flag set to false. 1108 timingDidChange(DidSeek::No, SynchronouslyNotify::No , Silently::Yes);1108 timingDidChange(DidSeek::No, SynchronouslyNotify::No); 1109 1109 1110 1110 invalidateEffect(); … … 1290 1290 Seconds WebAnimation::timeToNextTick() const 1291 1291 { 1292 // Any animation that is pending needs immediate resolution. 1292 ASSERT(isRunningAccelerated()); 1293 1293 1294 if (pending()) 1294 1295 return 0_s; 1295 1296 1296 // If we're not running, or time is not advancing for this animation, there's no telling when we'll end. 1297 auto playbackRate = effectivePlaybackRate(); 1298 if (playState() != PlayState::Running || !playbackRate) 1297 // If we're not running, there's no telling when we'll end. 1298 if (playState() != PlayState::Running) 1299 1299 return Seconds::infinity(); 1300 1300 1301 auto& effect = *this->effect(); 1302 auto timing = effect.getBasicTiming(); 1303 switch (timing.phase) { 1304 case AnimationEffectPhase::Before: 1305 // The animation is in its "before" phase, in this case we can wait until it enters its "active" phase. 1306 return (effect.delay() - timing.localTime.value()) / playbackRate; 1307 case AnimationEffectPhase::Active: 1308 // Non-accelerated animations in the "active" phase will need to update their animated value at the immediate next opportunity. 1309 if (!isRunningAccelerated()) 1310 return 0_s; 1311 // Accelerated CSS Animations need to trigger "animationiteration" events, in this case we can wait until the next iteration. 1312 if (isCSSAnimation()) { 1313 if (auto iterationProgress = effect.getComputedTiming().simpleIterationProgress) 1314 return effect.iterationDuration() * (1 - *iterationProgress); 1301 // CSS Animations dispatch events for each iteration, so compute the time until 1302 // the end of this iteration. Any other animation only cares about remaning total time. 1303 if (isCSSAnimation()) { 1304 auto* animationEffect = effect(); 1305 auto timing = animationEffect->getComputedTiming(); 1306 // If we're actively running, we need the time until the next iteration. 1307 if (auto iterationProgress = timing.simpleIterationProgress) 1308 return animationEffect->iterationDuration() * (1 - *iterationProgress); 1309 1310 // Otherwise we're probably in the before phase waiting to reach our start time. 1311 if (auto animationCurrentTime = currentTime()) { 1312 // If our current time is negative, we need to be scheduled to be resolved at the inverse 1313 // of our current time, unless we fill backwards, in which case we want to invalidate as 1314 // soon as possible. 1315 auto localTime = animationCurrentTime.value(); 1316 if (localTime < 0_s) 1317 return -localTime; 1318 if (localTime < animationEffect->delay()) 1319 return animationEffect->delay() - localTime; 1315 1320 } 1316 // Accelerated animations in the "active" phase can wait until they ended. 1317 return (effect.endTime() - timing.localTime.value()) / playbackRate; 1318 case AnimationEffectPhase::After: 1319 // The animation is in its after phase, which means it will no longer update its value, so it doens't need a tick. 1320 return Seconds::infinity(); 1321 case AnimationEffectPhase::Idle: 1322 ASSERT_NOT_REACHED(); 1323 return Seconds::infinity(); 1324 } 1321 } else if (auto animationCurrentTime = currentTime()) 1322 return effect()->endTime() - *animationCurrentTime; 1323 1324 ASSERT_NOT_REACHED(); 1325 return Seconds::infinity(); 1325 1326 } 1326 1327 -
trunk/Source/WebCore/animation/WebAnimation.h
r252944 r252951 155 155 enum class TimeToRunPendingTask : uint8_t { NotScheduled, ASAP, WhenReady }; 156 156 157 void timingDidChange(DidSeek, SynchronouslyNotify , Silently = Silently::No);157 void timingDidChange(DidSeek, SynchronouslyNotify); 158 158 void updateFinishedState(DidSeek, SynchronouslyNotify); 159 159 Seconds effectEndTime() const;
Note: See TracChangeset
for help on using the changeset viewer.