| Index: third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp
|
| diff --git a/third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp b/third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp
|
| index e480166ee7911ad9307bbc574689bfd142d7af45..ef975f9d998c912529d0cdae04d6a2f0cabd7cfe 100644
|
| --- a/third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp
|
| +++ b/third_party/WebKit/Source/core/animation/InvalidatableInterpolation.cpp
|
| @@ -32,7 +32,7 @@ InvalidatableInterpolation::maybeConvertPairwise(
|
| const InterpolationEnvironment& environment,
|
| const UnderlyingValueOwner& underlyingValueOwner) const {
|
| DCHECK(m_currentFraction != 0 && m_currentFraction != 1);
|
| - for (const auto& interpolationType : m_interpolationTypes) {
|
| + for (const auto& interpolationType : *m_interpolationTypes) {
|
| if ((m_startKeyframe->isNeutral() || m_endKeyframe->isNeutral()) &&
|
| (!underlyingValueOwner ||
|
| underlyingValueOwner.type() != *interpolationType))
|
| @@ -59,7 +59,7 @@ InvalidatableInterpolation::convertSingleKeyframe(
|
| const UnderlyingValueOwner& underlyingValueOwner) const {
|
| if (keyframe.isNeutral() && !underlyingValueOwner)
|
| return nullptr;
|
| - for (const auto& interpolationType : m_interpolationTypes) {
|
| + for (const auto& interpolationType : *m_interpolationTypes) {
|
| if (keyframe.isNeutral() &&
|
| underlyingValueOwner.type() != *interpolationType)
|
| continue;
|
| @@ -89,7 +89,7 @@ void InvalidatableInterpolation::addConversionCheckers(
|
| std::unique_ptr<TypedInterpolationValue>
|
| InvalidatableInterpolation::maybeConvertUnderlyingValue(
|
| const InterpolationEnvironment& environment) const {
|
| - for (const auto& interpolationType : m_interpolationTypes) {
|
| + for (const auto& interpolationType : *m_interpolationTypes) {
|
| InterpolationValue result =
|
| interpolationType->maybeConvertUnderlyingValue(environment);
|
| if (result)
|
| @@ -144,6 +144,9 @@ InvalidatableInterpolation::ensureValidConversion(
|
| const InterpolationEnvironment& environment,
|
| const UnderlyingValueOwner& underlyingValueOwner) const {
|
| DCHECK(!std::isnan(m_currentFraction));
|
| + DCHECK(m_interpolationTypes &&
|
| + m_interpolationTypesVersion ==
|
| + environment.interpolationTypesMap().version());
|
| if (isConversionCacheValid(environment, underlyingValueOwner))
|
| return m_cachedValue.get();
|
| clearConversionCache();
|
| @@ -172,6 +175,22 @@ InvalidatableInterpolation::ensureValidConversion(
|
| return m_cachedValue.get();
|
| }
|
|
|
| +void InvalidatableInterpolation::ensureValidInterpolationTypes(
|
| + const InterpolationEnvironment& environment) const {
|
| + const InterpolationTypesMap& map = environment.interpolationTypesMap();
|
| + size_t latestVersion = map.version();
|
| + if (m_interpolationTypes && m_interpolationTypesVersion == latestVersion) {
|
| + return;
|
| + }
|
| + const InterpolationTypes* latestInterpolationTypes = &map.get(m_property);
|
| + DCHECK(latestInterpolationTypes);
|
| + if (m_interpolationTypes != latestInterpolationTypes) {
|
| + clearConversionCache();
|
| + }
|
| + m_interpolationTypes = latestInterpolationTypes;
|
| + m_interpolationTypesVersion = latestVersion;
|
| +}
|
| +
|
| void InvalidatableInterpolation::setFlagIfInheritUsed(
|
| InterpolationEnvironment& environment) const {
|
| if (!m_property.isCSSProperty() && !m_property.isPresentationAttribute())
|
| @@ -208,6 +227,7 @@ void InvalidatableInterpolation::applyStack(
|
| UnderlyingValueOwner underlyingValueOwner;
|
| const InvalidatableInterpolation& firstInterpolation =
|
| toInvalidatableInterpolation(*interpolations.at(startingIndex));
|
| + firstInterpolation.ensureValidInterpolationTypes(environment);
|
| if (firstInterpolation.dependsOnUnderlyingValue()) {
|
| underlyingValueOwner.set(
|
| firstInterpolation.maybeConvertUnderlyingValue(environment));
|
| @@ -235,6 +255,7 @@ void InvalidatableInterpolation::applyStack(
|
| const InvalidatableInterpolation& currentInterpolation =
|
| toInvalidatableInterpolation(*interpolations.at(i));
|
| DCHECK(currentInterpolation.dependsOnUnderlyingValue());
|
| + currentInterpolation.ensureValidInterpolationTypes(environment);
|
| const TypedInterpolationValue* currentValue =
|
| currentInterpolation.ensureValidConversion(environment,
|
| underlyingValueOwner);
|
|
|