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

Unified Diff: Source/core/animation/css/CSSAnimatableValueFactory.cpp

Issue 203523002: Reland "Add plumbing for font-stretch" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: w/fix for ASSERT Created 6 years, 5 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: Source/core/animation/css/CSSAnimatableValueFactory.cpp
diff --git a/Source/core/animation/css/CSSAnimatableValueFactory.cpp b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
index abd8fee07599dd4dbe930964448779db6d74d6e7..f52b2f61ee07b6f19d81207feefb96f9fa08acd0 100644
--- a/Source/core/animation/css/CSSAnimatableValueFactory.cpp
+++ b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
@@ -225,6 +225,16 @@ inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromShapeValue(Shape
return AnimatableUnknown::create(CSSValueNone);
}
+static double fontStretchToDouble(FontStretch fontStretch)
+{
+ return static_cast<unsigned>(fontStretch);
+}
+
+static PassRefPtr<AnimatableValue> createFromFontStretch(FontStretch fontStretch)
+{
+ return createFromDouble(fontStretchToDouble(fontStretch));
+}
+
static double fontWeightToDouble(FontWeight fontWeight)
{
switch (fontWeight) {
@@ -341,6 +351,8 @@ PassRefPtrWillBeRawPtr<AnimatableValue> CSSAnimatableValueFactory::create(CSSPro
// FIXME: Should we introduce an option to pass the computed font size here, allowing consumers to
// enable text zoom rather than Text Autosizing? See http://crbug.com/227545.
return createFromDouble(style.specifiedFontSize());
+ case CSSPropertyFontStretch:
+ return createFromFontStretch(style.fontStretch());
case CSSPropertyFontWeight:
return createFromFontWeight(style.fontWeight());
case CSSPropertyHeight:

Powered by Google App Engine
This is Rietveld 408576698