<!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>[201498] 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/201498">201498</a></dd>
<dt>Author</dt> <dd>jfernandez@igalia.com</dd>
<dt>Date</dt> <dd>2016-05-30 01:14:31 -0700 (Mon, 30 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Box Alignment] New CSS Value 'normal' for Self Alignment
https://bugs.webkit.org/show_bug.cgi?id=156254

Reviewed by Darin Adler.

Source/WebCore:

The Box Alignment specification defines a new value 'normal' to be used
as default for the different layout models, which will define the
specific behavior for each case. This patch adds a new CSS value in the
parsing logic and adapts the Self Alignment properties to the new
value.

The 'auto' value is no longer valid for the 'align-items' property and
the Computed Value will be always the specified value. Hence, I removed
the StyleResolver logic because is not required now; the specific
behavior of the 'normal' value will be resolved at layout time.

Additionally, this patch updates the layout logic as well, for both
Flexbox and Grid layout models.

Test: css3/parse-alignment-of-root-elements.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::resolveLegacyJustifyItems): Added.
(WebCore::resolveJustifyItemsAuto): Added.
(WebCore::resolveJustifySelfAuto): Added.
(WebCore::resolveAlignSelfAuto): Added.
(WebCore::valueForItemPositionWithOverflowAlignment): Using a StyleSelfAlignmentData argument.
(WebCore::ComputedStyleExtractor::propertyValue): Using the new resolving functions.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseItemPositionOverflowPosition): A new value 'normal' is now valid.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Mappings for the new value 'normal'.
(WebCore::CSSPrimitiveValue::operator ItemPosition): Mappings for the new value 'normal'.
* css/CSSPropertyNames.in:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle): We don't need to resolve 'legacy&quot; keyword.
* rendering/RenderBox.cpp:
(WebCore::flexItemHasStretchAlignment):
(WebCore::RenderBox::hasStretchedLogicalWidth):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::styleDidChange):
(WebCore::RenderFlexibleBox::alignmentForChild):
(WebCore::contentAlignmentNormalBehaviorFlexibleBox):
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
(WebCore::RenderFlexibleBox::layoutColumnReverse):
(WebCore::RenderFlexibleBox::alignFlexLines):
(WebCore::RenderFlexibleBox::alignChildren):
* rendering/RenderGrid.cpp:
(WebCore::defaultAlignmentChangedToStretchInRowAxis):
(WebCore::defaultAlignmentChangedFromStretchInRowAxis):
(WebCore::defaultAlignmentChangedFromStretchInColumnAxis):
(WebCore::selfAlignmentChangedToStretchInRowAxis):
(WebCore::selfAlignmentChangedFromStretchInRowAxis):
(WebCore::selfAlignmentChangedFromStretchInColumnAxis):
(WebCore::contentAlignmentNormalBehaviorGrid):
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
(WebCore::RenderGrid::needToStretchChildLogicalHeight):
(WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
(WebCore::RenderGrid::columnAxisPositionForChild):
(WebCore::RenderGrid::rowAxisPositionForChild):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
* rendering/style/RenderStyle.cpp:
(WebCore::resolvedSelfAlignment):
(WebCore::RenderStyle::resolvedAlignItems):
(WebCore::RenderStyle::resolvedAlignSelf):
(WebCore::RenderStyle::resolvedJustifyItems):
(WebCore::RenderStyle::resolvedJustifySelf):
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): align-items uses now a different initial function.

LayoutTests:

Changes in the already defined tests for the alignment properties to
consider the new CSS value 'normal', which is the default for align-items
and the value to resolve 'auto' when there is no parent.

Added a new test to verify the Self-Alignment properties work as expected
with root elements.

