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

Issue 273683005: Web Animations API: Deferred computation of interpolated values (Closed)

Created:
6 years, 7 months ago by alancutter (OOO until 2018)
Modified:
6 years, 7 months ago
CC:
blink-reviews, ed+blinkwatch_opera.com, shans, rjwright, Mike Lawther (Google), blink-reviews-animation_chromium.org, blink-reviews-css, rune+blink, dglazkov+blink, dstockwell, Timothy Loh, apavlov+blink_chromium.org, rwlbuis, darktears, Steve Block, Eric Willigers, esprehn
Visibility:
Public.

Description

Web Animations API: Deferred computation of interpolated values This change ensures animations created via element.animate() are responsive to changes in the target element's style instead of animating between "snapshot" values like the existing CSS animations and transitions. Examples of responsive animation behaviour include: - The current font size may change during an animation affecting all lengths defined using em/ex/rem units. - The color may change affecting all keyframes that use currentcolor. - Viewport resizes may change keyframes that use viewport units. - The parent element style may change affecting keyframes that use inherit. LegacyStyleInterpolation now defers the interpolation calculation to animated style application time. This allows it to use the new RenderStyle object to generate snapshots of the start and end keyframes to interpolate between. This behaviour is not ideal for performance or system coupling, as we increase our coverage of CSSValues that can be converted to Interpolations without the use of AnimatableValue we can move away from this pattern. For now this is a catch all solution that provides the correct behaviour. This patch is a continuation of ericwilliger's change: https://codereview.chromium.org/261013006/ BUG=361948

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fix crashing shadow animation tests #

Total comments: 2

Patch Set 3 : Merge IVP into LSI #

Total comments: 5

