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

Unified Diff: Source/core/animation/DeferredLegacyStyleInterpolation.cpp

Issue 948583003: Use StringKeyframes to make CSS Animations responsive to style changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Split baseStyle out Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/animation/DeferredLegacyStyleInterpolation.cpp
diff --git a/Source/core/animation/DeferredLegacyStyleInterpolation.cpp b/Source/core/animation/DeferredLegacyStyleInterpolation.cpp
index 5fe96f9d0dd40a0ba946a75c725f4bfe9aa2dddc..4f1efc158da2a4f1c1ec77526db593c8e2322a68 100644
--- a/Source/core/animation/DeferredLegacyStyleInterpolation.cpp
+++ b/Source/core/animation/DeferredLegacyStyleInterpolation.cpp
@@ -22,10 +22,19 @@ namespace blink {
void DeferredLegacyStyleInterpolation::apply(StyleResolverState& state) const
{
if (m_outdated || !state.element()->elementAnimations() || !state.element()->elementAnimations()->isAnimationStyleChange()) {
- m_innerInterpolation = LegacyStyleInterpolation::create(
- StyleResolver::createAnimatableValueSnapshot(state, m_id, m_startCSSValue.get()),
- StyleResolver::createAnimatableValueSnapshot(state, m_id, m_endCSSValue.get()),
- m_id);
+ RefPtrWillBeRawPtr<AnimatableValue> startAnimatableValue;
+ RefPtrWillBeRawPtr<AnimatableValue> endAnimatableValue;
+
+ // Snapshot neutral values first because non-neutral values will mutate the StyleResolverState.
Timothy Loh 2015/03/16 00:49:41 Snapshot underlying values?
alancutter (OOO until 2018) 2015/03/17 00:12:34 Done.
+ if (!m_endCSSValue) {
+ endAnimatableValue = StyleResolver::createAnimatableValueSnapshot(state, m_id, m_endCSSValue.get());
+ startAnimatableValue = StyleResolver::createAnimatableValueSnapshot(state, m_id, m_startCSSValue.get());
+ } else {
+ startAnimatableValue = StyleResolver::createAnimatableValueSnapshot(state, m_id, m_startCSSValue.get());
+ endAnimatableValue = StyleResolver::createAnimatableValueSnapshot(state, m_id, m_endCSSValue.get());
+ }
+
+ m_innerInterpolation = LegacyStyleInterpolation::create(startAnimatableValue, endAnimatableValue, m_id);
m_outdated = false;
}
« no previous file with comments | « ManualTests/animation/compositor-neutral-keyframes.html ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698