| 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/DeferredLegacyStyleInterpolation.h" | 6 #include "core/animation/DeferredLegacyStyleInterpolation.h" |
| 7 | 7 |
| 8 #include "core/animation/ElementAnimations.h" | 8 #include "core/animation/ElementAnimations.h" |
| 9 #include "core/animation/css/CSSAnimatableValueFactory.h" | 9 #include "core/animation/css/CSSAnimatableValueFactory.h" |
| 10 #include "core/css/CSSBasicShapes.h" | 10 #include "core/css/CSSBasicShapes.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 m_innerInterpolation->interpolate(m_cachedIteration, m_cachedFraction); | 42 m_innerInterpolation->interpolate(m_cachedIteration, m_cachedFraction); |
| 43 m_innerInterpolation->apply(state); | 43 m_innerInterpolation->apply(state); |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C
SSValue& value) | 46 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C
SSValue& value) |
| 47 { | 47 { |
| 48 // FIXME: should not require resolving styles for inherit/initial/unset. | 48 // FIXME: should not require resolving styles for inherit/initial/unset. |
| 49 if (value.isCSSWideKeyword()) | 49 if (value.isCSSWideKeyword()) |
| 50 return true; | 50 return true; |
| 51 if (value.isStringValue() || value.isURIValue() || value.isIdentValue()) |
| 52 return false; |
| 51 if (value.isPrimitiveValue()) | 53 if (value.isPrimitiveValue()) |
| 52 return interpolationRequiresStyleResolve(toCSSPrimitiveValue(value)); | 54 return interpolationRequiresStyleResolve(toCSSPrimitiveValue(value)); |
| 53 if (value.isQuadValue()) | 55 if (value.isQuadValue()) |
| 54 return interpolationRequiresStyleResolve(toCSSQuadValue(value)); | 56 return interpolationRequiresStyleResolve(toCSSQuadValue(value)); |
| 55 if (value.isValueList()) | 57 if (value.isValueList()) |
| 56 return interpolationRequiresStyleResolve(toCSSValueList(value)); | 58 return interpolationRequiresStyleResolve(toCSSValueList(value)); |
| 57 if (value.isValuePair()) | 59 if (value.isValuePair()) |
| 58 return interpolationRequiresStyleResolve(toCSSValuePair(value)); | 60 return interpolationRequiresStyleResolve(toCSSValuePair(value)); |
| 59 if (value.isImageValue()) | 61 if (value.isImageValue()) |
| 60 return interpolationRequiresStyleResolve(toCSSImageValue(value)); | 62 return interpolationRequiresStyleResolve(toCSSImageValue(value)); |
| 61 if (value.isShadowValue()) | 63 if (value.isShadowValue()) |
| 62 return interpolationRequiresStyleResolve(toCSSShadowValue(value)); | 64 return interpolationRequiresStyleResolve(toCSSShadowValue(value)); |
| 63 if (value.isSVGDocumentValue()) | 65 if (value.isSVGDocumentValue()) |
| 64 return interpolationRequiresStyleResolve(toCSSSVGDocumentValue(value)); | 66 return interpolationRequiresStyleResolve(toCSSSVGDocumentValue(value)); |
| 65 // FIXME: consider other custom types. | 67 // FIXME: consider other custom types. |
| 66 return true; | 68 return true; |
| 67 } | 69 } |
| 68 | 70 |
| 69 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C
SSPrimitiveValue& primitiveValue) | 71 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C
SSPrimitiveValue& primitiveValue) |
| 70 { | 72 { |
| 71 // FIXME: consider other types. | 73 // FIXME: consider other types. |
| 72 if (primitiveValue.isNumber() || primitiveValue.isPercentage() || primitiveV
alue.isAngle() || primitiveValue.isRGBColor() || primitiveValue.isURI()) | 74 if (primitiveValue.isNumber() || primitiveValue.isPercentage() || primitiveV
alue.isAngle() || primitiveValue.isRGBColor()) |
| 73 return false; | 75 return false; |
| 74 | 76 |
| 75 if (primitiveValue.isLength()) | 77 if (primitiveValue.isLength()) |
| 76 return primitiveValue.isFontRelativeLength() || primitiveValue.isViewpor
tPercentageLength(); | 78 return primitiveValue.isFontRelativeLength() || primitiveValue.isViewpor
tPercentageLength(); |
| 77 | 79 |
| 78 if (primitiveValue.isCalculated()) { | 80 if (primitiveValue.isCalculated()) { |
| 79 CSSLengthArray lengthArray(CSSPrimitiveValue::LengthUnitTypeCount); | 81 CSSLengthArray lengthArray(CSSPrimitiveValue::LengthUnitTypeCount); |
| 80 primitiveValue.accumulateLengthArray(lengthArray); | 82 primitiveValue.accumulateLengthArray(lengthArray); |
| 81 return lengthArray[CSSPrimitiveValue::UnitTypeFontSize] != 0 | 83 return lengthArray[CSSPrimitiveValue::UnitTypeFontSize] != 0 |
| 82 || lengthArray[CSSPrimitiveValue::UnitTypeFontXSize] != 0 | 84 || lengthArray[CSSPrimitiveValue::UnitTypeFontXSize] != 0 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 144 |
| 143 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C
SSQuadValue& quad) | 145 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C
SSQuadValue& quad) |
| 144 { | 146 { |
| 145 return interpolationRequiresStyleResolve(*quad.top()) | 147 return interpolationRequiresStyleResolve(*quad.top()) |
| 146 || interpolationRequiresStyleResolve(*quad.right()) | 148 || interpolationRequiresStyleResolve(*quad.right()) |
| 147 || interpolationRequiresStyleResolve(*quad.bottom()) | 149 || interpolationRequiresStyleResolve(*quad.bottom()) |
| 148 || interpolationRequiresStyleResolve(*quad.left()); | 150 || interpolationRequiresStyleResolve(*quad.left()); |
| 149 } | 151 } |
| 150 | 152 |
| 151 } | 153 } |
| OLD | NEW |