[css-align] Implement the place-content shorthand
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Mar 2017 18:47:49 +0000 (18:47 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Mar 2017 18:47:49 +0000 (18:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168771

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

The CSS Box Alignment specification defines a new shorthand to set the
Content Alignment properties (align-content and justify-content) at the
same time.

This patch provides the implementation of the CSS parsing logic and the
required regression tests.

Test: css3/parse-place-content.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSimplifiedContentPosition):
(WebCore::CSSPropertyParser::consumePlaceContentShorthand):
(WebCore::CSSPropertyParser::parseShorthand):
* css/parser/CSSPropertyParser.h:

LayoutTests:

Regression tests for the new place-content alignment shorthand.
Added also a new parsing utility script which uses the testharness functions.

* css3/parse-place-content-expected.txt: Added.
* css3/parse-place-content.html: Added.
* css3/resources/alignment-parsing-utils-th.js: Added.
(checkValues):
(checkBadValues):
(checkInitialValues):
(checkInheritValues):
(checkLegacyValues):
(checkSupportedValues):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213230 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/css3/parse-place-content-expected.txt [new file with mode: 0644]
LayoutTests/css3/parse-place-content.html [new file with mode: 0644]
LayoutTests/css3/resources/alignment-parsing-utils-th.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSProperties.json
Source/WebCore/css/StyleProperties.cpp
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/css/parser/CSSPropertyParser.h

index 18ace2d..ec47a8d 100644 (file)
@@ -1,3 +1,23 @@
+2017-03-01  Javier Fernandez  <jfernandez@igalia.com>
+
+        [css-align] Implement the place-content shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=168771
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        Regression tests for the new place-content alignment shorthand.
+        Added also a new parsing utility script which uses the testharness functions.
+
+        * css3/parse-place-content-expected.txt: Added.
+        * css3/parse-place-content.html: Added.
+        * css3/resources/alignment-parsing-utils-th.js: Added.
+        (checkValues):
+        (checkBadValues):
+        (checkInitialValues):
+        (checkInheritValues):
+        (checkLegacyValues):
+        (checkSupportedValues):
+
 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
diff --git a/LayoutTests/css3/parse-place-content-expected.txt b/LayoutTests/css3/parse-place-content-expected.txt
new file mode 100644 (file)
index 0000000..880419a
--- /dev/null
@@ -0,0 +1,25 @@
+Test to verify that the new place-content alignment shorthand is parsed as expected and correctly sets the longhand values.
+
+
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'normal' value through CSS. 
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'baseline' value through CSS. 
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'start' value through CSS. 
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'flex-start' value through CSS. 
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'end' value through CSS. 
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'space-between' value through CSS. 
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'stretch' value through CSS. 
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'start end' value through CSS. 
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'start space-evenly' value through CSS. 
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'start baseline' value through CSS. 
+PASS Test setting '' as incorrect value through CSS. 
+PASS Test setting 'auto' as incorrect value through CSS. 
+PASS Test setting 'none' as incorrect value through CSS. 
+PASS Test setting 'safe' as incorrect value through CSS. 
+PASS Test setting 'start safe' as incorrect value through CSS. 
+PASS Test setting 'baseline safe' as incorrect value through CSS. 
+PASS Test setting 'start end left' as incorrect value through CSS. 
+FAIL Test setting values through JS. assert_equals: placeContent specified value is not what it should. expected "center" but got "center center"
+PASS Test setting incorrect values through JS. 
+PASS Test the 'initial' value of the place-content shorthand and its longhand properties' Computed value 
+PASS Test the 'inherit' value of the place-content shorthand and its longhand properties' Computed value 
+
diff --git a/LayoutTests/css3/parse-place-content.html b/LayoutTests/css3/parse-place-content.html
new file mode 100644 (file)
index 0000000..c6f6c65
--- /dev/null
@@ -0,0 +1,247 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#placeContentNormal {
+    place-content: normal;
+}
+#placeContentBaseline {
+    place-content: baseline;
+}
+#placeContentStart {
+    place-content: start;
+}
+#placeContentFlexStart {
+    place-content: flex-start;
+}
+#placeContentEnd {
+    place-content: end;
+}
+#placeContentSpaceBetween {
+    place-content: space-between;
+}
+#placeContentStretch {
+    place-content: stretch;
+}
+#placeContentStartEnd {
+    place-content: start end;
+}
+#placeContentStartSpaceEvenly {
+    place-content: start space-evenly;
+}
+#placeContentStartBaseline {
+    place-content: start baseline;
+}
+
+<!-- Invalid CSS cases -->
+#placeContentEmpty {
+    place-content:;
+}
+#placeContentAuto {
+    place-content: auto;
+}
+#placeContentNone {
+    place-content: none;
+}
+#placeContentSafe {
+    place-content: safe;
+}
+#placeContentStartSafe {
+    place-content: start safe;
+}
+#placeContentStartEndLeft {
+    place-content: start end left;
+}
+</style>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="resources/alignment-parsing-utils-th.js"></script>
+</head>
+<body>
+    <p>Test to verify that the new place-content alignment shorthand is parsed as expected and correctly sets the longhand values.</p>
+    <div id="log"></div>
+
+    <div id="placeContentNormal"></div>
+    <div id="placeContentBaseline"></div>
+    <div id="placeContentStart"></div>
+    <div id="placeContentFlexStart"></div>
+    <div id="placeContentEnd"></div>
+    <div id="placeContentSpaceBetween"></div>
+    <div id="placeContentStretch"></div>
+    <div id="placeContentStartEnd"></div>
+    <div id="placeContentStartSpaceEvenly"></div>
+    <div id="placeContentStartBaseline"></div>
+
+    <div id="placeContentEmpty"></div>
+    <div id="placeContentAuto"></div>
+    <div id="placeContentNone"></div>
+    <div id="placeContentSafe"></div>
+    <div id="placeContentStartSafe"></div>
+    <div id="placeContentBaselineSafe"></div>
+    <div id="placeContentStartEndLeft"></div>
+<script>
+function checkPlaceContentValues(element, value, alignValue, justifyValue)
+{
+     var res = value.split(" ");
+     if (res.length < 2)
+         res[1] = res[0];
+     checkValues(element, "alignContent", "align-content", res[0], alignValue);
+     checkValues(element, "justifyContent", "justify-content", res[1], justifyValue);
+}
+
+function checkPlaceContentValuesJS(value, alignValue, justifyValue)
+{
+   element = document.createElement("div");
+   document.body.appendChild(element);
+   element.style.placeContent = value;
+   checkValues(element, "placeContent", "place-content", value, alignValue + ' ' + justifyValue)
+   checkPlaceContentValues(element, value, alignValue, justifyValue)
+}
+
+function checkPlaceContentValuesBadJS(value)
+{
+   element.style.placeContent = "";
+   element.style.placeContent = value;
+   checkPlaceContentValues(element, "", "normal", "normal")
+}
+
+function checkPlaceContentInitialValue()
+{
+   element = document.createElement("div");
+   document.body.appendChild(element);
+   checkValues(element, "placeContent", "place-content", "", "normal normal");
+   element.style.placeContent = "center";
+   checkPlaceContentValues(element, "center", "center", "center");
+   element.style.placeContent = "initial";
+   checkValues(element, "placeContent", "place-content", "initial", "normal normal");
+   checkPlaceContentValues(element, "initial", "normal", "normal");
+}
+
+function checkPlaceContentInheritValue()
+{
+   document.body.style.placeContent = "start";
+   var anotherElement = document.createElement("div");
+   document.body.appendChild(anotherElement);
+   checkPlaceContentValues(anotherElement, "", "normal", "normal");
+   anotherElement.style.placeContent = "inherit";
+   checkPlaceContentValues(anotherElement, "inherit", "start", "start");
+}
+
+
+test(function() {
+    checkValues(placeContentNormal, "placeContent", "place-content", "", "normal normal");
+    checkPlaceContentValues(placeContentNormal, "", "normal", "normal");
+}, "Test getting the Computed Value of place-content's longhand properties when setting 'normal' value through CSS.");
+
+test(function() {
+    checkValues(placeContentBaseline, "placeContent", "place-content", "", "baseline baseline");
+    checkPlaceContentValues(placeContentBaseline, "", "baseline", "baseline");
+}, "Test getting the Computed Value of place-content's longhand properties when setting 'baseline' value through CSS.");
+
+test(function() {
+    checkValues(placeContentStart, "placeContent", "place-content", "", "start start");
+    checkPlaceContentValues(placeContentStart, "", "start", "start");
+}, "Test getting the Computed Value of place-content's longhand properties when setting 'start' value through CSS.");
+
+test(function() {
+    checkValues(placeContentFlexStart, "placeContent", "place-content", "", "flex-start flex-start");
+    checkPlaceContentValues(placeContentFlexStart, "", "flex-start", "flex-start");
+}, "Test getting the Computed Value of place-content's longhand properties when setting 'flex-start' value through CSS.");
+
+test(function() {
+    checkValues(placeContentEnd, "placeContent", "place-content", "", "end end");
+    checkPlaceContentValues(placeContentEnd, "", "end", "end");
+}, "Test getting the Computed Value of place-content's longhand properties when setting 'end' value through CSS.");
+
+test(function() {
+    checkValues(placeContentSpaceBetween, "placeContent", "place-content", "", "space-between space-between");
+    checkPlaceContentValues(placeContentSpaceBetween, "", "space-between", "space-between");
+}, "Test getting the Computed Value of place-content's longhand properties when setting 'space-between' value through CSS.");
+
+test(function() {
+    checkValues(placeContentStretch, "placeContent", "place-content", "", "stretch stretch");
+    checkPlaceContentValues(placeContentStretch, "", "stretch", "stretch");
+}, "Test getting the Computed Value of place-content's longhand properties when setting 'stretch' value through CSS.");
+
+test(function() {
+    checkValues(placeContentStartEnd, "placeContent", "place-content", "", "start end");
+    checkPlaceContentValues(placeContentStartEnd, "", "start", "end");
+}, "Test getting the Computed Value of place-content's longhand properties when setting 'start end' value through CSS.");
+
+test(function() {
+    checkValues(placeContentStartSpaceEvenly, "placeContent", "place-content", "", "start space-evenly");
+    checkPlaceContentValues(placeContentStartSpaceEvenly, "", "start", "space-evenly");
+}, "Test getting the Computed Value of place-content's longhand properties when setting 'start space-evenly' value through CSS.");
+
+test(function() {
+    checkValues(placeContentStartBaseline, "placeContent", "place-content", "", "start baseline");
+    checkPlaceContentValues(placeContentStartBaseline, "", "start", "baseline");
+}, "Test getting the Computed Value of place-content's longhand properties when setting 'start baseline' value through CSS.");
+
+test(function() {
+    checkValues(placeContentAuto, "placeContent", "place-content", "", "normal normal");
+    checkPlaceContentValues(placeContentAuto, "", "normal", "normal");
+}, "Test setting '' as incorrect value through CSS.");
+
+test(function() {
+    checkValues(placeContentAuto, "placeContent", "place-content", "", "normal normal");
+    checkPlaceContentValues(placeContentAuto, "", "normal", "normal");
+}, "Test setting 'auto' as incorrect value through CSS.");
+
+test(function() {
+    checkValues(placeContentNone, "placeContent", "place-content", "", "normal normal");
+    checkPlaceContentValues(placeContentNone, "", "normal", "normal");
+}, "Test setting 'none' as incorrect value through CSS.");
+
+test(function() {
+    checkValues(placeContentSafe, "placeContent", "place-content", "", "normal normal");
+    checkPlaceContentValues(placeContentSafe, "", "normal", "normal");
+}, "Test setting 'safe' as incorrect value through CSS.");
+
+test(function() {
+    checkValues(placeContentStartSafe, "placeContent", "place-content", "", "normal normal");
+    checkPlaceContentValues(placeContentStartSafe, "", "normal", "normal");
+}, "Test setting 'start safe' as incorrect value through CSS.");
+
+test(function() {
+    checkValues(placeContentStartSafe, "placeContent", "place-content", "", "normal normal");
+    checkPlaceContentValues(placeContentStartSafe, "", "normal", "normal");
+}, "Test setting 'baseline safe' as incorrect value through CSS.");
+
+test(function() {
+    checkValues(placeContentStartEndLeft, "placeContent", "place-content", "", "normal normal");
+    checkPlaceContentValues(placeContentStartEndLeft, "", "normal", "normal");
+}, "Test setting 'start end left' as incorrect value through CSS.");
+
+test(function() {
+    // FIXME: We will get FAIL for placeContent specified values tests because we still don't know how to serialize this shortand.
+    // https://github.com/w3c/csswg-drafts/issues/1041
+    checkPlaceContentValuesJS("center", "center", "center");
+    checkPlaceContentValuesJS("start start", "start", "start");
+    checkPlaceContentValuesJS("center start", "center", "start");
+    checkPlaceContentValuesJS("space-between end", "space-between", "end");
+    checkPlaceContentValuesJS("normal end", "normal", "end");
+}, "Test setting values through JS.");
+
+test(function() {
+    checkPlaceContentValuesBadJS("center safe", "normal", "normal");
+    checkPlaceContentValuesBadJS("center space-between center", "normal", "normal");
+    checkPlaceContentValuesBadJS("asrt", "normal", "normal");
+    checkPlaceContentValuesBadJS("auto", "normal", "normal");
+    checkPlaceContentValuesBadJS("10px", "normal", "normal");
+    checkPlaceContentValuesBadJS("stretch safe", "normal", "normal");
+    checkPlaceContentValuesBadJS("space-between start end", "normal", "normal");
+}, "Test setting incorrect values through JS.");
+
+test(function() {
+    checkPlaceContentInitialValue();
+}, "Test the 'initial' value of the place-content shorthand and its longhand properties' Computed value");
+
+test(function() {
+    checkPlaceContentInheritValue();
+}, "Test the 'inherit' value of the place-content shorthand and its longhand properties' Computed value");
+
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/css3/resources/alignment-parsing-utils-th.js b/LayoutTests/css3/resources/alignment-parsing-utils-th.js
new file mode 100644 (file)
index 0000000..4bfe591
--- /dev/null
@@ -0,0 +1,55 @@
+function checkValues(element, property, propertyID, value, computedValue)
+{
+    window.element = element;
+    var elementID = element.id || "element";
+    assert_equals(eval('element.style.' + property), value, property + ' specified value is not what it should.');
+    assert_equals(eval("window.getComputedStyle(" + elementID + ", '').getPropertyValue('" + propertyID + "')"), computedValue, property + " is not what it should.");
+}
+
+function checkBadValues(element, property, propertyID, value)
+{
+    var elementID = element.id || "element";
+    var initialValue = eval("window.getComputedStyle(" + elementID + " , '').getPropertyValue('" + propertyID + "')");
+    element.style[property] = value;
+    checkValues(element, property, propertyID, "", initialValue);
+}
+
+function checkInitialValues(element, property, propertyID, value, initial)
+{
+    element.style[property] = value;
+    checkValues(element, property, propertyID, value, value);
+    element.style[property] = "initial";
+    checkValues(element, property, propertyID, "initial", initial);
+}
+
+function checkInheritValues(property, propertyID, value)
+{
+    var parentElement = document.createElement("div");
+    document.body.appendChild(parentElement);
+    parentElement.style[property] = value;
+    checkValues(parentElement, property, propertyID, value, value);
+
+    var element = document.createElement("div");
+    parentElement.appendChild(element);
+    element.style[property] = "inherit";
+    checkValues(element, property, propertyID, "inherit", value);
+}
+
+function checkLegacyValues(property, propertyID, value)
+{
+    var parentElement = document.createElement("div");
+    document.body.appendChild(parentElement);
+    parentElement.style[property] = value;
+    checkValues(parentElement, property, propertyID, value, value);
+
+    var element = document.createElement("div");
+    parentElement.appendChild(element);
+    checkValues(element, property, propertyID, "", value);
+}
+
+function checkSupportedValues(elementID, property)
+{
+    var value = eval("window.getComputedStyle(" + elementID + " , '').getPropertyValue('" + property + "')");
+    var value1 = eval("window.getComputedStyle(" + elementID + " , '')");
+    shouldBeTrue("CSS.supports('" + property + "', '" + value + "')");
+}
index 0fb4bc8..b1e829d 100644 (file)
@@ -1,3 +1,30 @@
+2017-03-01  Javier Fernandez  <jfernandez@igalia.com>
+
+        [css-align] Implement the place-content shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=168771
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        The CSS Box Alignment specification defines a new shorthand to set the
+        Content Alignment properties (align-content and justify-content) at the
+        same time.
+
+        This patch provides the implementation of the CSS parsing logic and the
+        required regression tests.
+
+        Test: css3/parse-place-content.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/CSSProperties.json:
+        * css/StyleProperties.cpp:
+        (WebCore::StyleProperties::getPropertyValue):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeSimplifiedContentPosition):
+        (WebCore::CSSPropertyParser::consumePlaceContentShorthand):
+        (WebCore::CSSPropertyParser::parseShorthand):
+        * css/parser/CSSPropertyParser.h:
+
 2017-03-01  Simon Fraser  <simon.fraser@apple.com>
 
         Try to fix Windows build after r213191.
