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

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

Issue 851633002: Animation: Add template for ListStyleInterpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add else to shadowToInterpolableValue Created 5 years, 11 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/LengthPoint3DStyleInterpolation.cpp
diff --git a/Source/core/animation/LengthPoint3DStyleInterpolation.cpp b/Source/core/animation/LengthPoint3DStyleInterpolation.cpp
deleted file mode 100644
index 2a0ec4126bd2a7692b9a7613c22ec55f323c9677..0000000000000000000000000000000000000000
--- a/Source/core/animation/LengthPoint3DStyleInterpolation.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "core/animation/LengthPoint3DStyleInterpolation.h"
-
-#include "core/animation/LengthStyleInterpolation.h"
-#include "core/css/CSSCalculationValue.h"
-#include "core/css/resolver/StyleBuilder.h"
-
-namespace blink {
-
-bool LengthPoint3DStyleInterpolation::canCreateFrom(const CSSValue& value)
-{
- if (!value.isValueList())
- return false;
- const CSSValueList& valueList = toCSSValueList(value);
- if (valueList.length() == 2 || valueList.length() == 3) {
- for (size_t i = 0; i < valueList.length(); i++) {
- if (!LengthStyleInterpolation::canCreateFrom(*valueList.item(i)))
- return false;
- }
- }
- return true;
-}
-
-PassOwnPtrWillBeRawPtr<InterpolableValue> LengthPoint3DStyleInterpolation::lengthPoint3DtoInterpolableValue(const CSSValue& value)
-{
- ASSERT(value.isValueList());
- const CSSValueList& valueList = toCSSValueList(value);
- const size_t sizeOfList = valueList.length();
- OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(sizeOfList);
-
- for (size_t i = 0; i < sizeOfList; i ++) {
- const CSSPrimitiveValue* length = toCSSPrimitiveValue(valueList.item(i));
- result->set(i, LengthStyleInterpolation::lengthToInterpolableValue(*length));
- }
- return result.release();
-}
-
-PassRefPtrWillBeRawPtr<CSSValue> LengthPoint3DStyleInterpolation::interpolableValueToLengthPoint3D(InterpolableValue* value, InterpolationRange range)
-{
- InterpolableList* lengthPoint3D = toInterpolableList(value);
- RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createCommaSeparated();
- const size_t sizeOfList = lengthPoint3D->length();
-
- for (size_t i = 0; i < sizeOfList; i++)
- result->append(LengthStyleInterpolation::interpolableValueToLength(lengthPoint3D->get(i), RangeAll));
-
- return result.release();
-}
-
-void LengthPoint3DStyleInterpolation::apply(StyleResolverState& state) const
-{
- StyleBuilder::applyProperty(m_id, state, interpolableValueToLengthPoint3D(m_cachedValue.get()).get());
-}
-
-void LengthPoint3DStyleInterpolation::trace(Visitor* visitor)
-{
- StyleInterpolation::trace(visitor);
-}
-
-}
« no previous file with comments | « Source/core/animation/LengthPoint3DStyleInterpolation.h ('k') | Source/core/animation/LengthPoint3DStyleInterpolationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698