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

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

Issue 90113003: Web Animations CSS: Fix crash when animating viewport units (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Preserve legacy viewport unit blend behaviour Created 7 years, 1 month 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: Source/core/animation/AnimatableLength.cpp
diff --git a/Source/core/animation/AnimatableLength.cpp b/Source/core/animation/AnimatableLength.cpp
index 886ff9b546d44548bde426f1df259d5b9695ceee..f89477c6f65ac7e0f094e94435c5c45d495a1f6b 100644
--- a/Source/core/animation/AnimatableLength.cpp
+++ b/Source/core/animation/AnimatableLength.cpp
@@ -97,6 +97,10 @@ PassRefPtr<AnimatableValue> AnimatableLength::interpolateTo(const AnimatableValu
if (type != UnitTypeCalc)
return AnimatableLength::create(blend(m_number, length->m_number, 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());
}

Powered by Google App Engine
This is Rietveld 408576698