Changeset 268809 in webkit
- Timestamp:
- Oct 21, 2020, 11:10:52 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webanimations/transition-restart-after-style-recalc-during-transitionend-expected.txt (added)
-
LayoutTests/webanimations/transition-restart-after-style-recalc-during-transitionend.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/DocumentTimeline.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r268807 r268809 1 2020-10-21 Antoine Quint <graouts@webkit.org> 2 3 REGRESSION (r263729): transform transition doesn't restart 4 https://bugs.webkit.org/show_bug.cgi?id=218011 5 <rdar://problem/70035130> 6 7 Reviewed by Dean Jackson. 8 9 Add a new test that checks that forcing a style update during dispatch of the "transitionend" event 10 does not prevent the completed transition from starting again if reset. 11 12 * webanimations/transition-restart-after-style-recalc-during-transitionend-expected.txt: Added. 13 * webanimations/transition-restart-after-style-recalc-during-transitionend.html: Added. 14 1 15 2020-10-21 Antoine Quint <graouts@webkit.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r268808 r268809 1 2020-10-21 Antoine Quint <graouts@webkit.org> 2 3 REGRESSION (r263729): transform transition doesn't restart 4 https://bugs.webkit.org/show_bug.cgi?id=218011 5 6 Reviewed by Dean Jackson. 7 <rdar://problem/70035130> 8 9 In the case of accelerated animations, style for the targeted element is not updated while the animation is 10 in flight since the animation is performed by Core Animation. This means that by the time the "transitionend" 11 event is fired, a transition has not yet performed style updates for the element that would have already been 12 performed for a software animations and thus the updates to the completed and running transition maps performed 13 under AnimationTimeline::updateCSSTransitionsForStyleableAndProperty() may be out of sync with the assumptions 14 made in DocumentTimelinesController::updateAnimationsAndSendEvents() that a transition newly marked as finished 15 should be added to the list of completed transitions. 16 17 Indeed, in the newly-added test, if a style update is forced during the "transitionend" event listener before also 18 clearing the transition styles, two style updates, and thus two calls to updateCSSTransitionsForStyleableAndProperty(), 19 will have been performed by the time updateAnimationsAndSendEvents() runs again and collects completed transitions, 20 during which time the transition in question will have been removed from the list of running transitions and added 21 to the list of completed transitions (first update) and subsequently removed from the list of completed transitions 22 (second update). At this point, setting styles that would start a new transition for this property will not yield a 23 transition since we won't be able to satisfy the requirement that the new target value does not match that of the 24 completed transition. 25 26 In this change we stop assuming that just because updateAnimationsAndSendEvents() sees a transition as finished for 27 the first time it implies that the transition is still considered a running transition. As such we only add a transition 28 to the list of completed transitions should it be in the list of running transitions. 29 30 Test: webanimations/transition-restart-after-style-recalc-during-transitionend.html 31 32 * animation/DocumentTimeline.cpp: 33 (WebCore::DocumentTimeline::transitionDidComplete): 34 1 35 2020-10-21 Antoine Quint <graouts@webkit.org> 2 36 -
trunk/Source/WebCore/animation/DocumentTimeline.cpp
r268075 r268809 298 298 removeAnimation(*transition); 299 299 if (is<KeyframeEffect>(transition->effect())) { 300 if (auto styleable = downcast<KeyframeEffect>(transition->effect())->targetStyleable()) 301 styleable->ensureCompletedTransitionsByProperty().set(transition->property(), transition); 300 if (auto styleable = downcast<KeyframeEffect>(transition->effect())->targetStyleable()) { 301 auto property = transition->property(); 302 if (styleable->hasRunningTransitionForProperty(property)) 303 styleable->ensureCompletedTransitionsByProperty().set(property, transition); 304 } 302 305 } 303 306 }
Note:
See TracChangeset
for help on using the changeset viewer.