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

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: Created 4 years, 4 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 fbd1eed5ef7f09106a1c10afae8722433a694d8c..d4a984c16fd1968d9002cbd53979bc119df0dd9e 100644
--- a/third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.h
+++ b/third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.h
@@ -5,40 +5,27 @@
#ifndef CSSSizeListInterpolationType_h
#define CSSSizeListInterpolationType_h
-#include "core/animation/CSSLengthInterpolationType.h"
-#include "core/animation/CSSLengthListInterpolationType.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 {
suzyh_UTC10 (ex-contributor) 2016/08/26 04:14:34 In the CL description I think it would be useful t
alancutter (OOO until 2018) 2016/08/26 13:31:48 Done.
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);
- return CSSLengthInterpolationType::maybeConvertCSSValue(index % 2 == 0 ? pair.first() : pair.second());
- });
- }
+ 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