<!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>[183660] 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/183660">183660</a></dd>
<dt>Author</dt> <dd>jfernandez@igalia.com</dd>
<dt>Date</dt> <dd>2015-04-30 18:14:20 -0700 (Thu, 30 Apr 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>[CSS Grid Layout] overflow-position keyword for align and justify properties.
https://bugs.webkit.org/show_bug.cgi?id=144235
Reviewed by Sergio Villar Senin.
Source/WebCore:
When the alignment subject is larger than the alignment container,
it will overflow. Some alignment modes, if honored in this
situation, may cause data loss; an overflow alignment mode can be
explicitly specified to avoid this.
This patch implements overflow-keyword handling for Grid Layout on
align-self and justify-self properties.
Test: fast/css-grid-layout/grid-align-justify-overflow.html
* rendering/RenderGrid.cpp:
(WebCore::computeOverflowAlignmentOffset):
(WebCore::RenderGrid::rowPositionForChild):
(WebCore::RenderGrid::columnPositionForChild):
(WebCore::RenderGrid::rowAxisPositionForChild): Deleted.
* rendering/style/RenderStyle.cpp:
(WebCore::resolveAlignmentData):
(WebCore::resolveJustificationData):
(WebCore::RenderStyle::resolveAlignment):
(WebCore::RenderStyle::resolveAlignmentOverflow):
(WebCore::RenderStyle::resolveJustification):
(WebCore::RenderStyle::resolveJustificationOverflow):
* rendering/style/RenderStyle.h:
LayoutTests:
Implementation of overflow-keyword handling for Grid Layout on
align-self and justify-self properties.
* fast/css-grid-layout/grid-align-justify-overflow-expected.txt: Added.
* fast/css-grid-layout/grid-align-justify-overflow.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#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>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridalignjustifyoverflowexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-align-justify-overflow-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridalignjustifyoverflowhtml">trunk/LayoutTests/fast/css-grid-layout/grid-align-justify-overflow.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (183659 => 183660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-05-01 01:10:43 UTC (rev 183659)
+++ trunk/LayoutTests/ChangeLog        2015-05-01 01:14:20 UTC (rev 183660)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-04-30 Javier Fernandez <jfernandez@igalia.com>
+
+ [CSS Grid Layout] overflow-position keyword for align and justify properties.
+ https://bugs.webkit.org/show_bug.cgi?id=144235
+
+ Reviewed by Sergio Villar Senin.
+
+ Implementation of overflow-keyword handling for Grid Layout on
+ align-self and justify-self properties.
+
+ * fast/css-grid-layout/grid-align-justify-overflow-expected.txt: Added.
+ * fast/css-grid-layout/grid-align-justify-overflow.html: Added.
+
</ins><span class="cx"> 2015-04-30 Jon Davis <jond@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: console should show an icon for console.info() messages
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridalignjustifyoverflowexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-align-justify-overflow-expected.txt (0 => 183660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-align-justify-overflow-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-align-justify-overflow-expected.txt        2015-05-01 01:14:20 UTC (rev 183660)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This test checks that the 'overflow' keyword is applied correctly for 'align' and 'justify' properties.
+
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridalignjustifyoverflowhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-align-justify-overflow.html (0 => 183660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-align-justify-overflow.html         (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-align-justify-overflow.html        2015-05-01 01:14:20 UTC (rev 183660)
</span><span class="lines">@@ -0,0 +1,150 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<link href="resources/grid.css" rel="stylesheet">
+<script src="../../resources/check-layout.js"></script>
+<style>
+body {
+ margin: 0;
+}
+.grid {
+ -webkit-grid-template-columns: 150px 150px;
+ -webkit-grid-template-rows: 120px 120px 120px;
+ width: -webkit-fit-content;
+ margin-bottom: 20px;
+}
+.cellOverflowWidth {
+ width: 180px;
+ height: 40px;
+}
+.cellOverflowHeight {
+ width: 50px;
+ height: 150px;
+}
+.cellWithNoOverflow {
+ width: 50px;
+ height: 40px;
+}
+.alignItemsCenter { align-items: center; }
+.alignItemsCenterSafe { align-items: center safe; }
+.alignItemsCenterTrue { align-items: center true; }
+.alignItemsEnd { align-items: end; }
+.alignItemsEndSafe { align-items: end safe; }
+.alignItemsEndTrue { align-items: end true; }
+.alignSelfCenter { align-self: center; }
+.alignSelfCenterSafe { align-self: center safe; }
+.alignSelfCenterTrue { align-self: center true; }
+.alignSelfEnd { align-self: end; }
+.alignSelfEndSafe { align-self: end safe; }
+.alignSelfEndTrue { align-self: end true; }
+.justifyItemsCenter { justify-items: center; }
+.justifyItemsCenterSafe { justify-items: center safe; }
+.justifyItemsCenterTrue { justify-items: center true; }
+.justifyItemsEnd { justify-items: end; }
+.justifyItemsEndSafe { justify-items: end safe; }
+.justifyItemsEndTrue { justify-items: end true; }
+.justifySelfCenter { justify-self: center; }
+.justifySelfCenterSafe { justify-self: center safe; }
+.justifySelfCenterTrue { justify-self: center true; }
+.justifySelfEnd { justify-self: end; }
+.thirdRowFirstColumn {
+ background-color: green;
+ -webkit-grid-column: 1;
+ -webkit-grid-row: 3;
+}
+</style>
+</head>
+<body onload="checkLayout('.grid')">
+
+<p>This test checks that the 'overflow' keyword is applied correctly for 'align' and 'justify' properties.</p>
+
+<div style="position: relative">
+ <div class="grid alignItemsCenter justifyItemsCenter" data-expected-width="300" data-expected-height="360">
+ <div class="cellOverflowWidth firstRowFirstColumn" data-offset-x="-15" data-offset-y="40" data-expected-width="180" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow secondRowFirstColumn" data-offset-x="50" data-offset-y="160" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowFirstColumn" data-offset-x="50" data-offset-y="280" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow firstRowSecondColumn" data-offset-x="200" data-offset-y="40" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellOverflowWidth secondRowSecondColumn" data-offset-x="135" data-offset-y="160" data-expected-width="180" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowSecondColumn" data-offset-x="200" data-offset-y="280" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid alignItemsCenterTrue justifyItemsCenterTrue" data-expected-width="300" data-expected-height="360">
+ <div class="cellOverflowHeight firstRowFirstColumn" data-offset-x="50" data-offset-y="-15" data-expected-width="50" data-expected-height="150"></div>
+ <div class="cellWithNoOverflow secondRowFirstColumn" data-offset-x="50" data-offset-y="160" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowFirstColumn" data-offset-x="50" data-offset-y="280" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow firstRowSecondColumn" data-offset-x="200" data-offset-y="40" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellOverflowHeight secondRowSecondColumn" data-offset-x="200" data-offset-y="105" data-expected-width="50" data-expected-height="150"></div>
+ <div class="cellWithNoOverflow thirdRowSecondColumn" data-offset-x="200" data-offset-y="280" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid alignItemsCenterSafe justifyItemsCenterSafe" data-expected-width="300" data-expected-height="360">
+ <div class="cellOverflowWidth firstRowFirstColumn" data-offset-x="0" data-offset-y="40" data-expected-width="180" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow secondRowFirstColumn" data-offset-x="50" data-offset-y="160" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowFirstColumn" data-offset-x="50" data-offset-y="280" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow firstRowSecondColumn" data-offset-x="200" data-offset-y="40" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellOverflowWidth secondRowSecondColumn" data-offset-x="150" data-offset-y="160" data-expected-width="180" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowSecondColumn" data-offset-x="200" data-offset-y="280" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid alignItemsCenterSafe justifyItemsCenterSafe" data-expected-width="300" data-expected-height="360">
+ <div class="cellOverflowHeight firstRowFirstColumn" data-offset-x="50" data-offset-y="0" data-expected-width="50" data-expected-height="150"></div>
+ <div class="cellWithNoOverflow secondRowFirstColumn" data-offset-x="50" data-offset-y="160" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowFirstColumn" data-offset-x="50" data-offset-y="280" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow firstRowSecondColumn" data-offset-x="200" data-offset-y="40" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellOverflowHeight secondRowSecondColumn alignSelfCenterSafe justifySelfCenterSafe" data-offset-x="200" data-offset-y="120" data-expected-width="50" data-expected-height="150"></div>
+ <div class="cellWithNoOverflow thirdRowSecondColumn" data-offset-x="200" data-offset-y="280" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid alignItemsEnd justifyItemsEnd" data-expected-width="300" data-expected-height="360">
+ <div class="cellOverflowWidth firstRowFirstColumn" data-offset-x="-30" data-offset-y="80" data-expected-width="180" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow secondRowFirstColumn justifySelfCenter" data-offset-x="50" data-offset-y="200" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowFirstColumn" data-offset-x="100" data-offset-y="320" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow firstRowSecondColumn" data-offset-x="250" data-offset-y="80" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellOverflowWidth secondRowSecondColumn" data-offset-x="120" data-offset-y="200" data-expected-width="180" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowSecondColumn" data-offset-x="250" data-offset-y="320" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid alignItemsEndTrue justifyItemsEndTrue" data-expected-width="300" data-expected-height="360">
+ <div class="cellOverflowHeight firstRowFirstColumn" data-offset-x="100" data-offset-y="-30" data-expected-width="50" data-expected-height="150"></div>
+ <div class="cellWithNoOverflow secondRowFirstColumn" data-offset-x="100" data-offset-y="200" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowFirstColumn" data-offset-x="100" data-offset-y="320" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow firstRowSecondColumn alignSelfCenter" data-offset-x="250" data-offset-y="40" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellOverflowHeight secondRowSecondColumn" data-offset-x="250" data-offset-y="90" data-expected-width="50" data-expected-height="150"></div>
+ <div class="cellWithNoOverflow thirdRowSecondColumn" data-offset-x="250" data-offset-y="320" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid alignItemsEndSafe justifyItemsEndSafe" data-expected-width="300" data-expected-height="360">
+ <div class="cellOverflowWidth firstRowFirstColumn" data-offset-x="0" data-offset-y="80" data-expected-width="180" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow secondRowFirstColumn justifySelfCenterTrue" data-offset-x="50" data-offset-y="200" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowFirstColumn" data-offset-x="100" data-offset-y="320" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow firstRowSecondColumn" data-offset-x="250" data-offset-y="80" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellOverflowWidth secondRowSecondColumn" data-offset-x="150" data-offset-y="200" data-expected-width="180" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowSecondColumn" data-offset-x="250" data-offset-y="320" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid alignItemsEndSafe justifyItemsEndSafe" data-expected-width="300" data-expected-height="360">
+ <div class="cellOverflowHeight firstRowFirstColumn" data-offset-x="100" data-offset-y="0" data-expected-width="50" data-expected-height="150"></div>
+ <div class="cellWithNoOverflow secondRowFirstColumn" data-offset-x="100" data-offset-y="200" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow thirdRowFirstColumn" data-offset-x="100" data-offset-y="320" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellWithNoOverflow firstRowSecondColumn alignSelfCenterTrue" data-offset-x="250" data-offset-y="40" data-expected-width="50" data-expected-height="40"></div>
+ <div class="cellOverflowHeight secondRowSecondColumn" data-offset-x="250" data-offset-y="120" data-expected-width="50" data-expected-height="150"></div>
+ <div class="cellWithNoOverflow thirdRowSecondColumn" data-offset-x="250" data-offset-y="320" data-expected-width="50" data-expected-height="40"></div>
+ </div>
+</div>
+
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183659 => 183660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-05-01 01:10:43 UTC (rev 183659)
+++ trunk/Source/WebCore/ChangeLog        2015-05-01 01:14:20 UTC (rev 183660)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2015-04-30 Javier Fernandez <jfernandez@igalia.com>
+
+ [CSS Grid Layout] overflow-position keyword for align and justify properties.
+ https://bugs.webkit.org/show_bug.cgi?id=144235
+
+ Reviewed by Sergio Villar Senin.
+
+ When the alignment subject is larger than the alignment container,
+ it will overflow. Some alignment modes, if honored in this
+ situation, may cause data loss; an overflow alignment mode can be
+ explicitly specified to avoid this.
+
+ This patch implements overflow-keyword handling for Grid Layout on
+ align-self and justify-self properties.
+
+ Test: fast/css-grid-layout/grid-align-justify-overflow.html
+
+ * rendering/RenderGrid.cpp:
+ (WebCore::computeOverflowAlignmentOffset):
+ (WebCore::RenderGrid::rowPositionForChild):
+ (WebCore::RenderGrid::columnPositionForChild):
+ (WebCore::RenderGrid::rowAxisPositionForChild): Deleted.
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::resolveAlignmentData):
+ (WebCore::resolveJustificationData):
+ (WebCore::RenderStyle::resolveAlignment):
+ (WebCore::RenderStyle::resolveAlignmentOverflow):
+ (WebCore::RenderStyle::resolveJustification):
+ (WebCore::RenderStyle::resolveJustificationOverflow):
+ * rendering/style/RenderStyle.h:
+
</ins><span class="cx"> 2015-04-30 Jon Honeycutt <jhoneycutt@apple.com>
</span><span class="cx">
</span><span class="cx"> Rebaseline bindings tests results after r183648.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (183659 => 183660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp        2015-05-01 01:10:43 UTC (rev 183659)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp        2015-05-01 01:14:20 UTC (rev 183660)
</span><span class="lines">@@ -1238,6 +1238,26 @@
</span><span class="cx"> m_rowPositions[i + 1] = m_rowPositions[i] + sizingData.rowTracks[i].baseSize();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline LayoutUnit computeOverflowAlignmentOffset(OverflowAlignment overflow, LayoutUnit trackBreadth, LayoutUnit childBreadth)
+{
+ LayoutUnit offset = trackBreadth - childBreadth;
+ switch (overflow) {
+ case OverflowAlignmentSafe:
+ // If overflow is 'safe', we have to make sure we don't overflow the 'start'
+ // edge (potentially cause some data loss as the overflow is unreachable).
+ return std::max<LayoutUnit>(0, offset);
+ case OverflowAlignmentTrue:
+ case OverflowAlignmentDefault:
+ // If we overflow our alignment container and overflow is 'true' (default), we
+ // ignore the overflow and just return the value regardless (which may cause data
+ // loss as we overflow the 'start' edge).
+ return offset;
+ }
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
</ins><span class="cx"> bool RenderGrid::allowedToStretchLogicalHeightForChild(const RenderBox& child) const
</span><span class="cx"> {
</span><span class="cx"> return child.style().logicalHeight().isAuto() && !child.style().marginBeforeUsing(&style()).isAuto() && !child.style().marginAfterUsing(&style()).isAuto();
</span><span class="lines">@@ -1385,8 +1405,7 @@
</span><span class="cx"> LayoutUnit startOfRow = m_rowPositions[coordinate.rows.resolvedInitialPosition.toInt()];
</span><span class="cx"> LayoutUnit endOfRow = m_rowPositions[coordinate.rows.resolvedFinalPosition.next().toInt()];
</span><span class="cx"> LayoutUnit startPosition = startOfRow + marginBeforeForChild(child);
</span><del>- // FIXME: This should account for the grid item's <overflow-position>.
- LayoutUnit offsetFromStartPosition = endOfRow - startOfRow - child.logicalHeight() - child.marginLogicalHeight();
</del><ins>+ LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(RenderStyle::resolveAlignmentOverflow(style(), child.style()), endOfRow - startOfRow, child.logicalHeight() + child.marginLogicalHeight());
</ins><span class="cx">
</span><span class="cx"> switch (columnAxisPositionForChild(child)) {
</span><span class="cx"> case GridAxisStart:
</span><span class="lines">@@ -1408,8 +1427,7 @@
</span><span class="cx"> LayoutUnit startOfColumn = m_columnPositions[coordinate.columns.resolvedInitialPosition.toInt()];
</span><span class="cx"> LayoutUnit endOfColumn = m_columnPositions[coordinate.columns.resolvedFinalPosition.next().toInt()];
</span><span class="cx"> LayoutUnit startPosition = startOfColumn + marginStartForChild(child);
</span><del>- // FIXME: This should account for the grid item's <overflow-position>.
- LayoutUnit offsetFromStartPosition = endOfColumn - startOfColumn - child.logicalWidth() - child.marginLogicalWidth();
</del><ins>+ LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(RenderStyle::resolveJustificationOverflow(style(), child.style()), endOfColumn - startOfColumn, child.logicalWidth() + child.marginLogicalWidth());
</ins><span class="cx">
</span><span class="cx"> switch (rowAxisPositionForChild(child)) {
</span><span class="cx"> case GridAxisStart:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (183659 => 183660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2015-05-01 01:10:43 UTC (rev 183659)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2015-05-01 01:14:20 UTC (rev 183660)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include "StyleInheritedData.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "StyleScrollSnapPoints.h"
</span><ins>+#include "StyleSelfAlignmentData.h"
</ins><span class="cx"> #include <wtf/MathExtras.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <algorithm>
</span><span class="lines">@@ -171,21 +172,42 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ItemPosition RenderStyle::resolveAlignment(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer)
</del><ins>+static inline StyleSelfAlignmentData resolveAlignmentData(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer)
</ins><span class="cx"> {
</span><span class="cx"> // The auto keyword computes to the parent's align-items computed value, or to "stretch", if not set or "auto".
</span><span class="cx"> if (childStyle.alignSelfPosition() == ItemPositionAuto)
</span><del>- return (parentStyle.alignItemsPosition() == ItemPositionAuto) ? resolvedAutoPositionForRenderer : parentStyle.alignItemsPosition();
- return childStyle.alignSelfPosition();
</del><ins>+ return (parentStyle.alignItemsPosition() == ItemPositionAuto) ? StyleSelfAlignmentData(resolvedAutoPositionForRenderer, OverflowAlignmentDefault) : parentStyle.alignItems();
+ return childStyle.alignSelf();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ItemPosition RenderStyle::resolveJustification(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject)
</del><ins>+static inline StyleSelfAlignmentData resolveJustificationData(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer)
</ins><span class="cx"> {
</span><ins>+ // The auto keyword computes to the parent's justify-items computed value, or to "stretch", if not set or "auto".
</ins><span class="cx"> if (childStyle.justifySelfPosition() == ItemPositionAuto)
</span><del>- return (parentStyle.justifyItemsPosition() == ItemPositionAuto) ? resolvedAutoPositionForLayoutObject : parentStyle.justifyItemsPosition();
- return childStyle.justifySelfPosition();
</del><ins>+ return (parentStyle.justifyItemsPosition() == ItemPositionAuto) ? StyleSelfAlignmentData(resolvedAutoPositionForRenderer, OverflowAlignmentDefault) : parentStyle.justifyItems();
+ return childStyle.justifySelf();
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ItemPosition RenderStyle::resolveAlignment(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer)
+{
+ return resolveAlignmentData(parentStyle, childStyle, resolvedAutoPositionForRenderer).position();
+}
+
+OverflowAlignment RenderStyle::resolveAlignmentOverflow(const RenderStyle& parentStyle, const RenderStyle& childStyle)
+{
+ return resolveJustificationData(parentStyle, childStyle, ItemPositionStretch).overflow();
+}
+
+ItemPosition RenderStyle::resolveJustification(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer)
+{
+ return resolveJustificationData(parentStyle, childStyle, resolvedAutoPositionForRenderer).position();
+}
+
+OverflowAlignment RenderStyle::resolveJustificationOverflow(const RenderStyle& parentStyle, const RenderStyle& childStyle)
+{
+ return resolveJustificationData(parentStyle, childStyle, ItemPositionStretch).overflow();
+}
+
</ins><span class="cx"> void RenderStyle::inheritFrom(const RenderStyle* inheritParent, IsAtShadowBoundary isAtShadowBoundary)
</span><span class="cx"> {
</span><span class="cx"> if (isAtShadowBoundary == AtShadowBoundary) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (183659 => 183660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2015-05-01 01:10:43 UTC (rev 183659)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2015-05-01 01:14:20 UTC (rev 183660)
</span><span class="lines">@@ -492,7 +492,9 @@
</span><span class="cx"> static Ref<RenderStyle> createStyleInheritingFromPseudoStyle(const RenderStyle& pseudoStyle);
</span><span class="cx">
</span><span class="cx"> static ItemPosition resolveAlignment(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer);
</span><del>- static ItemPosition resolveJustification(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject);
</del><ins>+ static OverflowAlignment resolveAlignmentOverflow(const RenderStyle& parentStyle, const RenderStyle& childStyle);
+ static ItemPosition resolveJustification(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer);
+ static OverflowAlignment resolveJustificationOverflow(const RenderStyle& parentStyle, const RenderStyle& childStyle);
</ins><span class="cx">
</span><span class="cx"> enum IsAtShadowBoundary {
</span><span class="cx"> AtShadowBoundary,
</span></span></pre>
</div>
</div>
</body>
</html>