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

Unified Diff: third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.h

Issue 2280553002: Allow interpolation of background-size values with keywords in CSS Animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DCHECK Created 4 years, 3 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/CSSSizeListInterpolationType.h
diff --git a/third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.h
index 824992e8a27ab65418496853842ec6562f763ccc..d4a984c16fd1968d9002cbd53979bc119df0dd9e 100644
--- a/third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.h
+++ b/third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.h
@@ -5,41 +5,27 @@
#ifndef CSSSizeListInterpolationType_h
#define CSSSizeListInterpolationType_h
-#include "core/animation/CSSLengthListInterpolationType.h"
-#include "core/animation/LengthInterpolationFunctions.h"
-#include "core/animation/ListInterpolationFunctions.h"
-#include "core/css/CSSValueList.h"
-#include "core/css/CSSValuePair.h"
+#include "core/animation/CSSInterpolationType.h"
namespace blink {
-class CSSSizeListInterpolationType : public CSSLengthListInterpolationType {
+class CSSSizeListInterpolationType : public CSSInterpolationType {
public:
CSSSizeListInterpolationType(CSSPropertyID property)
- : CSSLengthListInterpolationType(property)
+ : CSSInterpolationType(property)
{ }
+ InterpolationValue maybeConvertUnderlyingValue(const InterpolationEnvironment&) const final;
+ void composite(UnderlyingValueOwner&, double underlyingFraction, const InterpolationValue&, double interpolationFraction) const final;
+ void apply(const InterpolableValue&, const NonInterpolableValue*, InterpolationEnvironment&) const final;
+
private:
- InterpolationValue maybeConvertValue(const CSSValue& value, const StyleResolverState&, ConversionCheckers&) const final
- {
- CSSValueList* tempList = nullptr;
- if (!value.isBaseValueList()) {
- tempList = CSSValueList::createCommaSeparated();
- tempList->append(value);
- }
- const CSSValueList& list = value.isBaseValueList() ? toCSSValueList(value) : *tempList;
-
- // Only size lists without keywords may interpolate smoothly:
- // https://drafts.csswg.org/css-backgrounds-3/#the-background-size
- return ListInterpolationFunctions::createList(list.length() * 2, [&list](size_t index) -> InterpolationValue {
- const CSSValue& item = list.item(index / 2);
- if (!item.isValuePair())
- return nullptr;
- const CSSValuePair& pair = toCSSValuePair(item);
- const CSSValue& side = index % 2 == 0 ? pair.first() : pair.second();
- return LengthInterpolationFunctions::maybeConvertCSSValue(side);
- });
- }
+ InterpolationValue maybeConvertNeutral(const InterpolationValue& underlying, ConversionCheckers&) const final;
+ InterpolationValue maybeConvertInitial(const StyleResolverState&, ConversionCheckers&) const final;
+ InterpolationValue maybeConvertInherit(const StyleResolverState&, ConversionCheckers&) const final;
+ InterpolationValue maybeConvertValue(const CSSValue&, const StyleResolverState&, ConversionCheckers&) const final;
+
+ PairwiseInterpolationValue maybeMergeSingles(InterpolationValue&& start, InterpolationValue&& end) const final;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698