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

Unified Diff: third_party/WebKit/Source/core/animation/CSSLengthListInterpolationType.cpp

Issue 1689383002: Add additive animation support for CSS property background-size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_transformOriginInterpolationType
Patch Set: Rebased Created 4 years, 10 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: third_party/WebKit/Source/core/animation/CSSLengthListInterpolationType.cpp
diff --git a/third_party/WebKit/Source/core/animation/CSSLengthListInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSLengthListInterpolationType.cpp
index c76529c3c6a734c0dcb04c335229faf53c88f53d..d3bb9085fdefea5f98a17d20fbe8121b19129c4d 100644
--- a/third_party/WebKit/Source/core/animation/CSSLengthListInterpolationType.cpp
+++ b/third_party/WebKit/Source/core/animation/CSSLengthListInterpolationType.cpp
@@ -45,7 +45,10 @@ static InterpolationValue maybeConvertLengthList(const Vector<Length>& lengthLis
InterpolationValue CSSLengthListInterpolationType::maybeConvertInitial() const
{
- return maybeConvertLengthList(LengthListPropertyFunctions::getInitialLengthList(cssProperty()), 1);
+ Vector<Length> initialLengthList;
+ if (!LengthListPropertyFunctions::getInitialLengthList(cssProperty(), initialLengthList))
+ return nullptr;
+ return maybeConvertLengthList(initialLengthList, 1);
}
class ParentLengthListChecker : public InterpolationType::ConversionChecker {
@@ -65,7 +68,9 @@ private:
bool isValid(const InterpolationEnvironment& environment, const InterpolationValue& underlying) const final
{
- return m_inheritedLengthList == LengthListPropertyFunctions::getLengthList(m_property, *environment.state().parentStyle());
+ Vector<Length> inheritedLengthList;
+ LengthListPropertyFunctions::getLengthList(m_property, *environment.state().parentStyle(), inheritedLengthList);
+ return m_inheritedLengthList == inheritedLengthList;
}
CSSPropertyID m_property;
@@ -74,11 +79,11 @@ private:
InterpolationValue CSSLengthListInterpolationType::maybeConvertInherit(const StyleResolverState& state, ConversionCheckers& conversionCheckers) const
{
- if (!state.parentStyle())
- return nullptr;
-
- Vector<Length> inheritedLengthList = LengthListPropertyFunctions::getLengthList(cssProperty(), *state.parentStyle());
+ Vector<Length> inheritedLengthList;
+ bool success = LengthListPropertyFunctions::getLengthList(cssProperty(), *state.parentStyle(), inheritedLengthList);
conversionCheckers.append(ParentLengthListChecker::create(cssProperty(), inheritedLengthList));
+ if (!success)
+ return nullptr;
return maybeConvertLengthList(inheritedLengthList, state.parentStyle()->effectiveZoom());
}
@@ -100,7 +105,9 @@ PairwiseInterpolationValue CSSLengthListInterpolationType::mergeSingleConversion
InterpolationValue CSSLengthListInterpolationType::maybeConvertUnderlyingValue(const InterpolationEnvironment& environment) const
{
- Vector<Length> underlyingLengthList = LengthListPropertyFunctions::getLengthList(cssProperty(), *environment.state().style());
+ Vector<Length> underlyingLengthList;
+ if (!LengthListPropertyFunctions::getLengthList(cssProperty(), *environment.state().style(), underlyingLengthList))
+ return nullptr;
return maybeConvertLengthList(underlyingLengthList, environment.state().style()->effectiveZoom());
}

Powered by Google App Engine
This is Rietveld 408576698