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

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

Issue 17155007: [CSS3] Parsing the property, text-justify. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parsingTextJustify
Patch Set: Patch for landing Created 7 years, 2 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
Index: Source/core/css/CSSPrimitiveValueMappings.h
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index a8c356543f322d276381100893c5580434cd17e1..3023d0dcc38f0c17e79f2404f74e373b744c6ed5 100644
--- a/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/Source/core/css/CSSPrimitiveValueMappings.h
@@ -2420,6 +2420,45 @@ template<> inline CSSPrimitiveValue::operator TextAlignLast() const
return TextAlignLastAuto;
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextJustify e)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_VALUE_ID;
+ switch (e) {
+ case TextJustifyAuto:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case TextJustifyNone:
+ m_value.valueID = CSSValueNone;
+ break;
+ case TextJustifyInterWord:
+ m_value.valueID = CSSValueInterWord;
+ break;
+ case TextJustifyDistribute:
+ m_value.valueID = CSSValueDistribute;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator TextJustify() const
+{
+ switch (m_value.valueID) {
+ case CSSValueAuto:
+ return TextJustifyAuto;
+ case CSSValueNone:
+ return TextJustifyNone;
+ case CSSValueInterWord:
+ return TextJustifyInterWord;
+ case CSSValueDistribute:
+ return TextJustifyDistribute;
+ default:
+ break;
+ }
+
+ ASSERT_NOT_REACHED();
+ return TextJustifyAuto;
+}
+
template<> inline CSSPrimitiveValue::operator TextDecoration() const
{
ASSERT(isValueID());

Powered by Google App Engine
This is Rietveld 408576698