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

Issue 21012002: Web Animations: Trigger and update CSS Animations backed by the Web Animations model (Closed)

Created:
7 years, 4 months ago by dstockwell
Modified:
7 years, 4 months ago
Reviewers:
shans, Steve Block, dglazkov
CC:
blink-reviews, shans, rjwright, alancutter (OOO until 2018), Mike Lawther (Google), eae+blinkwatch, dglazkov+blink, Timothy Loh, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, Steve Block, Eric Willigers
Visibility:
Public.

Description

Web Animations: Trigger and update CSS Animations backed by the Web Animations model This patch introduces CSSAnimations which tracks the state of active CSS Animations for a single Element. CSS Animation updates are calculated and effects applied during the style resolution process (rather than post resolution as in the current implementation) to allow our implementation to move towards the behavior specified by the CSSWG -- that is, animations should apply as part of the style cascade before !important rules (see http://crbug.com/232273). This patch creates Keyframes from raw, unresolved CSS Values. A change is in progress to implement a factory for AnimatableValues which will allow reading of the appropriate resolved values from the render style (as the current implementation achieves by stashing away an entire RenderStyle. See StyleResolver::styleForKeyframe and CSSPropertyAnimation). This patch changes the lifetime of active CSS Animations to be managed by the Element (as long as it is attached). In the current implementation active animations are owned by the renderer but this has the consequence that animations are restarted on reattachment (see http://crbug.com/265302). Note that changes introduced by this patch are not yet shipping, they are governed by the WebAnimationsCSS runtime feature and --enable-web-animations-css flag in Chromium. This change is covered by existing layout tests in LayoutTests/animations/ -- however at this point these tests are still being run manually as there are several other dependencies before it will be feasible to enable the virtual suite for CSS Animations backed by Web Animations. BUG=258896, 265302, 232273 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155386

Patch Set 1 #

Total comments: 7

Patch Set 2 : Caculcate a delta during style resoltion and apply afterwards. #

Patch Set 3 : Recompute and apply updates to active animations after style resolution. #

Total comments: 8

Patch Set 4 : Address review feedback. #

Patch Set 5 : Fix windows build. #

Total comments: 17
Unified diffs Side-by-side diffs Delta from patch set Stats (+444 lines, -23 lines) Patch
M Source/core/animation/ActiveAnimations.h View 1 2 3 1 chunk +12 lines, -5 lines 2 comments Download
M Source/core/animation/AnimationStack.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/animation/Player.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/animation/Player.cpp View 1 chunk +9 lines, -0 lines 0 comments Download
A Source/core/animation/css/CSSAnimations.h View 1 2 1 chunk +85 lines, -0 lines 2 comments Download
A Source/core/animation/css/CSSAnimations.cpp View 1 2 3 4 1 chunk +203 lines, -0 lines 3 comments Download
M Source/core/core.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 3 5 chunks +11 lines, -4 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 3 10 chunks +95 lines, -7 lines 8 comments Download
M Source/core/dom/Document.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 chunks +12 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderObject.cpp View 1 2 2 chunks +12 lines, -3 lines 2 comments Download

Messages

Total messages: 18 (0 generated)
dstockwell
pdr for core/animation and dglazkov for the intersection with StyleResolver and Element.
7 years, 4 months ago (2013-07-29 05:28:15 UTC) #1
dglazkov
I am <__< about animation state living on Element/Document. Where can I go read about ...
7 years, 4 months ago (2013-07-29 18:15:38 UTC) #2
dstockwell
On 2013/07/29 18:15:38, Dimitri Glazkov wrote: > I am <__< about animation state living on ...
7 years, 4 months ago (2013-07-30 01:12:47 UTC) #3
dstockwell
On 2013/07/30 01:12:47, dstockwell wrote: > In the current animation system this state lives in ...
7 years, 4 months ago (2013-07-30 01:28:28 UTC) #4
dglazkov
https://codereview.chromium.org/21012002/diff/1/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/21012002/diff/1/Source/core/css/resolver/StyleResolver.cpp#newcode1274 Source/core/css/resolver/StyleResolver.cpp:1274: element->ensureActiveAnimations()->cssAnimations()->update(element, display, this, animations); I just spoke with shans@ ...
7 years, 4 months ago (2013-07-30 22:07:27 UTC) #5
dstockwell
On 2013/07/30 22:07:27, Dimitri Glazkov wrote: > Let's break this into two phases: > > ...
7 years, 4 months ago (2013-07-30 23:21:52 UTC) #6
dstockwell
On 2013/07/30 22:07:27, Dimitri Glazkov wrote: > WDYT? Done, PTAL! Your spidey sense was spot ...
7 years, 4 months ago (2013-08-01 07:51:05 UTC) #7
dglazkov
This came together nicely. lgtm on StyleResolver parts with comments. I tried to look over ...
7 years, 4 months ago (2013-08-01 16:12:46 UTC) #8
shans
LGTM on animations part. https://codereview.chromium.org/21012002/diff/15001/Source/core/animation/ActiveAnimations.h File Source/core/animation/ActiveAnimations.h (right): https://codereview.chromium.org/21012002/diff/15001/Source/core/animation/ActiveAnimations.h#newcode45 Source/core/animation/ActiveAnimations.h:45: CSSAnimations* cssAnimations() { return &m_cssAnimations; ...
7 years, 4 months ago (2013-08-01 23:54:15 UTC) #9
dstockwell
https://codereview.chromium.org/21012002/diff/15001/Source/core/animation/ActiveAnimations.h File Source/core/animation/ActiveAnimations.h (right): https://codereview.chromium.org/21012002/diff/15001/Source/core/animation/ActiveAnimations.h#newcode45 Source/core/animation/ActiveAnimations.h:45: CSSAnimations* cssAnimations() { return &m_cssAnimations; } On 2013/08/01 23:54:16, ...
7 years, 4 months ago (2013-08-02 00:11:01 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dstockwell@chromium.org/21012002/23001
7 years, 4 months ago (2013-08-02 00:11:28 UTC) #11
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 4 months ago (2013-08-02 00:53:48 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dstockwell@chromium.org/21012002/35001
7 years, 4 months ago (2013-08-02 01:22:55 UTC) #13
commit-bot: I haz the power
Change committed as 155386
7 years, 4 months ago (2013-08-02 04:45:40 UTC) #14
Steve Block
https://codereview.chromium.org/21012002/diff/35001/Source/core/animation/ActiveAnimations.h File Source/core/animation/ActiveAnimations.h (right): https://codereview.chromium.org/21012002/diff/35001/Source/core/animation/ActiveAnimations.h#newcode47 Source/core/animation/ActiveAnimations.h:47: // Tracks the state of active CSS Animations. When ...
7 years, 4 months ago (2013-08-06 03:57:00 UTC) #15
Steve Block
Was just reading through this now I'm back and think I've spotted a minor of ...
7 years, 4 months ago (2013-08-06 03:59:37 UTC) #16
dstockwell
Fixes in https://codereview.chromium.org/22364002/ https://codereview.chromium.org/21012002/diff/35001/Source/core/animation/ActiveAnimations.h File Source/core/animation/ActiveAnimations.h (right): https://codereview.chromium.org/21012002/diff/35001/Source/core/animation/ActiveAnimations.h#newcode47 Source/core/animation/ActiveAnimations.h:47: // Tracks the state of active ...
7 years, 4 months ago (2013-08-06 05:43:25 UTC) #17
Mike Lawther (Google)
7 years, 4 months ago (2013-08-06 06:01:10 UTC) #18
Message was sent while issue was closed.
https://codereview.chromium.org/21012002/diff/35001/Source/core/animation/css...
File Source/core/animation/css/CSSAnimations.cpp (right):

https://codereview.chromium.org/21012002/diff/35001/Source/core/animation/css...
Source/core/animation/css/CSSAnimations.cpp:139: if (animationData->isDelaySet()
&& animationData->delay())
On 2013/08/06 05:43:25, dstockwell wrote:
> On 2013/08/06 03:57:01, Steve Block wrote:
> > Do we check/force anywhere that delay() is non-negative?
> 
> Good catch, this can be negative and will be hard to deal with. Added an
assert
> for now.

It sounds like we'll want to deal with negative eventually? I usually like to
file a bug and link to it in a comment for
TODOs like this.

Powered by Google App Engine
This is Rietveld 408576698