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

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

Issue 1215563002: Implement left property animation on InvalidatableStyleInterpolation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make Windows not crash Created 5 years, 5 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
« no previous file with comments | « Source/core/animation/LengthStyleInterpolation.h ('k') | Source/core/animation/PrimitiveInterpolation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/LengthStyleInterpolation.cpp
diff --git a/Source/core/animation/LengthStyleInterpolation.cpp b/Source/core/animation/LengthStyleInterpolation.cpp
index 643581c3f97c149af72cefc85a9c71d3565e5e3b..161a22a3cab44e1870f0e8f76d9cca2ba9dbb693 100644
--- a/Source/core/animation/LengthStyleInterpolation.cpp
+++ b/Source/core/animation/LengthStyleInterpolation.cpp
@@ -312,21 +312,26 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> LengthStyleInterpolation::fromInterpol
}
}
-void LengthStyleInterpolation::apply(StyleResolverState& state) const
+void LengthStyleInterpolation::applyInterpolableValue(CSSPropertyID property, const InterpolableValue& value, InterpolationRange range, StyleResolverState& state, LengthSetter lengthSetter)
{
- if (m_lengthSetter) {
- (state.style()->*m_lengthSetter)(lengthFromInterpolableValue(*m_cachedValue, m_range, state.style()->effectiveZoom()));
+ if (lengthSetter && isPixelsOrPercentOnly(value)) {
+ (state.style()->*lengthSetter)(lengthFromInterpolableValue(value, range, state.style()->effectiveZoom()));
#if ENABLE(ASSERT)
- RefPtrWillBeRawPtr<AnimatableValue> before = CSSAnimatableValueFactory::create(m_id, *state.style());
- StyleBuilder::applyProperty(m_id, state, fromInterpolableValue(*m_cachedValue, m_range).get());
- RefPtrWillBeRawPtr<AnimatableValue> after = CSSAnimatableValueFactory::create(m_id, *state.style());
+ RefPtrWillBeRawPtr<AnimatableValue> before = CSSAnimatableValueFactory::create(property, *state.style());
+ StyleBuilder::applyProperty(property, state, fromInterpolableValue(value, range).get());
+ RefPtrWillBeRawPtr<AnimatableValue> after = CSSAnimatableValueFactory::create(property, *state.style());
ASSERT(before->equals(*after));
#endif
} else {
- StyleBuilder::applyProperty(m_id, state, fromInterpolableValue(*m_cachedValue, m_range).get());
+ StyleBuilder::applyProperty(property, state, fromInterpolableValue(value, range).get());
}
}
+void LengthStyleInterpolation::apply(StyleResolverState& state) const
+{
+ applyInterpolableValue(m_id, *m_cachedValue, m_range, state, m_lengthSetter);
+}
+
DEFINE_TRACE(LengthStyleInterpolation)
{
StyleInterpolation::trace(visitor);
« no previous file with comments | « Source/core/animation/LengthStyleInterpolation.h ('k') | Source/core/animation/PrimitiveInterpolation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698