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

Unified Diff: Source/core/animation/AnimatableLength.cpp

Issue 228063006: Remove special cases for viewport units, and add tests for viewport units in calc(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Convert to interpolation test. Created 6 years, 8 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
« no previous file with comments | « Source/core/animation/AnimatableLength.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimatableLength.cpp
diff --git a/Source/core/animation/AnimatableLength.cpp b/Source/core/animation/AnimatableLength.cpp
index 9c14417a9b6f5ac6c7303e60334a2e63c6c4c169..fcc2668abcf7e9bcca2dd8ee14a2efc184a9ea93 100644
--- a/Source/core/animation/AnimatableLength.cpp
+++ b/Source/core/animation/AnimatableLength.cpp
@@ -90,24 +90,12 @@ Length AnimatableLength::toLength(const CSSToLengthConversionData& conversionDat
return toCSSPrimitiveValue(range)->convertToLength<AnyConversion>(conversionData);
}
-bool AnimatableLength::usesDefaultInterpolationWith(const AnimatableValue* value) const
-{
- const AnimatableLength* length = toAnimatableLength(value);
- CSSPrimitiveValue::LengthUnitType type = commonUnitType(length);
- return isCalc(type) && (isViewportUnit() || length->isViewportUnit());
-}
-
PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableLength::interpolateTo(const AnimatableValue* value, double fraction) const
{
const AnimatableLength* length = toAnimatableLength(value);
CSSPrimitiveValue::LengthUnitType type = commonUnitType(length);
if (!isCalc(type))
return AnimatableLength::create(blend(m_lengthValue, length->m_lengthValue, fraction), type);
-
- // FIXME(crbug.com/168840): Support for viewport units in calc needs to be added before we can blend them with other units.
- if (isViewportUnit() || length->isViewportUnit())
- return defaultInterpolateTo(this, value, fraction);
-
return AnimatableLength::create(scale(1 - fraction).get(), length->scale(fraction).get());
}
« no previous file with comments | « Source/core/animation/AnimatableLength.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698