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

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

Issue 1680803003: Add additive animation support for CSS property background-position (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove redundant braces 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/CSSLengthInterpolationType.cpp
diff --git a/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
index 8a97b542f2130403c2d5c14bfad8256cadeecffe..46b17a8c73c549cb68dee2155347710594bf2d1c 100644
--- a/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
+++ b/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
@@ -105,6 +105,18 @@ void CSSLengthInterpolationType::composite(
underlyingNonInterpolableValue = CSSLengthNonInterpolableValue::merge(underlyingNonInterpolableValue.get(), nonInterpolableValue);
}
+void CSSLengthInterpolationType::subtractFromOneHundredPercent(InterpolationValue& result)
+{
+ InterpolableList& list = toInterpolableList(*result.interpolableValue);
+ for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; i++) {
+ double value = -toInterpolableNumber(*list.get(i)).value();
+ if (i == CSSPrimitiveValue::UnitTypePercentage)
+ value += 100;
+ toInterpolableNumber(*list.getMutable(i)).set(value);
+ }
+ result.nonInterpolableValue = CSSLengthNonInterpolableValue::create(true);
+}
+
InterpolationValue CSSLengthInterpolationType::maybeConvertCSSValue(const CSSValue& value)
{
if (!value.isPrimitiveValue())

Powered by Google App Engine
This is Rietveld 408576698