OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/animation/CSSLengthInterpolationType.h" | 5 #include "core/animation/CSSLengthInterpolationType.h" |
6 | 6 |
7 #include "core/animation/LengthPropertyFunctions.h" | 7 #include "core/animation/LengthPropertyFunctions.h" |
8 #include "core/animation/css/CSSAnimatableValueFactory.h" | 8 #include "core/animation/css/CSSAnimatableValueFactory.h" |
9 #include "core/css/CSSCalculationValue.h" | 9 #include "core/css/CSSCalculationValue.h" |
10 #include "core/css/resolver/StyleBuilder.h" | 10 #include "core/css/resolver/StyleBuilder.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return nullptr; | 204 return nullptr; |
205 return InterpolationValue(createInterpolablePixels(pixels)); | 205 return InterpolationValue(createInterpolablePixels(pixels)); |
206 } | 206 } |
207 | 207 |
208 return maybeConvertCSSValue(value); | 208 return maybeConvertCSSValue(value); |
209 } | 209 } |
210 | 210 |
211 InterpolationValue CSSLengthInterpolationType::maybeConvertUnderlyingValue(const
InterpolationEnvironment& environment) const | 211 InterpolationValue CSSLengthInterpolationType::maybeConvertUnderlyingValue(const
InterpolationEnvironment& environment) const |
212 { | 212 { |
213 Length underlyingLength; | 213 Length underlyingLength; |
214 if (!LengthPropertyFunctions::getLength(cssProperty(), *environment.state().
style(), underlyingLength)) | 214 if (!LengthPropertyFunctions::getLength(cssProperty(), environment.style(),
underlyingLength)) |
215 return nullptr; | 215 return nullptr; |
216 return maybeConvertLength(underlyingLength, effectiveZoom(*environment.state
().style())); | 216 return maybeConvertLength(underlyingLength, effectiveZoom(environment.style(
))); |
217 } | 217 } |
218 | 218 |
219 void CSSLengthInterpolationType::composite(UnderlyingValueOwner& underlyingValue
Owner, double underlyingFraction, const InterpolationValue& value, double interp
olationFraction) const | 219 void CSSLengthInterpolationType::composite(UnderlyingValueOwner& underlyingValue
Owner, double underlyingFraction, const InterpolationValue& value, double interp
olationFraction) const |
220 { | 220 { |
221 InterpolationValue& underlying = underlyingValueOwner.mutableValue(); | 221 InterpolationValue& underlying = underlyingValueOwner.mutableValue(); |
222 composite(underlying.interpolableValue, underlying.nonInterpolableValue, | 222 composite(underlying.interpolableValue, underlying.nonInterpolableValue, |
223 underlyingFraction, *value.interpolableValue, value.nonInterpolableValue
.get()); | 223 underlyingFraction, *value.interpolableValue, value.nonInterpolableValue
.get()); |
224 } | 224 } |
225 | 225 |
226 static bool isPixelsOrPercentOnly(const InterpolableList& values) | 226 static bool isPixelsOrPercentOnly(const InterpolableList& values) |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 RefPtr<AnimatableValue> after = CSSAnimatableValueFactory::create(cs
sProperty(), *state.style()); | 334 RefPtr<AnimatableValue> after = CSSAnimatableValueFactory::create(cs
sProperty(), *state.style()); |
335 ASSERT(before->equals(*after)); | 335 ASSERT(before->equals(*after)); |
336 #endif | 336 #endif |
337 return; | 337 return; |
338 } | 338 } |
339 } | 339 } |
340 StyleBuilder::applyProperty(cssProperty(), state, *createCSSValue(values, ha
sPercentage, m_valueRange)); | 340 StyleBuilder::applyProperty(cssProperty(), state, *createCSSValue(values, ha
sPercentage, m_valueRange)); |
341 } | 341 } |
342 | 342 |
343 } // namespace blink | 343 } // namespace blink |
OLD | NEW |