Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Issue 46043014: Web Animations CSS: Unfreeze AnimationClock if sampling timelines does not trigger style recalc (Closed)

Created:
7 years, 1 month ago by Steve Block
Modified:
7 years, 1 month ago
Reviewers:
dstockwell, Timothy Loh
CC:
blink-reviews, shans, rjwright, alancutter (OOO until 2018), Mike Lawther (Google), dstockwell, Timothy Loh, darktears, Steve Block, dino_apple.com, Eric Willigers
Visibility:
Public.

Description

Web Animations CSS: Unfreeze AnimationClock if sampling timelines does not trigger style recalc When sampling the animations and transitions timelines, we set the AnimationClock's time and freeze it so that subsequent accesses of the clock's time during style recalc receive the same value. The clock is unfrozen when style recalc completes. However, if a timeline is sampled after its last Player is removed, it will not trigger style recalc *. This can occur if a transition is cancelled prematurely. In this case, we will fail to unfreeze the clock, so transitions started subsequently will see a stale clock time. This change modifies DocumentTimeline::serviceAnimations() to unfreeze the AnimationClock if it did not trigger a style recalc. It also adds a test to verify this behavior. * In non-CSS uses of the Web Animations model, a timeline can also fail to trigger style recalc if its animations have no effect or no target. BUG=303430, 248938 R=timloh@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=161134

Patch Set 1 #

Patch Set 2 : Fix unit test #

Patch Set 3 : Really fix unit tests #

Total comments: 4

Patch Set 4 : Handle both timelines #

Patch Set 5 : Fix test #

Patch Set 6 : Rebased and updated unit test #

Patch Set 7 : Reinstate assert #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+181 lines, -42 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A LayoutTests/transitions/cancel-and-start-new.html View 1 2 3 4 1 chunk +76 lines, -0 lines 0 comments Download
A LayoutTests/transitions/cancel-and-start-new-expected.txt View 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/animation/Animation.h View 1 chunk +3 lines, -2 lines 0 comments Download
M Source/core/animation/Animation.cpp View 3 chunks +11 lines, -6 lines 0 comments Download
M Source/core/animation/DocumentTimeline.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/animation/DocumentTimeline.cpp View 1 2 3 2 chunks +8 lines, -5 lines 0 comments Download
M Source/core/animation/DocumentTimelineTest.cpp View 1 2 3 4 5 5 chunks +54 lines, -16 lines 0 comments Download
M Source/core/animation/InertAnimation.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/animation/Player.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/animation/Player.cpp View 1 chunk +6 lines, -2 lines 0 comments Download
M Source/core/animation/PlayerTest.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/animation/TimedItem.h View 1 chunk +4 lines, -2 lines 0 comments Download
M Source/core/animation/TimedItem.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M Source/core/animation/TimedItemTest.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/frame/FrameView.cpp View 1 2 3 4 5 2 chunks +6 lines, -2 lines 1 comment Download

Messages

Total messages: 6 (0 generated)
Steve Block
7 years, 1 month ago (2013-10-30 02:20:08 UTC) #1
Timothy Loh
lgtm https://codereview.chromium.org/46043014/diff/70001/LayoutTests/transitions/cancel-and-start-new.html File LayoutTests/transitions/cancel-and-start-new.html (right): https://codereview.chromium.org/46043014/diff/70001/LayoutTests/transitions/cancel-and-start-new.html#newcode54 LayoutTests/transitions/cancel-and-start-new.html:54: var result = "<span style='color:red'>FAIL(was: " + left ...
7 years, 1 month ago (2013-10-30 03:55:06 UTC) #2
Steve Block
https://codereview.chromium.org/46043014/diff/70001/LayoutTests/transitions/cancel-and-start-new.html File LayoutTests/transitions/cancel-and-start-new.html (right): https://codereview.chromium.org/46043014/diff/70001/LayoutTests/transitions/cancel-and-start-new.html#newcode54 LayoutTests/transitions/cancel-and-start-new.html:54: var result = "<span style='color:red'>FAIL(was: " + left + ...
7 years, 1 month ago (2013-11-01 03:04:58 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/steveblock@chromium.org/46043014/290001
7 years, 1 month ago (2013-11-01 03:08:21 UTC) #4
commit-bot: I haz the power
Change committed as 161134
7 years, 1 month ago (2013-11-01 04:46:00 UTC) #5
dstockwell
7 years, 1 month ago (2013-11-05 05:05:43 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/46043014/diff/290001/Source/core/frame/FrameV...
File Source/core/frame/FrameView.cpp (right):

https://codereview.chromium.org/46043014/diff/290001/Source/core/frame/FrameV...
Source/core/frame/FrameView.cpp:2030: bool didTriggerStyleRecalc =
frame->document()->timeline()->serviceAnimations();
It's unfortunate that we have to thread this all the way out. Wouldn't it be
sufficient to test !(frame->document->needsStyleRecalc() ||
...->childNeedsStyleRecalc()) ?

Powered by Google App Engine
This is Rietveld 408576698