Chromium Code Reviews| 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; |
| } |