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

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

Issue 199423003: Add plumbing for font-stretch (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 37b4c59d9c461334cbe025447453b948fe0d738f..77c83708ee5027f0dbbdeb2c9772b72ebf84e22b 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -295,6 +295,58 @@ void StyleBuilderFunctions::applyValueCSSPropertyFontWeight(StyleResolverState&
}
}
+
+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)
{
if (!value->isPrimitiveValue())
@@ -1510,7 +1562,6 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolverState& state,
ASSERT(newId != id);
return applyProperty(newId, state, value);
}
- case CSSPropertyFontStretch:
case CSSPropertyPage:
case CSSPropertyTextLineThroughColor:
case CSSPropertyTextLineThroughMode:
@@ -1804,6 +1855,7 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolverState& state,
case CSSPropertyFloat:
case CSSPropertyFontKerning:
case CSSPropertyFontSize:
+ case CSSPropertyFontStretch:
case CSSPropertyFontStyle:
case CSSPropertyFontVariant:
case CSSPropertyFontVariantLigatures:
« 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