Patch Set 4 : Add missing test file #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1033 lines, -163 lines) Patch
A LayoutTests/web-animations-api/animations-responsive-assorted-lengths.html View 1 chunk +102 lines, -0 lines 0 comments Download
A LayoutTests/web-animations-api/animations-responsive-backgroundPosition.html View 1 chunk +25 lines, -0 lines 0 comments Download
A + LayoutTests/web-animations-api/animations-responsive-backgroundSize.html View 1 chunk +7 lines, -13 lines 0 comments Download
A + LayoutTests/web-animations-api/animations-responsive-borderImageWidth.html View 1 chunk +7 lines, -13 lines 0 comments Download
A LayoutTests/web-animations-api/animations-responsive-borderRadius.html View 1 chunk +39 lines, -0 lines 0 comments Download
A LayoutTests/web-animations-api/animations-responsive-borderWidth.html View 1 chunk +35 lines, -0 lines 0 comments Download
A + LayoutTests/web-animations-api/animations-responsive-boxShadow.html View 1 chunk +12 lines, -10 lines 0 comments Download
A LayoutTests/web-animations-api/animations-responsive-fontSize.html View 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/web-animations-api/animations-responsive-fontWeight.html View 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/web-animations-api/animations-responsive-minHeight.html View 1 chunk +22 lines, -0 lines 0 comments Download
A LayoutTests/web-animations-api/animations-responsive-shapeMargin.html View 1 chunk +24 lines, -0 lines 0 comments Download
A + LayoutTests/web-animations-api/animations-responsive-textIndent.html View 1 chunk +10 lines, -10 lines 0 comments Download
M LayoutTests/web-animations-api/animations-responsive-to-color-change.html View 1 chunk +189 lines, -8 lines 0 comments Download
D LayoutTests/web-animations-api/animations-responsive-to-color-change-expected.txt View 1 chunk +0 lines, -4 lines 0 comments Download
M LayoutTests/web-animations-api/animations-responsive-to-inherited-change.html View 1 chunk +33 lines, -5 lines 0 comments Download
D LayoutTests/web-animations-api/animations-responsive-to-inherited-change-expected.txt View 1 chunk +0 lines, -4 lines 0 comments Download
M LayoutTests/web-animations-api/animations-responsive-to-style-change.html View 2 chunks +21 lines, -1 line 0 comments Download
A + LayoutTests/web-animations-api/animations-responsive-transform.html View 1 chunk +7 lines, -13 lines 0 comments Download
M Source/core/animation/AnimatableValueKeyframe.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/animation/AnimationStackTest.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/animation/CompositorAnimations.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/animation/InterpolableValue.h View 1 chunk +1 line, -0 lines 0 comments Download
A Source/core/animation/InterpolableValuePromiseTest.cpp View 1 2 1 chunk +88 lines, -0 lines 0 comments Download
M Source/core/animation/Interpolation.h View 2 chunks +0 lines, -26 lines 0 comments Download
M Source/core/animation/Interpolation.cpp View 1 2 2 chunks +1 line, -12 lines 0 comments Download
M Source/core/animation/InterpolationTest.cpp View 2 chunks +2 lines, -9 lines 0 comments Download
M Source/core/animation/KeyframeEffectModelTest.cpp View 1 chunk +1 line, -0 lines 0 comments Download
A Source/core/animation/LegacyStyleInterpolation.h View 1 2 1 chunk +63 lines, -0 lines 0 comments Download
A Source/core/animation/LegacyStyleInterpolation.cpp View 1 2 1 chunk +128 lines, -0 lines 0 comments Download
A Source/core/animation/LegacyStyleInterpolationTest.cpp View 1 2 3 1 chunk +87 lines, -0 lines 0 comments Download
M Source/core/animation/StringKeyframe.h View 1 2 1 chunk +1 line, -4 lines 0 comments Download
M Source/core/animation/StringKeyframe.cpp View 1 2 3 chunks +12 lines, -7 lines 0 comments Download
M Source/core/animation/css/CSSAnimations.cpp View 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M Source/core/css/CSSCalculationValueTest.cpp View 2 chunks +2 lines, -9 lines 0 comments Download
M Source/core/css/CSSPrimitiveValue.h View 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/css/CSSPrimitiveValue.cpp View 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/css/parser/SizesCalcParserTest.cpp View 1 chunk +1 line, -8 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 1 chunk +9 lines, -4 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
alancutter (OOO until 2018)
This change is a continuation of: https://codereview.chromium.org/261013006/ https://codereview.chromium.org/273683005/diff/1/Source/core/animation/StringKeyframe.cpp File Source/core/animation/StringKeyframe.cpp (right): https://codereview.chromium.org/273683005/diff/1/Source/core/animation/StringKeyframe.cpp#newcode78 Source/core/animation/StringKeyframe.cpp:78: case CSSPropertyBorderTopWidth: ...
6 years, 7 months ago (2014-05-08 12:34:12 UTC) #1
shans
I'm really not that happy with this. It seems very awkward. I'll have a think ...
6 years, 7 months ago (2014-05-08 16:12:57 UTC) #2
alancutter (OOO until 2018)
On 2014/05/08 16:12:57, shans wrote: > I'm really not that happy with this. It seems ...
6 years, 7 months ago (2014-05-09 02:48:08 UTC) #3
dstockwell
6 years, 7 months ago (2014-05-09 05:57:08 UTC) #4
I think this still isn't quite what Shane had in mind. It's also not compiling
currently, so I think we're going to have to defer this.

https://codereview.chromium.org/273683005/diff/40001/Source/core/animation/Le...
File Source/core/animation/LegacyStyleInterpolation.cpp (right):

https://codereview.chromium.org/273683005/diff/40001/Source/core/animation/Le...
Source/core/animation/LegacyStyleInterpolation.cpp:66: return false;
Which cases aren't handled here? Can this be a switch?

https://codereview.chromium.org/273683005/diff/40001/Source/core/animation/Le...
Source/core/animation/LegacyStyleInterpolation.cpp:75: return
lengthArray[CSSPrimitiveValue::UnitTypeFontSize]
Clearer to use != 0 here.

https://codereview.chromium.org/273683005/diff/40001/Source/core/animation/Le...
Source/core/animation/LegacyStyleInterpolation.cpp:82: ||
lengthArray[CSSPrimitiveValue::UnitTypeViewportMax];
Presumably this logic should live somewhere else? How does someone know to
update this when we add new units?

https://codereview.chromium.org/273683005/diff/40001/Source/core/animation/Le...
Source/core/animation/LegacyStyleInterpolation.cpp:116: default:
How do we avoid hitting other important cases?

https://codereview.chromium.org/273683005/diff/40001/Source/core/animation/cs...
File Source/core/animation/css/CSSAnimations.cpp (right):

https://codereview.chromium.org/273683005/diff/40001/Source/core/animation/cs...
Source/core/animation/css/CSSAnimations.cpp:446:
ASSERT(newFrames[0]->propertyValue(id));
This doesn't seem necessary. Or I don't understand it, why would
setPropertyValue not set the property value?

Powered by Google App Engine
This is Rietveld 408576698