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

Issue 96283002: Web Animations API: Start implementation of Element.animate(). (Closed)

Created:
7 years ago by rjwright
Modified:
7 years ago
CC:
blink-reviews, alancutter (OOO until 2018), Mike Lawther (Google), dglazkov+blink, Timothy Loh, apavlov+blink_chromium.org, Inactive, darktears, arv+blink, dino_apple.com, watchdog-blink-watchlist_google.com, Eric Willigers
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Web Animations API: Start implementation of Element.animate(). This is the first in a series of patches to implement the Web Animations API (see http://dev.w3.org/fxtf/web-animations/). Please note that this work is being completed behind a runtime flag. While the Web Animations model is now used to support CSS Animations and Transitions, there are some important differences between that use and the API: * CSS Animations and Transitions operate on computed style, and are inherently resolution-dependent mechanisms. Web Animations is style resolution independent. * CSS Animations and Transitions accept the use of -webkit prefixed properties. Following the principle of deprecating prefixing for new APIs, the Web Animations JS API does not. Note that this *may* require us to gate release of this feature on unprefixing of -webkit-transform. As an initial patch, this code takes some shortcuts that will eventually be replaced. Most notably, we temporarily make use of StyleResolver for the purpose of parsing CSS Strings into usable values. This will be switched out in the future in favor of an approach that doesn't resolve styles at the same time. BUG=327564 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=163761

Patch Set 1 #

Total comments: 56

Patch Set 2 : #

Total comments: 19

Patch Set 3 : Remove explicit calls to StyleResolverState into StyleResolver. #

Patch Set 4 : Convert camelCase property names into CSSPropertyIDs in the CSSParser #

Total comments: 4

Patch Set 5 : Small changes to StyleResolver::setKeyframePropertyValues. #

Patch Set 6 : Add layout test for animate() #

Total comments: 29

Patch Set 7 : Move property name parsing. Return KAE from setKeyframePropertyValues. Improve test. #

Total comments: 2

Patch Set 8 : Added unit test (WIP) #

Total comments: 28

Patch Set 9 : Move web-animations-api layout tests into LayoutTest. #

Total comments: 20

Patch Set 10 : Added test for camelCaseCSSPropertyNameToID. Improved layout and unit tests. #

Patch Set 11 : Change first param type of StyleResolver::createKeyframeAnimationEffect to Element& #

Patch Set 12 : Added test to check that animate() does not leak into stable. #

Total comments: 2

Patch Set 13 : Change description of LayoutTests/webexposed/element-animate.html. #

Patch Set 14 : #

Patch Set 15 : Fix broken unit test #

Total comments: 1

Patch Set 16 : Cleaned up unit test and made startAnimation private. #

Patch Set 17 : Fix nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+506 lines, -0 lines) Patch
A LayoutTests/virtual/stable/webexposed/element-animate-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/web-animations-api/element-animate-list-of-keyframes.html View 1 2 3 4 5 6 7 8 9 1 chunk +64 lines, -0 lines 0 comments Download
A LayoutTests/web-animations-api/element-animate-list-of-keyframes-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
A LayoutTests/webexposed/element-animate.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +11 lines, -0 lines 0 comments Download
A LayoutTests/webexposed/element-animate-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +10 lines, -0 lines 0 comments Download
M Source/core/animation/DocumentTimeline.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
A Source/core/animation/ElementAnimation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +54 lines, -0 lines 0 comments Download
A Source/core/animation/ElementAnimation.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +147 lines, -0 lines 0 comments Download
A Source/core/animation/ElementAnimation.idl View 1 1 chunk +33 lines, -0 lines 0 comments Download
A Source/core/animation/ElementAnimationTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +146 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 3 chunks +4 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 53 (0 generated)
rjwright
7 years ago (2013-11-29 05:34:39 UTC) #1
dstockwell
I just skimmed quickly, here are some high level comments: https://codereview.chromium.org/96283002/diff/1/Source/core/animation/AnimatedElement.h File Source/core/animation/AnimatedElement.h (right): https://codereview.chromium.org/96283002/diff/1/Source/core/animation/AnimatedElement.h#newcode31 ...
7 years ago (2013-11-29 06:32:48 UTC) #2
Steve Block
Exciting stuff! We should't land this without some tests. Also did you look into a ...
7 years ago (2013-11-29 07:31:19 UTC) #3
apavlov
https://codereview.chromium.org/96283002/diff/1/Source/core/animation/AnimatedElement.cpp File Source/core/animation/AnimatedElement.cpp (right): https://codereview.chromium.org/96283002/diff/1/Source/core/animation/AnimatedElement.cpp#newcode54 Source/core/animation/AnimatedElement.cpp:54: static CSSPropertyID v8PropertyToCSSPropertyID(String propertyName) On 2013/11/29 07:31:19, Steve Block ...
7 years ago (2013-11-29 09:19:02 UTC) #4
dstockwell
On 2013/11/29 07:31:19, Steve Block wrote: > > The flag is webAnimationsAPI. > Nit. That's ...
7 years ago (2013-12-02 01:19:15 UTC) #5
Steve Block
> The runtime feature is experimental so we shouldn't need a > command line flag ...
7 years ago (2013-12-02 01:59:42 UTC) #6
Steve Block
https://codereview.chromium.org/96283002/diff/1/Source/core/animation/AnimatedElement.cpp File Source/core/animation/AnimatedElement.cpp (right): https://codereview.chromium.org/96283002/diff/1/Source/core/animation/AnimatedElement.cpp#newcode95 Source/core/animation/AnimatedElement.cpp:95: dictionaryKeyframesVector[i].get("compositeOperation", compositeOperationString); This should be 'composite'. 'CompositeOperation' is the ...
7 years ago (2013-12-02 04:45:44 UTC) #7
rjwright
https://codereview.chromium.org/96283002/diff/1/Source/core/animation/AnimatedElement.cpp File Source/core/animation/AnimatedElement.cpp (right): https://codereview.chromium.org/96283002/diff/1/Source/core/animation/AnimatedElement.cpp#newcode32 Source/core/animation/AnimatedElement.cpp:32: On 2013/11/29 07:31:19, Steve Block wrote: > NO blank ...
7 years ago (2013-12-04 05:05:53 UTC) #8
esprehn
https://codereview.chromium.org/96283002/diff/40001/Source/core/animation/ElementAnimation.cpp File Source/core/animation/ElementAnimation.cpp (right): https://codereview.chromium.org/96283002/diff/40001/Source/core/animation/ElementAnimation.cpp#newcode102 Source/core/animation/ElementAnimation.cpp:102: RefPtr<RenderStyle> style = RenderStyle::clone(element->styleForRenderer().get()); Calling styleForRenderer() repeatedly for each ...
7 years ago (2013-12-04 06:14:13 UTC) #9
Steve Block
https://codereview.chromium.org/96283002/diff/40001/Source/core/animation/ElementAnimation.cpp File Source/core/animation/ElementAnimation.cpp (right): https://codereview.chromium.org/96283002/diff/40001/Source/core/animation/ElementAnimation.cpp#newcode52 Source/core/animation/ElementAnimation.cpp:52: static CSSPropertyID camelCasePropertyToCSSPropertyID(String propertyName) No need for static now ...
7 years ago (2013-12-06 03:27:27 UTC) #10
Steve Block
Did you look into a test to avoid 'leaking' this prematurely?
7 years ago (2013-12-06 04:36:10 UTC) #11
rjwright1
Not yet. Will do tests next though. On Fri, Dec 6, 2013 at 3:36 PM, ...
7 years ago (2013-12-07 10:50:59 UTC) #12
rjwright
I've done what you asked the best I could, Elliott. PTAL. Steve, I will come ...
7 years ago (2013-12-07 11:09:06 UTC) #13
rjwright
Ok Steve I think that's all your stuff except testing, which I'll do next. PTAL. ...
7 years ago (2013-12-09 00:29:45 UTC) #14
Steve Block
https://codereview.chromium.org/96283002/diff/70001/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/96283002/diff/70001/Source/core/css/resolver/StyleResolver.cpp#newcode862 Source/core/css/resolver/StyleResolver.cpp:862: void StyleResolver::setKeyframePropertyValues(KeyframeAnimationEffect::KeyframeVector& keyframes, Vector<RefPtr<MutableStylePropertySet> >& propertySetVector, Element* element) Can ...
7 years ago (2013-12-09 03:11:14 UTC) #15
rjwright
https://codereview.chromium.org/96283002/diff/70001/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/96283002/diff/70001/Source/core/css/resolver/StyleResolver.cpp#newcode862 Source/core/css/resolver/StyleResolver.cpp:862: void StyleResolver::setKeyframePropertyValues(KeyframeAnimationEffect::KeyframeVector& keyframes, Vector<RefPtr<MutableStylePropertySet> >& propertySetVector, Element* element) On ...
7 years ago (2013-12-09 09:04:02 UTC) #16
rjwright
Added a layout test. It took me all day to work out how to do ...
7 years ago (2013-12-09 12:01:28 UTC) #17
rjwright
On 2013/12/09 12:01:28, rjwright wrote: > Added a layout test. It took me all day ...
7 years ago (2013-12-09 13:32:43 UTC) #18
esprehn
https://codereview.chromium.org/96283002/diff/130001/Source/core/animation/ElementAnimation.cpp File Source/core/animation/ElementAnimation.cpp (right): https://codereview.chromium.org/96283002/diff/130001/Source/core/animation/ElementAnimation.cpp#newcode60 Source/core/animation/ElementAnimation.cpp:60: RELEASE_ASSERT_WITH_MESSAGE(false, "Web Animations not yet implemented: Handling for keyframes ...
7 years ago (2013-12-09 18:51:24 UTC) #19
shans
https://codereview.chromium.org/96283002/diff/130001/Source/core/animation/ElementAnimation.cpp File Source/core/animation/ElementAnimation.cpp (right): https://codereview.chromium.org/96283002/diff/130001/Source/core/animation/ElementAnimation.cpp#newcode60 Source/core/animation/ElementAnimation.cpp:60: RELEASE_ASSERT_WITH_MESSAGE(false, "Web Animations not yet implemented: Handling for keyframes ...
7 years ago (2013-12-09 23:25:56 UTC) #20
Steve Block
https://codereview.chromium.org/96283002/diff/130001/Source/core/animation/ElementAnimation.cpp File Source/core/animation/ElementAnimation.cpp (right): https://codereview.chromium.org/96283002/diff/130001/Source/core/animation/ElementAnimation.cpp#newcode60 Source/core/animation/ElementAnimation.cpp:60: RELEASE_ASSERT_WITH_MESSAGE(false, "Web Animations not yet implemented: Handling for keyframes ...
7 years ago (2013-12-09 23:32:19 UTC) #21
esprehn
Adding ojan and eseidel, landing stuff behind a flag with a reachable from JS RELEASE_ASSERT(false) ...
7 years ago (2013-12-09 23:36:15 UTC) #22
shans
https://codereview.chromium.org/96283002/diff/130001/Source/core/animation/ElementAnimation.cpp File Source/core/animation/ElementAnimation.cpp (right): https://codereview.chromium.org/96283002/diff/130001/Source/core/animation/ElementAnimation.cpp#newcode60 Source/core/animation/ElementAnimation.cpp:60: RELEASE_ASSERT_WITH_MESSAGE(false, "Web Animations not yet implemented: Handling for keyframes ...
7 years ago (2013-12-09 23:41:26 UTC) #23
esprehn
On 2013/12/09 23:41:26, shans wrote: > ... > Again, though, what is your proposed alternative? ...
7 years ago (2013-12-09 23:44:12 UTC) #24
Steve Block
> There's a problem with the expectations. In some places > they show up like ...
7 years ago (2013-12-09 23:48:03 UTC) #25
shans
https://codereview.chromium.org/96283002/diff/130001/Source/core/css/CSSParser-in.cpp File Source/core/css/CSSParser-in.cpp (right): https://codereview.chromium.org/96283002/diff/130001/Source/core/css/CSSParser-in.cpp#newcode10235 Source/core/css/CSSParser-in.cpp:10235: builder.append(propertyName->substring(position, end) + "-" + toASCIILower((*propertyName)[end])); On 2013/12/09 23:36:16, ...
7 years ago (2013-12-09 23:48:40 UTC) #26
ojan
On 2013/12/09 23:44:12, esprehn wrote: > On 2013/12/09 23:41:26, shans wrote: > > ... > ...
7 years ago (2013-12-09 23:54:17 UTC) #27
ojan
On 2013/12/09 23:48:40, shans wrote: > https://codereview.chromium.org/96283002/diff/130001/Source/core/css/CSSParser-in.cpp > File Source/core/css/CSSParser-in.cpp (right): > > https://codereview.chromium.org/96283002/diff/130001/Source/core/css/CSSParser-in.cpp#newcode10235 > ...
7 years ago (2013-12-09 23:58:49 UTC) #28
shans
On 2013/12/09 23:58:49, ojan wrote: > On 2013/12/09 23:48:40, shans wrote: > > > https://codereview.chromium.org/96283002/diff/130001/Source/core/css/CSSParser-in.cpp ...
7 years ago (2013-12-10 00:57:59 UTC) #29
rjwright
I've moved camelCaseCSSPropertyNameToID back into ElementAnimation.cpp, and changed it to reject property names with dashes. ...
7 years ago (2013-12-10 03:05:39 UTC) #30
esprehn
https://codereview.chromium.org/96283002/diff/140001/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/96283002/diff/140001/Source/core/css/resolver/StyleResolver.cpp#newcode862 Source/core/css/resolver/StyleResolver.cpp:862: PassRefPtr<KeyframeAnimationEffect> StyleResolver::setKeyframePropertyValues(Element* element, const Vector<RefPtr<MutableStylePropertySet> >& propertySetVector, KeyframeAnimationEffect::KeyframeVector& keyframes) ...
7 years ago (2013-12-10 03:49:00 UTC) #31
rjwright
Add unit test for animate(). WIP but thought you might want to have a look, ...
7 years ago (2013-12-10 14:00:12 UTC) #32
Steve Block
https://codereview.chromium.org/96283002/diff/160001/LayoutTests/virtual/legacy-animations-engine/animations/web-animations-api/element-animate-list-of-keyframes-expected.txt File LayoutTests/virtual/legacy-animations-engine/animations/web-animations-api/element-animate-list-of-keyframes-expected.txt (right): https://codereview.chromium.org/96283002/diff/160001/LayoutTests/virtual/legacy-animations-engine/animations/web-animations-api/element-animate-list-of-keyframes-expected.txt#newcode3 LayoutTests/virtual/legacy-animations-engine/animations/web-animations-api/element-animate-list-of-keyframes-expected.txt:3: at Object.<anonymous> (file:///usr/local/google/home/rjwright/chromium/src/third_party/WebKit/LayoutTests/animations/api/element-animate-list-of-keyframes.html:35:8) Obviously we can't check in expected ...
7 years ago (2013-12-10 23:26:44 UTC) #33
Steve Block
lgtm pending esprehn's review
7 years ago (2013-12-10 23:27:28 UTC) #34
dstockwell
https://codereview.chromium.org/96283002/diff/160001/LayoutTests/animations/web-animations-api/element-animate-list-of-keyframes.html File LayoutTests/animations/web-animations-api/element-animate-list-of-keyframes.html (right): https://codereview.chromium.org/96283002/diff/160001/LayoutTests/animations/web-animations-api/element-animate-list-of-keyframes.html#newcode15 LayoutTests/animations/web-animations-api/element-animate-list-of-keyframes.html:15: <html> This seems like an odd place for the ...
7 years ago (2013-12-11 00:04:27 UTC) #35
esprehn
You need to update style before doing any kind of style resolution, otherwise we can't ...
7 years ago (2013-12-11 00:26:10 UTC) #36
rjwright
Steve and Doug I've done your comments. Steve: I haven't forgotten the leakage test. https://codereview.chromium.org/96283002/diff/140001/Source/core/css/resolver/StyleResolver.cpp ...
7 years ago (2013-12-11 02:16:36 UTC) #37
rjwright
NB: New issue description. https://codereview.chromium.org/96283002/diff/180001/Source/core/animation/ElementAnimation.cpp File Source/core/animation/ElementAnimation.cpp (right): https://codereview.chromium.org/96283002/diff/180001/Source/core/animation/ElementAnimation.cpp#newcode64 Source/core/animation/ElementAnimation.cpp:64: // Doesn't handle prefixed properties. ...
7 years ago (2013-12-11 03:12:11 UTC) #38
rjwright
On 2013/12/06 04:36:10, Steve Block wrote: > Did you look into a test to avoid ...
7 years ago (2013-12-11 05:08:22 UTC) #39
Steve Block
>> Did you look into a test to avoid 'leaking' this >> prematurely? > Done. ...
7 years ago (2013-12-11 05:24:07 UTC) #40
rjwright
https://codereview.chromium.org/96283002/diff/230001/LayoutTests/webexposed/element-animate.html File LayoutTests/webexposed/element-animate.html (right): https://codereview.chromium.org/96283002/diff/230001/LayoutTests/webexposed/element-animate.html#newcode6 LayoutTests/webexposed/element-animate.html:6: // and pass in LayoutTests/virtual/stable/webexposed (where flags are off). ...
7 years ago (2013-12-11 05:44:46 UTC) #41
esprehn
Can you explain what this means: "This will be switched out in the future in ...
7 years ago (2013-12-11 07:44:26 UTC) #42
dstockwell
On 2013/12/11 07:44:26, esprehn wrote: > Can you explain what this means: "This will be ...
7 years ago (2013-12-11 08:20:09 UTC) #43
esprehn
On 2013/12/11 08:20:09, dstockwell wrote: > On 2013/12/11 07:44:26, esprehn wrote: > > Can you ...
7 years ago (2013-12-11 08:24:37 UTC) #44
dstockwell
lgtm As best I can tell, the only thing still outstanding is the question around ...
7 years ago (2013-12-11 09:00:33 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rjwright@chromium.org/96283002/70002
7 years ago (2013-12-11 09:06:37 UTC) #46
esprehn
On 2013/12/11 09:00:33, dstockwell wrote: > lgtm > > As best I can tell, the ...
7 years ago (2013-12-11 09:39:39 UTC) #47
esprehn
btw trivial fix for the update style part is probably: if (!element->inActiveDocument()) return; element->document().updateStyleIfNeeded(); if ...
7 years ago (2013-12-11 10:04:24 UTC) #48
rjwright
On 2013/12/11 10:04:24, esprehn wrote: > btw trivial fix for the update style part is ...
7 years ago (2013-12-12 05:14:23 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rjwright@chromium.org/96283002/260001
7 years ago (2013-12-12 05:15:29 UTC) #50
esprehn
lgtm, one nit https://codereview.chromium.org/96283002/diff/270001/Source/core/animation/ElementAnimation.cpp File Source/core/animation/ElementAnimation.cpp (right): https://codereview.chromium.org/96283002/diff/270001/Source/core/animation/ElementAnimation.cpp#newcode77 Source/core/animation/ElementAnimation.cpp:77: } nit: braces are not needed ...
7 years ago (2013-12-12 06:40:09 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rjwright@chromium.org/96283002/280014
7 years ago (2013-12-12 06:44:52 UTC) #52
commit-bot: I haz the power
7 years ago (2013-12-12 07:45:49 UTC) #53
Message was sent while issue was closed.
Change committed as 163761

Powered by Google App Engine
This is Rietveld 408576698