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

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

Issue 1644883002: Add additive animation support for CSS property translate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_propertyInterpolationTypesMapping
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/CSSLengthInterpolationType.cpp
diff --git a/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
index 7478f60e66e8b6d5d6b0f101b97b06f4b1f7c009..58d3c6587b5303ea0179a525bb73db86c5a59c44 100644
--- a/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
+++ b/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
@@ -246,8 +246,9 @@ static double clampToRange(double x, ValueRange range)
static Length createLength(double pixels, double percentage, bool hasPercentage, ValueRange range)
{
- ASSERT(hasPercentage || percentage == 0);
- if (pixels && hasPercentage)
+ if (percentage != 0)
+ hasPercentage = true;
+ if (pixels != 0 && hasPercentage)
return Length(CalculationValue::create(PixelsAndPercent(pixels, percentage), range));
if (hasPercentage)
return Length(clampToRange(percentage, range), Percent);

Powered by Google App Engine
This is Rietveld 408576698