index bd55069..ec6657a 100644 (file)
@@ -320,6 +320,7 @@ static const CSSPropertyID computedProperties[] = {
     CSSPropertyJustifyContent,
     CSSPropertyJustifySelf,
     CSSPropertyJustifyItems,
+    CSSPropertyPlaceContent,
 #if ENABLE(FILTERS_LEVEL_2)
     CSSPropertyWebkitBackdropFilter,
 #endif
@@ -2871,6 +2872,8 @@ RefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID,
             return valueForItemPositionWithOverflowAlignment(resolveJustifyItemsAuto(style->justifyItems(), styledElement->parentNode()));
         case CSSPropertyJustifySelf:
             return valueForItemPositionWithOverflowAlignment(resolveJustifySelfAuto(style->justifySelf(), styledElement->parentNode()));
+        case CSSPropertyPlaceContent:
+            return getCSSPropertyValuesForShorthandProperties(placeContentShorthand());
         case CSSPropertyOrder:
             return cssValuePool.createValue(style->order(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyFloat:
index 0d14ad9..6deb7bf 100644 (file)
                 "url": "https://www.w3.org/TR/css-align-3/#propdef-justify-items"
             }
         },
+        "place-content": {
+            "codegen-properties": {
+                "longhands": [
+                    "align-content",
+                    "justify-content"
+                ]
+            }
+        },
         "grid": {
             "codegen-properties": {
                 "longhands": [
index ea1f9f1..2b3fa3d 100644 (file)
@@ -187,6 +187,8 @@ String StyleProperties::getPropertyValue(CSSPropertyID propertyID) const
         return getShorthandValue(gridColumnShorthand());
     case CSSPropertyGridRow:
         return getShorthandValue(gridRowShorthand());
+    case CSSPropertyPlaceContent:
+        return getShorthandValue(placeContentShorthand());
     case CSSPropertyFont:
         return fontValue();
     case CSSPropertyMargin:
index 129c299..4c7c7c5 100644 (file)
@@ -5254,6 +5254,39 @@ bool CSSPropertyParser::consumeGridShorthand(bool important)
     return true;
 }
 
+static RefPtr<CSSValue> consumeSimplifiedContentPosition(CSSParserTokenRange& range)
+{
+    CSSValueID id = range.peek().id();
+    if (identMatches<CSSValueNormal, CSSValueBaseline, CSSValueLastBaseline>(id))
+        return CSSContentDistributionValue::create(CSSValueInvalid, range.consumeIncludingWhitespace().id(), CSSValueInvalid);
+    if (identMatches<CSSValueSpaceBetween, CSSValueSpaceAround, CSSValueSpaceEvenly, CSSValueStretch>(id))
+        return CSSContentDistributionValue::create(range.consumeIncludingWhitespace().id(), CSSValueInvalid, CSSValueInvalid);
+    if (identMatches<CSSValueStart, CSSValueEnd, CSSValueCenter, CSSValueFlexStart, CSSValueFlexEnd, CSSValueLeft, CSSValueRight>(id))
+        return CSSContentDistributionValue::create(CSSValueInvalid, range.consumeIncludingWhitespace().id(), CSSValueInvalid);
+    return nullptr;
+}
+
+bool CSSPropertyParser::consumePlaceContentShorthand(bool important)
+{
+    ASSERT(shorthandForProperty(CSSPropertyPlaceContent).length() == 2);
+
+    if (m_range.atEnd())
+        return false;
+
+    RefPtr<CSSValue> alignContentValue = consumeSimplifiedContentPosition(m_range);
+    if (!alignContentValue)
+        return false;
+    RefPtr<CSSValue> justifyContentValue = m_range.atEnd() ? alignContentValue : consumeSimplifiedContentPosition(m_range);
+    if (!justifyContentValue)
+        return false;
+    if (!m_range.atEnd())
+        return false;
+
+    addProperty(CSSPropertyAlignContent, CSSPropertyPlaceContent, alignContentValue.releaseNonNull(), important);
+    addProperty(CSSPropertyJustifyContent, CSSPropertyPlaceContent, justifyContentValue.releaseNonNull(), important);
+    return true;
+}
+
 bool CSSPropertyParser::parseShorthand(CSSPropertyID property, bool important)
 {
     switch (property) {
@@ -5435,6 +5468,8 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID property, bool important)
         return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important);
     case CSSPropertyGrid:
         return consumeGridShorthand(important);
+    case CSSPropertyPlaceContent:
+        return consumePlaceContentShorthand(important);
     case CSSPropertyWebkitMarquee:
         return consumeShorthandGreedily(webkitMarqueeShorthand(), important);
     default:
index 76d3c71..bdde19c 100644 (file)
@@ -80,6 +80,8 @@ private:
     bool consumeGridShorthand(bool important);
     bool consumeGridAreaShorthand(bool important);
 
+    bool consumePlaceContentShorthand(bool important);
+
     bool consumeFont(bool important);
     bool consumeFontVariantShorthand(bool important);
     bool consumeSystemFont(bool important);