OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/CSSClipInterpolationType.h" | 5 #include "core/animation/CSSClipInterpolationType.h" |
6 | 6 |
7 #include "core/animation/LengthInterpolationFunctions.h" | 7 #include "core/animation/LengthInterpolationFunctions.h" |
8 #include "core/css/CSSIdentifierValue.h" | 8 #include "core/css/CSSIdentifierValue.h" |
9 #include "core/css/CSSQuadValue.h" | 9 #include "core/css/CSSQuadValue.h" |
10 #include "core/css/resolver/StyleResolverState.h" | 10 #include "core/css/resolver/StyleResolverState.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 .clipAutos(); | 255 .clipAutos(); |
256 const ClipAutos& autos = | 256 const ClipAutos& autos = |
257 toCSSClipNonInterpolableValue(*value.nonInterpolableValue).clipAutos(); | 257 toCSSClipNonInterpolableValue(*value.nonInterpolableValue).clipAutos(); |
258 if (underlyingAutos == autos) | 258 if (underlyingAutos == autos) |
259 underlyingValueOwner.mutableValue().interpolableValue->scaleAndAdd( | 259 underlyingValueOwner.mutableValue().interpolableValue->scaleAndAdd( |
260 underlyingFraction, *value.interpolableValue); | 260 underlyingFraction, *value.interpolableValue); |
261 else | 261 else |
262 underlyingValueOwner.set(*this, value); | 262 underlyingValueOwner.set(*this, value); |
263 } | 263 } |
264 | 264 |
265 void CSSClipInterpolationType::apply( | 265 void CSSClipInterpolationType::applyStandardPropertyValue( |
266 const InterpolableValue& interpolableValue, | 266 const InterpolableValue& interpolableValue, |
267 const NonInterpolableValue* nonInterpolableValue, | 267 const NonInterpolableValue* nonInterpolableValue, |
268 InterpolationEnvironment& environment) const { | 268 StyleResolverState& state) const { |
269 const ClipAutos& autos = | 269 const ClipAutos& autos = |
270 toCSSClipNonInterpolableValue(nonInterpolableValue)->clipAutos(); | 270 toCSSClipNonInterpolableValue(nonInterpolableValue)->clipAutos(); |
271 const InterpolableList& list = toInterpolableList(interpolableValue); | 271 const InterpolableList& list = toInterpolableList(interpolableValue); |
272 const auto& convertIndex = [&list, &environment](bool isAuto, size_t index) { | 272 const auto& convertIndex = [&list, &state](bool isAuto, size_t index) { |
273 if (isAuto) | 273 if (isAuto) |
274 return Length(Auto); | 274 return Length(Auto); |
275 return LengthInterpolationFunctions::createLength( | 275 return LengthInterpolationFunctions::createLength( |
276 *list.get(index), nullptr, | 276 *list.get(index), nullptr, state.cssToLengthConversionData(), |
277 environment.state().cssToLengthConversionData(), ValueRangeAll); | 277 ValueRangeAll); |
278 }; | 278 }; |
279 environment.state().style()->setClip( | 279 state.style()->setClip(LengthBox(convertIndex(autos.isTopAuto, ClipTop), |
280 LengthBox(convertIndex(autos.isTopAuto, ClipTop), | 280 convertIndex(autos.isRightAuto, ClipRight), |
281 convertIndex(autos.isRightAuto, ClipRight), | 281 convertIndex(autos.isBottomAuto, ClipBottom), |
282 convertIndex(autos.isBottomAuto, ClipBottom), | 282 convertIndex(autos.isLeftAuto, ClipLeft))); |
283 convertIndex(autos.isLeftAuto, ClipLeft))); | |
284 } | 283 } |
285 | 284 |
286 } // namespace blink | 285 } // namespace blink |
OLD | NEW |