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

Unified Diff: Source/core/css/resolver/AnimatedStyleBuilder.cpp

Issue 721773002: Build animated font properties through FontBuilder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove body tags. Created 6 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/css/resolver/AnimatedStyleBuilder.cpp
diff --git a/Source/core/css/resolver/AnimatedStyleBuilder.cpp b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
index c87dac309e9df75198dc35fe09a4114b54311af6..50434503f546de4b8ff771738b5c56340798e86b 100644
--- a/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -259,6 +259,12 @@ FontWeight animatableValueToFontWeight(const AnimatableValue* value)
return weights[index];
}
+FontDescription::Size animatableValueToFontSize(const AnimatableValue* value)
+{
+ float size = clampTo<float>(toAnimatableDouble(value)->toDouble(), 0);
+ return FontDescription::Size(0, size, true);
+}
+
} // namespace
// FIXME: Generate this function.
@@ -382,13 +388,13 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setFloodOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0, 1));
return;
case CSSPropertyFontSize:
- style->setFontSize(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0));
+ state.fontBuilder().setSize(animatableValueToFontSize(value));
return;
case CSSPropertyFontStretch:
- style->setFontStretch(animatableValueToFontStretch(value));
+ state.fontBuilder().setStretch(animatableValueToFontStretch(value));
return;
case CSSPropertyFontWeight:
- style->setFontWeight(animatableValueToFontWeight(value));
+ state.fontBuilder().setWeight(animatableValueToFontWeight(value));
return;
case CSSPropertyHeight:
style->setHeight(animatableValueToLength(value, state, ValueRangeNonNegative));

Powered by Google App Engine
This is Rietveld 408576698