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

Unified Diff: Source/core/css/CSSComputedStyleDeclaration.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/animation/css/CSSPropertyEquality.cpp ('k') | Source/core/css/CSSFontValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 9320cc418ff60a590d043653104e44c22a58cada..59399f481ff77f50205d9d2d976529f45165b72f 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -129,6 +129,7 @@ static const CSSPropertyID staticComputableProperties[] = {
CSSPropertyFontFamily,
CSSPropertyFontKerning,
CSSPropertyFontSize,
+ CSSPropertyFontStretch,
CSSPropertyFontStyle,
CSSPropertyFontVariant,
CSSPropertyFontVariantLigatures,
@@ -1407,6 +1408,32 @@ static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontSize(RenderStyle& s
return zoomAdjustedPixelValue(style.fontDescription().computedPixelSize(), style);
}
+static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontStretch(RenderStyle& style)
+{
+ switch (style.fontDescription().stretch()) {
+ case FontStretchUltraCondensed:
+ return cssValuePool().createIdentifierValue(CSSValueUltraCondensed);
+ case FontStretchExtraCondensed:
+ return cssValuePool().createIdentifierValue(CSSValueExtraCondensed);
+ case FontStretchCondensed:
+ return cssValuePool().createIdentifierValue(CSSValueCondensed);
+ case FontStretchSemiCondensed:
+ return cssValuePool().createIdentifierValue(CSSValueSemiCondensed);
+ case FontStretchNormal:
+ return cssValuePool().createIdentifierValue(CSSValueNormal);
+ case FontStretchSemiExpanded:
+ return cssValuePool().createIdentifierValue(CSSValueSemiExpanded);
+ case FontStretchExpanded:
+ return cssValuePool().createIdentifierValue(CSSValueExpanded);
+ case FontStretchExtraExpanded:
+ return cssValuePool().createIdentifierValue(CSSValueExtraExpanded);
+ case FontStretchUltraExpanded:
+ return cssValuePool().createIdentifierValue(CSSValueUltraExpanded);
+ }
+ ASSERT_NOT_REACHED();
+ return cssValuePool().createIdentifierValue(CSSValueNormal);
+}
+
static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontStyle(RenderStyle& style)
{
if (style.fontDescription().style() == FontStyleItalic)
@@ -1925,6 +1952,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
computedFont->style = valueForFontStyle(*style);
computedFont->variant = valueForFontVariant(*style);
computedFont->weight = valueForFontWeight(*style);
+ computedFont->stretch = valueForFontStretch(*style);
computedFont->size = valueForFontSize(*style);
computedFont->lineHeight = valueForLineHeight(*style);
computedFont->family = valueForFontFamily(*style);
@@ -1940,6 +1968,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
}
case CSSPropertyFontSize:
return valueForFontSize(*style);
+ case CSSPropertyFontStretch:
+ return valueForFontStretch(*style);
case CSSPropertyFontStyle:
return valueForFontStyle(*style);
case CSSPropertyFontVariant:
@@ -2837,7 +2867,6 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
break;
/* Unimplemented @font-face properties */
- case CSSPropertyFontStretch:
case CSSPropertySrc:
case CSSPropertyUnicodeRange:
break;
« no previous file with comments | « Source/core/animation/css/CSSPropertyEquality.cpp ('k') | Source/core/css/CSSFontValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698