| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/ShadowStyleInterpolation.h" | 6 #include "core/animation/ShadowStyleInterpolation.h" |
| 7 | 7 |
| 8 #include "core/animation/ColorStyleInterpolation.h" | 8 #include "core/animation/ColorStyleInterpolation.h" |
| 9 #include "core/animation/LengthStyleInterpolation.h" | 9 #include "core/animation/LengthStyleInterpolation.h" |
| 10 #include "core/css/CSSPrimitiveValue.h" | 10 #include "core/css/CSSPrimitiveValue.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 PassRefPtrWillBeRawPtr<CSSValue> ShadowStyleInterpolation::fromInterpolableValue
(const InterpolableValue& value, NonInterpolableType nonInterpolableData, Interp
olationRange range) | 53 PassRefPtrWillBeRawPtr<CSSValue> ShadowStyleInterpolation::fromInterpolableValue
(const InterpolableValue& value, NonInterpolableType nonInterpolableData, Interp
olationRange range) |
| 54 { | 54 { |
| 55 const InterpolableList* shadow = toInterpolableList(&value); | 55 const InterpolableList* shadow = toInterpolableList(&value); |
| 56 RefPtrWillBeRawPtr<CSSPrimitiveValue> x = LengthStyleInterpolation::fromInte
rpolableValue(*shadow->get(0), RangeAll); | 56 RefPtrWillBeRawPtr<CSSPrimitiveValue> x = LengthStyleInterpolation::fromInte
rpolableValue(*shadow->get(0), RangeAll); |
| 57 RefPtrWillBeRawPtr<CSSPrimitiveValue> y = LengthStyleInterpolation::fromInte
rpolableValue(*shadow->get(1), RangeAll); | 57 RefPtrWillBeRawPtr<CSSPrimitiveValue> y = LengthStyleInterpolation::fromInte
rpolableValue(*shadow->get(1), RangeAll); |
| 58 RefPtrWillBeRawPtr<CSSPrimitiveValue> blur = LengthStyleInterpolation::fromI
nterpolableValue(*shadow->get(2), RangeNonNegative); | 58 RefPtrWillBeRawPtr<CSSPrimitiveValue> blur = LengthStyleInterpolation::fromI
nterpolableValue(*shadow->get(2), RangeNonNegative); |
| 59 RefPtrWillBeRawPtr<CSSPrimitiveValue> spread = LengthStyleInterpolation::fro
mInterpolableValue(*shadow->get(3), RangeAll); | 59 RefPtrWillBeRawPtr<CSSPrimitiveValue> spread = LengthStyleInterpolation::fro
mInterpolableValue(*shadow->get(3), RangeAll); |
| 60 | 60 |
| 61 RefPtrWillBeRawPtr<CSSPrimitiveValue> color = ColorStyleInterpolation::inter
polableValueToColor(*shadow->get(4)); | 61 RefPtrWillBeRawPtr<CSSPrimitiveValue> color = ColorStyleInterpolation::inter
polableValueToColor(*shadow->get(4)); |
| 62 RefPtrWillBeRawPtr<CSSPrimitiveValue> style = nonInterpolableData ? CSSPrimi
tiveValue::createIdentifier(CSSValueInset) : CSSPrimitiveValue::createIdentifier
(CSSValueNone); | 62 RefPtrWillBeRawPtr<CSSPrimitiveValue> style = nonInterpolableData ? CSSPrimi
tiveValue::create(CSSValueInset) : CSSPrimitiveValue::create(CSSValueNone); |
| 63 | 63 |
| 64 RefPtrWillBeRawPtr<CSSShadowValue> result = CSSShadowValue::create(x, y, blu
r, spread, style, color); | 64 RefPtrWillBeRawPtr<CSSShadowValue> result = CSSShadowValue::create(x, y, blu
r, spread, style, color); |
| 65 return result.release(); | 65 return result.release(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool ShadowStyleInterpolation::usesDefaultStyleInterpolation(const CSSValue& sta
rt, const CSSValue& end) | 68 bool ShadowStyleInterpolation::usesDefaultStyleInterpolation(const CSSValue& sta
rt, const CSSValue& end) |
| 69 { | 69 { |
| 70 if (start.isValueList() && end.isValueList() && toCSSValueList(start).length
() == toCSSValueList(end).length()) { | 70 if (start.isValueList() && end.isValueList() && toCSSValueList(start).length
() == toCSSValueList(end).length()) { |
| 71 const CSSValueList* startList = toCSSValueList(&start); | 71 const CSSValueList* startList = toCSSValueList(&start); |
| 72 const CSSValueList* endList = toCSSValueList(&end); | 72 const CSSValueList* endList = toCSSValueList(&end); |
| 73 for (size_t i = 0; i < toCSSValueList(start).length(); i++) { | 73 for (size_t i = 0; i < toCSSValueList(start).length(); i++) { |
| 74 if (startList->item(i)->isShadowValue() && endList->item(i)->isShado
wValue() | 74 if (startList->item(i)->isShadowValue() && endList->item(i)->isShado
wValue() |
| 75 && toCSSShadowValue(startList->item(i))->style != toCSSShadowVal
ue(endList->item(i))->style) | 75 && toCSSShadowValue(startList->item(i))->style != toCSSShadowVal
ue(endList->item(i))->style) |
| 76 return true; | 76 return true; |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 return false; | 79 return false; |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace blink | 82 } // namespace blink |
| OLD | NEW |