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

Unified Diff: Source/core/css/CSSPrimitiveValueMappings.h

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/CSSFontValue.cpp ('k') | Source/core/css/CSSProperties.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValueMappings.h
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index 21a349a696e3b5c7d7157f282777316ffc939fbf..e39a273c08a9094db14db6dc9e81d7df8773f779 100644
--- a/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/Source/core/css/CSSPrimitiveValueMappings.h
@@ -3513,6 +3513,76 @@ template<> inline CSSPrimitiveValue::operator FontStyle() const
return FontStyleNormal;
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontStretch stretch)
+ : CSSValue(PrimitiveClass)
+{
+ fprintf(stderr, "CSSPrimitiveValue::CSSPrimitiveValue(FontStretch stretch)\n");
+ m_primitiveUnitType = CSS_VALUE_ID;
+ switch (stretch) {
+ case FontStretchUltraCondensed:
+ m_value.valueID = CSSValueUltraCondensed;
+ return;
+ case FontStretchExtraCondensed:
+ m_value.valueID = CSSValueExtraCondensed;
+ return;
+ case FontStretchCondensed:
+ m_value.valueID = CSSValueCondensed;
+ return;
+ case FontStretchSemiCondensed:
+ m_value.valueID = CSSValueSemiCondensed;
+ return;
+ case FontStretchNormal:
+ m_value.valueID = CSSValueNormal;
+ return;
+ case FontStretchSemiExpanded:
+ m_value.valueID = CSSValueSemiExpanded;
+ return;
+ case FontStretchExpanded:
+ m_value.valueID = CSSValueExpanded;
+ return;
+ case FontStretchExtraExpanded:
+ m_value.valueID = CSSValueExtraExpanded;
+ return;
+ case FontStretchUltraExpanded:
+ m_value.valueID = CSSValueUltraExpanded;
+ return;
+ }
+
+ ASSERT_NOT_REACHED();
+ m_value.valueID = CSSValueNormal;
+}
+
+template<> inline CSSPrimitiveValue::operator FontStretch() const
+{
+ fprintf(stderr, "CSSPrimitiveValue::operator FontStretch\n");
+ ASSERT(isValueID());
+ switch (m_value.valueID) {
+ case CSSValueUltraCondensed:
+ return FontStretchUltraCondensed;
+ case CSSValueExtraCondensed:
+ return FontStretchExtraCondensed;
+ case CSSValueCondensed:
+ return FontStretchCondensed;
+ case CSSValueSemiCondensed:
+ return FontStretchSemiCondensed;
+ case CSSValueNormal:
+ return FontStretchNormal;
+ case CSSValueSemiExpanded:
+ return FontStretchSemiExpanded;
+ case CSSValueExpanded:
+ return FontStretchExpanded;
+ case CSSValueExtraExpanded:
+ return FontStretchExtraExpanded;
+ case CSSValueUltraExpanded:
+ return FontStretchUltraExpanded;
+ default:
+ break;
+ }
+
+ ASSERT_NOT_REACHED();
+ return FontStretchNormal;
+}
+
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontVariant smallCaps)
: CSSValue(PrimitiveClass)
{
« no previous file with comments | « Source/core/css/CSSFontValue.cpp ('k') | Source/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698