<!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>[213230] 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/213230">213230</a></dd>
<dt>Author</dt> <dd>jfernandez@igalia.com</dd>
<dt>Date</dt> <dd>2017-03-01 10:47:49 -0800 (Wed, 01 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-align] Implement the place-content shorthand
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):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertiesjson">trunk/Source/WebCore/css/CSSProperties.json</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertiescpp">trunk/Source/WebCore/css/StyleProperties.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParsercpp">trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParserh">trunk/Source/WebCore/css/parser/CSSPropertyParser.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<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="#trunkLayoutTestscss3resourcesalignmentparsingutilsthjs">trunk/LayoutTests/css3/resources/alignment-parsing-utils-th.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (213229 => 213230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-01 18:18:04 UTC (rev 213229)
+++ trunk/LayoutTests/ChangeLog        2017-03-01 18:47:49 UTC (rev 213230)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2017-03-01  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [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):
+
</ins><span class="cx"> 2017-03-01  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
</span></span></pre></div>
<a id="trunkLayoutTestscss3parseplacecontentexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/parse-place-content-expected.txt (0 => 213230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/parse-place-content-expected.txt                                (rev 0)
+++ trunk/LayoutTests/css3/parse-place-content-expected.txt        2017-03-01 18:47:49 UTC (rev 213230)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+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 &quot;center&quot; but got &quot;center center&quot;
+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 
+
</ins></span></pre></div>
<a id="trunkLayoutTestscss3parseplacecontenthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/parse-place-content.html (0 => 213230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/parse-place-content.html                                (rev 0)
+++ trunk/LayoutTests/css3/parse-place-content.html        2017-03-01 18:47:49 UTC (rev 213230)
</span><span class="lines">@@ -0,0 +1,247 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+#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;
+}
+
+&lt;!-- Invalid CSS cases --&gt;
+#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;
+}
+&lt;/style&gt;
+&lt;script src=&quot;../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/alignment-parsing-utils-th.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test to verify that the new place-content alignment shorthand is parsed as expected and correctly sets the longhand values.&lt;/p&gt;
+    &lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+
+    &lt;div id=&quot;placeContentNormal&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentBaseline&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentStart&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentFlexStart&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentEnd&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentSpaceBetween&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentStretch&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentStartEnd&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentStartSpaceEvenly&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentStartBaseline&quot;&gt;&lt;/div&gt;
+
+    &lt;div id=&quot;placeContentEmpty&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentAuto&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentNone&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentSafe&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentStartSafe&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentBaselineSafe&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;placeContentStartEndLeft&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+function checkPlaceContentValues(element, value, alignValue, justifyValue)
+{
+     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);
+}
+
+function checkPlaceContentValuesJS(value, alignValue, justifyValue)
+{
+   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)
+}
+
+function checkPlaceContentValuesBadJS(value)
+{
+   element.style.placeContent = &quot;&quot;;
+   element.style.placeContent = value;
+   checkPlaceContentValues(element, &quot;&quot;, &quot;normal&quot;, &quot;normal&quot;)
+}
+
+function checkPlaceContentInitialValue()
+{
+   element = document.createElement(&quot;div&quot;);
+   document.body.appendChild(element);
+   checkValues(element, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;normal normal&quot;);
+   element.style.placeContent = &quot;center&quot;;
+   checkPlaceContentValues(element, &quot;center&quot;, &quot;center&quot;, &quot;center&quot;);
+   element.style.placeContent = &quot;initial&quot;;
+   checkValues(element, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;initial&quot;, &quot;normal normal&quot;);
+   checkPlaceContentValues(element, &quot;initial&quot;, &quot;normal&quot;, &quot;normal&quot;);
+}
+
+function checkPlaceContentInheritValue()
+{
+   document.body.style.placeContent = &quot;start&quot;;
+   var anotherElement = document.createElement(&quot;div&quot;);
+   document.body.appendChild(anotherElement);
+   checkPlaceContentValues(anotherElement, &quot;&quot;, &quot;normal&quot;, &quot;normal&quot;);
+   anotherElement.style.placeContent = &quot;inherit&quot;;
+   checkPlaceContentValues(anotherElement, &quot;inherit&quot;, &quot;start&quot;, &quot;start&quot;);
+}
+
+
+test(function() {
+    checkValues(placeContentNormal, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;normal normal&quot;);
+    checkPlaceContentValues(placeContentNormal, &quot;&quot;, &quot;normal&quot;, &quot;normal&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'normal' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentBaseline, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;baseline baseline&quot;);
+    checkPlaceContentValues(placeContentBaseline, &quot;&quot;, &quot;baseline&quot;, &quot;baseline&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'baseline' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentStart, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;start start&quot;);
+    checkPlaceContentValues(placeContentStart, &quot;&quot;, &quot;start&quot;, &quot;start&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'start' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentFlexStart, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;flex-start flex-start&quot;);
+    checkPlaceContentValues(placeContentFlexStart, &quot;&quot;, &quot;flex-start&quot;, &quot;flex-start&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'flex-start' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentEnd, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;end end&quot;);
+    checkPlaceContentValues(placeContentEnd, &quot;&quot;, &quot;end&quot;, &quot;end&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'end' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentSpaceBetween, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;space-between space-between&quot;);
+    checkPlaceContentValues(placeContentSpaceBetween, &quot;&quot;, &quot;space-between&quot;, &quot;space-between&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'space-between' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentStretch, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;stretch stretch&quot;);
+    checkPlaceContentValues(placeContentStretch, &quot;&quot;, &quot;stretch&quot;, &quot;stretch&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'stretch' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentStartEnd, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;start end&quot;);
+    checkPlaceContentValues(placeContentStartEnd, &quot;&quot;, &quot;start&quot;, &quot;end&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'start end' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentStartSpaceEvenly, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;start space-evenly&quot;);
+    checkPlaceContentValues(placeContentStartSpaceEvenly, &quot;&quot;, &quot;start&quot;, &quot;space-evenly&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'start space-evenly' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentStartBaseline, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;start baseline&quot;);
+    checkPlaceContentValues(placeContentStartBaseline, &quot;&quot;, &quot;start&quot;, &quot;baseline&quot;);
+}, &quot;Test getting the Computed Value of place-content's longhand properties when setting 'start baseline' value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentAuto, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;normal normal&quot;);
+    checkPlaceContentValues(placeContentAuto, &quot;&quot;, &quot;normal&quot;, &quot;normal&quot;);
+}, &quot;Test setting '' as incorrect value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentAuto, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;normal normal&quot;);
+    checkPlaceContentValues(placeContentAuto, &quot;&quot;, &quot;normal&quot;, &quot;normal&quot;);
+}, &quot;Test setting 'auto' as incorrect value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentNone, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;normal normal&quot;);
+    checkPlaceContentValues(placeContentNone, &quot;&quot;, &quot;normal&quot;, &quot;normal&quot;);
+}, &quot;Test setting 'none' as incorrect value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentSafe, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;normal normal&quot;);
+    checkPlaceContentValues(placeContentSafe, &quot;&quot;, &quot;normal&quot;, &quot;normal&quot;);
+}, &quot;Test setting 'safe' as incorrect value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentStartSafe, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;normal normal&quot;);
+    checkPlaceContentValues(placeContentStartSafe, &quot;&quot;, &quot;normal&quot;, &quot;normal&quot;);
+}, &quot;Test setting 'start safe' as incorrect value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentStartSafe, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;normal normal&quot;);
+    checkPlaceContentValues(placeContentStartSafe, &quot;&quot;, &quot;normal&quot;, &quot;normal&quot;);
+}, &quot;Test setting 'baseline safe' as incorrect value through CSS.&quot;);
+
+test(function() {
+    checkValues(placeContentStartEndLeft, &quot;placeContent&quot;, &quot;place-content&quot;, &quot;&quot;, &quot;normal normal&quot;);
+    checkPlaceContentValues(placeContentStartEndLeft, &quot;&quot;, &quot;normal&quot;, &quot;normal&quot;);
+}, &quot;Test setting 'start end left' as incorrect value through CSS.&quot;);
+
+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(&quot;center&quot;, &quot;center&quot;, &quot;center&quot;);
+    checkPlaceContentValuesJS(&quot;start start&quot;, &quot;start&quot;, &quot;start&quot;);
+    checkPlaceContentValuesJS(&quot;center start&quot;, &quot;center&quot;, &quot;start&quot;);
+    checkPlaceContentValuesJS(&quot;space-between end&quot;, &quot;space-between&quot;, &quot;end&quot;);
+    checkPlaceContentValuesJS(&quot;normal end&quot;, &quot;normal&quot;, &quot;end&quot;);
+}, &quot;Test setting values through JS.&quot;);
+
+test(function() {
+    checkPlaceContentValuesBadJS(&quot;center safe&quot;, &quot;normal&quot;, &quot;normal&quot;);
+    checkPlaceContentValuesBadJS(&quot;center space-between center&quot;, &quot;normal&quot;, &quot;normal&quot;);
+    checkPlaceContentValuesBadJS(&quot;asrt&quot;, &quot;normal&quot;, &quot;normal&quot;);
+    checkPlaceContentValuesBadJS(&quot;auto&quot;, &quot;normal&quot;, &quot;normal&quot;);
+    checkPlaceContentValuesBadJS(&quot;10px&quot;, &quot;normal&quot;, &quot;normal&quot;);
+    checkPlaceContentValuesBadJS(&quot;stretch safe&quot;, &quot;normal&quot;, &quot;normal&quot;);
+    checkPlaceContentValuesBadJS(&quot;space-between start end&quot;, &quot;normal&quot;, &quot;normal&quot;);
+}, &quot;Test setting incorrect values through JS.&quot;);
+
+test(function() {
+    checkPlaceContentInitialValue();
+}, &quot;Test the 'initial' value of the place-content shorthand and its longhand properties' Computed value&quot;);
+
+test(function() {
+    checkPlaceContentInheritValue();
+}, &quot;Test the 'inherit' value of the place-content shorthand and its longhand properties' Computed value&quot;);
+
+
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3resourcesalignmentparsingutilsthjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/resources/alignment-parsing-utils-th.js (0 => 213230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/resources/alignment-parsing-utils-th.js                                (rev 0)
+++ trunk/LayoutTests/css3/resources/alignment-parsing-utils-th.js        2017-03-01 18:47:49 UTC (rev 213230)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+function checkValues(element, property, propertyID, value, computedValue)
+{
+    window.element = element;
+    var elementID = element.id || &quot;element&quot;;
+    assert_equals(eval('element.style.' + property), value, property + ' specified value is not what it should.');
+    assert_equals(eval(&quot;window.getComputedStyle(&quot; + elementID + &quot;, '').getPropertyValue('&quot; + propertyID + &quot;')&quot;), computedValue, property + &quot; is not what it should.&quot;);
+}
+
+function checkBadValues(element, property, propertyID, value)
+{
+    var elementID = element.id || &quot;element&quot;;
+    var initialValue = eval(&quot;window.getComputedStyle(&quot; + elementID + &quot; , '').getPropertyValue('&quot; + propertyID + &quot;')&quot;);
+    element.style[property] = value;
+    checkValues(element, property, propertyID, &quot;&quot;, initialValue);
+}
+
+function checkInitialValues(element, property, propertyID, value, initial)
+{
+    element.style[property] = value;
+    checkValues(element, property, propertyID, value, value);
+    element.style[property] = &quot;initial&quot;;
+    checkValues(element, property, propertyID, &quot;initial&quot;, initial);
+}
+
+function checkInheritValues(property, propertyID, value)
+{
+    var parentElement = document.createElement(&quot;div&quot;);
+    document.body.appendChild(parentElement);
+    parentElement.style[property] = value;
+    checkValues(parentElement, property, propertyID, value, value);
+
+    var element = document.createElement(&quot;div&quot;);
+    parentElement.appendChild(element);
+    element.style[property] = &quot;inherit&quot;;
+    checkValues(element, property, propertyID, &quot;inherit&quot;, value);
+}
+
+function checkLegacyValues(property, propertyID, value)
+{
+    var parentElement = document.createElement(&quot;div&quot;);
+    document.body.appendChild(parentElement);
+    parentElement.style[property] = value;
+    checkValues(parentElement, property, propertyID, value, value);
+
+    var element = document.createElement(&quot;div&quot;);
+    parentElement.appendChild(element);
+    checkValues(element, property, propertyID, &quot;&quot;, value);
+}
+
+function checkSupportedValues(elementID, property)
+{
+    var value = eval(&quot;window.getComputedStyle(&quot; + elementID + &quot; , '').getPropertyValue('&quot; + property + &quot;')&quot;);
+    var value1 = eval(&quot;window.getComputedStyle(&quot; + elementID + &quot; , '')&quot;);
+    shouldBeTrue(&quot;CSS.supports('&quot; + property + &quot;', '&quot; + value + &quot;')&quot;);
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213229 => 213230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-01 18:18:04 UTC (rev 213229)
+++ trunk/Source/WebCore/ChangeLog        2017-03-01 18:47:49 UTC (rev 213230)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2017-03-01  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [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:
+
</ins><span class="cx"> 2017-03-01  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Try to fix Windows build after r213191.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (213229 => 213230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2017-03-01 18:18:04 UTC (rev 213229)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2017-03-01 18:47:49 UTC (rev 213230)
</span><span class="lines">@@ -320,6 +320,7 @@
</span><span class="cx">     CSSPropertyJustifyContent,
</span><span class="cx">     CSSPropertyJustifySelf,
</span><span class="cx">     CSSPropertyJustifyItems,
</span><ins>+    CSSPropertyPlaceContent,
</ins><span class="cx"> #if ENABLE(FILTERS_LEVEL_2)
</span><span class="cx">     CSSPropertyWebkitBackdropFilter,
</span><span class="cx"> #endif
</span><span class="lines">@@ -2871,6 +2872,8 @@
</span><span class="cx">             return valueForItemPositionWithOverflowAlignment(resolveJustifyItemsAuto(style-&gt;justifyItems(), styledElement-&gt;parentNode()));
</span><span class="cx">         case CSSPropertyJustifySelf:
</span><span class="cx">             return valueForItemPositionWithOverflowAlignment(resolveJustifySelfAuto(style-&gt;justifySelf(), styledElement-&gt;parentNode()));
</span><ins>+        case CSSPropertyPlaceContent:
+            return getCSSPropertyValuesForShorthandProperties(placeContentShorthand());
</ins><span class="cx">         case CSSPropertyOrder:
</span><span class="cx">             return cssValuePool.createValue(style-&gt;order(), CSSPrimitiveValue::CSS_NUMBER);
</span><span class="cx">         case CSSPropertyFloat:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertiesjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSProperties.json (213229 => 213230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSProperties.json        2017-03-01 18:18:04 UTC (rev 213229)
+++ trunk/Source/WebCore/css/CSSProperties.json        2017-03-01 18:47:49 UTC (rev 213230)
</span><span class="lines">@@ -4625,6 +4625,14 @@
</span><span class="cx">                 &quot;url&quot;: &quot;https://www.w3.org/TR/css-align-3/#propdef-justify-items&quot;
</span><span class="cx">             }
</span><span class="cx">         },
</span><ins>+        &quot;place-content&quot;: {
+            &quot;codegen-properties&quot;: {
+                &quot;longhands&quot;: [
+                    &quot;align-content&quot;,
+                    &quot;justify-content&quot;
+                ]
+            }
+        },
</ins><span class="cx">         &quot;grid&quot;: {
</span><span class="cx">             &quot;codegen-properties&quot;: {
</span><span class="cx">                 &quot;longhands&quot;: [
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleProperties.cpp (213229 => 213230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleProperties.cpp        2017-03-01 18:18:04 UTC (rev 213229)
+++ trunk/Source/WebCore/css/StyleProperties.cpp        2017-03-01 18:47:49 UTC (rev 213230)
</span><span class="lines">@@ -187,6 +187,8 @@
</span><span class="cx">         return getShorthandValue(gridColumnShorthand());
</span><span class="cx">     case CSSPropertyGridRow:
</span><span class="cx">         return getShorthandValue(gridRowShorthand());
</span><ins>+    case CSSPropertyPlaceContent:
+        return getShorthandValue(placeContentShorthand());
</ins><span class="cx">     case CSSPropertyFont:
</span><span class="cx">         return fontValue();
</span><span class="cx">     case CSSPropertyMargin:
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (213229 => 213230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2017-03-01 18:18:04 UTC (rev 213229)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2017-03-01 18:47:49 UTC (rev 213230)
</span><span class="lines">@@ -5254,6 +5254,39 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static RefPtr&lt;CSSValue&gt; consumeSimplifiedContentPosition(CSSParserTokenRange&amp; range)
+{
+    CSSValueID id = range.peek().id();
+    if (identMatches&lt;CSSValueNormal, CSSValueBaseline, CSSValueLastBaseline&gt;(id))
+        return CSSContentDistributionValue::create(CSSValueInvalid, range.consumeIncludingWhitespace().id(), CSSValueInvalid);
+    if (identMatches&lt;CSSValueSpaceBetween, CSSValueSpaceAround, CSSValueSpaceEvenly, CSSValueStretch&gt;(id))
+        return CSSContentDistributionValue::create(range.consumeIncludingWhitespace().id(), CSSValueInvalid, CSSValueInvalid);
+    if (identMatches&lt;CSSValueStart, CSSValueEnd, CSSValueCenter, CSSValueFlexStart, CSSValueFlexEnd, CSSValueLeft, CSSValueRight&gt;(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&lt;CSSValue&gt; alignContentValue = consumeSimplifiedContentPosition(m_range);
+    if (!alignContentValue)
+        return false;
+    RefPtr&lt;CSSValue&gt; 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;
+}
+
</ins><span class="cx"> bool CSSPropertyParser::parseShorthand(CSSPropertyID property, bool important)
</span><span class="cx"> {
</span><span class="cx">     switch (property) {
</span><span class="lines">@@ -5435,6 +5468,8 @@
</span><span class="cx">         return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important);
</span><span class="cx">     case CSSPropertyGrid:
</span><span class="cx">         return consumeGridShorthand(important);
</span><ins>+    case CSSPropertyPlaceContent:
+        return consumePlaceContentShorthand(important);
</ins><span class="cx">     case CSSPropertyWebkitMarquee:
</span><span class="cx">         return consumeShorthandGreedily(webkitMarqueeShorthand(), important);
</span><span class="cx">     default:
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.h (213229 => 213230)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.h        2017-03-01 18:18:04 UTC (rev 213229)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.h        2017-03-01 18:47:49 UTC (rev 213230)
</span><span class="lines">@@ -80,6 +80,8 @@
</span><span class="cx">     bool consumeGridShorthand(bool important);
</span><span class="cx">     bool consumeGridAreaShorthand(bool important);
</span><span class="cx"> 
</span><ins>+    bool consumePlaceContentShorthand(bool important);
+
</ins><span class="cx">     bool consumeFont(bool important);
</span><span class="cx">     bool consumeFontVariantShorthand(bool important);
</span><span class="cx">     bool consumeSystemFont(bool important);
</span></span></pre>
</div>
</div>

</body>
</html>