* css3/flexbox/css-properties-expected.txt:
* css3/flexbox/css-properties.html:
* css3/parse-align-items-expected.txt:
* css3/parse-align-items.html:
* css3/parse-align-self-expected.txt:
* css3/parse-align-self.html:
* css3/parse-alignment-of-root-elements-expected.txt: Added.
* css3/parse-alignment-of-root-elements.html: Added.
* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/css/parse-justify-items-expected.txt:
* fast/css/parse-justify-items.html:
* fast/css/parse-justify-self-expected.txt:
* fast/css/parse-justify-self.html:
* fast/css/resources/alignment-parsing-utils.js:
* svg/css/getComputedStyle-basic-expected.txt:
(checkBadValues):
* svg/css/getComputedStyle-basic-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscss3flexboxcsspropertiesexpectedtxt">trunk/LayoutTests/css3/flexbox/css-properties-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3flexboxcsspropertieshtml">trunk/LayoutTests/css3/flexbox/css-properties.html</a></li>
<li><a href="#trunkLayoutTestscss3parsealignitemsexpectedtxt">trunk/LayoutTests/css3/parse-align-items-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3parsealignitemshtml">trunk/LayoutTests/css3/parse-align-items.html</a></li>
<li><a href="#trunkLayoutTestscss3parsealignselfexpectedtxt">trunk/LayoutTests/css3/parse-align-self-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3parsealignselfhtml">trunk/LayoutTests/css3/parse-align-self.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgetComputedStylecomputedstyleexpectedtxt">trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgetComputedStylecomputedstylewithoutrendererexpectedtxt">trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsejustifyitemsexpectedtxt">trunk/LayoutTests/fast/css/parse-justify-items-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsejustifyitemshtml">trunk/LayoutTests/fast/css/parse-justify-items.html</a></li>
<li><a href="#trunkLayoutTestsfastcssparsejustifyselfexpectedtxt">trunk/LayoutTests/fast/css/parse-justify-self-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsejustifyselfhtml">trunk/LayoutTests/fast/css/parse-justify-self.html</a></li>
<li><a href="#trunkLayoutTestsfastcssresourcesalignmentparsingutilsjs">trunk/LayoutTests/fast/css/resources/alignment-parsing-utils.js</a></li>
<li><a href="#trunkLayoutTestssvgcssgetComputedStylebasicexpectedtxt">trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt</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="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueMappingsh">trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFlexibleBoxcpp">trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/WebCore/rendering/RenderGrid.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStylecpp">trunk/Source/WebCore/rendering/style/RenderStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleConstantsh">trunk/Source/WebCore/rendering/style/RenderStyleConstants.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareNonInheritedDatacpp">trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscss3parsealignmentofrootelementsexpectedtxt">trunk/LayoutTests/css3/parse-alignment-of-root-elements-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3parsealignmentofrootelementshtml">trunk/LayoutTests/css3/parse-alignment-of-root-elements.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/ChangeLog        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-05-30  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [CSS Box Alignment] New CSS Value 'normal' for Self Alignment
+        https://bugs.webkit.org/show_bug.cgi?id=156254
+
+        Reviewed by Darin Adler.
+
+        Changes in the already defined tests for the alignment properties to
+        consider the new CSS value 'normal', which is the default for align-items
+        and the value to resolve 'auto' when there is no parent.
+
+        Added a new test to verify the Self-Alignment properties work as expected
+        with root elements.
+
+        * css3/flexbox/css-properties-expected.txt:
+        * css3/flexbox/css-properties.html:
+        * css3/parse-align-items-expected.txt:
+        * css3/parse-align-items.html:
+        * css3/parse-align-self-expected.txt:
+        * css3/parse-align-self.html:
+        * css3/parse-alignment-of-root-elements-expected.txt: Added.
+        * css3/parse-alignment-of-root-elements.html: Added.
+        * fast/css/getComputedStyle/computed-style-expected.txt:
+        * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
+        * fast/css/parse-justify-items-expected.txt:
+        * fast/css/parse-justify-items.html:
+        * fast/css/parse-justify-self-expected.txt:
+        * fast/css/parse-justify-self.html:
+        * fast/css/resources/alignment-parsing-utils.js:
+        * svg/css/getComputedStyle-basic-expected.txt:
+        (checkBadValues):
+        * svg/css/getComputedStyle-basic-expected.txt:
+
</ins><span class="cx"> 2016-05-25  Skachkov Oleksandr  &lt;gskachkov@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ESNext] Support trailing commas in function param lists
</span></span></pre></div>
<a id="trunkLayoutTestscss3flexboxcsspropertiesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/flexbox/css-properties-expected.txt (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/flexbox/css-properties-expected.txt        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/css3/flexbox/css-properties-expected.txt        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -29,12 +29,12 @@
</span><span class="cx"> PASS flexbox.style.webkitJustifyContent is &quot;&quot;
</span><span class="cx"> PASS window.getComputedStyle(flexbox, null).webkitJustifyContent is &quot;normal&quot;
</span><span class="cx"> PASS flexbox.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is &quot;start&quot;
-PASS window.getComputedStyle(document.documentElement, null).webkitAlignSelf is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is &quot;normal&quot;
+PASS window.getComputedStyle(document.documentElement, null).webkitAlignSelf is &quot;normal&quot;
</ins><span class="cx"> PASS flexbox.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is &quot;normal&quot;
</ins><span class="cx"> PASS flexbox.style.webkitAlignSelf is &quot;auto&quot;
</span><del>-PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is &quot;normal&quot;
</ins><span class="cx"> PASS flexbox.style.webkitAlignSelf is &quot;flex-start&quot;
</span><span class="cx"> PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is &quot;flex-start&quot;
</span><span class="cx"> PASS flexbox.style.webkitAlignSelf is &quot;flex-end&quot;
</span><span class="lines">@@ -46,19 +46,19 @@
</span><span class="cx"> PASS flexbox.style.webkitAlignSelf is &quot;baseline&quot;
</span><span class="cx"> PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is &quot;baseline&quot;
</span><span class="cx"> PASS flexbox.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is &quot;normal&quot;
</ins><span class="cx"> PASS flexbox.style.webkitAlignItems is &quot;&quot;
</span><span class="cx"> PASS flexitem.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;stretch&quot;
-PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;normal&quot;
+PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;normal&quot;
</ins><span class="cx"> PASS flexbox.style.webkitAlignItems is &quot;&quot;
</span><span class="cx"> PASS flexitem.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;stretch&quot;
-PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;stretch&quot;
-PASS flexbox.style.webkitAlignItems is &quot;auto&quot;
</del><ins>+PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;normal&quot;
+PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;normal&quot;
+PASS flexbox.style.webkitAlignItems is &quot;&quot;
</ins><span class="cx"> PASS flexitem.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;stretch&quot;
-PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;normal&quot;
+PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;normal&quot;
</ins><span class="cx"> PASS flexbox.style.webkitAlignItems is &quot;flex-start&quot;
</span><span class="cx"> PASS flexitem.style.webkitAlignSelf is &quot;&quot;
</span><span class="cx"> PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;flex-start&quot;
</span><span class="lines">@@ -76,11 +76,11 @@
</span><span class="cx"> PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;baseline&quot;
</span><span class="cx"> PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;baseline&quot;
</span><span class="cx"> PASS flexbox.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;stretch&quot;
-PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;normal&quot;
+PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;normal&quot;
</ins><span class="cx"> PASS flexbox.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;auto&quot;
-PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;auto&quot;
</del><ins>+PASS window.getComputedStyle(flexbox, null).webkitAlignItems is &quot;normal&quot;
+PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is &quot;normal&quot;
</ins><span class="cx"> PASS window.getComputedStyle(detachedFlexbox, null).webkitAlignSelf is &quot;&quot;
</span><span class="cx"> PASS window.getComputedStyle(detachedFlexItem, null).webkitAlignSelf is &quot;&quot;
</span><span class="cx"> PASS flexbox.style.webkitFlexDirection is &quot;&quot;
</span></span></pre></div>
<a id="trunkLayoutTestscss3flexboxcsspropertieshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/flexbox/css-properties.html (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/flexbox/css-properties.html        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/css3/flexbox/css-properties.html        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -82,16 +82,16 @@
</span><span class="cx"> 
</span><span class="cx"> shouldBeEqualToString('flexbox.style.webkitAlignSelf', '');
</span><span class="cx"> // The initial value is 'auto', which will be resolved depending on parent's style (except for the 'document' element).
</span><del>-shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'start');
-shouldBeEqualToString('window.getComputedStyle(document.documentElement, null).webkitAlignSelf', 'start');
</del><ins>+shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'normal');
+shouldBeEqualToString('window.getComputedStyle(document.documentElement, null).webkitAlignSelf', 'normal');
</ins><span class="cx"> 
</span><span class="cx"> flexbox.style.webkitAlignSelf = 'foo';
</span><span class="cx"> shouldBeEqualToString('flexbox.style.webkitAlignSelf', '');
</span><del>-shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'start');
</del><ins>+shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'normal');
</ins><span class="cx"> 
</span><span class="cx"> flexbox.style.webkitAlignSelf = 'auto';
</span><span class="cx"> shouldBeEqualToString('flexbox.style.webkitAlignSelf', 'auto');
</span><del>-shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'start');
</del><ins>+shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'normal');
</ins><span class="cx"> 
</span><span class="cx"> flexbox.style.webkitAlignSelf = 'flex-start';
</span><span class="cx"> shouldBeEqualToString('flexbox.style.webkitAlignSelf', 'flex-start');
</span><span class="lines">@@ -115,25 +115,26 @@
</span><span class="cx"> 
</span><span class="cx"> flexbox.style.webkitAlignSelf = '';
</span><span class="cx"> shouldBeEqualToString('flexbox.style.webkitAlignSelf', '');
</span><del>-shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'start');
</del><ins>+shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'normal');
</ins><span class="cx"> 
</span><span class="cx"> shouldBeEqualToString('flexbox.style.webkitAlignItems', '');
</span><span class="cx"> shouldBeEqualToString('flexitem.style.webkitAlignSelf', '');
</span><del>-// The initial value is 'auto', which will be resolved to 'stretch' in case of flexbox containers.
-shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'stretch');
-shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'stretch');
</del><ins>+// The initial value is 'auto', which will be resolved to 'normal' in case of flexbox containers.
+shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'normal');
+shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'normal');
</ins><span class="cx"> 
</span><span class="cx"> flexbox.style.webkitAlignItems = 'foo';
</span><span class="cx"> shouldBeEqualToString('flexbox.style.webkitAlignItems', '');
</span><span class="cx"> shouldBeEqualToString('flexitem.style.webkitAlignSelf', '');
</span><del>-shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'stretch');
-shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'stretch');
</del><ins>+shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'normal');
+shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'normal');
</ins><span class="cx"> 
</span><ins>+// The 'auto' value is not valid for the align-items property.
</ins><span class="cx"> flexbox.style.webkitAlignItems = 'auto';
</span><del>-shouldBeEqualToString('flexbox.style.webkitAlignItems', 'auto');
</del><ins>+shouldBeEqualToString('flexbox.style.webkitAlignItems', '');
</ins><span class="cx"> shouldBeEqualToString('flexitem.style.webkitAlignSelf', '');
</span><del>-shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'stretch');
-shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'stretch');
</del><ins>+shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'normal');
+shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'normal');
</ins><span class="cx"> 
</span><span class="cx"> flexbox.style.webkitAlignItems = 'flex-start';
</span><span class="cx"> shouldBeEqualToString('flexbox.style.webkitAlignItems', 'flex-start');
</span><span class="lines">@@ -163,13 +164,13 @@
</span><span class="cx"> 
</span><span class="cx"> flexbox.style.webkitAlignItems = '';
</span><span class="cx"> shouldBeEqualToString('flexbox.style.webkitAlignItems', '');
</span><del>-shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'stretch');
-shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'stretch');
</del><ins>+shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'normal');
+shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'normal');
</ins><span class="cx"> 
</span><span class="cx"> flexbox.style.display = 'none';
</span><span class="cx"> shouldBeEqualToString('flexbox.style.webkitAlignItems', '');
</span><del>-shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'auto');
-shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'auto');
</del><ins>+shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'normal');
+shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'normal');
</ins><span class="cx"> flexbox.style.display = '';
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestscss3parsealignitemsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/parse-align-items-expected.txt (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/parse-align-items-expected.txt        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/css3/parse-align-items-expected.txt        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> PASS getComputedStyle(alignItemsFlexEndSafe, '').getPropertyValue('-webkit-align-items') is 'flex-end safe'
</span><span class="cx"> 
</span><span class="cx"> Test initial value of align-items through JS
</span><del>-PASS getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is 'start'
</del><ins>+PASS getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is 'normal'
</ins><span class="cx"> 
</span><span class="cx"> Test getting and setting align-items through JS
</span><span class="cx"> PASS element.style.webkitAlignItems is &quot;center&quot;
</span><span class="lines">@@ -41,82 +41,84 @@
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;center&quot;
</span><span class="cx"> PASS element.style.webkitAlignItems is &quot;self-start&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;self-start&quot;
</span><del>-PASS element.style.webkitAlignItems is &quot;auto&quot;
-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
-PASS element.style.webkitAlignItems is &quot;auto&quot;
-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;stretch&quot;
-PASS element.style.webkitAlignItems is &quot;auto&quot;
-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;stretch&quot;
</del><ins>+PASS element.style.webkitAlignItems is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
+PASS element.style.webkitAlignItems is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
+PASS element.style.webkitAlignItems is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;self-end&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;self-end&quot;
</span><span class="cx"> 
</span><span class="cx"> Test bad combinations of align-items
</span><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
+PASS element.style.webkitAlignItems is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial'
</span><span class="cx"> PASS element.style.webkitAlignItems is &quot;center&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;center&quot;
</span><span class="cx"> PASS element.style.webkitAlignItems is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial' for grid containers
</span><span class="cx"> PASS element.style.webkitAlignItems is &quot;left safe&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;left safe&quot;
</span><span class="cx"> PASS element.style.webkitAlignItems is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial' for flex containers
</span><span class="cx"> PASS element.style.webkitAlignItems is &quot;right unsafe&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;right unsafe&quot;
</span><span class="cx"> PASS element.style.webkitAlignItems is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'inherit'
</span><span class="cx"> PASS element.style.webkitAlignItems is &quot;end&quot;
</span></span></pre></div>
<a id="trunkLayoutTestscss3parsealignitemshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/parse-align-items.html (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/parse-align-items.html        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/css3/parse-align-items.html        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> debug(&quot;Test initial value of align-items through JS&quot;);
</span><span class="cx"> element = document.createElement(&quot;div&quot;);
</span><span class="cx"> document.body.appendChild(element);
</span><del>-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-align-items')&quot;, &quot;'start'&quot;);
</del><ins>+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-align-items')&quot;, &quot;'normal'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test getting and setting align-items through JS&quot;);
</span><span class="lines">@@ -200,16 +200,18 @@
</span><span class="cx"> element.style.webkitAlignItems = &quot;self-start&quot;;
</span><span class="cx"> checkValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;self-start&quot;, &quot;self-start&quot;);
</span><span class="cx"> 
</span><ins>+&lt;!-- The 'auto' value is no valid for the align-items property. --&gt;
+element.style.webkitAlignItems = &quot;&quot;;
</ins><span class="cx"> element.style.webkitAlignItems = &quot;auto&quot;;
</span><del>-checkValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;auto&quot;, &quot;start&quot;);
</del><ins>+checkValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> element.style.display = &quot;-webkit-flex&quot;;
</span><span class="cx"> element.style.webkitAlignItems = &quot;auto&quot;;
</span><del>-checkValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;auto&quot;, &quot;stretch&quot;);
</del><ins>+checkValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> element.style.display = &quot;grid&quot;;
</span><span class="cx"> element.style.webkitAlignItems = &quot;auto&quot;;
</span><del>-checkValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;auto&quot;, &quot;stretch&quot;);
</del><ins>+checkValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> element.style.webkitAlignItems = &quot;self-end&quot;;
</span><span class="cx"> checkValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;self-end&quot;, &quot;self-end&quot;);
</span><span class="lines">@@ -219,6 +221,7 @@
</span><span class="cx"> element = document.createElement(&quot;div&quot;);
</span><span class="cx"> document.body.appendChild(element);
</span><span class="cx"> 
</span><ins>+checkBadValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;auto&quot;);
</ins><span class="cx"> checkBadValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;unsafe auto&quot;);
</span><span class="cx"> checkBadValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;auto safe&quot;);
</span><span class="cx"> checkBadValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;,  &quot;auto left&quot;);
</span><span class="lines">@@ -247,17 +250,17 @@
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial'&quot;);
</span><span class="cx"> element.style.display = &quot;&quot;;
</span><del>-checkInitialValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;center&quot;, &quot;start&quot;);
</del><ins>+checkInitialValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;center&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial' for grid containers&quot;);
</span><del>-element.style.display = &quot;grid&quot;;
-checkInitialValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;left safe&quot;, &quot;stretch&quot;);
</del><ins>+element.style.display = &quot;-webkit-grid&quot;;
+checkInitialValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;left safe&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial' for flex containers&quot;);
</span><span class="cx"> element.style.display = &quot;-webkit-flex&quot;;
</span><del>-checkInitialValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;right unsafe&quot;, &quot;stretch&quot;);
</del><ins>+checkInitialValues(element, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;right unsafe&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'inherit'&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestscss3parsealignselfexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/parse-align-self-expected.txt (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/parse-align-self-expected.txt        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/css3/parse-align-self-expected.txt        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> PASS getComputedStyle(alignSelfFlexEndSafe, '').getPropertyValue('-webkit-align-self') is 'flex-end safe'
</span><span class="cx"> 
</span><span class="cx"> Test initial value of align-self through JS
</span><del>-PASS getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is 'start'
</del><ins>+PASS getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is 'normal'
</ins><span class="cx"> 
</span><span class="cx"> Test getting and setting align-self through JS
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;center&quot;
</span><span class="lines">@@ -42,99 +42,103 @@
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;self-start&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;self-start&quot;
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;auto&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;auto&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;auto&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;self-end&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;self-end&quot;
</span><span class="cx"> 
</span><ins>+Test 'auto' value resolution for the root node
+PASS element.style.webkitAlignSelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
+
</ins><span class="cx"> Test bad combinations of align-self
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.webkitAlignSelf is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial'
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;center&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;center&quot;
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial' for grid containers
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;left safe&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;left safe&quot;
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial' for flex containers
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;right unsafe&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;right unsafe&quot;
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial' for positioned elements
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;left&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;left&quot;
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;auto&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial' for positioned elements in grid containers
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;right&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;right&quot;
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;auto&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial' for positioned elements in grid containers
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;end&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;end&quot;
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;auto&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'inherit'
</span><span class="cx"> PASS element.style.webkitAlignSelf is &quot;end&quot;
</span></span></pre></div>
<a id="trunkLayoutTestscss3parsealignselfhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/parse-align-self.html (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/parse-align-self.html        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/css3/parse-align-self.html        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> 
</span><span class="cx"> #alignSelfSelfEndSafe {
</span><span class="cx">     -webkit-align-self: self-end safe;
</span><del>-}
</del><ins>+x}
</ins><span class="cx"> 
</span><span class="cx"> #alignSelfSelfStartSafe {
</span><span class="cx">     -webkit-align-self: self-start safe;
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx"> debug(&quot;Test initial value of align-self through JS&quot;);
</span><span class="cx"> element = document.createElement(&quot;div&quot;);
</span><span class="cx"> document.body.appendChild(element);
</span><del>-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-align-self')&quot;, &quot;'start'&quot;);
</del><ins>+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-align-self')&quot;, &quot;'normal'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test getting and setting align-self through JS&quot;);
</span><span class="lines">@@ -202,20 +202,25 @@
</span><span class="cx"> checkValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;,  &quot;self-start&quot;, &quot;self-start&quot;);
</span><span class="cx"> 
</span><span class="cx"> element.style.webkitAlignSelf = &quot;auto&quot;;
</span><del>-checkValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;,  &quot;auto&quot;, &quot;start&quot;);
</del><ins>+checkValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> container.style.display = &quot;-webkit-flex&quot;;
</span><span class="cx"> element.style.webkitAlignSelf = &quot;auto&quot;;
</span><del>-checkValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;,  &quot;auto&quot;, &quot;stretch&quot;);
</del><ins>+checkValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> container.style.display = &quot;grid&quot;;
</span><span class="cx"> element.style.webkitAlignSelf = &quot;auto&quot;;
</span><del>-checkValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;,  &quot;auto&quot;, &quot;stretch&quot;);
</del><ins>+checkValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> element.style.webkitAlignSelf = &quot;self-end&quot;;
</span><span class="cx"> checkValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;,  &quot;self-end&quot;, &quot;self-end&quot;);
</span><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><ins>+debug(&quot;Test 'auto' value resolution for the root node&quot;);
+document.documentElement.style.webkitAlignSelf = &quot;auto&quot;;
+checkValues(document.documentElement, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
+
+debug(&quot;&quot;);
</ins><span class="cx"> debug(&quot;Test bad combinations of align-self&quot;);
</span><span class="cx"> container = document.createElement(&quot;div&quot;);
</span><span class="cx"> element = document.createElement(&quot;div&quot;);
</span><span class="lines">@@ -250,35 +255,35 @@
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial'&quot;);
</span><span class="cx"> container.style.display = &quot;&quot;;
</span><del>-checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;center&quot;, &quot;start&quot;);
</del><ins>+checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;center&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial' for grid containers&quot;);
</span><del>-container.style.display = &quot;grid&quot;;
-checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;left safe&quot;, &quot;stretch&quot;);
</del><ins>+container.style.display = &quot;-webkit-grid&quot;;
+checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;left safe&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial' for flex containers&quot;);
</span><span class="cx"> container.style.display = &quot;-webkit-flex&quot;;
</span><del>-checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;right unsafe&quot;, &quot;stretch&quot;);
</del><ins>+checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;right unsafe&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial' for positioned elements&quot;);
</span><span class="cx"> container.style.display = &quot;&quot;;
</span><span class="cx"> element.style.position = &quot;absolute&quot;;
</span><del>-checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;left&quot;, &quot;auto&quot;);
</del><ins>+checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;left&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial' for positioned elements in grid containers&quot;);
</span><span class="cx"> container.style.display = &quot;grid&quot;;
</span><span class="cx"> element.style.position = &quot;absolute&quot;;
</span><del>-checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;right&quot;, &quot;auto&quot;);
</del><ins>+checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;right&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial' for positioned elements in grid containers&quot;);
</span><span class="cx"> container.style.display = &quot;-webkit-flex&quot;;
</span><span class="cx"> element.style.position = &quot;absolute&quot;;
</span><del>-checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;end&quot;, &quot;auto&quot;);
</del><ins>+checkInitialValues(element, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;end&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'inherit'&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestscss3parsealignmentofrootelementsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/parse-alignment-of-root-elements-expected.txt (0 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/parse-alignment-of-root-elements-expected.txt                                (rev 0)
+++ trunk/LayoutTests/css3/parse-alignment-of-root-elements-expected.txt        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+Test to verify auto value resolution works as expected in root elements (eg. document root / shadow roots / slotted elements / elements inside&lt;slot&gt;)
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+*** Test 'auto' value resolution for the document root node. ***
+
+Check out how the DOM's root element resolves the align-self 'auto' values.
+PASS element.style.webkitAlignSelf is &quot;center&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;center&quot;
+PASS element.style.webkitAlignSelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
+
+Check out how the DOM's root element align-items's value is used to resolve its children's align-self 'auto' values.
+PASS element.style.webkitAlignItems is &quot;center&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;center&quot;
+PASS element.style.webkitAlignItems is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
+PASS element.style.webkitAlignSelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is &quot;center&quot;
+PASS element.style.webkitAlignItems is &quot;&quot;
+PASS window.getComputedStyle(host, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
+PASS element.style.webkitAlignSelf is &quot;auto&quot;
+PASS window.getComputedStyle(host, '').getPropertyValue('-webkit-align-self') is &quot;normal&quot;
+
+Check out how the DOM's root element deals with 'auto' value in align-items.
+PASS element.style.webkitAlignItems is &quot;center&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;center&quot;
+PASS element.style.webkitAlignItems is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is &quot;normal&quot;
+
+Check out how the DOM's root element resolves the justify-self 'auto' values.
+PASS element.style.justifySelf is &quot;left&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;left&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+
+Check out how the DOM's root element align-items's value is used to resolve its children's align-self 'auto' values.
+PASS element.style.justifyItems is &quot;center&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;center&quot;
+PASS element.style.justifyItems is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;center&quot;
+PASS element.style.justifyItems is &quot;auto&quot;
+PASS window.getComputedStyle(host, '').getPropertyValue('justify-items') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(host, '').getPropertyValue('justify-self') is &quot;normal&quot;
+
+Check out how the DOM's root element deals with 'auto' value in justify-items.
+PASS element.style.justifyItems is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(host, '').getPropertyValue('justify-self') is &quot;normal&quot;
+
+Check out how the DOM's root element justify-items's value with 'legacy' keyword is used to resolve any descendant's justify-items 'auto' values.
+PASS element.style.justifyItems is &quot;legacy center&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;legacy center&quot;
+PASS element.style.justifyItems is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;legacy center&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;center&quot;
+PASS element.style.justifyItems is &quot;auto&quot;
+PASS window.getComputedStyle(host, '').getPropertyValue('justify-items') is &quot;legacy center&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(host, '').getPropertyValue('justify-self') is &quot;center&quot;
+
+Check out how the DOM's root element recomputes its descendant's style when 'legacy' keyword is removed from its justify-items value.
+PASS element.style.justifyItems is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifyItems is &quot;auto&quot;
+PASS window.getComputedStyle(host, '').getPropertyValue('justify-items') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(host, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscss3parsealignmentofrootelementshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/parse-alignment-of-root-elements.html (0 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/parse-alignment-of-root-elements.html                                (rev 0)
+++ trunk/LayoutTests/css3/parse-alignment-of-root-elements.html        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;script src=&quot;../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;html&gt;
+ &lt;body&gt;
+     &lt;div id=&quot;host&quot;&gt;
+         &lt;div id=&quot;slotted&quot; slot=&quot;s1&quot;&gt;&lt;/div&gt;
+     &lt;/div&gt;
+&lt;script src=&quot;resources/alignment-parsing-utils.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description('Test to verify auto value resolution works as expected in root elements (eg. document root / shadow roots / slotted elements / elements inside&amp;lt;slot&amp;gt;)');
+
+var block = document.getElementById(&quot;host&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;*** Test 'auto' value resolution for the document root node. ***&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Check out how the DOM's root element resolves the align-self 'auto' values.&quot;);
+document.documentElement.style.webkitAlignSelf = &quot;center&quot;;
+checkValues(document.documentElement, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;center&quot;, &quot;center&quot;);
+document.documentElement.style.webkitAlignSelf = &quot;auto&quot;;
+checkValues(document.documentElement, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;auto&quot;, &quot;normal&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Check out how the DOM's root element align-items's value is used to resolve its children's align-self 'auto' values.&quot;);
+document.documentElement.style.webkitAlignItems = &quot;center&quot;;
+checkValues(document.documentElement, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;center&quot;, &quot;center&quot;);
+document.body.style.webkitAlignItems = &quot;auto&quot;; // The 'auto' value is not valid for align-items.
+document.body.style.webkitAlignSelf = &quot;auto&quot;;
+checkValues(document.body, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;&quot;, &quot;normal&quot;);
+checkValues(document.body, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;auto&quot;, &quot;center&quot;);
+block.style.webkitAlignItems = &quot;&quot;; // Default value is 'normal' for align-items.
+block.style.webkitAlignSelf = &quot;auto&quot;;
+checkValues(block, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;&quot;, &quot;normal&quot;);
+checkValues(block, &quot;webkitAlignSelf&quot;, &quot;-webkit-align-self&quot;, &quot;auto&quot;, &quot;normal&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Check out how the DOM's root element deals with 'auto' value in align-items.&quot;);
+document.documentElement.style.webkitAlignItems = &quot;auto&quot;; // The 'auto' value is not valid for align-items.
+checkValues(document.documentElement, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;center&quot;, &quot;center&quot;);
+document.documentElement.style.webkitAlignItems = &quot;&quot;; // Default value is 'normal' for align-items.
+checkValues(document.documentElement, &quot;webkitAlignItems&quot;, &quot;-webkit-align-items&quot;, &quot;&quot;, &quot;normal&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Check out how the DOM's root element resolves the justify-self 'auto' values.&quot;);
+document.documentElement.style.justifySelf = &quot;left&quot;;
+checkValues(document.documentElement, &quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;left&quot;, &quot;left&quot;);
+document.documentElement.style.justifySelf = &quot;auto&quot;;
+checkValues(document.documentElement, &quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;auto&quot;, &quot;normal&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Check out how the DOM's root element align-items's value is used to resolve its children's align-self 'auto' values.&quot;);
+document.documentElement.style.justifyItems = &quot;center&quot;;
+checkValues(document.documentElement, &quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;center&quot;, &quot;center&quot;);
+document.body.style.justifyItems = &quot;auto&quot;;
+document.body.style.justifySelf = &quot;auto&quot;;
+checkValues(document.body, &quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;auto&quot;, &quot;normal&quot;);
+checkValues(document.body, &quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;auto&quot;, &quot;center&quot;);
+block.style.justifyItems = &quot;auto&quot;;
+block.style.justifySelf = &quot;auto&quot;;
+checkValues(block, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;normal&quot;);
+checkValues(block, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Check out how the DOM's root element deals with 'auto' value in justify-items.&quot;);
+document.documentElement.style.justifyItems = &quot;auto&quot;;
+checkValues(document.documentElement, &quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;auto&quot;, &quot;normal&quot;);
+checkValues(document.body, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
+checkValues(block, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Check out how the DOM's root element justify-items's value with 'legacy' keyword is used to resolve any descendant's justify-items 'auto' values.&quot;);
+document.documentElement.style.justifyItems = &quot;legacy center&quot;;
+checkValues(document.documentElement, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;legacy center&quot;, &quot;legacy center&quot;);
+document.body.style.justifyItems = &quot;auto&quot;;
+document.body.style.justifySelf = &quot;auto&quot;;
+checkValues(document.body, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;legacy center&quot;);
+checkValues(document.body, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto&quot;, &quot;center&quot;);
+block.style.justifyItems = &quot;auto&quot;;
+block.style.justifySelf = &quot;auto&quot;;
+checkValues(block, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;legacy center&quot;);
+checkValues(block, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto&quot;, &quot;center&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;Check out how the DOM's root element recomputes its descendant's style when 'legacy' keyword is removed from its justify-items value.&quot;);
+document.documentElement.style.justifyItems = &quot;auto&quot;;
+checkValues(document.body, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;normal&quot;);
+checkValues(document.body, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
+checkValues(block, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;normal&quot;);
+checkValues(block, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
+
+&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgetComputedStylecomputedstyleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -149,14 +149,14 @@
</span><span class="cx"> column-span: none;
</span><span class="cx"> column-width: auto;
</span><span class="cx"> align-content: normal;
</span><del>-align-items: start;
-align-self: start;
</del><ins>+align-items: normal;
+align-self: normal;
</ins><span class="cx"> filter: none;
</span><span class="cx"> flex-direction: row;
</span><span class="cx"> flex-wrap: nowrap;
</span><span class="cx"> justify-content: normal;
</span><del>-justify-self: start;
-justify-items: start;
</del><ins>+justify-self: normal;
+justify-items: normal;
</ins><span class="cx"> -webkit-font-kerning: auto;
</span><span class="cx"> -webkit-font-smoothing: auto;
</span><span class="cx"> font-variant-ligatures: normal;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgetComputedStylecomputedstylewithoutrendererexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -148,14 +148,14 @@
</span><span class="cx"> column-span: none
</span><span class="cx"> column-width: auto
</span><span class="cx"> align-content: normal
</span><del>-align-items: auto
-align-self: auto
</del><ins>+align-items: normal
+align-self: normal
</ins><span class="cx"> filter: none
</span><span class="cx"> flex-direction: row
</span><span class="cx"> flex-wrap: nowrap
</span><span class="cx"> justify-content: normal
</span><del>-justify-self: auto
-justify-items: auto
</del><ins>+justify-self: normal
+justify-items: normal
</ins><span class="cx"> -webkit-font-kerning: auto
</span><span class="cx"> -webkit-font-smoothing: auto
</span><span class="cx"> font-variant-ligatures: normal
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsejustifyitemsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/parse-justify-items-expected.txt (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parse-justify-items-expected.txt        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/fast/css/parse-justify-items-expected.txt        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> PASS getComputedStyle(justifyItemsRightLegacy, '').getPropertyValue('justify-items') is 'legacy right'
</span><span class="cx"> 
</span><span class="cx"> Test initial value of justify-items through JS
</span><del>-PASS getComputedStyle(element, '').getPropertyValue('justify-items') is 'start'
</del><ins>+PASS getComputedStyle(element, '').getPropertyValue('justify-items') is 'normal'
</ins><span class="cx"> 
</span><span class="cx"> Test getting and setting justify-items through JS
</span><span class="cx"> PASS element.style.justifyItems is &quot;center&quot;
</span><span class="lines">@@ -48,83 +48,81 @@
</span><span class="cx"> PASS element.style.justifyItems is &quot;legacy left&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;legacy left&quot;
</span><span class="cx"> PASS element.style.justifyItems is &quot;auto&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;auto&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;auto&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;stretch&quot;
-PASS getComputedStyle(element, '').getPropertyValue('justify-items') is 'stretch'
-PASS element.style.justifyItems is 'auto'
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;self-end&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;self-end&quot;
</span><span class="cx"> 
</span><span class="cx"> Test bad combinations of justify-items
</span><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial'
</span><del>-PASS element.style.justifyItems is &quot;center&quot;
-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;center&quot;
</del><ins>+PASS element.style.justifyItems is &quot;legacy center&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;legacy center&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;start&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial' for grid containers
</span><span class="cx"> PASS element.style.justifyItems is &quot;left safe&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;left safe&quot;
</span><span class="cx"> PASS element.style.justifyItems is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial' for flex containers
</span><span class="cx"> PASS element.style.justifyItems is &quot;right unsafe&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;right unsafe&quot;
</span><span class="cx"> PASS element.style.justifyItems is &quot;initial&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;stretch&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'inherit'
</span><span class="cx"> PASS element.style.justifyItems is &quot;end&quot;
</span><span class="lines">@@ -135,10 +133,10 @@
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;left safe&quot;
</span><span class="cx"> PASS element.style.justifyItems is &quot;inherit&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;left safe&quot;
</span><del>-PASS element.style.justifyItems is &quot;center unsafe&quot;
-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;center unsafe&quot;
</del><ins>+PASS element.style.justifyItems is &quot;legacy center&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;legacy center&quot;
</ins><span class="cx"> PASS element.style.justifyItems is &quot;inherit&quot;
</span><del>-PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;center unsafe&quot;
</del><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is &quot;legacy center&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'legacy'
</span><span class="cx"> PASS element.style.justifyItems is &quot;legacy left&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsejustifyitemshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/parse-justify-items.html (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parse-justify-items.html        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/fast/css/parse-justify-items.html        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx"> debug(&quot;Test initial value of justify-items through JS&quot;);
</span><span class="cx"> element = document.createElement(&quot;div&quot;);
</span><span class="cx"> document.body.appendChild(element);
</span><del>-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-items')&quot;, &quot;'start'&quot;);
</del><ins>+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-items')&quot;, &quot;'normal'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test getting and setting justify-items through JS&quot;);
</span><span class="lines">@@ -248,17 +248,15 @@
</span><span class="cx"> checkValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;legacy left&quot;, &quot;legacy left&quot;);
</span><span class="cx"> 
</span><span class="cx"> element.style.justifyItems = &quot;auto&quot;;
</span><del>-checkValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;start&quot;);
</del><ins>+checkValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> element.style.display = &quot;flex&quot;;
</span><span class="cx"> element.style.justifyItems = &quot;auto&quot;;
</span><del>-checkValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;stretch&quot;);
</del><ins>+checkValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> element.style.display = &quot;grid&quot;;
</span><span class="cx"> element.style.justifyItems = &quot;auto&quot;;
</span><del>-checkValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;stretch&quot;);
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-items')&quot;, &quot;'stretch'&quot;);
-shouldBe(&quot;element.style.justifyItems&quot;, &quot;'auto'&quot;);
</del><ins>+checkValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;auto&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> element.style.justifyItems = &quot;self-end&quot;;
</span><span class="cx"> checkValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;,  &quot;self-end&quot;, &quot;self-end&quot;);
</span><span class="lines">@@ -296,24 +294,23 @@
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial'&quot;);
</span><span class="cx"> element.style.display = &quot;&quot;;
</span><del>-checkInitialValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;center&quot;, &quot;start&quot;);
</del><ins>+checkInitialValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;legacy center&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial' for grid containers&quot;);
</span><span class="cx"> element.style.display = &quot;grid&quot;;
</span><del>-checkInitialValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;left safe&quot;, &quot;stretch&quot;);
</del><ins>+checkInitialValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;left safe&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'initial' for flex containers&quot;);
</span><del>-element.style.display = &quot;-webkit-flex&quot;;
-checkInitialValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;right unsafe&quot;, &quot;stretch&quot;);
</del><ins>+element.style.display = &quot;flex&quot;;
+checkInitialValues(element, &quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;right unsafe&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'inherit'&quot;);
</span><del>-parentElement = document.createElement(&quot;div&quot;);
</del><span class="cx"> checkInheritValues(&quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;end&quot;);
</span><span class="cx"> checkInheritValues(&quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;left safe&quot;);
</span><del>-checkInheritValues(&quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;center unsafe&quot;);
</del><ins>+checkInheritValues(&quot;justifyItems&quot;, &quot;justify-items&quot;, &quot;legacy center&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'legacy'&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsejustifyselfexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/parse-justify-self-expected.txt (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parse-justify-self-expected.txt        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/fast/css/parse-justify-self-expected.txt        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> Test getting justify-self set through CSS
</span><span class="cx"> PASS getComputedStyle(justifySelfBaseline, '').getPropertyValue('justify-self') is 'baseline'
</span><ins>+PASS getComputedStyle(justifySelfLastBaseline, '').getPropertyValue('justify-self') is 'last-baseline'
</ins><span class="cx"> PASS getComputedStyle(justifySelfStretch, '').getPropertyValue('justify-self') is 'stretch'
</span><span class="cx"> PASS getComputedStyle(justifySelfStart, '').getPropertyValue('justify-self') is 'start'
</span><span class="cx"> PASS getComputedStyle(justifySelfEnd, '').getPropertyValue('justify-self') is 'end'
</span><span class="lines">@@ -13,47 +14,141 @@
</span><span class="cx"> PASS getComputedStyle(justifySelfSelfStart, '').getPropertyValue('justify-self') is 'self-start'
</span><span class="cx"> PASS getComputedStyle(justifySelfLeft, '').getPropertyValue('justify-self') is 'left'
</span><span class="cx"> PASS getComputedStyle(justifySelfRight, '').getPropertyValue('justify-self') is 'right'
</span><ins>+PASS getComputedStyle(justifySelfFlexStart, '').getPropertyValue('justify-self') is 'flex-start'
+PASS getComputedStyle(justifySelfFlexEnd, '').getPropertyValue('justify-self') is 'flex-end'
</ins><span class="cx"> PASS getComputedStyle(justifySelfEndUnsafe, '').getPropertyValue('justify-self') is 'end unsafe'
</span><span class="cx"> PASS getComputedStyle(justifySelfCenterUnsafe, '').getPropertyValue('justify-self') is 'center unsafe'
</span><span class="cx"> PASS getComputedStyle(justifySelfSelfEndSafe, '').getPropertyValue('justify-self') is 'self-end safe'
</span><span class="cx"> PASS getComputedStyle(justifySelfSelfStartSafe, '').getPropertyValue('justify-self') is 'self-start safe'
</span><span class="cx"> PASS getComputedStyle(justifySelfRightSafe, '').getPropertyValue('justify-self') is 'right safe'
</span><span class="cx"> PASS getComputedStyle(justifySelfLeftUnsafe, '').getPropertyValue('justify-self') is 'left unsafe'
</span><ins>+PASS getComputedStyle(justifySelfFlexStartUnsafe, '').getPropertyValue('justify-self') is 'flex-start unsafe'
+PASS getComputedStyle(justifySelfFlexEndSafe, '').getPropertyValue('justify-self') is 'flex-end safe'
</ins><span class="cx"> 
</span><span class="cx"> Test initial value of justify-self through JS
</span><del>-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
</del><ins>+PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'normal'
</ins><span class="cx"> 
</span><span class="cx"> Test getting and setting justify-self through JS
</span><del>-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'center'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start unsafe'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
</del><ins>+PASS element.style.justifySelf is &quot;center&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;center&quot;
+PASS element.style.justifySelf is &quot;start unsafe&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;start unsafe&quot;
+PASS element.style.justifySelf is &quot;flex-end safe&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;flex-end safe&quot;
+PASS element.style.justifySelf is &quot;right&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;right&quot;
+PASS element.style.justifySelf is &quot;center&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;center&quot;
+PASS element.style.justifySelf is &quot;self-start&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;self-start&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;auto&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;self-end&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;self-end&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test bad combinations of justify-self
</span><del>-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
</del><ins>+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+PASS element.style.justifySelf is &quot;&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test the value 'initial'
</span><del>-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'center'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
</del><ins>+PASS element.style.justifySelf is &quot;center&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;center&quot;
+PASS element.style.justifySelf is &quot;initial&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
</ins><span class="cx"> 
</span><ins>+Test the value 'initial' for grid containers
+PASS element.style.justifySelf is &quot;left safe&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;left safe&quot;
+PASS element.style.justifySelf is &quot;initial&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+
+Test the value 'initial' for flex containers
+PASS element.style.justifySelf is &quot;right unsafe&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;right unsafe&quot;
+PASS element.style.justifySelf is &quot;initial&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+
+Test the value 'initial' for positioned elements
+PASS element.style.justifySelf is &quot;left&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;left&quot;
+PASS element.style.justifySelf is &quot;initial&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+
+Test the value 'initial' for positioned elements in grid containers
+PASS element.style.justifySelf is &quot;right&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;right&quot;
+PASS element.style.justifySelf is &quot;initial&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+
+Test the value 'initial' for positioned elements in grid containers
+PASS element.style.justifySelf is &quot;end&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;end&quot;
+PASS element.style.justifySelf is &quot;initial&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;normal&quot;
+
</ins><span class="cx"> Test the value 'inherit'
</span><del>-PASS getComputedStyle(parentElement, '').getPropertyValue('justify-self') is 'end'
-PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'end'
</del><ins>+PASS element.style.justifySelf is &quot;end&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;end&quot;
+PASS element.style.justifySelf is &quot;inherit&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;end&quot;
+PASS element.style.justifySelf is &quot;left safe&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;left safe&quot;
+PASS element.style.justifySelf is &quot;inherit&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;left safe&quot;
+PASS element.style.justifySelf is &quot;center unsafe&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;center unsafe&quot;
+PASS element.style.justifySelf is &quot;inherit&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is &quot;center unsafe&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsejustifyselfhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/parse-justify-self.html (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parse-justify-self.html        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/fast/css/parse-justify-self.html        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -6,6 +6,10 @@
</span><span class="cx">     justify-self: baseline;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#justifySelfLastBaseline {
+    justify-self: last-baseline;
+}
+
</ins><span class="cx"> #justifySelfStretch {
</span><span class="cx">     justify-self: stretch;
</span><span class="cx"> }
</span><span class="lines">@@ -38,6 +42,14 @@
</span><span class="cx">     justify-self: right;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#justifySelfFlexStart {
+    justify-self: flex-start;
+}
+
+#justifySelfFlexEnd {
+    justify-self: flex-end;
+}
+
</ins><span class="cx"> #justifySelfEndUnsafe {
</span><span class="cx">     justify-self: end unsafe;
</span><span class="cx"> }
</span><span class="lines">@@ -61,11 +73,20 @@
</span><span class="cx"> #justifySelfLeftUnsafe {
</span><span class="cx">     justify-self: left unsafe;
</span><span class="cx"> }
</span><ins>+
+#justifySelfFlexStartUnsafe {
+    justify-self: flex-start unsafe;
+}
+
+#justifySelfFlexEndSafe {
+    justify-self: flex-end safe;
+}
</ins><span class="cx"> &lt;/style&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> &lt;div id=&quot;justifySelfBaseline&quot;&gt;&lt;/div&gt;
</span><ins>+&lt;div id=&quot;justifySelfLastBaseline&quot;&gt;&lt;/div&gt;
</ins><span class="cx"> &lt;div id=&quot;justifySelfStretch&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;justifySelfStart&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;justifySelfEnd&quot;&gt;&lt;/div&gt;
</span><span class="lines">@@ -74,6 +95,8 @@
</span><span class="cx"> &lt;div id=&quot;justifySelfSelfEnd&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;justifySelfLeft&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;justifySelfRight&quot;&gt;&lt;/div&gt;
</span><ins>+&lt;div id=&quot;justifySelfFlexStart&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;justifySelfFlexEnd&quot;&gt;&lt;/div&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;justifySelfEndUnsafe&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;justifySelfCenterUnsafe&quot;&gt;&lt;/div&gt;
</span><span class="lines">@@ -81,6 +104,9 @@
</span><span class="cx"> &lt;div id=&quot;justifySelfSelfStartSafe&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;justifySelfRightSafe&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;justifySelfLeftUnsafe&quot;&gt;&lt;/div&gt;
</span><ins>+&lt;div id=&quot;justifySelfFlexStartUnsafe&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;justifySelfFlexEndSafe&quot;&gt;&lt;/div&gt;
+&lt;script src=&quot;resources/alignment-parsing-utils.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> description('Test that setting and getting justify-self works as expected');
</span><span class="cx"> 
</span><span class="lines">@@ -88,6 +114,9 @@
</span><span class="cx"> var justifySelfBaseline = document.getElementById(&quot;justifySelfBaseline&quot;);
</span><span class="cx"> shouldBe(&quot;getComputedStyle(justifySelfBaseline, '').getPropertyValue('justify-self')&quot;, &quot;'baseline'&quot;);
</span><span class="cx"> 
</span><ins>+var justifySelfLastBaseline = document.getElementById(&quot;justifySelfLastBaseline&quot;);
+shouldBe(&quot;getComputedStyle(justifySelfLastBaseline, '').getPropertyValue('justify-self')&quot;, &quot;'last-baseline'&quot;);
+
</ins><span class="cx"> var justifySelfStretch = document.getElementById(&quot;justifySelfStretch&quot;);
</span><span class="cx"> shouldBe(&quot;getComputedStyle(justifySelfStretch, '').getPropertyValue('justify-self')&quot;, &quot;'stretch'&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -112,6 +141,12 @@
</span><span class="cx"> var justifySelfRight = document.getElementById(&quot;justifySelfRight&quot;);
</span><span class="cx"> shouldBe(&quot;getComputedStyle(justifySelfRight, '').getPropertyValue('justify-self')&quot;, &quot;'right'&quot;);
</span><span class="cx"> 
</span><ins>+var justifySelfFlexStart = document.getElementById(&quot;justifySelfFlexStart&quot;);
+shouldBe(&quot;getComputedStyle(justifySelfFlexStart, '').getPropertyValue('justify-self')&quot;, &quot;'flex-start'&quot;);
+
+var justifySelfFlexEnd = document.getElementById(&quot;justifySelfFlexEnd&quot;);
+shouldBe(&quot;getComputedStyle(justifySelfFlexEnd, '').getPropertyValue('justify-self')&quot;, &quot;'flex-end'&quot;);
+
</ins><span class="cx"> var justifySelfEndUnsafe = document.getElementById(&quot;justifySelfEndUnsafe&quot;);
</span><span class="cx"> shouldBe(&quot;getComputedStyle(justifySelfEndUnsafe, '').getPropertyValue('justify-self')&quot;, &quot;'end unsafe'&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -130,100 +165,127 @@
</span><span class="cx"> var justifySelfLeftUnsafe = document.getElementById(&quot;justifySelfLeftUnsafe&quot;);
</span><span class="cx"> shouldBe(&quot;getComputedStyle(justifySelfLeftUnsafe, '').getPropertyValue('justify-self')&quot;, &quot;'left unsafe'&quot;);
</span><span class="cx"> 
</span><ins>+var justifySelfFlexStartUnsafe = document.getElementById(&quot;justifySelfFlexStartUnsafe&quot;);
+shouldBe(&quot;getComputedStyle(justifySelfFlexStartUnsafe, '').getPropertyValue('justify-self')&quot;, &quot;'flex-start unsafe'&quot;);
+
+var justifySelfFlexEndSafe = document.getElementById(&quot;justifySelfFlexEndSafe&quot;);
+shouldBe(&quot;getComputedStyle(justifySelfFlexEndSafe, '').getPropertyValue('justify-self')&quot;, &quot;'flex-end safe'&quot;);
+
</ins><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test initial value of justify-self through JS&quot;);
</span><span class="cx"> element = document.createElement(&quot;div&quot;);
</span><span class="cx"> document.body.appendChild(element);
</span><del>-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'normal'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test getting and setting justify-self through JS&quot;);
</span><ins>+container = document.createElement(&quot;div&quot;);
</ins><span class="cx"> element = document.createElement(&quot;div&quot;);
</span><del>-document.body.appendChild(element);
</del><ins>+container.appendChild(element);
+document.body.appendChild(container);
</ins><span class="cx"> element.style.justifySelf = &quot;center&quot;;
</span><del>-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'center'&quot;);
</del><ins>+checkValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;center&quot;, &quot;center&quot;);
</ins><span class="cx"> 
</span><del>-element = document.createElement(&quot;div&quot;);
-document.body.appendChild(element);
</del><span class="cx"> element.style.justifySelf = &quot;unsafe start&quot;;
</span><del>-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start unsafe'&quot;);
</del><ins>+checkValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;start unsafe&quot;, &quot;start unsafe&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;start&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+element.style.justifySelf = &quot;flex-end safe&quot;;
+checkValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;flex-end safe&quot;, &quot;flex-end safe&quot;);
</ins><span class="cx"> 
</span><del>-debug(&quot;&quot;);
-debug(&quot;Test bad combinations of justify-self&quot;);
-element = document.createElement(&quot;div&quot;);
-document.body.appendChild(element);
-element.style.justifySelf = &quot;start left&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+element.style.justifySelf = &quot;right&quot;;
+checkValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;right&quot;, &quot;right&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;baseline safe&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+element.style.justifySelf = &quot;center&quot;;
+checkValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;center&quot;, &quot;center&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;baseline center&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+element.style.justifySelf = &quot;self-start&quot;;
+checkValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;self-start&quot;, &quot;self-start&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;stretch unsafe&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+element.style.justifySelf = &quot;auto&quot;;
+checkValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;stretch right&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+container.style.display = &quot;flex&quot;;
+element.style.justifySelf = &quot;auto&quot;;
+checkValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;unsafe unsafe&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+container.style.display = &quot;grid&quot;;
+element.style.justifySelf = &quot;auto&quot;;
+checkValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;unsafe&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+element.style.justifySelf = &quot;self-end&quot;;
+checkValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;self-end&quot;, &quot;self-end&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;unsafe safe&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+debug(&quot;&quot;);
+debug(&quot;Test bad combinations of justify-self&quot;);
+container = document.createElement(&quot;div&quot;);
+element = document.createElement(&quot;div&quot;);
+container.appendChild(element);
+document.body.appendChild(container);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;center start&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;unsafe auto&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto safe&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;auto left&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;baseline safe&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;baseline center&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;stretch unsafe&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;stretch right&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;unsafe unsafe&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;unsafe safe&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;center start&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;stretch unsafe&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;safe stretch&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;baseline safe&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;unsafe baseline&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;unsafe safe left&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;unsafe left safe&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;left safe unsafe safe&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;legacy start&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;legacy end&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;legacy right unsafe&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;legacy auto&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;legacy stretch&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;legacy&quot;);
+checkBadValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;,  &quot;legacy left right&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;stretch unsafe&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+debug(&quot;&quot;);
+debug(&quot;Test the value 'initial'&quot;);
+container.style.display = &quot;&quot;;
+checkInitialValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;center&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;safe stretch&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+debug(&quot;&quot;);
+debug(&quot;Test the value 'initial' for grid containers&quot;);
+container.style.display = &quot;grid&quot;;
+checkInitialValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;left safe&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;baseline safe&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+debug(&quot;&quot;);
+debug(&quot;Test the value 'initial' for flex containers&quot;);
+container.style.display = &quot;flex&quot;;
+checkInitialValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;right unsafe&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;unsafe baseline&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+debug(&quot;&quot;);
+debug(&quot;Test the value 'initial' for positioned elements&quot;);
+container.style.display = &quot;&quot;;
+element.style.position = &quot;absolute&quot;;
+checkInitialValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;left&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;unsafe safe&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+debug(&quot;&quot;);
+debug(&quot;Test the value 'initial' for positioned elements in grid containers&quot;);
+container.style.display = &quot;grid&quot;;
+element.style.position = &quot;absolute&quot;;
+checkInitialValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;right&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><del>-element.style.justifySelf = &quot;unsafe safe left&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
-
-element.style.justifySelf = &quot;unsafe left safe&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
-
-element.style.justifySelf = &quot;left safe unsafe safe&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
-
</del><span class="cx"> debug(&quot;&quot;);
</span><del>-debug(&quot;Test the value 'initial'&quot;);
-element.style.justifySelf = &quot;center&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'center'&quot;);
-element.style.justifySelf = &quot;initial&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'start'&quot;);
</del><ins>+debug(&quot;Test the value 'initial' for positioned elements in grid containers&quot;);
+container.style.display = &quot;flex&quot;;
+element.style.position = &quot;absolute&quot;;
+checkInitialValues(element, &quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;end&quot;, &quot;normal&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Test the value 'inherit'&quot;);
</span><del>-parentElement = document.createElement(&quot;div&quot;);
-document.body.appendChild(parentElement);
-parentElement.style.justifySelf = &quot;end&quot;;
-shouldBe(&quot;getComputedStyle(parentElement, '').getPropertyValue('justify-self')&quot;, &quot;'end'&quot;);
</del><ins>+checkInheritValues(&quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;end&quot;);
+checkInheritValues(&quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;left safe&quot;);
+checkInheritValues(&quot;justifySelf&quot;, &quot;justify-self&quot;, &quot;center unsafe&quot;);
</ins><span class="cx"> 
</span><del>-element = document.createElement(&quot;div&quot;);
-parentElement.appendChild(element);
-element.style.justifySelf = &quot;inherit&quot;;
-shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('justify-self')&quot;, &quot;'end'&quot;);
</del><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssresourcesalignmentparsingutilsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/resources/alignment-parsing-utils.js (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/resources/alignment-parsing-utils.js        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/fast/css/resources/alignment-parsing-utils.js        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -8,8 +8,10 @@
</span><span class="cx"> 
</span><span class="cx"> function checkBadValues(element, property, propertyID, value)
</span><span class="cx"> {
</span><ins>+    var elementID = element.id || &quot;element&quot;;
+    var initialValue = eval(&quot;window.getComputedStyle(&quot; + elementID + &quot; , '').getPropertyValue('&quot; + propertyID + &quot;')&quot;);
</ins><span class="cx">     element.style[property] = value;
</span><del>-    checkValues(element, property, propertyID, &quot;&quot;, &quot;start&quot;);
</del><ins>+    checkValues(element, property, propertyID, &quot;&quot;, initialValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function checkInitialValues(element, property, propertyID, value, initial)
</span></span></pre></div>
<a id="trunkLayoutTestssvgcssgetComputedStylebasicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -296,9 +296,9 @@
</span><span class="cx"> rect: style.getPropertyCSSValue(column-width) : [object CSSPrimitiveValue]
</span><span class="cx"> rect: style.getPropertyValue(align-content) : normal
</span><span class="cx"> rect: style.getPropertyCSSValue(align-content) : [object CSSValueList]
</span><del>-rect: style.getPropertyValue(align-items) : start
</del><ins>+rect: style.getPropertyValue(align-items) : normal
</ins><span class="cx"> rect: style.getPropertyCSSValue(align-items) : [object CSSValueList]
</span><del>-rect: style.getPropertyValue(align-self) : start
</del><ins>+rect: style.getPropertyValue(align-self) : normal
</ins><span class="cx"> rect: style.getPropertyCSSValue(align-self) : [object CSSValueList]
</span><span class="cx"> rect: style.getPropertyValue(filter) : none
</span><span class="cx"> rect: style.getPropertyCSSValue(filter) : [object CSSPrimitiveValue]
</span><span class="lines">@@ -308,9 +308,9 @@
</span><span class="cx"> rect: style.getPropertyCSSValue(flex-wrap) : [object CSSPrimitiveValue]
</span><span class="cx"> rect: style.getPropertyValue(justify-content) : normal
</span><span class="cx"> rect: style.getPropertyCSSValue(justify-content) : [object CSSValueList]
</span><del>-rect: style.getPropertyValue(justify-self) : start
</del><ins>+rect: style.getPropertyValue(justify-self) : normal
</ins><span class="cx"> rect: style.getPropertyCSSValue(justify-self) : [object CSSValueList]
</span><del>-rect: style.getPropertyValue(justify-items) : start
</del><ins>+rect: style.getPropertyValue(justify-items) : normal
</ins><span class="cx"> rect: style.getPropertyCSSValue(justify-items) : [object CSSValueList]
</span><span class="cx"> rect: style.getPropertyValue(-webkit-font-kerning) : auto
</span><span class="cx"> rect: style.getPropertyCSSValue(-webkit-font-kerning) : [object CSSPrimitiveValue]
</span><span class="lines">@@ -830,9 +830,9 @@
</span><span class="cx"> g: style.getPropertyCSSValue(column-width) : [object CSSPrimitiveValue]
</span><span class="cx"> g: style.getPropertyValue(align-content) : normal
</span><span class="cx"> g: style.getPropertyCSSValue(align-content) : [object CSSValueList]
</span><del>-g: style.getPropertyValue(align-items) : start
</del><ins>+g: style.getPropertyValue(align-items) : normal
</ins><span class="cx"> g: style.getPropertyCSSValue(align-items) : [object CSSValueList]
</span><del>-g: style.getPropertyValue(align-self) : start
</del><ins>+g: style.getPropertyValue(align-self) : normal
</ins><span class="cx"> g: style.getPropertyCSSValue(align-self) : [object CSSValueList]
</span><span class="cx"> g: style.getPropertyValue(filter) : none
</span><span class="cx"> g: style.getPropertyCSSValue(filter) : [object CSSPrimitiveValue]
</span><span class="lines">@@ -842,9 +842,9 @@
</span><span class="cx"> g: style.getPropertyCSSValue(flex-wrap) : [object CSSPrimitiveValue]
</span><span class="cx"> g: style.getPropertyValue(justify-content) : normal
</span><span class="cx"> g: style.getPropertyCSSValue(justify-content) : [object CSSValueList]
</span><del>-g: style.getPropertyValue(justify-self) : start
</del><ins>+g: style.getPropertyValue(justify-self) : normal
</ins><span class="cx"> g: style.getPropertyCSSValue(justify-self) : [object CSSValueList]
</span><del>-g: style.getPropertyValue(justify-items) : start
</del><ins>+g: style.getPropertyValue(justify-items) : normal
</ins><span class="cx"> g: style.getPropertyCSSValue(justify-items) : [object CSSValueList]
</span><span class="cx"> g: style.getPropertyValue(-webkit-font-kerning) : auto
</span><span class="cx"> g: style.getPropertyCSSValue(-webkit-font-kerning) : [object CSSPrimitiveValue]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/ChangeLog        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -1,3 +1,79 @@
</span><ins>+2016-05-30  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [CSS Box Alignment] New CSS Value 'normal' for Self Alignment
+        https://bugs.webkit.org/show_bug.cgi?id=156254
+
+        Reviewed by Darin Adler.
+
+        The Box Alignment specification defines a new value 'normal' to be used
+        as default for the different layout models, which will define the
+        specific behavior for each case. This patch adds a new CSS value in the
+        parsing logic and adapts the Self Alignment properties to the new
+        value.
+
+        The 'auto' value is no longer valid for the 'align-items' property and
+        the Computed Value will be always the specified value. Hence, I removed
+        the StyleResolver logic because is not required now; the specific
+        behavior of the 'normal' value will be resolved at layout time.
+
+        Additionally, this patch updates the layout logic as well, for both
+        Flexbox and Grid layout models.
+
+        Test: css3/parse-alignment-of-root-elements.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::resolveLegacyJustifyItems): Added.
+        (WebCore::resolveJustifyItemsAuto): Added.
+        (WebCore::resolveJustifySelfAuto): Added.
+        (WebCore::resolveAlignSelfAuto): Added.
+        (WebCore::valueForItemPositionWithOverflowAlignment): Using a StyleSelfAlignmentData argument.
+        (WebCore::ComputedStyleExtractor::propertyValue): Using the new resolving functions.
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseItemPositionOverflowPosition): A new value 'normal' is now valid.
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Mappings for the new value 'normal'.
+        (WebCore::CSSPrimitiveValue::operator ItemPosition): Mappings for the new value 'normal'.
+        * css/CSSPropertyNames.in:
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::adjustRenderStyle): We don't need to resolve 'legacy&quot; keyword.
+        * rendering/RenderBox.cpp:
+        (WebCore::flexItemHasStretchAlignment):
+        (WebCore::RenderBox::hasStretchedLogicalWidth):
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::styleDidChange):
+        (WebCore::RenderFlexibleBox::alignmentForChild):
+        (WebCore::contentAlignmentNormalBehaviorFlexibleBox):
+        (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
+        (WebCore::RenderFlexibleBox::layoutColumnReverse):
+        (WebCore::RenderFlexibleBox::alignFlexLines):
+        (WebCore::RenderFlexibleBox::alignChildren):
+        * rendering/RenderGrid.cpp:
+        (WebCore::defaultAlignmentChangedToStretchInRowAxis):
+        (WebCore::defaultAlignmentChangedFromStretchInRowAxis):
+        (WebCore::defaultAlignmentChangedFromStretchInColumnAxis):
+        (WebCore::selfAlignmentChangedToStretchInRowAxis):
+        (WebCore::selfAlignmentChangedFromStretchInRowAxis):
+        (WebCore::selfAlignmentChangedFromStretchInColumnAxis):
+        (WebCore::contentAlignmentNormalBehaviorGrid):
+        (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
+        (WebCore::RenderGrid::needToStretchChildLogicalHeight):
+        (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
+        (WebCore::RenderGrid::columnAxisPositionForChild):
+        (WebCore::RenderGrid::rowAxisPositionForChild):
+        (WebCore::RenderGrid::columnAxisOffsetForChild):
+        (WebCore::RenderGrid::rowAxisOffsetForChild):
+        (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::resolvedSelfAlignment):
+        (WebCore::RenderStyle::resolvedAlignItems):
+        (WebCore::RenderStyle::resolvedAlignSelf):
+        (WebCore::RenderStyle::resolvedJustifyItems):
+        (WebCore::RenderStyle::resolvedJustifySelf):
+        * rendering/style/RenderStyle.h:
+        * rendering/style/RenderStyleConstants.h:
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): align-items uses now a different initial function.
+
</ins><span class="cx"> 2016-05-29  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Transition various Task/Function queues from std::function to NoncopyableFunction.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -2275,25 +2275,47 @@
</span><span class="cx">     return &amp;element;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static ItemPosition resolveContainerAlignmentAuto(ItemPosition position, RenderObject* element)
</del><ins>+static StyleSelfAlignmentData resolveLegacyJustifyItems(const StyleSelfAlignmentData&amp; data)
</ins><span class="cx"> {
</span><del>-    if (position != ItemPositionAuto || !element)
-        return position;
</del><ins>+    if (data.positionType() == LegacyPosition)
+        return { data.position(), OverflowAlignmentDefault };
+    return data;
+}
</ins><span class="cx"> 
</span><del>-    return element-&gt;style().isDisplayFlexibleOrGridBox() ? ItemPositionStretch : ItemPositionStart;
</del><ins>+static StyleSelfAlignmentData resolveJustifyItemsAuto(const StyleSelfAlignmentData&amp; data, Node* parent)
+{
+    if (data.position() != ItemPositionAuto)
+        return data;
+
+    // If the inherited value of justify-items includes the 'legacy' keyword, 'auto' computes to the inherited value.
+    const auto&amp; inheritedValue = (!parent || !parent-&gt;computedStyle()) ? RenderStyle::initialDefaultAlignment() : parent-&gt;computedStyle()-&gt;justifyItems();
+    if (inheritedValue.positionType() == LegacyPosition)
+        return inheritedValue;
+    if (inheritedValue.position() == ItemPositionAuto)
+        return resolveJustifyItemsAuto(inheritedValue, parent-&gt;parentNode());
+    return { ItemPositionNormal, OverflowAlignmentDefault };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static ItemPosition resolveSelfAlignmentAuto(ItemPosition position, OverflowAlignment&amp; overflow, RenderObject* element)
</del><ins>+static StyleSelfAlignmentData resolveJustifySelfAuto(const StyleSelfAlignmentData&amp; data, Node* parent)
</ins><span class="cx"> {
</span><del>-    if (position != ItemPositionAuto || !element || element-&gt;isOutOfFlowPositioned())
-        return position;
</del><ins>+    if (data.position() != ItemPositionAuto)
+        return data;
</ins><span class="cx"> 
</span><del>-    RenderBlock* parent = element-&gt;containingBlock();
-    if (!parent)
-        return ItemPositionStart;
</del><ins>+    // The 'auto' keyword computes to the computed value of justify-items on the parent or 'normal' if the box has no parent.
+    if (!parent || !parent-&gt;computedStyle())
+        return { ItemPositionNormal, OverflowAlignmentDefault };
+    return resolveLegacyJustifyItems(resolveJustifyItemsAuto(parent-&gt;computedStyle()-&gt;justifyItems(), parent-&gt;parentNode()));
+}
</ins><span class="cx"> 
</span><del>-    overflow = parent-&gt;style().alignItemsOverflowAlignment();
-    return resolveContainerAlignmentAuto(parent-&gt;style().alignItemsPosition(), parent);
</del><ins>+static StyleSelfAlignmentData resolveAlignSelfAuto(const StyleSelfAlignmentData&amp; data, Node* parent)
+{
+    if (data.position() != ItemPositionAuto)
+        return data;
+
+    // The 'auto' keyword computes to the computed value of align-items on the parent or 'normal' if the box has no parent.
+    if (!parent || !parent-&gt;computedStyle())
+        return { ItemPositionNormal, OverflowAlignmentDefault };
+    return parent-&gt;computedStyle()-&gt;alignItems();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
</span><span class="lines">@@ -2376,30 +2398,31 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static RefPtr&lt;CSSValueList&gt; valueForItemPositionWithOverflowAlignment(ItemPosition itemPosition, OverflowAlignment overflowAlignment, ItemPositionType positionType)
</del><ins>+static Ref&lt;CSSValueList&gt; valueForItemPositionWithOverflowAlignment(const StyleSelfAlignmentData&amp; data)
</ins><span class="cx"> {
</span><span class="cx">     auto&amp; cssValuePool = CSSValuePool::singleton();
</span><del>-    RefPtr&lt;CSSValueList&gt; result = CSSValueList::createSpaceSeparated();
-    if (positionType == LegacyPosition)
-        result-&gt;append(CSSPrimitiveValue::createIdentifier(CSSValueLegacy));
-    result-&gt;append(cssValuePool.createValue(itemPosition));
-    if (overflowAlignment != OverflowAlignmentDefault)
-        result-&gt;append(cssValuePool.createValue(overflowAlignment));
-    ASSERT(result-&gt;length() &lt;= 2);
</del><ins>+    auto result = CSSValueList::createSpaceSeparated();
+    if (data.positionType() == LegacyPosition)
+        result.get().append(cssValuePool.createIdentifierValue(CSSValueLegacy));
+    result.get().append(cssValuePool.createValue(data.position()));
+    if (data.position() &gt;= ItemPositionCenter &amp;&amp; data.overflow() != OverflowAlignmentDefault)
+        result.get().append(cssValuePool.createValue(data.overflow()));
+    ASSERT(result.get().length() &lt;= 2);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RefPtr&lt;CSSValueList&gt; valueForContentPositionAndDistributionWithOverflowAlignment(const StyleContentAlignmentData&amp; data)
</del><ins>+static Ref&lt;CSSValueList&gt; valueForContentPositionAndDistributionWithOverflowAlignment(const StyleContentAlignmentData&amp; data)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;CSSValueList&gt; result = CSSValueList::createSpaceSeparated();
</del><ins>+    auto&amp; cssValuePool = CSSValuePool::singleton();
+    auto result = CSSValueList::createSpaceSeparated();
</ins><span class="cx">     if (data.distribution() != ContentDistributionDefault)
</span><del>-        result-&gt;append(CSSPrimitiveValue::create(data.distribution()));
</del><ins>+        result.get().append(cssValuePool.createValue(data.distribution()));
</ins><span class="cx">     if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal)
</span><del>-        result-&gt;append(CSSPrimitiveValue::create(data.position()));
</del><ins>+        result.get().append(cssValuePool.createValue(data.position()));
</ins><span class="cx">     if ((data.position() &gt;= ContentPositionCenter || data.distribution() != ContentDistributionDefault) &amp;&amp; data.overflow() != OverflowAlignmentDefault)
</span><del>-        result-&gt;append(CSSPrimitiveValue::create(data.overflow()));
-    ASSERT(result-&gt;length() &gt; 0);
-    ASSERT(result-&gt;length() &lt;= 3);
</del><ins>+        result.get().append(cssValuePool.createValue(data.overflow()));
+    ASSERT(result.get().length() &gt; 0);
+    ASSERT(result.get().length() &lt;= 3);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2779,12 +2802,9 @@
</span><span class="cx">         case CSSPropertyAlignContent:
</span><span class="cx">             return valueForContentPositionAndDistributionWithOverflowAlignment(style-&gt;alignContent());
</span><span class="cx">         case CSSPropertyAlignItems:
</span><del>-            return valueForItemPositionWithOverflowAlignment(resolveContainerAlignmentAuto(style-&gt;alignItemsPosition(), renderer), style-&gt;alignItemsOverflowAlignment(), NonLegacyPosition);
-        case CSSPropertyAlignSelf: {
-            OverflowAlignment overflow = style-&gt;alignSelfOverflowAlignment();
-            ItemPosition alignSelf = resolveSelfAlignmentAuto(style-&gt;alignSelfPosition(), overflow, renderer);
-            return valueForItemPositionWithOverflowAlignment(alignSelf, overflow, NonLegacyPosition);
-        }
</del><ins>+            return valueForItemPositionWithOverflowAlignment(style-&gt;alignItems());
+        case CSSPropertyAlignSelf:
+            return valueForItemPositionWithOverflowAlignment(resolveAlignSelfAuto(style-&gt;alignSelf(), styledNode-&gt;parentNode()));
</ins><span class="cx">         case CSSPropertyFlex:
</span><span class="cx">             return getCSSPropertyValuesForShorthandProperties(flexShorthand());
</span><span class="cx">         case CSSPropertyFlexBasis:
</span><span class="lines">@@ -2802,12 +2822,9 @@
</span><span class="cx">         case CSSPropertyJustifyContent:
</span><span class="cx">             return valueForContentPositionAndDistributionWithOverflowAlignment(style-&gt;justifyContent());
</span><span class="cx">         case CSSPropertyJustifyItems:
</span><del>-            return valueForItemPositionWithOverflowAlignment(resolveContainerAlignmentAuto(style-&gt;justifyItemsPosition(), renderer), style-&gt;justifyItemsOverflowAlignment(), style-&gt;justifyItemsPositionType());
-        case CSSPropertyJustifySelf: {
-            OverflowAlignment overflow = style-&gt;justifySelfOverflowAlignment();
-            ItemPosition justifySelf = resolveSelfAlignmentAuto(style-&gt;justifySelfPosition(), overflow, renderer);
-            return valueForItemPositionWithOverflowAlignment(justifySelf, overflow, NonLegacyPosition);
-        }
</del><ins>+            return valueForItemPositionWithOverflowAlignment(resolveJustifyItemsAuto(style-&gt;justifyItems(), styledNode-&gt;parentNode()));
+        case CSSPropertyJustifySelf:
+            return valueForItemPositionWithOverflowAlignment(resolveJustifySelfAuto(style-&gt;justifySelf(), styledNode-&gt;parentNode()));
</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="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -3423,16 +3423,19 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseItemPositionOverflowPosition(CSSPropertyID propId, bool important)
</span><span class="cx"> {
</span><del>-    // auto | stretch | &lt;baseline-position&gt; | [&lt;item-position&gt; &amp;&amp; &lt;overflow-position&gt;? ]
</del><ins>+    // auto | normal | stretch | &lt;baseline-position&gt; | [&lt;item-position&gt; &amp;&amp; &lt;overflow-position&gt;? ]
</ins><span class="cx">     // &lt;baseline-position&gt; = baseline | last-baseline;
</span><span class="cx">     // &lt;item-position&gt; = center | start | end | self-start | self-end | flex-start | flex-end | left | right;
</span><del>-    // &lt;overflow-position&gt; = true | safe
</del><ins>+    // &lt;overflow-position&gt; = unsafe | safe
</ins><span class="cx"> 
</span><span class="cx">     CSSParserValue* value = m_valueList-&gt;current();
</span><span class="cx">     if (!value)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (value-&gt;id == CSSValueAuto || value-&gt;id == CSSValueStretch || isBaselinePositionKeyword(value-&gt;id)) {
</del><ins>+    if (value-&gt;id == CSSValueAuto || value-&gt;id == CSSValueNormal || value-&gt;id == CSSValueStretch || isBaselinePositionKeyword(value-&gt;id)) {
+        // align-items property does not allow the 'auto' value.
+        if (value-&gt;id == CSSValueAuto &amp;&amp; propId == CSSPropertyAlignItems)
+            return false;
</ins><span class="cx">         if (m_valueList-&gt;next())
</span><span class="cx">             return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueMappingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -5118,6 +5118,9 @@
</span><span class="cx">     case ItemPositionAuto:
</span><span class="cx">         m_value.valueID = CSSValueAuto;
</span><span class="cx">         break;
</span><ins>+    case ItemPositionNormal:
+        m_value.valueID = CSSValueNormal;
+        break;
</ins><span class="cx">     case ItemPositionStretch:
</span><span class="cx">         m_value.valueID = CSSValueStretch;
</span><span class="cx">         break;
</span><span class="lines">@@ -5162,6 +5165,8 @@
</span><span class="cx">     switch (m_value.valueID) {
</span><span class="cx">     case CSSValueAuto:
</span><span class="cx">         return ItemPositionAuto;
</span><ins>+    case CSSValueNormal:
+        return ItemPositionNormal;
</ins><span class="cx">     case CSSValueStretch:
</span><span class="cx">         return ItemPositionStretch;
</span><span class="cx">     case CSSValueBaseline:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -468,7 +468,7 @@
</span><span class="cx"> -webkit-filter = filter
</span><span class="cx"> align-content [Initial=initialContentAlignment, Converter=ContentAlignmentData]
</span><span class="cx"> -webkit-align-content = align-content
</span><del>-align-items [Initial=initialSelfAlignment, Converter=SelfOrDefaultAlignmentData]
</del><ins>+align-items [Initial=initialDefaultAlignment, Converter=SelfOrDefaultAlignmentData]
</ins><span class="cx"> -webkit-align-items = align-items
</span><span class="cx"> align-self [Initial=initialSelfAlignment, Converter=SelfOrDefaultAlignmentData]
</span><span class="cx"> -webkit-align-self = align-self
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -1009,11 +1009,6 @@
</span><span class="cx">         if ((element-&gt;hasTagName(SVGNames::foreignObjectTag) || element-&gt;hasTagName(SVGNames::textTag)) &amp;&amp; style.isDisplayInlineType())
</span><span class="cx">             style.setDisplay(BLOCK);
</span><span class="cx">     }
</span><del>-
-    // If the inherited value of justify-items includes the legacy keyword, 'auto'
-    // computes to the the inherited value.
-    if (parentStyle.justifyItemsPositionType() == LegacyPosition &amp;&amp; style.justifyItemsPosition() == ItemPositionAuto)
-        style.setJustifyItems(parentStyle.justifyItems());
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool StyleResolver::checkRegionStyle(const Element* regionElement)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -2519,7 +2519,7 @@
</span><span class="cx"> static bool flexItemHasStretchAlignment(const RenderBox&amp; flexitem)
</span><span class="cx"> {
</span><span class="cx">     auto parent = flexitem.parent();
</span><del>-    return RenderStyle::resolveAlignment(parent-&gt;style(), flexitem.style(), ItemPositionStretch) == ItemPositionStretch;
</del><ins>+    return flexitem.style().resolvedAlignSelf(parent-&gt;style(), ItemPositionStretch).position() == ItemPositionStretch;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool isStretchingColumnFlexItem(const RenderBox&amp; flexitem)
</span><span class="lines">@@ -2547,8 +2547,8 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     if (containingBlock-&gt;isHorizontalWritingMode() != isHorizontalWritingMode())
</span><del>-        return RenderStyle::resolveAlignment(containingBlock-&gt;style(), style, ItemPositionStretch) == ItemPositionStretch;
-    return RenderStyle::resolveJustification(containingBlock-&gt;style(), style, ItemPositionStretch) == ItemPositionStretch;
</del><ins>+        return style.resolvedAlignSelf(containingBlock-&gt;style(), ItemPositionStretch).position() == ItemPositionStretch;
+    return style.resolvedJustifySelf(containingBlock-&gt;style(), ItemPositionStretch).position() == ItemPositionStretch;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderBox::sizesLogicalWidthToFitContent(SizeType widthType) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFlexibleBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -39,6 +39,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+static constexpr ItemPosition selfAlignmentNormalBehaviorFlexibleBox = ItemPositionStretch;
+
</ins><span class="cx"> struct RenderFlexibleBox::LineContext {
</span><span class="cx">     LineContext(LayoutUnit crossAxisOffset, LayoutUnit crossAxisExtent, size_t numberOfChildren, LayoutUnit maxAscent)
</span><span class="cx">         : crossAxisOffset(crossAxisOffset)
</span><span class="lines">@@ -231,12 +233,14 @@
</span><span class="cx"> {
</span><span class="cx">     RenderBlock::styleDidChange(diff, oldStyle);
</span><span class="cx"> 
</span><del>-    if (oldStyle &amp;&amp; (oldStyle-&gt;alignItemsPosition() == ItemPositionStretch || oldStyle-&gt;alignItemsPosition() == ItemPositionAuto) &amp;&amp; diff == StyleDifferenceLayout) {
</del><ins>+    if (oldStyle &amp;&amp; oldStyle-&gt;resolvedAlignItems(selfAlignmentNormalBehaviorFlexibleBox).position() == ItemPositionStretch &amp;&amp; diff == StyleDifferenceLayout) {
</ins><span class="cx">         // Flex items that were previously stretching need to be relayed out so we can compute new available cross axis space.
</span><span class="cx">         // This is only necessary for stretching since other alignment values don't change the size of the box.
</span><ins>+        auto&amp; newStyle = style();
</ins><span class="cx">         for (RenderBox* child = firstChildBox(); child; child = child-&gt;nextSiblingBox()) {
</span><del>-            ItemPosition previousAlignment = RenderStyle::resolveAlignment(*oldStyle, child-&gt;style(), ItemPositionStretch);
-            if (previousAlignment == ItemPositionStretch &amp;&amp; previousAlignment != RenderStyle::resolveAlignment(style(), child-&gt;style(), ItemPositionStretch))
</del><ins>+            auto&amp; childStyle = child-&gt;style();
+            auto previousAlignment = childStyle.resolvedAlignSelf(*oldStyle, selfAlignmentNormalBehaviorFlexibleBox).position();
+            if (previousAlignment == ItemPositionStretch &amp;&amp; previousAlignment != childStyle.resolvedAlignSelf(newStyle, selfAlignmentNormalBehaviorFlexibleBox).position())
</ins><span class="cx">                 child-&gt;setChildNeedsLayout(MarkOnlyThis);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -1046,7 +1050,7 @@
</span><span class="cx"> 
</span><span class="cx"> ItemPosition RenderFlexibleBox::alignmentForChild(RenderBox&amp; child) const
</span><span class="cx"> {
</span><del>-    ItemPosition align = RenderStyle::resolveAlignment(style(), child.style(), ItemPositionStretch);
</del><ins>+    ItemPosition align = child.style().resolvedAlignSelf(style(), selfAlignmentNormalBehaviorFlexibleBox).position();
</ins><span class="cx"> 
</span><span class="cx">     if (align == ItemPositionBaseline &amp;&amp; hasOrthogonalFlow(child))
</span><span class="cx">         align = ItemPositionFlexStart;
</span><span class="lines">@@ -1094,7 +1098,7 @@
</span><span class="cx">     return child.style().overflowY();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const StyleContentAlignmentData&amp; normalValueBehaviorFlexibleBox()
</del><ins>+static const StyleContentAlignmentData&amp; contentAlignmentNormalBehaviorFlexibleBox()
</ins><span class="cx"> {
</span><span class="cx">     // The justify-content property applies along the main axis, but since flexing
</span><span class="cx">     // in the main axis is controlled by flex, stretch behaves as flex-start (ignoring
</span><span class="lines">@@ -1108,8 +1112,8 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(childSizes.size() == children.size());
</span><span class="cx"> 
</span><del>-    ContentPosition position = style().resolvedJustifyContentPosition(normalValueBehaviorFlexibleBox());
-    ContentDistributionType distribution = style().resolvedJustifyContentDistribution(normalValueBehaviorFlexibleBox());
</del><ins>+    auto position = style().resolvedJustifyContentPosition(contentAlignmentNormalBehaviorFlexibleBox());
+    auto distribution = style().resolvedJustifyContentDistribution(contentAlignmentNormalBehaviorFlexibleBox());
</ins><span class="cx"> 
</span><span class="cx">     size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(children);
</span><span class="cx">     LayoutUnit autoMarginOffset = autoMarginOffsetInMainAxis(children, availableFreeSpace);
</span><span class="lines">@@ -1192,8 +1196,8 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList&amp; children, LayoutUnit crossAxisOffset, LayoutUnit availableFreeSpace)
</span><span class="cx"> {
</span><del>-    ContentPosition position = style().resolvedJustifyContentPosition(normalValueBehaviorFlexibleBox());
-    ContentDistributionType distribution = style().resolvedJustifyContentDistribution(normalValueBehaviorFlexibleBox());
</del><ins>+    auto position = style().resolvedJustifyContentPosition(contentAlignmentNormalBehaviorFlexibleBox());
+    auto distribution = style().resolvedJustifyContentDistribution(contentAlignmentNormalBehaviorFlexibleBox());
</ins><span class="cx"> 
</span><span class="cx">     // This is similar to the logic in layoutAndPlaceChildren, except we place the children
</span><span class="cx">     // starting from the end of the flexbox. We also don't need to layout anything since we're
</span><span class="lines">@@ -1250,8 +1254,8 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderFlexibleBox::alignFlexLines(Vector&lt;LineContext&gt;&amp; lineContexts)
</span><span class="cx"> {
</span><del>-    ContentPosition position = style().resolvedAlignContentPosition(normalValueBehaviorFlexibleBox());
-    ContentDistributionType distribution = style().resolvedAlignContentDistribution(normalValueBehaviorFlexibleBox());
</del><ins>+    ContentPosition position = style().resolvedAlignContentPosition(contentAlignmentNormalBehaviorFlexibleBox());
+    ContentDistributionType distribution = style().resolvedAlignContentDistribution(contentAlignmentNormalBehaviorFlexibleBox());
</ins><span class="cx"> 
</span><span class="cx">     if (!isMultiline() || position == ContentPositionFlexStart)
</span><span class="cx">         return;
</span><span class="lines">@@ -1313,6 +1317,7 @@
</span><span class="cx"> 
</span><span class="cx">             switch (alignmentForChild(*child)) {
</span><span class="cx">             case ItemPositionAuto:
</span><ins>+            case ItemPositionNormal:
</ins><span class="cx">                 ASSERT_NOT_REACHED();
</span><span class="cx">                 break;
</span><span class="cx">             case ItemPositionStart:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static const int infinity = -1;
</span><ins>+static constexpr ItemPosition selfAlignmentNormalBehavior = ItemPositionStretch;
</ins><span class="cx"> 
</span><span class="cx"> class GridTrack {
</span><span class="cx"> public:
</span><span class="lines">@@ -264,35 +265,35 @@
</span><span class="cx"> 
</span><span class="cx"> static inline bool defaultAlignmentChangedToStretchInRowAxis(const RenderStyle&amp; oldStyle, const RenderStyle&amp; newStyle)
</span><span class="cx"> {
</span><del>-    return !defaultAlignmentIsStretch(oldStyle.justifyItemsPosition()) &amp;&amp; defaultAlignmentIsStretch(newStyle.justifyItemsPosition());
</del><ins>+    return !defaultAlignmentIsStretch(oldStyle.justifyItems().position()) &amp;&amp; defaultAlignmentIsStretch(newStyle.justifyItems().position());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool defaultAlignmentChangedFromStretchInRowAxis(const RenderStyle&amp; oldStyle, const RenderStyle&amp; newStyle)
</span><span class="cx"> {
</span><del>-    return defaultAlignmentIsStretch(oldStyle.justifyItemsPosition()) &amp;&amp; !defaultAlignmentIsStretch(newStyle.justifyItemsPosition());
</del><ins>+    return defaultAlignmentIsStretch(oldStyle.justifyItems().position()) &amp;&amp; !defaultAlignmentIsStretch(newStyle.justifyItems().position());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool defaultAlignmentChangedFromStretchInColumnAxis(const RenderStyle&amp; oldStyle, const RenderStyle&amp; newStyle)
</span><span class="cx"> {
</span><del>-    return defaultAlignmentIsStretch(oldStyle.alignItemsPosition()) &amp;&amp; !defaultAlignmentIsStretch(newStyle.alignItemsPosition());
</del><ins>+    return defaultAlignmentIsStretch(oldStyle.alignItems().position()) &amp;&amp; !defaultAlignmentIsStretch(newStyle.alignItems().position());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool selfAlignmentChangedToStretchInRowAxis(const RenderStyle&amp; oldStyle, const RenderStyle&amp; newStyle, const RenderStyle&amp; childStyle)
</span><span class="cx"> {
</span><del>-    return RenderStyle::resolveJustification(oldStyle, childStyle, ItemPositionStretch) != ItemPositionStretch
-        &amp;&amp; RenderStyle::resolveJustification(newStyle, childStyle, ItemPositionStretch) == ItemPositionStretch;
</del><ins>+    return childStyle.resolvedJustifySelf(oldStyle, selfAlignmentNormalBehavior).position() != ItemPositionStretch
+        &amp;&amp; childStyle.resolvedJustifySelf(newStyle, selfAlignmentNormalBehavior).position() == ItemPositionStretch;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool selfAlignmentChangedFromStretchInRowAxis(const RenderStyle&amp; oldStyle, const RenderStyle&amp; newStyle, const RenderStyle&amp; childStyle)
</span><span class="cx"> {
</span><del>-    return RenderStyle::resolveJustification(oldStyle, childStyle, ItemPositionStretch) == ItemPositionStretch
-        &amp;&amp; RenderStyle::resolveJustification(newStyle, childStyle, ItemPositionStretch) != ItemPositionStretch;
</del><ins>+    return childStyle.resolvedJustifySelf(oldStyle, selfAlignmentNormalBehavior).position() == ItemPositionStretch
+        &amp;&amp; childStyle.resolvedJustifySelf(newStyle, selfAlignmentNormalBehavior).position() != ItemPositionStretch;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool selfAlignmentChangedFromStretchInColumnAxis(const RenderStyle&amp; oldStyle, const RenderStyle&amp; newStyle, const RenderStyle&amp; childStyle)
</span><span class="cx"> {
</span><del>-    return RenderStyle::resolveAlignment(oldStyle, childStyle, ItemPositionStretch) == ItemPositionStretch
-        &amp;&amp; RenderStyle::resolveAlignment(newStyle, childStyle, ItemPositionStretch) != ItemPositionStretch;
</del><ins>+    return childStyle.resolvedAlignSelf(oldStyle, selfAlignmentNormalBehavior).position() == ItemPositionStretch
+        &amp;&amp; childStyle.resolvedAlignSelf(newStyle, selfAlignmentNormalBehavior).position() != ItemPositionStretch;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderGrid::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
</span><span class="lines">@@ -1511,7 +1512,7 @@
</span><span class="cx">     m_gridItemArea.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const StyleContentAlignmentData&amp; normalValueBehaviorGrid()
</del><ins>+static const StyleContentAlignmentData&amp; contentAlignmentNormalBehaviorGrid()
</ins><span class="cx"> {
</span><span class="cx">     static const StyleContentAlignmentData normalBehavior = {ContentPositionNormal, ContentDistributionStretch};
</span><span class="cx">     return normalBehavior;
</span><span class="lines">@@ -1522,8 +1523,8 @@
</span><span class="cx">     Optional&lt;LayoutUnit&gt; freeSpace = sizingData.freeSpaceForDirection(direction);
</span><span class="cx">     if (!freeSpace
</span><span class="cx">         || freeSpace.value() &lt;= 0
</span><del>-        || (direction == ForColumns &amp;&amp; style().resolvedJustifyContentDistribution(normalValueBehaviorGrid()) != ContentDistributionStretch)
-        || (direction == ForRows &amp;&amp; style().resolvedAlignContentDistribution(normalValueBehaviorGrid()) != ContentDistributionStretch))
</del><ins>+        || (direction == ForColumns &amp;&amp; style().resolvedJustifyContentDistribution(contentAlignmentNormalBehaviorGrid()) != ContentDistributionStretch)
+        || (direction == ForRows &amp;&amp; style().resolvedAlignContentDistribution(contentAlignmentNormalBehaviorGrid()) != ContentDistributionStretch))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Spec defines auto-sized tracks as the ones with an 'auto' max-sizing function.
</span><span class="lines">@@ -1803,7 +1804,7 @@
</span><span class="cx"> // FIXME: This logic is shared by RenderFlexibleBox, so it should be moved to RenderBox.
</span><span class="cx"> bool RenderGrid::needToStretchChildLogicalHeight(const RenderBox&amp; child) const
</span><span class="cx"> {
</span><del>-    if (RenderStyle::resolveAlignment(style(), child.style(), ItemPositionStretch) != ItemPositionStretch)
</del><ins>+    if (child.style().resolvedAlignSelf(style(), selfAlignmentNormalBehavior).position() != ItemPositionStretch)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return isHorizontalWritingMode() &amp;&amp; child.style().height().isAuto();
</span><span class="lines">@@ -1852,7 +1853,7 @@
</span><span class="cx">     bool isHorizontalMode = isHorizontalWritingMode();
</span><span class="cx">     bool hasAutoSizeInColumnAxis = isHorizontalMode ? childStyle.height().isAuto() : childStyle.width().isAuto();
</span><span class="cx">     bool allowedToStretchChildAlongColumnAxis = hasAutoSizeInColumnAxis &amp;&amp; !childStyle.marginBeforeUsing(&amp;gridStyle).isAuto() &amp;&amp; !childStyle.marginAfterUsing(&amp;gridStyle).isAuto();
</span><del>-    if (allowedToStretchChildAlongColumnAxis &amp;&amp; RenderStyle::resolveAlignment(gridStyle, childStyle, ItemPositionStretch) == ItemPositionStretch) {
</del><ins>+    if (allowedToStretchChildAlongColumnAxis &amp;&amp; childStyle.resolvedAlignSelf(style(), selfAlignmentNormalBehavior).position() == ItemPositionStretch) {
</ins><span class="cx">         // TODO (lajava): If the child has orthogonal flow, then it already has an override height set, so use it.
</span><span class="cx">         // TODO (lajava): grid track sizing and positioning do not support orthogonal modes yet.
</span><span class="cx">         if (child.isHorizontalWritingMode() == isHorizontalMode) {
</span><span class="lines">@@ -1933,7 +1934,7 @@
</span><span class="cx">     bool hasOrthogonalWritingMode = child.isHorizontalWritingMode() != isHorizontalWritingMode();
</span><span class="cx">     bool hasSameWritingMode = child.style().writingMode() == style().writingMode();
</span><span class="cx"> 
</span><del>-    switch (RenderStyle::resolveAlignment(style(), child.style(), ItemPositionStretch)) {
</del><ins>+    switch (child.style().resolvedAlignSelf(style(), selfAlignmentNormalBehavior).position()) {
</ins><span class="cx">     case ItemPositionSelfStart:
</span><span class="cx">         // If orthogonal writing-modes, this computes to 'start'.
</span><span class="cx">         // FIXME: grid track sizing and positioning do not support orthogonal modes yet.
</span><span class="lines">@@ -1969,6 +1970,7 @@
</span><span class="cx">         // FIXME: Implement the previous values. For now, we always 'start' align the child.
</span><span class="cx">         return GridAxisStart;
</span><span class="cx">     case ItemPositionAuto:
</span><ins>+    case ItemPositionNormal:
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1982,7 +1984,7 @@
</span><span class="cx">     bool hasSameDirection = child.style().direction() == style().direction();
</span><span class="cx">     bool isLTR = style().isLeftToRightDirection();
</span><span class="cx"> 
</span><del>-    switch (RenderStyle::resolveJustification(style(), child.style(), ItemPositionStretch)) {
</del><ins>+    switch (child.style().resolvedJustifySelf(style(), selfAlignmentNormalBehavior).position()) {
</ins><span class="cx">     case ItemPositionSelfStart:
</span><span class="cx">         // For orthogonal writing-modes, this computes to 'start'
</span><span class="cx">         // FIXME: grid track sizing and positioning do not support orthogonal modes yet.
</span><span class="lines">@@ -2011,6 +2013,7 @@
</span><span class="cx">         // FIXME: Implement the previous values. For now, we always 'start' align the child.
</span><span class="cx">         return GridAxisStart;
</span><span class="cx">     case ItemPositionAuto:
</span><ins>+    case ItemPositionNormal:
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -2040,7 +2043,8 @@
</span><span class="cx">         if (childEndLine &lt; m_rowPositions.size() - 1)
</span><span class="cx">             endOfRow -= guttersSize(ForRows, 2) + m_offsetBetweenRows;
</span><span class="cx">         LayoutUnit childBreadth = child.logicalHeight() + child.marginLogicalHeight();
</span><del>-        LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(RenderStyle::resolveAlignmentOverflow(style(), child.style()), endOfRow - startOfRow, childBreadth);
</del><ins>+        auto overflow = child.style().resolvedAlignSelf(style(), selfAlignmentNormalBehavior).overflow();
+        LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(overflow, endOfRow - startOfRow, childBreadth);
</ins><span class="cx">         return startPosition + (axisPosition == GridAxisEnd ? offsetFromStartPosition : offsetFromStartPosition / 2);
</span><span class="cx">     }
</span><span class="cx">     }
</span><span class="lines">@@ -2072,7 +2076,8 @@
</span><span class="cx">         if (childEndLine &lt; m_columnPositions.size() - 1)
</span><span class="cx">             endOfColumn -= guttersSize(ForColumns, 2) + m_offsetBetweenColumns;
</span><span class="cx">         LayoutUnit childBreadth = child.logicalWidth() + child.marginLogicalWidth();
</span><del>-        LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(RenderStyle::resolveJustificationOverflow(style(), child.style()), endOfColumn - startOfColumn, childBreadth);
</del><ins>+        auto overflow = child.style().resolvedJustifySelf(style(), selfAlignmentNormalBehavior).overflow();
+        LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(overflow, endOfColumn - startOfColumn, childBreadth);
</ins><span class="cx">         return startPosition + (axisPosition == GridAxisEnd ? offsetFromStartPosition : offsetFromStartPosition / 2);
</span><span class="cx">     }
</span><span class="cx">     }
</span><span class="lines">@@ -2134,15 +2139,15 @@
</span><span class="cx"> ContentAlignmentData RenderGrid::computeContentPositionAndDistributionOffset(GridTrackSizingDirection direction, const LayoutUnit&amp; availableFreeSpace, unsigned numberOfGridTracks) const
</span><span class="cx"> {
</span><span class="cx">     bool isRowAxis = direction == ForColumns;
</span><del>-    ContentPosition position = isRowAxis ? style().resolvedJustifyContentPosition(normalValueBehaviorGrid()) : style().resolvedAlignContentPosition(normalValueBehaviorGrid());
-    ContentDistributionType distribution = isRowAxis ? style().resolvedJustifyContentDistribution(normalValueBehaviorGrid()) : style().resolvedAlignContentDistribution(normalValueBehaviorGrid());
</del><ins>+    auto position = isRowAxis ? style().resolvedJustifyContentPosition(contentAlignmentNormalBehaviorGrid()) : style().resolvedAlignContentPosition(contentAlignmentNormalBehaviorGrid());
+    auto distribution = isRowAxis ? style().resolvedJustifyContentDistribution(contentAlignmentNormalBehaviorGrid()) : style().resolvedAlignContentDistribution(contentAlignmentNormalBehaviorGrid());
</ins><span class="cx">     // If &lt;content-distribution&gt; value can't be applied, 'position' will become the associated
</span><span class="cx">     // &lt;content-position&gt; fallback value.
</span><del>-    ContentAlignmentData contentAlignment = contentDistributionOffset(availableFreeSpace, position, distribution, numberOfGridTracks);
</del><ins>+    auto contentAlignment = contentDistributionOffset(availableFreeSpace, position, distribution, numberOfGridTracks);
</ins><span class="cx">     if (contentAlignment.isValid())
</span><span class="cx">         return contentAlignment;
</span><span class="cx"> 
</span><del>-    OverflowAlignment overflow = isRowAxis ? style().justifyContentOverflowAlignment() : style().alignContentOverflowAlignment();
</del><ins>+    auto overflow = isRowAxis ? style().justifyContentOverflowAlignment() : style().alignContentOverflowAlignment();
</ins><span class="cx">     if (availableFreeSpace &lt;= 0 &amp;&amp; overflow == OverflowAlignmentSafe)
</span><span class="cx">         return {0, 0};
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -190,40 +190,46 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline StyleSelfAlignmentData resolveAlignmentData(const RenderStyle&amp; parentStyle, const RenderStyle&amp; childStyle, ItemPosition resolvedAutoPositionForRenderer)
</del><ins>+static StyleSelfAlignmentData resolvedSelfAlignment(const StyleSelfAlignmentData&amp; value, ItemPosition normalValueBehavior)
</ins><span class="cx"> {
</span><del>-    // The auto keyword computes to the parent's align-items computed value, or to &quot;stretch&quot;, if not set or &quot;auto&quot;.
-    if (childStyle.alignSelfPosition() == ItemPositionAuto)
-        return (parentStyle.alignItemsPosition() == ItemPositionAuto) ? StyleSelfAlignmentData(resolvedAutoPositionForRenderer, OverflowAlignmentDefault) : parentStyle.alignItems();
-    return childStyle.alignSelf();
</del><ins>+    ASSERT(value.position() != ItemPositionAuto);
+    if (value.position() == ItemPositionNormal)
+        return { normalValueBehavior, OverflowAlignmentDefault };
+    return value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline StyleSelfAlignmentData resolveJustificationData(const RenderStyle&amp; parentStyle, const RenderStyle&amp; childStyle, ItemPosition resolvedAutoPositionForRenderer)
</del><ins>+StyleSelfAlignmentData RenderStyle::resolvedAlignItems(ItemPosition normalValueBehaviour) const
</ins><span class="cx"> {
</span><del>-    // The auto keyword computes to the parent's justify-items computed value, or to &quot;stretch&quot;, if not set or &quot;auto&quot;.
-    if (childStyle.justifySelfPosition() == ItemPositionAuto)
-        return (parentStyle.justifyItemsPosition() == ItemPositionAuto) ? StyleSelfAlignmentData(resolvedAutoPositionForRenderer, OverflowAlignmentDefault) : parentStyle.justifyItems();
-    return childStyle.justifySelf();
</del><ins>+    return resolvedSelfAlignment(alignItems(), normalValueBehaviour);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-ItemPosition RenderStyle::resolveAlignment(const RenderStyle&amp; parentStyle, const RenderStyle&amp; childStyle, ItemPosition resolvedAutoPositionForRenderer)
</del><ins>+StyleSelfAlignmentData RenderStyle::resolvedAlignSelf(const RenderStyle&amp; parentStyle, ItemPosition normalValueBehaviour) const
</ins><span class="cx"> {
</span><del>-    return resolveAlignmentData(parentStyle, childStyle, resolvedAutoPositionForRenderer).position();
</del><ins>+    // The auto keyword computes to the parent's align-items computed value.
+    // We will return the behaviour of 'normal' value if needed, which is specific of each layout model.
+    if (alignSelfPosition() == ItemPositionAuto)
+        return parentStyle.resolvedAlignItems(normalValueBehaviour);
+    return resolvedSelfAlignment(alignSelf(), normalValueBehaviour);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-OverflowAlignment RenderStyle::resolveAlignmentOverflow(const RenderStyle&amp; parentStyle, const RenderStyle&amp; childStyle)
</del><ins>+StyleSelfAlignmentData RenderStyle::resolvedJustifyItems(ItemPosition normalValueBehaviour) const
</ins><span class="cx"> {
</span><del>-    return resolveAlignmentData(parentStyle, childStyle, ItemPositionStretch).overflow();
-}
</del><ins>+    // FIXME: justify-items 'auto' value is allowed only to provide the 'legacy' keyword's behavior, which it's still not implemented for layout.
+    // &quot;If the inherited value of justify-items includes the legacy keyword, auto computes to the inherited value.&quot;
+    // https://drafts.csswg.org/css-align/#justify-items-property
+    if (justifyItemsPosition() == ItemPositionAuto)
+        return { normalValueBehaviour, OverflowAlignmentDefault };
</ins><span class="cx"> 
</span><del>-ItemPosition RenderStyle::resolveJustification(const RenderStyle&amp; parentStyle, const RenderStyle&amp; childStyle, ItemPosition resolvedAutoPositionForRenderer)
-{
-    return resolveJustificationData(parentStyle, childStyle, resolvedAutoPositionForRenderer).position();
</del><ins>+    return resolvedSelfAlignment(justifyItems(), normalValueBehaviour);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-OverflowAlignment RenderStyle::resolveJustificationOverflow(const RenderStyle&amp; parentStyle, const RenderStyle&amp; childStyle)
</del><ins>+StyleSelfAlignmentData RenderStyle::resolvedJustifySelf(const RenderStyle&amp; parentStyle, ItemPosition normalValueBehaviour) const
</ins><span class="cx"> {
</span><del>-    return resolveJustificationData(parentStyle, childStyle, ItemPositionStretch).overflow();
</del><ins>+    // The auto keyword computes to the parent's justify-items computed value.
+    // We will return the behaviour of 'normal' value if needed, which is specific of each layout model.
+    if (justifySelfPosition() == ItemPositionAuto)
+        return parentStyle.resolvedJustifyItems(normalValueBehaviour);
+    return resolvedSelfAlignment(justifySelf(), normalValueBehaviour);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline ContentPosition resolvedContentAlignmentPosition(const StyleContentAlignmentData&amp; value, const StyleContentAlignmentData&amp; normalValueBehavior)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -508,10 +508,10 @@
</span><span class="cx">     ContentDistributionType resolvedJustifyContentDistribution(const StyleContentAlignmentData&amp; normalValueBehavior) const;
</span><span class="cx">     ContentPosition resolvedAlignContentPosition(const StyleContentAlignmentData&amp; normalValueBehavior) const;
</span><span class="cx">     ContentDistributionType resolvedAlignContentDistribution(const StyleContentAlignmentData&amp; normalValueBehavior) const;
</span><del>-    static ItemPosition resolveAlignment(const RenderStyle&amp; parentStyle, const RenderStyle&amp; childStyle, ItemPosition resolvedAutoPositionForRenderer);
-    static OverflowAlignment resolveAlignmentOverflow(const RenderStyle&amp; parentStyle, const RenderStyle&amp; childStyle);
-    static ItemPosition resolveJustification(const RenderStyle&amp; parentStyle, const RenderStyle&amp; childStyle, ItemPosition resolvedAutoPositionForRenderer);
-    static OverflowAlignment resolveJustificationOverflow(const RenderStyle&amp; parentStyle, const RenderStyle&amp; childStyle);
</del><ins>+    StyleSelfAlignmentData resolvedAlignItems(ItemPosition normalValueBehaviour) const;
+    StyleSelfAlignmentData resolvedAlignSelf(const RenderStyle&amp; parentStyle, ItemPosition normalValueBehaviour) const;
+    StyleSelfAlignmentData resolvedJustifyItems(ItemPosition normalValueBehaviour) const;
+    StyleSelfAlignmentData resolvedJustifySelf(const RenderStyle&amp; parentStyle, ItemPosition normalValueBehaviour) const;
</ins><span class="cx"> 
</span><span class="cx">     enum IsAtShadowBoundary {
</span><span class="cx">         AtShadowBoundary,
</span><span class="lines">@@ -2004,6 +2004,7 @@
</span><span class="cx">     static Length initialFlexBasis() { return Length(Auto); }
</span><span class="cx">     static int initialOrder() { return 0; }
</span><span class="cx">     static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlignmentData(ItemPositionAuto, OverflowAlignmentDefault); }
</span><ins>+    static StyleSelfAlignmentData initialDefaultAlignment() { return StyleSelfAlignmentData(ItemPositionNormal, OverflowAlignmentDefault); }
</ins><span class="cx">     static StyleContentAlignmentData initialContentAlignment() { return StyleContentAlignmentData(ContentPositionNormal, ContentDistributionDefault, OverflowAlignmentDefault); }
</span><span class="cx">     static EFlexDirection initialFlexDirection() { return FlowRow; }
</span><span class="cx">     static EFlexWrap initialFlexWrap() { return FlexNoWrap; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleConstantsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -254,11 +254,11 @@
</span><span class="cx"> enum EAlignContent { AlignContentFlexStart, AlignContentFlexEnd, AlignContentCenter, AlignContentSpaceBetween, AlignContentSpaceAround, AlignContentStretch };
</span><span class="cx"> enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse };
</span><span class="cx"> enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse };
</span><del>-enum ItemPosition {ItemPositionAuto, ItemPositionStretch, ItemPositionBaseline, ItemPositionLastBaseline, ItemPositionCenter, ItemPositionStart, ItemPositionEnd, ItemPositionSelfStart, ItemPositionSelfEnd, ItemPositionFlexStart, ItemPositionFlexEnd, ItemPositionLeft, ItemPositionRight};
-enum OverflowAlignment {OverflowAlignmentDefault, OverflowAlignmentUnsafe, OverflowAlignmentSafe};
-enum ItemPositionType {NonLegacyPosition, LegacyPosition};
-enum ContentPosition {ContentPositionNormal, ContentPositionBaseline, ContentPositionLastBaseline, ContentPositionCenter, ContentPositionStart, ContentPositionEnd, ContentPositionFlexStart, ContentPositionFlexEnd, ContentPositionLeft, ContentPositionRight};
-enum ContentDistributionType {ContentDistributionDefault, ContentDistributionSpaceBetween, ContentDistributionSpaceAround, ContentDistributionSpaceEvenly, ContentDistributionStretch};
</del><ins>+enum ItemPosition { ItemPositionAuto, ItemPositionNormal, ItemPositionStretch, ItemPositionBaseline, ItemPositionLastBaseline, ItemPositionCenter, ItemPositionStart, ItemPositionEnd, ItemPositionSelfStart, ItemPositionSelfEnd, ItemPositionFlexStart, ItemPositionFlexEnd, ItemPositionLeft, ItemPositionRight };
+enum OverflowAlignment { OverflowAlignmentDefault, OverflowAlignmentUnsafe, OverflowAlignmentSafe };
+enum ItemPositionType { NonLegacyPosition, LegacyPosition };
+enum ContentPosition { ContentPositionNormal, ContentPositionBaseline, ContentPositionLastBaseline, ContentPositionCenter, ContentPositionStart, ContentPositionEnd, ContentPositionFlexStart, ContentPositionFlexEnd, ContentPositionLeft, ContentPositionRight };
+enum ContentDistributionType { ContentDistributionDefault, ContentDistributionSpaceBetween, ContentDistributionSpaceAround, ContentDistributionSpaceEvenly, ContentDistributionStretch };
</ins><span class="cx"> 
</span><span class="cx"> enum ETextSecurity {
</span><span class="cx">     TSNONE, TSDISC, TSCIRCLE, TSSQUARE
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareNonInheritedDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (201497 => 201498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp        2016-05-30 06:53:36 UTC (rev 201497)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp        2016-05-30 08:14:31 UTC (rev 201498)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     , m_flowThread(RenderStyle::initialFlowThread())
</span><span class="cx">     , m_regionThread(RenderStyle::initialRegionThread())
</span><span class="cx">     , m_alignContent(RenderStyle::initialContentAlignment())
</span><del>-    , m_alignItems(RenderStyle::initialSelfAlignment())
</del><ins>+    , m_alignItems(RenderStyle::initialDefaultAlignment())
</ins><span class="cx">     , m_alignSelf(RenderStyle::initialSelfAlignment())
</span><span class="cx">     , m_justifyContent(RenderStyle::initialContentAlignment())
</span><span class="cx">     , m_justifyItems(RenderStyle::initialSelfAlignment())
</span></span></pre>
</div>
</div>

</body>
</html>