<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[214852] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/214852">214852</a></dd>
<dt>Author</dt> <dd>jfernandez@igalia.com</dd>
<dt>Date</dt> <dd>2017-04-03 16:08:42 -0700 (Mon, 03 Apr 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-align] Adapt place-content alignment shorthand to the new baseline syntax
https://bugs.webkit.org/show_bug.cgi?id=170340

Reviewed by David Hyatt.

Source/WebCore:

Now that the align-content and justify-content CSS properties are
adapted to the new baseline-position CSS values syntax we can adapt the
shorthand that controls such properties to the new syntax as well.

No new tests, just adding some additional cases to the tests we already have.

* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::placeContentPropertyValue):
* css/StyleProperties.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::isContentDistributionKeyword):
(WebCore::isContentPositionKeyword):
(WebCore::isOverflowKeyword):
(WebCore::getBaselineKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSimplifiedContentPosition):

LayoutTests:

Added additional test cases to evaluate the new baseline-alignment syntax.

* css3/parse-place-content-expected.txt:
* css3/parse-place-content.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscss3parseplacecontentexpectedtxt">trunk/LayoutTests/css3/parse-place-content-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3parseplacecontenthtml">trunk/LayoutTests/css3/parse-place-content.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertiescpp">trunk/Source/WebCore/css/StyleProperties.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertiesh">trunk/Source/WebCore/css/StyleProperties.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParsercpp">trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (214851 => 214852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-04-03 23:06:25 UTC (rev 214851)
+++ trunk/LayoutTests/ChangeLog        2017-04-03 23:08:42 UTC (rev 214852)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-04-03  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [css-align] Adapt place-content alignment shorthand to the new baseline syntax
+        https://bugs.webkit.org/show_bug.cgi?id=170340
+
+        Reviewed by David Hyatt.
+
+        Added additional test cases to evaluate the new baseline-alignment syntax.
+
+        * css3/parse-place-content-expected.txt:
+        * css3/parse-place-content.html:
+
</ins><span class="cx"> 2017-04-03  Nan Wang  &lt;n_wang@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Expose link children when doing search predication on iOS
</span></span></pre></div>
<a id="trunkLayoutTestscss3parseplacecontentexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/parse-place-content-expected.txt (214851 => 214852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/parse-place-content-expected.txt        2017-04-03 23:06:25 UTC (rev 214851)
+++ trunk/LayoutTests/css3/parse-place-content-expected.txt        2017-04-03 23:08:42 UTC (rev 214852)
</span><span class="lines">@@ -3,6 +3,8 @@
</span><span class="cx"> 
</span><span class="cx"> PASS Test getting the Computed Value of place-content's longhand properties when setting 'normal' value through CSS. 
</span><span class="cx"> PASS Test getting the Computed Value of place-content's longhand properties when setting 'baseline' value through CSS. 
</span><ins>+PASS Test getting the Computed Value of place-content's longhand properties when setting 'first baseline' value through CSS. 
+PASS Test getting the Computed Value of place-content's longhand properties when setting 'last baseline' value through CSS. 
</ins><span class="cx"> PASS Test getting the Computed Value of place-content's longhand properties when setting 'start' value through CSS. 
</span><span class="cx"> PASS Test getting the Computed Value of place-content's longhand properties when setting 'flex-start' value through CSS. 
</span><span class="cx"> PASS Test getting the Computed Value of place-content's longhand properties when setting 'end' value through CSS. 
</span><span class="lines">@@ -18,7 +20,7 @@
</span><span class="cx"> PASS Test setting 'start safe' as incorrect value through CSS. 
</span><span class="cx"> PASS Test setting 'baseline safe' as incorrect value through CSS. 
</span><span class="cx"> PASS Test setting 'start end left' as incorrect value through CSS. 
</span><del>-FAIL Test setting values through JS. assert_equals: placeContent specified value is not what it should. expected &quot;center&quot; but got &quot;center center&quot;
</del><ins>+PASS Test setting values through JS. 
</ins><span class="cx"> PASS Test setting incorrect values through JS. 
</span><span class="cx"> PASS Test the 'initial' value of the place-content shorthand and its longhand properties' Computed value 
</span><span class="cx"> PASS Test the 'inherit' value of the place-content shorthand and its longhand properties' Computed value 
</span></span></pre></div>
<a id="trunkLayoutTestscss3parseplacecontenthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/parse-place-content.html (214851 => 214852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/parse-place-content.html        2017-04-03 23:06:25 UTC (rev 214851)
+++ trunk/LayoutTests/css3/parse-place-content.html        2017-04-03 23:08:42 UTC (rev 214852)
</span><span class="lines">@@ -8,6 +8,12 @@
</span><span class="cx"> #placeContentBaseline {
</span><span class="cx">     place-content: baseline;
</span><span class="cx"> }
</span><ins>+#placeContentFirstBaseline {
+    place-content: first baseline;
+}
+#placeContentLastBaseline {
+    place-content: last baseline;
+}
</ins><span class="cx"> #placeContentStart {
</span><span class="cx">     place-content: start;
</span><span class="cx"> }
</span><span class="lines">@@ -63,6 +69,8 @@
</span><span class="cx"> 
</span><span class="cx">     &lt;div id=&quot;placeContentNormal&quot;&gt;&lt;/div&gt;
</span><span class="cx">     &lt;div id=&quot;placeContentBaseline&quot;&gt;&lt;/div&gt;
</span><ins>+    &lt;div id=&quot;placeContentFirstBaseline&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentLastBaseline&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;div id=&quot;placeContentStart&quot;&gt;&lt;/div&gt;
</span><span class="cx">     &lt;div id=&quot;placeContentFlexStart&quot;&gt;&lt;/div&gt;
</span><span class="cx">     &lt;div id=&quot;placeContentEnd&quot;&gt;&lt;/div&gt;
</span><span class="lines">@@ -82,20 +90,30 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function checkPlaceContentValues(element, value, alignValue, justifyValue)
</span><span class="cx"> {
</span><del>-     var res = value.split(&quot; &quot;);
-     if (res.length &lt; 2)
-         res[1] = res[0];
-     checkValues(element, &quot;alignContent&quot;, &quot;align-content&quot;, res[0], alignValue);
-     checkValues(element, &quot;justifyContent&quot;, &quot;justify-content&quot;, res[1], justifyValue);
</del><ins>+    var res = value.split(&quot; &quot;);
+    var alignContentSpecified = res[0];
+    var justifyContentSpecified = &quot;&quot;;
+    if (res[0] === &quot;first&quot; || res[0] === &quot;last&quot;) {
+        alignContentSpecified = res[0] + &quot; &quot; + res[1];
+        if (res.length &gt; 2)
+            justifyContentSpecified = res.slice(2).join(&quot; &quot;);
+    } else {
+        justifyContentSpecified = res.slice(1).join(&quot; &quot;);
+    }
+
+    if (justifyContentSpecified === &quot;&quot;)
+         justifyContentSpecified = alignContentSpecified;
+     checkValues(element, &quot;alignContent&quot;, &quot;align-content&quot;, alignContentSpecified, alignValue);
+     checkValues(element, &quot;justifyContent&quot;, &quot;justify-content&quot;, justifyContentSpecified, justifyValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function checkPlaceContentValuesJS(value, alignValue, justifyValue)
</span><span class="cx"> {
</span><del>-   element = document.createElement(&quot;div&quot;);
-   document.body.appendChild(element);
-   element.style.placeContent = value;
-   checkValues(element, &quot;placeContent&quot;, &quot;place-content&quot;, value, alignValue + ' ' + justifyValue)
-   checkPlaceContentValues(element, value, alignValue, justifyValue)
</del><ins>+    element = document.createElement(&quot;div&quot;);
+    document.body.appendChild(element);
+    element.style.placeContent = value;
+    checkValues(element, &quot;placeContent&quot;, &quot;place-content&quot;, value, alignValue + ' ' + justifyValue)
+    checkPlaceContentValues(element, value, alignValue, justifyValue)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function checkPlaceContentValuesBadJS(value)
</span><span class="lines">@@ -139,6 +157,16 @@
</span><span class="cx"> }, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'baseline' value through CSS.&quot;);
</span><span class="cx"> 
</span><span class="cx"> test(function() {
</span><ins>+    checkValues(placeContentFirstBaseline, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;baseline baseline&quot;);
+    checkPlaceContentValues(placeContentFirstBaseline, &quot;&quot;, &quot;baseline&quot;, &quot;baseline&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'first baseline' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentLastBaseline, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;last baseline last baseline&quot;);
+    checkPlaceContentValues(placeContentLastBaseline, &quot;&quot;, &quot;last baseline&quot;, &quot;last baseline&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'last baseline' value through CSS.&quot;);
+
+test(function() {
</ins><span class="cx">     checkValues(placeContentStart, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;start start&quot;);
</span><span class="cx">     checkPlaceContentValues(placeContentStart, &quot;&quot;, &quot;start&quot;, &quot;start&quot;);
</span><span class="cx"> }, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'start' value through CSS.&quot;);
</span><span class="lines">@@ -214,10 +242,7 @@
</span><span class="cx"> }, &quot;Test setting 'start end left' as incorrect value through CSS.&quot;);
</span><span class="cx"> 
</span><span class="cx"> test(function() {
</span><del>-    // 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
</del><span class="cx">     checkPlaceContentValuesJS(&quot;center&quot;, &quot;center&quot;, &quot;center&quot;);
</span><del>-    checkPlaceContentValuesJS(&quot;start start&quot;, &quot;start&quot;, &quot;start&quot;);
</del><span class="cx">     checkPlaceContentValuesJS(&quot;center start&quot;, &quot;center&quot;, &quot;start&quot;);
</span><span class="cx">     checkPlaceContentValuesJS(&quot;space-between end&quot;, &quot;space-between&quot;, &quot;end&quot;);
</span><span class="cx">     checkPlaceContentValuesJS(&quot;normal end&quot;, &quot;normal&quot;, &quot;end&quot;);
</span><span class="lines">@@ -231,6 +256,7 @@
</span><span class="cx">     checkPlaceContentValuesBadJS(&quot;10px&quot;, &quot;normal&quot;, &quot;normal&quot;);
</span><span class="cx">     checkPlaceContentValuesBadJS(&quot;stretch safe&quot;, &quot;normal&quot;, &quot;normal&quot;);
</span><span class="cx">     checkPlaceContentValuesBadJS(&quot;space-between start end&quot;, &quot;normal&quot;, &quot;normal&quot;);
</span><ins>+    checkPlaceContentValuesBadJS(&quot;&quot;, &quot;normal&quot;, &quot;normal&quot;);
</ins><span class="cx"> }, &quot;Test setting incorrect values through JS.&quot;);
</span><span class="cx"> 
</span><span class="cx"> test(function() {
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (214851 => 214852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-04-03 23:06:25 UTC (rev 214851)
+++ trunk/Source/WebCore/ChangeLog        2017-04-03 23:08:42 UTC (rev 214852)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2017-04-03  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [css-align] Adapt place-content alignment shorthand to the new baseline syntax
+        https://bugs.webkit.org/show_bug.cgi?id=170340
+
+        Reviewed by David Hyatt.
+
+        Now that the align-content and justify-content CSS properties are
+        adapted to the new baseline-position CSS values syntax we can adapt the
+        shorthand that controls such properties to the new syntax as well.
+
+        No new tests, just adding some additional cases to the tests we already have.
+
+        * css/StyleProperties.cpp:
+        (WebCore::StyleProperties::getPropertyValue):
+        (WebCore::StyleProperties::placeContentPropertyValue):
+        * css/StyleProperties.h:
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::isContentDistributionKeyword):
+        (WebCore::isContentPositionKeyword):
+        (WebCore::isOverflowKeyword):
+        (WebCore::getBaselineKeyword):
+        (WebCore::consumeContentDistributionOverflowPosition):
+        (WebCore::consumeSimplifiedContentPosition):
+
</ins><span class="cx"> 2017-04-03  Nan Wang  &lt;n_wang@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Expose link children when doing search predication on iOS
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleProperties.cpp (214851 => 214852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleProperties.cpp        2017-04-03 23:06:25 UTC (rev 214851)
+++ trunk/Source/WebCore/css/StyleProperties.cpp        2017-04-03 23:08:42 UTC (rev 214852)
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx">     case CSSPropertyGridRow:
</span><span class="cx">         return getShorthandValue(gridRowShorthand());
</span><span class="cx">     case CSSPropertyPlaceContent:
</span><del>-        return getShorthandValue(placeContentShorthand());
</del><ins>+        return placeContentPropertyValue();
</ins><span class="cx">     case CSSPropertyFont:
</span><span class="cx">         return fontValue();
</span><span class="cx">     case CSSPropertyMargin:
</span><span class="lines">@@ -583,6 +583,14 @@
</span><span class="cx">     return res;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String StyleProperties::placeContentPropertyValue() const
+{
+    String value = getCommonValue(placeContentShorthand());
+    if (value.isNull() || value.isEmpty())
+        return getShorthandValue(placeContentShorthand());
+    return value;
+}
+
</ins><span class="cx"> String StyleProperties::borderPropertyValue(CommonValueMode valueMode) const
</span><span class="cx"> {
</span><span class="cx">     const StylePropertyShorthand properties[3] = { borderWidthShorthand(), borderStyleShorthand(), borderColorShorthand() };
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleProperties.h (214851 => 214852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleProperties.h        2017-04-03 23:06:25 UTC (rev 214851)
+++ trunk/Source/WebCore/css/StyleProperties.h        2017-04-03 23:08:42 UTC (rev 214852)
</span><span class="lines">@@ -157,6 +157,7 @@
</span><span class="cx"> private:
</span><span class="cx">     String getShorthandValue(const StylePropertyShorthand&amp;) const;
</span><span class="cx">     String getCommonValue(const StylePropertyShorthand&amp;) const;
</span><ins>+    String placeContentPropertyValue() const;
</ins><span class="cx">     enum CommonValueMode { OmitUncommonValues, ReturnNullOnUncommonValues };
</span><span class="cx">     String borderPropertyValue(CommonValueMode) const;
</span><span class="cx">     String getLayeredShorthandValue(const StylePropertyShorthand&amp;) const;
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (214851 => 214852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2017-04-03 23:06:25 UTC (rev 214851)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2017-04-03 23:08:42 UTC (rev 214852)
</span><span class="lines">@@ -2619,11 +2619,39 @@
</span><span class="cx">     return list;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool isContentDistributionKeyword(CSSValueID id)
+{
+    return identMatches&lt;CSSValueSpaceBetween, CSSValueSpaceAround, CSSValueSpaceEvenly, CSSValueStretch&gt;(id);
+}
+
+static bool isContentPositionKeyword(CSSValueID id)
+{
+    return identMatches&lt;CSSValueStart, CSSValueEnd, CSSValueCenter, CSSValueFlexStart, CSSValueFlexEnd, CSSValueLeft, CSSValueRight&gt;(id);
+}
+
+static bool isOverflowKeyword(CSSValueID id)
+{
+    return CSSPropertyParserHelpers::identMatches&lt;CSSValueUnsafe, CSSValueSafe&gt;(id);
+}
+
</ins><span class="cx"> static bool isBaselineKeyword(CSSValueID id)
</span><span class="cx"> {
</span><span class="cx">     return identMatches&lt;CSSValueFirst, CSSValueLast, CSSValueBaseline&gt;(id);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static CSSValueID getBaselineKeyword(RefPtr&lt;CSSValue&gt; value)
+{
+    auto&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    if (auto* pairValue = primitiveValue.pairValue()) {
+        ASSERT(pairValue-&gt;second()-&gt;valueID() == CSSValueBaseline);
+        if (pairValue-&gt;first()-&gt;valueID() == CSSValueLast)
+            return CSSValueLastBaseline;
+        return CSSValueFirstBaseline;
+    }
+    ASSERT(primitiveValue.valueID() == CSSValueBaseline);
+    return CSSValueBaseline;
+}
+
</ins><span class="cx"> static RefPtr&lt;CSSValue&gt; consumeBaselineKeyword(CSSParserTokenRange&amp; range)
</span><span class="cx"> {
</span><span class="cx">     CSSValueID id = range.peek().id();
</span><span class="lines">@@ -2648,15 +2676,7 @@
</span><span class="cx">         RefPtr&lt;CSSValue&gt; baseline = consumeBaselineKeyword(range);
</span><span class="cx">         if (!baseline)
</span><span class="cx">             return nullptr;
</span><del>-        CSSValueID baselineID = CSSValueBaseline;
-        auto&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*baseline);
-        if (auto* pairValue = primitiveValue.pairValue()) {
-            if (pairValue-&gt;first()-&gt;valueID() == CSSValueLast)
-                baselineID = CSSValueLastBaseline;
-            else
-                baselineID = CSSValueFirstBaseline;
-        }
-        return CSSContentDistributionValue::create(CSSValueInvalid, baselineID, CSSValueInvalid);
</del><ins>+        return CSSContentDistributionValue::create(CSSValueInvalid, getBaselineKeyword(baseline), CSSValueInvalid);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CSSValueID distribution = CSSValueInvalid;
</span><span class="lines">@@ -2664,15 +2684,15 @@
</span><span class="cx">     CSSValueID overflow = CSSValueInvalid;
</span><span class="cx">     do {
</span><span class="cx">         CSSValueID id = range.peek().id();
</span><del>-        if (identMatches&lt;CSSValueSpaceBetween, CSSValueSpaceAround, CSSValueSpaceEvenly, CSSValueStretch&gt;(id)) {
</del><ins>+        if (isContentDistributionKeyword(id)) {
</ins><span class="cx">             if (distribution != CSSValueInvalid)
</span><span class="cx">                 return nullptr;
</span><span class="cx">             distribution = id;
</span><del>-        } else if (identMatches&lt;CSSValueStart, CSSValueEnd, CSSValueCenter, CSSValueFlexStart, CSSValueFlexEnd, CSSValueLeft, CSSValueRight&gt;(id)) {
</del><ins>+        } else if (isContentPositionKeyword(id)) {
</ins><span class="cx">             if (position != CSSValueInvalid)
</span><span class="cx">                 return nullptr;
</span><span class="cx">             position = id;
</span><del>-        } else if (identMatches&lt;CSSValueUnsafe, CSSValueSafe&gt;(id)) {
</del><ins>+        } else if (isOverflowKeyword(id)) {
</ins><span class="cx">             if (overflow != CSSValueInvalid)
</span><span class="cx">                 return nullptr;
</span><span class="cx">             overflow = id;
</span><span class="lines">@@ -5451,12 +5471,16 @@
</span><span class="cx"> static RefPtr&lt;CSSValue&gt; consumeSimplifiedContentPosition(CSSParserTokenRange&amp; range)
</span><span class="cx"> {
</span><span class="cx">     CSSValueID id = range.peek().id();
</span><del>-    if (identMatches&lt;CSSValueNormal, CSSValueBaseline, CSSValueLastBaseline&gt;(id))
</del><ins>+    if (identMatches&lt;CSSValueNormal&gt;(id) || isContentPositionKeyword(id))
</ins><span class="cx">         return CSSContentDistributionValue::create(CSSValueInvalid, range.consumeIncludingWhitespace().id(), CSSValueInvalid);
</span><del>-    if (identMatches&lt;CSSValueSpaceBetween, CSSValueSpaceAround, CSSValueSpaceEvenly, CSSValueStretch&gt;(id))
</del><ins>+    if (isBaselineKeyword(id)) {
+        RefPtr&lt;CSSValue&gt; baseline = consumeBaselineKeyword(range);
+        if (!baseline)
+            return nullptr;
+        return CSSContentDistributionValue::create(CSSValueInvalid, getBaselineKeyword(baseline.releaseNonNull()), CSSValueInvalid);
+    }
+    if (isContentDistributionKeyword(id))
</ins><span class="cx">         return CSSContentDistributionValue::create(range.consumeIncludingWhitespace().id(), CSSValueInvalid, CSSValueInvalid);
</span><del>-    if (identMatches&lt;CSSValueStart, CSSValueEnd, CSSValueCenter, CSSValueFlexStart, CSSValueFlexEnd, CSSValueLeft, CSSValueRight&gt;(id))
-        return CSSContentDistributionValue::create(CSSValueInvalid, range.consumeIncludingWhitespace().id(), CSSValueInvalid);
</del><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>