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

Unified Diff: Source/core/css/resolver/StyleBuilderCustom.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
« no previous file with comments | « Source/core/css/resolver/FontBuilder.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleBuilderCustom.cpp
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index 660c5c6cbd10c79d3c56536ab4073b3630fec970..d6ba5f569415e1db23e328ea7c3ad1cfb58ce330 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -382,6 +382,57 @@ void StyleBuilderFunctions::applyValueCSSPropertyGridTemplateAreas(StyleResolver
state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue->columnCount());
}
+void StyleBuilderFunctions::applyInitialCSSPropertyFontStretch(StyleResolverState& state)
+{
+ state.fontBuilder().setStretch(FontStretchNormal);
+}
+
+void StyleBuilderFunctions::applyInheritCSSPropertyFontStretch(StyleResolverState& state)
+{
+ state.fontBuilder().setStretch(state.parentFontDescription().stretch());
+}
+
+void StyleBuilderFunctions::applyValueCSSPropertyFontStretch(StyleResolverState& state, CSSValue* value)
+{
+ if (!value->isPrimitiveValue())
+ return;
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+ switch (primitiveValue->getValueID()) {
+ case CSSValueInvalid:
+ ASSERT_NOT_REACHED();
+ break;
+ case CSSValueUltraCondensed:
+ state.fontBuilder().setStretch(FontStretchUltraCondensed);
+ break;
+ case CSSValueExtraCondensed:
+ state.fontBuilder().setStretch(FontStretchExtraCondensed);
+ break;
+ case CSSValueCondensed:
+ state.fontBuilder().setStretch(FontStretchCondensed);
+ break;
+ case CSSValueSemiCondensed:
+ state.fontBuilder().setStretch(FontStretchSemiCondensed);
+ break;
+ case CSSValueNormal:
+ state.fontBuilder().setStretch(FontStretchNormal);
+ break;
+ case CSSValueSemiExpanded:
+ state.fontBuilder().setStretch(FontStretchSemiExpanded);
+ break;
+ case CSSValueExpanded:
+ state.fontBuilder().setStretch(FontStretchExpanded);
+ break;
+ case CSSValueExtraExpanded:
+ state.fontBuilder().setStretch(FontStretchExtraExpanded);
+ break;
+ case CSSValueUltraExpanded:
+ state.fontBuilder().setStretch(FontStretchUltraExpanded);
+ break;
+ default:
+ return;
+ }
+}
+
void StyleBuilderFunctions::applyValueCSSPropertyLineHeight(StyleResolverState& state, CSSValue* value)
{
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
« no previous file with comments | « Source/core/css/resolver/FontBuilder.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698