<!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>[238457] 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/238457">238457</a></dd>
<dt>Author</dt> <dd>jfernandez@igalia.com</dd>
<dt>Date</dt> <dd>2018-11-23 03:04:23 -0800 (Fri, 23 Nov 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-grid] Implement Baseline Alignment for grid items
https://bugs.webkit.org/show_bug.cgi?id=145566

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Updated test expectations of severla tests, that are now passing with the new code.

* resources/import-expectations.json:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-001-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-002-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-003-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-004-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-005-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-006-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-007-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-008-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-001-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-002-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-003-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-004-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-001-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-002-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-003-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-004-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-001-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-002-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003-expected.txt:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-007.html:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-008.html:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-009.html:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-010.html:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-011.html:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-012.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-lr-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-rl-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt:

Source/WebCore:

This patch impements the Baseline Self-Alignment feature for grid items according to
the CSS Box Alignment specification [1].

This new layout logic is handled by the Self-Alignment (justify-self and align-self)
and Default-Alignment (justify-items and align-items) CSS properties.

This feature allows users to align the grid items sharing a Baseline Alignment Context,
either row or column contexts, based on their respective baselines.

[1] https://drafts.csswg.org/css-align-3/#baseline-align-self

Tests: fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html
       fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html
       fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html
       fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html
       fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html
       fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html

* Sources.txt:
* rendering/GridBaselineAlignment.cpp: Added.
(WebCore::GridBaselineAlignment::marginOverForChild const):
(WebCore::GridBaselineAlignment::marginUnderForChild const):
(WebCore::GridBaselineAlignment::logicalAscentForChild const):
(WebCore::GridBaselineAlignment::ascentForChild const):
(WebCore::GridBaselineAlignment::descentForChild const):
(WebCore::GridBaselineAlignment::isDescentBaselineForChild const):
(WebCore::GridBaselineAlignment::isHorizontalBaselineAxis const):
(WebCore::GridBaselineAlignment::isOrthogonalChildForBaseline const):
(WebCore::GridBaselineAlignment::isParallelToBaselineAxisForChild const):
(WebCore::GridBaselineAlignment::baselineGroupForChild const):
(WebCore::GridBaselineAlignment::updateBaselineAlignmentContext):
(WebCore::GridBaselineAlignment::baselineOffsetForChild const):
(WebCore::GridBaselineAlignment::clear):
(WebCore::BaselineGroup::BaselineGroup):
(WebCore::BaselineGroup::update):
(WebCore::BaselineGroup::isOppositeBlockFlow const):
(WebCore::BaselineGroup::isOrthogonalBlockFlow const):
(WebCore::BaselineGroup::isCompatible const):
(WebCore::BaselineContext::BaselineContext):
(WebCore::BaselineContext::sharedGroup const):
(WebCore::BaselineContext::updateSharedGroup):
(WebCore::BaselineContext::findCompatibleSharedGroup):
* rendering/GridBaselineAlignment.h: Added.
(WebCore::BaselineGroup::maxAscent const):
(WebCore::BaselineGroup::maxDescent const):
(WebCore::BaselineGroup::size const):
(WebCore::isBaselinePosition):
(WebCore::GridBaselineAlignment::setBlockFlow):
* rendering/GridLayoutFunctions.h:
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::gridAxisForDirection):
(WebCore::gridDirectionForAxis):
(WebCore::GridTrackSizingAlgorithm::availableSpace const):
(WebCore::GridTrackSizingAlgorithm::isIntrinsicSizedGridArea const):
(WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithm::canParticipateInBaselineAlignment const):
(WebCore::GridTrackSizingAlgorithm::participateInBaselineAlignment const):
(WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext):
(WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const):
(WebCore::GridTrackSizingAlgorithm::clearBaselineItemsCache):
(WebCore::GridTrackSizingAlgorithm::cacheBaselineAlignedItem):
(WebCore::GridTrackSizingAlgorithm::copyBaselineItemsCache):
(WebCore::GridTrackSizingAlgorithm::setup):
(WebCore::GridTrackSizingAlgorithm::computeBaselineAlignmentContext):
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::placeItemsOnGrid const):
(WebCore::RenderGrid::performGridItemsPreLayout const):
(WebCore::synthesizedBaselineFromMarginBox):
(WebCore::RenderGrid::isBaselineAlignmentForChild const):
(WebCore::RenderGrid::baselinePosition const):
(WebCore::RenderGrid::firstLineBaseline const):
(WebCore::RenderGrid::inlineBlockBaseline const):
(WebCore::RenderGrid::columnAxisBaselineOffsetForChild const):
(WebCore::RenderGrid::rowAxisBaselineOffsetForChild const):
(WebCore::RenderGrid::columnAxisOffsetForChild const):
(WebCore::RenderGrid::rowAxisOffsetForChild const):
* rendering/RenderGrid.h:

LayoutTests:

Most of the baseline realated tests pass now; just a few still fail because of unrelated bugs.

* TestExpectations: Removed several entries, related to the baseline tests that are now passing.
* fast/css-grid-layout/grid-align-baseline-expected.txt:
* fast/css-grid-layout/grid-align-baseline-vertical-expected.txt:
* fast/css-grid-layout/grid-baseline-expected.html:
* fast/css-grid-layout/grid-baseline-margins-expected.html:
* fast/css-grid-layout/grid-baseline-margins.html:
* fast/css-grid-layout/grid-baseline-must-respect-grid-order-expected.txt:
* fast/css-grid-layout/grid-baseline-must-respect-grid-order.html:
* fast/css-grid-layout/grid-baseline.html:
* fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-two-dimensional-expected.txt:
* fast/css-grid-layout/grid-self-baseline-two-dimensional.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridalignbaselineexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-align-baseline-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridalignbaselineverticalexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-align-baseline-vertical-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridbaselineexpectedhtml">trunk/LayoutTests/fast/css-grid-layout/grid-baseline-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridbaselinemarginsexpectedhtml">trunk/LayoutTests/fast/css-grid-layout/grid-baseline-margins-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridbaselinemarginshtml">trunk/LayoutTests/fast/css-grid-layout/grid-baseline-margins.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridbaselinemustrespectgridorderexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridbaselinemustrespectgridorderhtml">trunk/LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridbaselinehtml">trunk/LayoutTests/fast/css-grid-layout/grid-baseline.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselinehoriz04expectedhtml">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-horiz-04-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselinetwodimensionalexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselinetwodimensionalhtml">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineverticallr04expectedhtml">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-lr-04-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineverticallr04html">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-lr-04.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineverticalrl04expectedhtml">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-rl-04-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineverticalrl04html">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-rl-04.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges001expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-001-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges003expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-003-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges004expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-004-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges005expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-005-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges006expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-006-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges007expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-007-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges008expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-008-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridcolumnaxisselfbaselinesynthesized001expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-001-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridcolumnaxisselfbaselinesynthesized002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridcolumnaxisselfbaselinesynthesized003expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-003-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridcolumnaxisselfbaselinesynthesized004expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-004-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridrowaxisselfbaselinesynthesized001expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-001-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridrowaxisselfbaselinesynthesized002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridrowaxisselfbaselinesynthesized003expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-003-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridrowaxisselfbaselinesynthesized004expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-004-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridselfbaselinenotappliedifsizingcyclicdependency001expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-001-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridselfbaselinenotappliedifsizingcyclicdependency002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridselfbaselinenotappliedifsizingcyclicdependency003expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize002html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-002.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize007html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-007.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize008html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-008.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize009html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-009.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize010html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-010.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize011html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-011.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize012html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-012.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagemargins002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagemarginsverticallr002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-lr-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagemarginsverticalrl002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-rl-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagepaddings002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagepaddingsverticallr002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagepaddingsverticalrl002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCorerenderingGridLayoutFunctionsh">trunk/Source/WebCore/rendering/GridLayoutFunctions.h</a></li>
<li><a href="#trunkSourceWebCorerenderingGridTrackSizingAlgorithmcpp">trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingGridTrackSizingAlgorithmh">trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/WebCore/rendering/RenderGrid.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridh">trunk/Source/WebCore/rendering/RenderGrid.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineandflextrackswithindefinitecontainercrashexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineandflextrackswithindefinitecontainercrashhtml">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineandflexibletracksshouldnotcrashexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineandflexibletracksshouldnotcrashhtml">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineanditemrelayoutshouldnotcrashexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineanditemrelayoutshouldnotcrashhtml">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineandrelativesizeditemscrashexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineandrelativesizeditemscrashhtml">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineandrelativesizedtrackscrashexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselineandrelativesizedtrackscrashhtml">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselinefollowedbyitemstylechangeshouldnotcrashexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridselfbaselinefollowedbyitemstylechangeshouldnotcrashhtml">trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html</a></li>
<li><a href="#trunkSourceWebCorerenderingGridBaselineAlignmentcpp">trunk/Source/WebCore/rendering/GridBaselineAlignment.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingGridBaselineAlignmenth">trunk/Source/WebCore/rendering/GridBaselineAlignment.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/ChangeLog 2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2018-11-23  Javier Fernandez  <jfernandez@igalia.com>
+
+        [css-grid] Implement Baseline Alignment for grid items
+        https://bugs.webkit.org/show_bug.cgi?id=145566
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        Most of the baseline realated tests pass now; just a few still fail because of unrelated bugs.
+
+        * TestExpectations: Removed several entries, related to the baseline tests that are now passing.
+        * fast/css-grid-layout/grid-align-baseline-expected.txt:
+        * fast/css-grid-layout/grid-align-baseline-vertical-expected.txt:
+        * fast/css-grid-layout/grid-baseline-expected.html:
+        * fast/css-grid-layout/grid-baseline-margins-expected.html:
+        * fast/css-grid-layout/grid-baseline-margins.html:
+        * fast/css-grid-layout/grid-baseline-must-respect-grid-order-expected.txt:
+        * fast/css-grid-layout/grid-baseline-must-respect-grid-order.html:
+        * fast/css-grid-layout/grid-baseline.html:
+        * fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash-expected.txt: Added.
+        * fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html: Added.
+        * fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash-expected.txt: Added.
+        * fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html: Added.
+        * fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash-expected.txt: Added.
+        * fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html: Added.
+        * fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash-expected.txt: Added.
+        * fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html: Added.
+        * fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash-expected.txt: Added.
+        * fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html: Added.
+        * fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash-expected.txt: Added.
+        * fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html: Added.
+        * fast/css-grid-layout/grid-self-baseline-two-dimensional-expected.txt:
+        * fast/css-grid-layout/grid-self-baseline-two-dimensional.html:
+
</ins><span class="cx"> 2018-11-22  Dean Jackson  <dino@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Implement WebGPUQueue and device.getQueue()
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations       2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/TestExpectations  2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -580,50 +580,6 @@
</span><span class="cx"> webkit.org/b/169271 imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-sizing-alignment-001.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/191465 imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-changing-containing-block-001.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/191465 imported/w3c/web-platform-tests/css/css-grid/abspos/grid-item-absolute-positioning-dynamic-001.html [ ImageOnlyFailure ]
</span><del>-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-001.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-002.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-003.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-004.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-005.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-006.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-007.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-008.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-009.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-010.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-011.html [ ImageOnlyFailure ]
-webkit.org/b/145566 imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-012.html [ ImageOnlyFailure ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-01.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-02-b.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-02.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-03.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-04.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-05.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-06.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-07.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-horiz-01.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-horiz-02.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-horiz-03.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-horiz-04.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-horiz-05.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-horiz-06.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-horiz-07.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-lr-01.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-lr-02.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-lr-03.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-lr-04.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-lr-05.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-lr-06.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-lr-07.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-rl-01.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-rl-02.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-rl-03.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-rl-04.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-rl-05.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-rl-06.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-vertical-rl-07.html [ Skip ]
-webkit.org/b/145566 fast/css-grid-layout/grid-self-baseline-two-dimensional.html [ Failure ]
-webkit.org/b/145566 fast/css-grid-layout/grid-align-baseline.html [ Failure ]
-webkit.org/b/145566 fast/css-grid-layout/grid-align-baseline-vertical.html [ Failure ]
</del><span class="cx"> webkit.org/b/191365 imported/w3c/web-platform-tests/css/css-grid/grid-items/item-with-table-with-infinite-max-intrinsic-width.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/191365 imported/w3c/web-platform-tests/css/css-grid/grid-items/table-with-infinite-max-intrinsic-width.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/191367 imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-ignores-first-letter-002.html [ ImageOnlyFailure ]
</span><span class="lines">@@ -631,6 +587,7 @@
</span><span class="cx"> webkit.org/b/191461 imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-001.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/191462 imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-replaced-subitems-001.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/191463 imported/w3c/web-platform-tests/css/css-grid/grid-items/explicitly-sized-grid-item-as-table.html
</span><ins>+webkit.org/b/191627 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-001.html [ Failure ]
</ins><span class="cx"> webkit.org/b/191473 fast/css-grid-layout/grid-crash-out-of-flow-positioned-element.html [ Crash ]
</span><span class="cx"> webkit.org/b/149890 fast/css-grid-layout/grid-shorthands-style-format.html [ Failure ]
</span><span class="cx"> webkit.org/b/191506 fast/css-grid-layout/grid-item-scroll-position.html [ Failure ]
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridalignbaselineexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-align-baseline-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-align-baseline-expected.txt  2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-align-baseline-expected.txt     2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -6,7 +6,6 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-baseline1 and baseline2 should have the same baseline.baseline4 and baseline5 should be below baseline6.
</del><span class="cx"> 
</span><span class="cx"> PASS .grid 1 
</span><span class="cx"> PASS .grid 2 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridalignbaselineverticalexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-align-baseline-vertical-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-align-baseline-vertical-expected.txt 2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-align-baseline-vertical-expected.txt    2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -14,8 +14,6 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-baseline1 and baseline2 should have the same baseline.
-baseline4 and baseline5 should be below baseline6.
</del><span class="cx"> 
</span><span class="cx"> PASS .grid 1 
</span><span class="cx"> PASS .grid 2 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridbaselineexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-baseline-expected.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-baseline-expected.html       2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-baseline-expected.html  2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><span class="cx"> <!DOCTYPE html>
</span><ins>+<html>
</ins><span class="cx"> <style>
</span><span class="cx"> body {
</span><span class="cx">     margin: 0;
</span><span class="lines">@@ -202,3 +203,4 @@
</span><span class="cx"> </script>
</span><span class="cx"> 
</span><span class="cx"> </body>
</span><ins>+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridbaselinemarginsexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-baseline-margins-expected.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-baseline-margins-expected.html       2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-baseline-margins-expected.html  2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -17,16 +17,12 @@
</span><span class="cx"> .border { border: 11px solid pink; }
</span><span class="cx"> .padding { padding: 13px; }
</span><span class="cx"> .margin { margin: 8px 0; }
</span><del>-.border-padding-margin {
-   border: 5px solid pink;
-   padding: 7px;
-   margin: 3px 0;
-}
</del><span class="cx"> .flexbox > div {
</span><span class="cx">     min-width: 0;
</span><span class="cx">     min-height: 0;
</span><span class="cx"> }
</span><span class="cx"> </style>
</span><ins>+<p>This test ensures that Baseline Alignment works for 1-dimensional Grid like in Flexible Box, even using margins, paddings and borders.</p>
</ins><span class="cx"> <div>
</span><span class="cx"> before text
</span><span class="cx"> <div class="border" style="display: inline-block; background-color: lightgrey">
</span><span class="lines">@@ -76,8 +72,8 @@
</span><span class="cx"> 
</span><span class="cx"> <div>
</span><span class="cx"> Should align with the top
</span><del>-<div class="inline-block border-padding-margin" style="background-color: pink;">
-  <div class="flexbox border-padding-margin" style="width: 100px; height: 100px; background-color: pink">
</del><ins>+<div class="inline-block border margin padding" style="background-color: pink">
+  <div class="flexbox border margin padding" style="width: 100px; height: 100px; background-color: pink">
</ins><span class="cx">       <div style="width: 200px; overflow: scroll; background-color: lightgrey; margin: 10px 0px; border-top: 10px solid pink; border-bottom: 10px solid pink;"></div>
</span><span class="cx">   </div>
</span><span class="cx"> </div>
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridbaselinemarginshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-baseline-margins.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-baseline-margins.html        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-baseline-margins.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -9,12 +9,8 @@
</span><span class="cx"> .border { border: 11px solid pink; }
</span><span class="cx"> .padding { padding: 13px; }
</span><span class="cx"> .margin { margin: 8px 0; }
</span><del>-.border-padding-margin {
-   border: 5px solid pink;
-   padding: 7px;
-   margin: 3px 0;
-}
</del><span class="cx"> </style>
</span><ins>+<p>This test ensures that Baseline Alignment works for 1-dimensional Grid like in Flexible Box, even using margins, paddings and borders.</p>
</ins><span class="cx"> <div>
</span><span class="cx"> before text
</span><span class="cx"> <div class="border" style="display: inline-block; background-color: lightgrey">
</span><span class="lines">@@ -64,8 +60,8 @@
</span><span class="cx"> 
</span><span class="cx"> <div>
</span><span class="cx"> Should align with the top
</span><del>-<div class="inline-block border-padding-margin" style="background-color: pink">
-  <div class="grid border border-padding-margin" style="width: 100px; height: 100px; background-color: pink">
</del><ins>+<div class="inline-block border margin padding" style="background-color: pink">
+  <div class="grid border margin padding" style="grid-template-columns: 100px; grid-template-rows: 100px; background-color: pink">
</ins><span class="cx">       <div style="overflow: scroll; background-color: lightgrey; margin: 10px 0px; border-top: 10px solid pink; border-bottom: 10px solid pink;"></div>
</span><span class="cx">   </div>
</span><span class="cx"> </div>
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridbaselinemustrespectgridorderexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order-expected.txt        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order-expected.txt   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+
+PASS .grid, container 1 
+PASS .grid, container 2 
+PASS .grid, container 3 
+PASS .grid, container 4 
+PASS .grid, container 5 
+PASS .grid, container 6 
+PASS .grid, container 7 
+PASS .grid, container 8 
+PASS .grid, container 9 
+PASS .grid, container 10 
+PASS .grid, container 11 
+PASS .grid, container 12 
+PASS .grid, container 13 
+PASS .grid, container 14 
+PASS .grid, container 15 
+PASS .grid, container 16 
+PASS .grid, container 17 
+PASS .grid, container 18 
</ins><span class="cx"> The test shows 3 grids each of them with 3 items sorted differently in the DOM.
</span><span class="cx"> Each grid container must use its first (grid order) item to compute its baseline, and using document-oder in case of element with same grid-order. Hence they might be baseline aligned each other accordingly.
</span><span class="cx"> 
</span><span class="lines">@@ -5,41 +24,24 @@
</span><span class="cx"> 
</span><span class="cx">  
</span><span class="cx">  
</span><del>- PASS
-PASS
-PASS
</del><span class="cx"> This case shows 3 items located along the first row and in different columns, so such item is used to determine the grid's baseline instead of using the grid order.
</span><span class="cx"> 
</span><span class="cx">  
</span><span class="cx">  
</span><del>- PASS
-PASS
-PASS
</del><span class="cx"> This case shows 3 items' areas intersecting the first row and first column, so the dom order must be used to determine each grid's baseline.
</span><span class="cx"> 
</span><span class="cx">  
</span><span class="cx">  
</span><del>- PASS
-PASS
-PASS
</del><span class="cx"> This case shows 3 items' areas intersecting the first row and first column, but one of the items participates in baseline alignment, so such item is used to determine the grid's baseline instead of using the dom order.
</span><span class="cx"> 
</span><span class="cx">  
</span><span class="cx">  
</span><del>- PASS
-PASS
-PASS
</del><span class="cx"> This case shows one of the grids with no items, hence its baseline must be synthesized.
</span><span class="cx"> 
</span><span class="cx">  
</span><span class="cx">  
</span><del>-PASS
-PASS
-PASS
</del><span class="cx"> This case shows one of the grids with no items in the first row, hence its baseline must be synthesized.
</span><span class="cx"> 
</span><span class="cx">  
</span><span class="cx">  
</span><del>- PASS
-PASS
-PASS
</del><ins>+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridbaselinemustrespectgridorderhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order.html        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -57,7 +57,9 @@
</span><span class="cx">    background-color: green;
</span><span class="cx"> }
</span><span class="cx"> </style>
</span><del>-<script src="../../resources/check-layout.js"></script>
</del><ins>+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../../resources/check-layout-th.js"></script>
</ins><span class="cx"> <body onload="checkLayout('.grid, container')">
</span><span class="cx"> <div id="log"></div>
</span><span class="cx"> <p>
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridbaselinehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-baseline.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-baseline.html        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-baseline.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><span class="cx"> <!DOCTYPE html>
</span><ins>+<html>
</ins><span class="cx"> <style>
</span><span class="cx"> body {
</span><span class="cx">     margin: 0;
</span><span class="lines">@@ -93,7 +94,7 @@
</span><span class="cx"> <!-- If there are no griditems, align to the bottom of the box. -->
</span><span class="cx"> <div>
</span><span class="cx"> should align with the bottom
</span><del>-<div class="empty inline-grid" style="width: 30px; height: 30px">
</del><ins>+<div class="inline-grid" style="width: 30px; height: 30px">
</ins><span class="cx"> </div>
</span><span class="cx"> of the grey box
</span><span class="cx"> </div>
</span><span class="lines">@@ -208,3 +209,4 @@
</span><span class="cx"> </script>
</span><span class="cx"> 
</span><span class="cx"> </body>
</span><ins>+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineandflextrackswithindefinitecontainercrashexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash-expected.txt (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash-expected.txt                           (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS This test should not crash in debug. 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineandflextrackswithindefinitecontainercrashhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html                           (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+.grid {
+  display: grid;
+  grid-template-columns: 10px;
+  grid-template-rows: minmax(4px, 1fr);
+  align-items: baseline;
+  width: 100px;
+}
+</style>
+<div class="grid">
+    <div style="writing-mode: vertical-rl;"></div>
+</div>
+<script>
+    test(() => {
+    }, "This test should not crash in debug.");
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineandflexibletracksshouldnotcrashexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash-expected.txt (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash-expected.txt                              (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash-expected.txt 2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+ 




+
+PASS No crash or assertion failure. 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineandflexibletracksshouldnotcrashhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html                              (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html 2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div id="grid" style="display: inline-grid; grid-template-columns: 2fr;">
+    <div id="item" style="justify-self: baseline;"></div>
+</div>
+<br>
+<div id="grid" style="display: inline-grid; grid-template-columns: minmax(100px, 4fr);">
+    <div id="item" style="justify-self: baseline;"></div>
+</div>
+<div id="grid" style="display: inline-grid; grid-template-columns: minmax(100px, 4fr);">
+    <div style="width: 100%; justify-self: baseline;"></div>
+</div>
+<div id="grid" style="display: inline-grid; grid-template-rows: 2fr;">
+    <div style="align-self: baseline;"></div>
+</div>
+<div id="grid" style="display: inline-grid; grid-template-rows: minmax(10px, 2fr);">
+    <div style="align-self: baseline;"></div>
+</div>
+<div id="grid" style="display: inline-grid; grid-template-rows: minmax(10px, 2fr);">
+    <div style="height: 100%; align-self: baseline;"></div>
+</div>
+<script>
+    test(() => {}, "No crash or assertion failure.");
+</script>
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineanditemrelayoutshouldnotcrashexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash-expected.txt (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash-expected.txt   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+This test should not crash
+
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineanditemrelayoutshouldnotcrashhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<!doctype html>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<p>This test should not crash</p>
+<div style="display: grid;">
+    <div id="item" style="align-self: baseline;">PASS</div>
+</div>
+<script>
+    let item = document.getElementById("item");
+    item.offsetLeft;
+    item.style.width = "20px";
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineandrelativesizeditemscrashexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash-expected.txt (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash-expected.txt                            (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash-expected.txt       2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+This test should not crash
+
+PASS
+
+PASS
+PASS
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineandrelativesizeditemscrashhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html                            (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html       2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<p>This test should not crash</p>
+<div style="display: grid;">
+    <span style="height: 54%; align-self: baseline;" >PASS</span>
+</div>
+
+<br>
+
+<div style="display: inline-grid;">
+    <span>PASS</span>
+    <div style="display: inline-grid; height: 54%; align-self: baseline;" ><span>PASS</span></div>
+</div>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineandrelativesizedtrackscrashexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash-expected.txt (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash-expected.txt                           (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+This test should not crash
+
+PASS
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineandrelativesizedtrackscrashhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html                           (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<!doctype html>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<p>This test should not crash</p>
+<div style="display: grid; grid-template-columns: 41%; justify-items: baseline">PASS<div>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselinefollowedbyitemstylechangeshouldnotcrashexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash-expected.txt (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash-expected.txt                            (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash-expected.txt       2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+
+PASS No crash or assertion failure when changing align-self from 'auto' to 'baseline'. 
+PASS No crash or assertion failure when changing align-self from 'baseline' to 'start'. 
+PASS No crash or assertion failure when item's writing-mode changes from orthogonal to parallel. 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselinefollowedbyitemstylechangeshouldnotcrashhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html                            (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html       2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div style="display: grid;">
+    <div id="item1"></div>
+</div>
+<div style="display: grid;">
+    <div id="item2" style="align-self: baseline"></div>
+</div>
+<div style="display: grid;">
+    <div id="item3" style="writing-mode: vertical-lr;"></div>
+</div>
+<script>
+    test(() => {
+       document.body.offsetLeft;
+       var item = document.getElementById("item1");
+       item.style.alignSelf = "baseline";
+       assert_equals(item.style.alignSelf, "baseline");
+    }, "No crash or assertion failure when changing align-self from 'auto' to 'baseline'.");
+    test(() => {
+       document.body.offsetLeft;
+       var item = document.getElementById("item2");
+       item.style.alignSelf = "start";
+       assert_equals(item.style.alignSelf, "start");
+    }, "No crash or assertion failure when changing align-self from 'baseline' to 'start'.");
+    test(() => {
+       document.body.offsetLeft;
+       var item = document.getElementById("item3");
+       item.style.writingMode = "horizontal-tb";
+       assert_equals(item.style.writingMode, "horizontal-tb");
+    }, "No crash or assertion failure when item's writing-mode changes from orthogonal to parallel.");
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselinehoriz04expectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-horiz-04-expected.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-horiz-04-expected.html 2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-horiz-04-expected.html    2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -23,10 +23,10 @@
</span><span class="cx"> }
</span><span class="cx"> .extraRightPadding { padding-right: 30px; }
</span><span class="cx"> .extraLeftPadding { padding-left: 30px; }
</span><del>-.item { display: inline; }
</del><ins>+.item { float: left; clear: both; }
</ins><span class="cx"> .left { vertical-align: bottom; }
</span><span class="cx"> </style>
</span><span class="cx"> 
</span><span class="cx"> <p>4x1 with parallel items. <br>No item shares any row-like Baseline Context. All items share 'first-column' Baseline Context.<br>All the items are orthogonal to the column-axis, so they don't participate in the column-like Baseline Context; since no items shares row-like Baseline context, neither 'justify-self' or 'align-self' should apply.</p>
</span><del>-<div class="block verticalLR"><div class="item horizontalTB left">A</div><div class="item horizontalTB left">A</div><div class="item horizontalTB left">A</div><div class="item horizontalTB left">A</div></div>
-<div class="block verticalLR"><div class="item horizontalTB extraRightPadding left">A</div><div class="item horizontalTB left">A</div><div class="item horizontalTB extraLeftPadding left">A</div><div class="item horizontalTB left">A</div></div>
</del><ins>+<div class="block"><div class="item left">A</div><div class="item left">A</div><div class="item left">A</div><div class="item left">A</div></div>
+<div class="block"><div class="item extraRightPadding left">A</div><div class="item left">A</div><div class="item extraLeftPadding left">A</div><div class="item left">A</div></div>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselinetwodimensionalexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional-expected.txt   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -11,7 +11,6 @@
</span><span class="cx"> PASS .grid 10 
</span><span class="cx"> PASS .grid 11 
</span><span class="cx"> PASS .grid 12 
</span><del>-
</del><span class="cx"> This test checks that baseline is applied correctly on a grid aling both axis and different writing-modes when using symbolic fonts, which will use middle-baseline.
</span><span class="cx"> 
</span><span class="cx"> A
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselinetwodimensionalhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional.html   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional.html      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -7,6 +7,7 @@
</span><span class="cx"> .grid {
</span><span class="cx">    margin: 5px;
</span><span class="cx">    font-family: Ahem;
</span><ins>+   -webkit-text-orientation: sideways;
</ins><span class="cx"> }
</span><span class="cx"> .font12 { font-size:24px; }
</span><span class="cx"> .font16 { font-size:32px; }
</span><span class="lines">@@ -46,10 +47,10 @@
</span><span class="cx"> 
</span><span class="cx"> <div style="position: relative">
</span><span class="cx">     <div class="grid fit-content itemsBaseline">
</span><del>-        <span class="firstRowFirstColumn verticalLR font12" data-offset-x="37" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16 extraTopPadding" data-offset-x="138" data-offset-y="11">A</span><span class="firstRowThirdColumn verticalLR font24 extraLeftPadding" data-offset-x="240" data-offset-y="10">A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="348" data-offset-y="10">A</span>
-        <span class="secondRowFirstColumn verticalLR font16 extraTopPadding" data-offset-x="33" data-offset-y="111">A</span><span class="secondRowSecondColumn horizontalTB font24" data-offset-x="138" data-offset-y="124">A</span><span class="secondRowThirdColumn verticalLR font12" data-offset-x="274" data-offset-y="111">A</span><span class="secondRowFourthColumn horizontalTB font32" data-offset-x="348" data-offset-y="111">A</span>
-        <span class="thirdRowFirstColumn verticalLR font32" data-offset-x="17" data-offset-y="212">A</span><span class="thirdRowSecondColumn horizontalTB font12" data-offset-x="138" data-offset-y="243">A</span><span class="thirdRowThirdColumn verticalLR font24 extraBottomPadding" data-offset-x="262" data-offset-y="212">A</span><span class="thirdRowFourthColumn horizontalTB font16 extraTopPadding" data-offset-x="348" data-offset-y="212">A</span>
-        <span class="fourthRowFirstColumn verticalLR font24 extraRightPadding" data-offset-x="25" data-offset-y="320">A</span><span class="fourthRowSecondColumn horizontalTB font32 extraBottomPadding" data-offset-x="138" data-offset-y="320">A</span><span class="fourthRowThirdColumn verticalLR font16" data-offset-x="270" data-offset-y="320">A</span><span class="fourthRowFourthColumn horizontalTB font12" data-offset-x="348" data-offset-y="352">A</span>
</del><ins>+        <span class="firstRowFirstColumn verticalLR font12" data-offset-x="25" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16 extraTopPadding" data-offset-x="133" data-offset-y="11">A</span><span class="firstRowThirdColumn verticalLR font24 extraLeftPadding" data-offset-x="235" data-offset-y="10">A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="343" data-offset-y="10">A</span>
+        <span class="secondRowFirstColumn verticalLR font16 extraTopPadding" data-offset-x="24" data-offset-y="111">A</span><span class="secondRowSecondColumn horizontalTB font24" data-offset-x="133" data-offset-y="124">A</span><span class="secondRowThirdColumn verticalLR font12" data-offset-x="262" data-offset-y="111">A</span><span class="secondRowFourthColumn horizontalTB font32" data-offset-x="343" data-offset-y="111">A</span>
+        <span class="thirdRowFirstColumn verticalLR font32" data-offset-x="17" data-offset-y="212">A</span><span class="thirdRowSecondColumn horizontalTB font12" data-offset-x="133" data-offset-y="243">A</span><span class="thirdRowThirdColumn verticalLR font24 extraBottomPadding" data-offset-x="257" data-offset-y="212">A</span><span class="thirdRowFourthColumn horizontalTB font16 extraTopPadding" data-offset-x="343" data-offset-y="212">A</span>
+        <span class="fourthRowFirstColumn verticalLR font24 extraRightPadding" data-offset-x="20" data-offset-y="320">A</span><span class="fourthRowSecondColumn horizontalTB font32 extraBottomPadding" data-offset-x="133" data-offset-y="320">A</span><span class="fourthRowThirdColumn verticalLR font16" data-offset-x="261" data-offset-y="320">A</span><span class="fourthRowFourthColumn horizontalTB font12" data-offset-x="343" data-offset-y="352">A</span>
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -57,10 +58,10 @@
</span><span class="cx"> 
</span><span class="cx"> <div style="position: relative">
</span><span class="cx">     <div class="grid fit-content itemsBaseline">
</span><del>-        <span class="firstRowFirstColumn verticalLR font12 extraLeftPadding" data-offset-x="17" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16" data-offset-x="121" data-offset-y="35">A</span><span class="firstRowThirdColumn verticalLR font24 extraRightPadding" data-offset-x="" data-offset-y="10">A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="336" data-offset-y="10">A</span>
-        <span class="secondRowFirstColumn horizontalTB font16" data-offset-x="17" data-offset-y="111">A</span><span class="secondRowSecondColumn verticalLR font24" data-offset-x="129" data-offset-y="111">A</span><span class="secondRowThirdColumn horizontalTB font12" data-offset-x="223" data-offset-y="118">A</span><span class="secondRowFourthColumn verticalLR font32 extraBottomPadding" data-offset-x="336" data-offset-y="111">A</span>
-        <span class="thirdRowFirstColumn verticalLR font32 extraBottomPadding" data-offset-x="19" data-offset-y="235">A</span><span class="thirdRowSecondColumn horizontalTB font12" data-offset-x="121" data-offset-y="242">A</span><span class="thirdRowThirdColumn verticalLR font24 extraTopPadding" data-offset-x="223" data-offset-y="235">A</span><span class="thirdRowFourthColumn horizontalTB font16" data-offset-x="336" data-offset-y="235">A</span>
-        <span class="fourthRowFirstColumn horizontalTB font24" data-offset-x="17" data-offset-y="359">A</span><span class="fourthRowSecondColumn verticalLR font32" data-offset-x="121" data-offset-y="359">A</span><span class="fourthRowThirdColumn horizontalTB font16" data-offset-x="223" data-offset-y="371">A</span><span class="fourthRowFourthColumn verticalLR font12" data-offset-x="356" data-offset-y="359">A</span>
</del><ins>+        <span class="firstRowFirstColumn verticalLR font12 extraLeftPadding" data-offset-x="17" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16" data-offset-x="133" data-offset-y="35">A</span><span class="firstRowThirdColumn verticalLR font24 extraRightPadding" data-offset-x="" data-offset-y="10">A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="348" data-offset-y="10">A</span>
+        <span class="secondRowFirstColumn horizontalTB font16" data-offset-x="17" data-offset-y="111">A</span><span class="secondRowSecondColumn verticalLR font24" data-offset-x="136" data-offset-y="111">A</span><span class="secondRowThirdColumn horizontalTB font12" data-offset-x="235" data-offset-y="118">A</span><span class="secondRowFourthColumn verticalLR font32 extraBottomPadding" data-offset-x="348" data-offset-y="111">A</span>
+        <span class="thirdRowFirstColumn verticalLR font32 extraBottomPadding" data-offset-x="31" data-offset-y="235">A</span><span class="thirdRowSecondColumn horizontalTB font12" data-offset-x="133" data-offset-y="242">A</span><span class="thirdRowThirdColumn verticalLR font24 extraTopPadding" data-offset-x="235" data-offset-y="235">A</span><span class="thirdRowFourthColumn horizontalTB font16" data-offset-x="348" data-offset-y="235">A</span>
+        <span class="fourthRowFirstColumn horizontalTB font24" data-offset-x="17" data-offset-y="359">A</span><span class="fourthRowSecondColumn verticalLR font32" data-offset-x="133" data-offset-y="359">A</span><span class="fourthRowThirdColumn horizontalTB font16" data-offset-x="235" data-offset-y="371">A</span><span class="fourthRowFourthColumn verticalLR font12" data-offset-x="356" data-offset-y="359">A</span>
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -79,10 +80,10 @@
</span><span class="cx"> 
</span><span class="cx"> <div style="position: relative">
</span><span class="cx">     <div class="grid fit-content itemsBaseline verticalLR">
</span><del>-        <span class="firstRowFirstColumn verticalLR font12" data-offset-x="29" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16 extraTopPadding" data-offset-x="17" data-offset-y="135">A</span><span class="firstRowThirdColumn verticalLR font24 extraBottomPadding" data-offset-x="17" data-offset-y="235">A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="17" data-offset-y="343">A</span>
-        <span class="secondRowFirstColumn verticalLR font16" data-offset-x="119" data-offset-y="10">A</span><span class="secondRowSecondColumn horizontalTB font24" data-offset-x="119" data-offset-y="147">A</span><span class="secondRowThirdColumn verticalLR font12" data-offset-x="123" data-offset-y="235">A</span><span class="secondRowFourthColumn horizontalTB font32" data-offset-x="119" data-offset-y="343">A</span>
-        <span class="thirdRowFirstColumn verticalLR font32 extraBottomPadding" data-offset-x="221" data-offset-y="10">A</span><span class="thirdRowSecondColumn horizontalTB font12 extraTopPadding" data-offset-x="221" data-offset-y="142">A</span><span class="thirdRowThirdColumn verticalLR font24" data-offset-x="229" data-offset-y="235">A</span><span class="thirdRowFourthColumn horizontalTB font16 extraTopPadding" data-offset-x="221" data-offset-y="344">A</span>
-        <span class="fourthRowFirstColumn verticalLR font24" data-offset-x="323" data-offset-y="10">A</span><span class="fourthRowSecondColumn horizontalTB font32" data-offset-x="323" data-offset-y="134">A</span><span class="fourthRowThirdColumn verticalLR font16" data-offset-x="331" data-offset-y="235">A</span><span class="fourthRowFourthColumn horizontalTB font12" data-offset-x="323" data-offset-y="375">A</span>
</del><ins>+        <span class="firstRowFirstColumn verticalLR font12" data-offset-x="22" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16 extraTopPadding" data-offset-x="17" data-offset-y="135">A</span><span class="firstRowThirdColumn verticalLR font24 extraBottomPadding" data-offset-x="17" data-offset-y="235">A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="17" data-offset-y="343">A</span>
+        <span class="secondRowFirstColumn verticalLR font16" data-offset-x="119" data-offset-y="10">A</span><span class="secondRowSecondColumn horizontalTB font24" data-offset-x="119" data-offset-y="147">A</span><span class="secondRowThirdColumn verticalLR font12" data-offset-x="120" data-offset-y="235">A</span><span class="secondRowFourthColumn horizontalTB font32" data-offset-x="119" data-offset-y="343">A</span>
+        <span class="thirdRowFirstColumn verticalLR font32 extraBottomPadding" data-offset-x="221" data-offset-y="10">A</span><span class="thirdRowSecondColumn horizontalTB font12 extraTopPadding" data-offset-x="221" data-offset-y="142">A</span><span class="thirdRowThirdColumn verticalLR font24" data-offset-x="224" data-offset-y="235">A</span><span class="thirdRowFourthColumn horizontalTB font16 extraTopPadding" data-offset-x="221" data-offset-y="344">A</span>
+        <span class="fourthRowFirstColumn verticalLR font24" data-offset-x="323" data-offset-y="10">A</span><span class="fourthRowSecondColumn horizontalTB font32" data-offset-x="323" data-offset-y="134">A</span><span class="fourthRowThirdColumn verticalLR font16" data-offset-x="327" data-offset-y="235">A</span><span class="fourthRowFourthColumn horizontalTB font12" data-offset-x="323" data-offset-y="375">A</span>
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -90,10 +91,10 @@
</span><span class="cx"> 
</span><span class="cx"> <div style="position: relative">
</span><span class="cx">     <div class="grid fit-content itemsBaseline verticalLR">
</span><del>-        <span class="firstRowFirstColumn verticalLR font12 extraBottomPadding" data-offset-x="29" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16 extraTopPadding" data-offset-x="17" data-offset-y="135">A</span><span class="firstRowThirdColumn verticalLR font24" data-offset-x="17" data-offset-y="236">A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="17" data-offset-y="351">A</span>
-        <span class="secondRowFirstColumn horizontalTB font16" data-offset-x="119" data-offset-y="22">A</span><span class="secondRowSecondColumn verticalLR font24" data-offset-x="127" data-offset-y="135">A</span><span class="secondRowThirdColumn horizontalTB font12 extraBottomPadding" data-offset-x="119" data-offset-y="267">A</span><span class="secondRowFourthColumn verticalLR font32" data-offset-x="119" data-offset-y="351">A</span>
-        <span class="thirdRowFirstColumn  verticalLR font32 extraTopPadding" data-offset-x="221" data-offset-y="10">A</span><span class="thirdRowSecondColumn horizontalTB font12" data-offset-x="221" data-offset-y="166">A</span><span class="thirdRowThirdColumn verticalLR font24" data-offset-x="229" data-offset-y="236">A</span><span class="thirdRowFourthColumn horizontalTB font16" data-offset-x="221" data-offset-y="376">A</span>
-        <span class="fourthRowFirstColumn horizontalTB font24" data-offset-x="323" data-offset-y="10">A</span><span class="fourthRowSecondColumn verticalLR font32" data-offset-x="323" data-offset-y="135">A</span><span class="fourthRowThirdColumn horizontalTB font16 extraTopPadding" data-offset-x="323" data-offset-y="236">A</span><span class="fourthRowFourthColumn verticalLR font12" data-offset-x="343" data-offset-y="351">A</span>
</del><ins>+        <span class="firstRowFirstColumn verticalLR font12 extraBottomPadding" data-offset-x="22" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16 extraTopPadding" data-offset-x="17" data-offset-y="135">A</span><span class="firstRowThirdColumn verticalLR font24" data-offset-x="17" data-offset-y="236">A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="17" data-offset-y="351">A</span>
+        <span class="secondRowFirstColumn horizontalTB font16" data-offset-x="119" data-offset-y="22">A</span><span class="secondRowSecondColumn verticalLR font24" data-offset-x="122" data-offset-y="135">A</span><span class="secondRowThirdColumn horizontalTB font12 extraBottomPadding" data-offset-x="119" data-offset-y="267">A</span><span class="secondRowFourthColumn verticalLR font32" data-offset-x="119" data-offset-y="351">A</span>
+        <span class="thirdRowFirstColumn  verticalLR font32 extraTopPadding" data-offset-x="221" data-offset-y="10">A</span><span class="thirdRowSecondColumn horizontalTB font12" data-offset-x="221" data-offset-y="166">A</span><span class="thirdRowThirdColumn verticalLR font24" data-offset-x="224" data-offset-y="236">A</span><span class="thirdRowFourthColumn horizontalTB font16" data-offset-x="221" data-offset-y="376">A</span>
+        <span class="fourthRowFirstColumn horizontalTB font24" data-offset-x="323" data-offset-y="10">A</span><span class="fourthRowSecondColumn verticalLR font32" data-offset-x="323" data-offset-y="135">A</span><span class="fourthRowThirdColumn horizontalTB font16 extraTopPadding" data-offset-x="323" data-offset-y="236">A</span><span class="fourthRowFourthColumn verticalLR font12" data-offset-x="331" data-offset-y="351">A</span>
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -112,10 +113,10 @@
</span><span class="cx"> 
</span><span class="cx"> <div style="position: relative">
</span><span class="cx">     <div class="grid fit-content itemsBaseline verticalRL">
</span><del>-        <span class="firstRowFirstColumn verticalLR font12" data-offset-x="378" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16" data-offset-x="382" data-offset-y="170">A</span><span class="firstRowThirdColumn verticalLR font24 extraTopPadding" data-offset-x="366" data-offset-y="246">A</span><span class="firstRowFourthColumn horizontalTB font32 extraRightPadding" data-offset-x="323" data-offset-y="355">A</span>
-        <span class="secondRowFirstColumn verticalLR font16" data-offset-x="253" data-offset-y="10">A</span><span class="secondRowSecondColumn horizontalTB font24 extraTopPadding" data-offset-x="237" data-offset-y="134">A</span><span class="secondRowThirdColumn verticalLR font12" data-offset-x="257" data-offset-y="246">A</span><span class="secondRowFourthColumn horizontalTB font32" data-offset-x="221" data-offset-y="355">A</span>
-        <span class="thirdRowFirstColumn verticalLR font32 extraBottomPadding" data-offset-x="119" data-offset-y="10">A</span><span class="thirdRowSecondColumn horizontalTB font12" data-offset-x="159" data-offset-y="177">A</span><span class="thirdRowThirdColumn verticalLR font24" data-offset-x="127" data-offset-y="246">A</span><span class="thirdRowFourthColumn horizontalTB font16" data-offset-x="151" data-offset-y="380">A</span>
-        <span class="fourthRowFirstColumn verticalLR font24 extraTopPadding" data-offset-x="33" data-offset-y="10">A</span><span class="fourthRowSecondColumn horizontalTB font32" data-offset-x="17" data-offset-y="145">A</span><span class="fourthRowThirdColumn verticalLR font16 extraBottomPadding" data-offset-x="41" data-offset-y="246">A</span><span class="fourthRowFourthColumn horizontalTB font12" data-offset-x="57" data-offset-y="387">A</span>
</del><ins>+        <span class="firstRowFirstColumn verticalLR font12" data-offset-x="371" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16" data-offset-x="382" data-offset-y="170">A</span><span class="firstRowThirdColumn verticalLR font24 extraTopPadding" data-offset-x="366" data-offset-y="246">A</span><span class="firstRowFourthColumn horizontalTB font32 extraRightPadding" data-offset-x="323" data-offset-y="355">A</span>
+        <span class="secondRowFirstColumn verticalLR font16" data-offset-x="253" data-offset-y="10">A</span><span class="secondRowSecondColumn horizontalTB font24 extraTopPadding" data-offset-x="237" data-offset-y="134">A</span><span class="secondRowThirdColumn verticalLR font12" data-offset-x="254" data-offset-y="246">A</span><span class="secondRowFourthColumn horizontalTB font32" data-offset-x="221" data-offset-y="355">A</span>
+        <span class="thirdRowFirstColumn verticalLR font32 extraBottomPadding" data-offset-x="119" data-offset-y="10">A</span><span class="thirdRowSecondColumn horizontalTB font12" data-offset-x="159" data-offset-y="177">A</span><span class="thirdRowThirdColumn verticalLR font24" data-offset-x="122" data-offset-y="246">A</span><span class="thirdRowFourthColumn horizontalTB font16" data-offset-x="151" data-offset-y="380">A</span>
+        <span class="fourthRowFirstColumn verticalLR font24 extraTopPadding" data-offset-x="33" data-offset-y="10">A</span><span class="fourthRowSecondColumn horizontalTB font32" data-offset-x="17" data-offset-y="145">A</span><span class="fourthRowThirdColumn verticalLR font16 extraBottomPadding" data-offset-x="37" data-offset-y="246">A</span><span class="fourthRowFourthColumn horizontalTB font12" data-offset-x="57" data-offset-y="387">A</span>
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -123,10 +124,10 @@
</span><span class="cx"> 
</span><span class="cx"> <div style="position: relative">
</span><span class="cx">     <div class="grid fit-content itemsBaseline verticalRL">
</span><del>-        <span class="firstRowFirstColumn verticalLR font12" data-offset-x="351" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16 extraBottomPadding" data-offset-x="355" data-offset-y="114">A</span><span class="firstRowThirdColumn verticalLR font24" data-offset-x="339" data-offset-y="215">A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="323" data-offset-y="307">A</span>
-        <span class="secondRowFirstColumn horizontalTB font16 extraBottomPadding" data-offset-x="253" data-offset-y="22">A</span><span class="secondRowSecondColumn verticalLR font24" data-offset-x="229" data-offset-y="114">A</span><span class="secondRowThirdColumn horizontalTB font12" data-offset-x="261" data-offset-y="222">A</span><span class="secondRowFourthColumn verticalLR font32" data-offset-x="221" data-offset-y="307">A</span>
-        <span class="thirdRowFirstColumn  verticalLR font32" data-offset-x="119" data-offset-y="10">A</span><span class="thirdRowSecondColumn horizontalTB font12 extraLeftPadding" data-offset-x="137" data-offset-y="121">A</span><span class="thirdRowThirdColumn verticalLR font24" data-offset-x="127" data-offset-y="215">A</span><span class="thirdRowFourthColumn horizontalTB font16" data-offset-x="151" data-offset-y="332">A</span>
-        <span class="fourthRowFirstColumn horizontalTB font24" data-offset-x="33" data-offset-y="10">A</span><span class="fourthRowSecondColumn verticalLR font32" data-offset-x="17" data-offset-y="114">A</span><span class="fourthRowThirdColumn horizontalTB font16 extraBottomPadding" data-offset-x="49" data-offset-y="215">A</span><span class="fourthRowFourthColumn verticalLR font12" data-offset-x="37" data-offset-y="307">A</span>
</del><ins>+        <span class="firstRowFirstColumn verticalLR font12" data-offset-x="344" data-offset-y="10">A</span><span class="firstRowSecondColumn horizontalTB font16 extraBottomPadding" data-offset-x="355" data-offset-y="114">A</span><span class="firstRowThirdColumn verticalLR font24" data-offset-x="339" data-offset-y="215">A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="323" data-offset-y="307">A</span>
+        <span class="secondRowFirstColumn horizontalTB font16 extraBottomPadding" data-offset-x="253" data-offset-y="22">A</span><span class="secondRowSecondColumn verticalLR font24" data-offset-x="224" data-offset-y="114">A</span><span class="secondRowThirdColumn horizontalTB font12" data-offset-x="261" data-offset-y="222">A</span><span class="secondRowFourthColumn verticalLR font32" data-offset-x="221" data-offset-y="307">A</span>
+        <span class="thirdRowFirstColumn  verticalLR font32" data-offset-x="119" data-offset-y="10">A</span><span class="thirdRowSecondColumn horizontalTB font12 extraLeftPadding" data-offset-x="137" data-offset-y="121">A</span><span class="thirdRowThirdColumn verticalLR font24" data-offset-x="122" data-offset-y="215">A</span><span class="thirdRowFourthColumn horizontalTB font16" data-offset-x="151" data-offset-y="332">A</span>
+        <span class="fourthRowFirstColumn horizontalTB font24" data-offset-x="33" data-offset-y="10">A</span><span class="fourthRowSecondColumn verticalLR font32" data-offset-x="17" data-offset-y="114">A</span><span class="fourthRowThirdColumn horizontalTB font16 extraBottomPadding" data-offset-x="49" data-offset-y="215">A</span><span class="fourthRowFourthColumn verticalLR font12" data-offset-x="25" data-offset-y="307">A</span>
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -145,10 +146,10 @@
</span><span class="cx"> 
</span><span class="cx"> <div style="position: relative">
</span><span class="cx">     <div class="grid fit-content itemsBaseline">
</span><del>-        <span class="firstRowFirstColumn verticalLR font12 extraLeftPadding" data-offset-x="17" data-offset-y="10">A<br>A</span><span class="firstRowSecondColumn horizontalTB font16 extraBottomPadding" data-offset-x="185" data-offset-y="35">A<br>A</span><span class="firstRowThirdColumn verticalLR font24" data-offset-x="287" data-offset-y="10">A<br>A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="421" data-offset-y="10">A<br>A</span>
-        <span class="secondRowFirstColumn verticalLR font16 extraTopPadding" data-offset-x="35" data-offset-y="175">A<br>A</span><span class="secondRowSecondColumn horizontalTB font24" data-offset-x="185" data-offset-y="188">A<br>A</span><span class="secondRowThirdColumn verticalLR font12 extraTopPadding" data-offset-x="299" data-offset-y="175">A<br>A</span><span class="secondRowFourthColumn horizontalTB font32 extraLeftPadding" data-offset-x="421" data-offset-y="175">A<br>A</span>
-        <span class="thirdRowFirstColumn verticalLR font32" data-offset-x="19" data-offset-y="340">A<br>A</span><span class="thirdRowSecondColumn horizontalTB font12 extraTopPadding" data-offset-x="185" data-offset-y="340">A<br>A</span><span class="thirdRowThirdColumn verticalLR font24" data-offset-x="287" data-offset-y="340">A<br>A</span><span class="thirdRowFourthColumn horizontalTB font16" data-offset-x="421" data-offset-y="357">A<br>A</span>
-        <span class="fourthRowFirstColumn verticalLR font24" data-offset-x="27" data-offset-y="458">A<br>A</span><span class="fourthRowSecondColumn horizontalTB font32" data-offset-x="185" data-offset-y="458">A<br>A</span><span class="fourthRowThirdColumn verticalLR font16 extraBottomPadding" data-offset-x="295" data-offset-y="458">A<br>A</span><span class="fourthRowFourthColumn horizontalTB font12 extraTopPadding" data-offset-x="421" data-offset-y="466">A<br>A</span>
</del><ins>+        <span class="firstRowFirstColumn verticalLR font12 extraLeftPadding" data-offset-x="17" data-offset-y="10">A<br>A</span><span class="firstRowSecondColumn horizontalTB font16 extraBottomPadding" data-offset-x="197" data-offset-y="35">A<br>A</span><span class="firstRowThirdColumn verticalLR font24" data-offset-x="299" data-offset-y="10">A<br>A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="433" data-offset-y="10">A<br>A</span>
+        <span class="secondRowFirstColumn verticalLR font16 extraTopPadding" data-offset-x="38" data-offset-y="175">A<br>A</span><span class="secondRowSecondColumn horizontalTB font24" data-offset-x="197" data-offset-y="188">A<br>A</span><span class="secondRowThirdColumn verticalLR font12 extraTopPadding" data-offset-x="304" data-offset-y="175">A<br>A</span><span class="secondRowFourthColumn horizontalTB font32 extraLeftPadding" data-offset-x="433" data-offset-y="175">A<br>A</span>
+        <span class="thirdRowFirstColumn verticalLR font32" data-offset-x="31" data-offset-y="340">A<br>A</span><span class="thirdRowSecondColumn horizontalTB font12 extraTopPadding" data-offset-x="197" data-offset-y="340">A<br>A</span><span class="thirdRowThirdColumn verticalLR font24" data-offset-x="299" data-offset-y="340">A<br>A</span><span class="thirdRowFourthColumn horizontalTB font16" data-offset-x="433" data-offset-y="357">A<br>A</span>
+        <span class="fourthRowFirstColumn verticalLR font24" data-offset-x="34" data-offset-y="458">A<br>A</span><span class="fourthRowSecondColumn horizontalTB font32" data-offset-x="197" data-offset-y="458">A<br>A</span><span class="fourthRowThirdColumn verticalLR font16 extraBottomPadding" data-offset-x="303" data-offset-y="458">A<br>A</span><span class="fourthRowFourthColumn horizontalTB font12 extraTopPadding" data-offset-x="433" data-offset-y="466">A<br>A</span>
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -156,10 +157,10 @@
</span><span class="cx"> 
</span><span class="cx"> <div style="position: relative">
</span><span class="cx">     <div class="grid fit-content itemsBaseline">
</span><del>-        <span class="firstRowFirstColumn verticalLR font12 extraTopPadding" data-offset-x="37" data-offset-y="10">A<br>A</span><span class="firstRowSecondColumn horizontalTB font16 extraBottomPadding" data-offset-x="183" data-offset-y="35">A<br>A</span><span class="firstRowThirdColumn verticalLR font24" data-offset-x="371" data-offset-y="10">A<br>A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="505" data-offset-y="10">A<br>A</span>
-        <span class="secondRowFirstColumn horizontalTB font16" data-offset-x="17" data-offset-y="192">A<br>A</span><span class="secondRowSecondColumn verticalLR font24" data-offset-x="191" data-offset-y="175">A<br>A</span><span class="secondRowThirdColumn horizontalTB font12 extraTopPadding" data-offset-x="349" data-offset-y="175">A<br>A</span><span class="secondRowFourthColumn verticalLR font32" data-offset-x="505" data-offset-y="175">A<br>A</span>
</del><ins>+        <span class="firstRowFirstColumn verticalLR font12 extraTopPadding" data-offset-x="25" data-offset-y="10">A<br>A</span><span class="firstRowSecondColumn horizontalTB font16 extraBottomPadding" data-offset-x="183" data-offset-y="35">A<br>A</span><span class="firstRowThirdColumn verticalLR font24" data-offset-x="371" data-offset-y="10">A<br>A</span><span class="firstRowFourthColumn horizontalTB font32" data-offset-x="505" data-offset-y="10">A<br>A</span>
+        <span class="secondRowFirstColumn horizontalTB font16" data-offset-x="17" data-offset-y="192">A<br>A</span><span class="secondRowSecondColumn verticalLR font24" data-offset-x="186" data-offset-y="175">A<br>A</span><span class="secondRowThirdColumn horizontalTB font12 extraTopPadding" data-offset-x="349" data-offset-y="175">A<br>A</span><span class="secondRowFourthColumn verticalLR font32" data-offset-x="505" data-offset-y="175">A<br>A</span>
</ins><span class="cx">         <span class="thirdRowFirstColumn verticalLR font32" data-offset-x="17" data-offset-y="293">A<br>A</span><span class="thirdRowSecondColumn horizontalTB font12 extraTopPadding" data-offset-x="183" data-offset-y="300">A<br>A</span><span class="thirdRowThirdColumn verticalLR font24 extraLeftPadding" data-offset-x="349" data-offset-y="293">A<br>A</span><span class="thirdRowFourthColumn horizontalTB font16 extraTopPadding" data-offset-x="505" data-offset-y="293">A<br>A</span>
</span><del>-        <span class="fourthRowFirstColumn horizontalTB font24" data-offset-x="17" data-offset-y="418">A<br>A</span><span class="fourthRowSecondColumn verticalLR font32" data-offset-x="183" data-offset-y="418">A<br>A</span><span class="fourthRowThirdColumn horizontalTB font16" data-offset-x="349" data-offset-y="430">A<br>A</span><span class="fourthRowFourthColumn verticalLR font12" data-offset-x="525" data-offset-y="418">A<br>A</span>
</del><ins>+        <span class="fourthRowFirstColumn horizontalTB font24" data-offset-x="17" data-offset-y="418">A<br>A</span><span class="fourthRowSecondColumn verticalLR font32" data-offset-x="183" data-offset-y="418">A<br>A</span><span class="fourthRowThirdColumn horizontalTB font16" data-offset-x="349" data-offset-y="430">A<br>A</span><span class="fourthRowFourthColumn verticalLR font12" data-offset-x="513" data-offset-y="418">A<br>A</span>
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineverticallr04expectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-lr-04-expected.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-lr-04-expected.html   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-lr-04-expected.html      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">    float: left;
</span><span class="cx">    margin: 5px;
</span><span class="cx">    text-orientation: sideways;
</span><del>-   width: 350px;
</del><ins>+   width: 360px;
</ins><span class="cx">    height: 100px;
</span><span class="cx"> }
</span><span class="cx"> .block > :nth-child(1) { font-size:24px; }
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineverticallr04html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-lr-04.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-lr-04.html    2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-lr-04.html       2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">    float: left;
</span><span class="cx">    margin: 5px;
</span><span class="cx">    text-orientation: sideways;
</span><del>-   width: 350px;
</del><ins>+   width: 360px;
</ins><span class="cx">    height: 100px;
</span><span class="cx"> }
</span><span class="cx"> .block > :nth-child(1) { font-size:24px; }
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineverticalrl04expectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-rl-04-expected.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-rl-04-expected.html   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-rl-04-expected.html      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">    float: left;
</span><span class="cx">    margin: 5px;
</span><span class="cx">    text-orientation: sideways;
</span><del>-   width: 350px;
</del><ins>+   width: 360px;
</ins><span class="cx">    height: 100px;
</span><span class="cx"> }
</span><span class="cx"> .block > :nth-child(1) { font-size:24px; }
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridselfbaselineverticalrl04html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-rl-04.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-rl-04.html    2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-self-baseline-vertical-rl-04.html       2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">    float: left;
</span><span class="cx">    margin: 5px;
</span><span class="cx">    text-orientation: sideways;
</span><del>-   width: 350px;
</del><ins>+   width: 360px;
</ins><span class="cx">    height: 100px;
</span><span class="cx"> }
</span><span class="cx"> .block > :nth-child(1) { font-size:24px; }
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2018-11-23  Javier Fernandez  <jfernandez@igalia.com>
+
+        [css-grid] Implement Baseline Alignment for grid items
+        https://bugs.webkit.org/show_bug.cgi?id=145566
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        Updated test expectations of severla tests, that are now passing with the new code.
+
+        * resources/import-expectations.json:
+        * web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-001-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-002-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-003-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-004-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-005-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-006-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-007-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-008-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-001-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-002-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-003-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-004-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-001-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-002-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-003-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-004-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-001-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-002-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003-expected.txt:
+        * web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-007.html:
+        * web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-008.html:
+        * web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-009.html:
+        * web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-010.html:
+        * web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-011.html:
+        * web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-012.html:
+        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-002-expected.txt:
+        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-lr-002-expected.txt:
+        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-rl-002-expected.txt:
+        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt:
+        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt:
+        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt:
+
</ins><span class="cx"> 2018-11-20  Manuel Rego Casasnovas  <rego@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges001expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-001-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-001-expected.txt   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-001-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,9 +1,5 @@
</span><span class="cx"> 
</span><del>-FAIL .before 1 assert_equals: 
-<div id="item3" data-expected-width="50" data-expected-height="30" data-offset-x="100" class=" before" data-offset-y="20"></div>
-offsetTop expected 20 but got 0
</del><ins>+PASS .before 1 
</ins><span class="cx"> PASS .before 2 
</span><del>-FAIL .before 3 assert_equals: 
-<div id="item1" data-expected-width="50" data-expected-height="20" data-offset-x="0" class=" before" data-offset-y="30"></div>
-offsetTop expected 30 but got 0
</del><ins>+PASS .before 3 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-002-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-002-expected.txt   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-002-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,7 +1,5 @@
</span><span class="cx"> 
</span><span class="cx"> PASS .before 1 
</span><span class="cx"> PASS .before 2 
</span><del>-FAIL .before 3 assert_equals: 
-<div id="item1" data-expected-width="50" data-expected-height="20" data-offset-x="0" class=" before" data-offset-y="10"></div>
-offsetTop expected 10 but got 0
</del><ins>+PASS .before 3 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges003expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-003-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-003-expected.txt   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-003-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,9 +1,5 @@
</span><span class="cx"> 
</span><del>-FAIL .before 1 assert_equals: 
-<div id="item3" data-expected-width="30" data-expected-height="50" data-offset-y="100" class=" before" data-offset-x="20"></div>
-offsetLeft expected 20 but got 0
</del><ins>+PASS .before 1 
</ins><span class="cx"> PASS .before 2 
</span><del>-FAIL .before 3 assert_equals: 
-<div id="item1" data-expected-width="20" data-expected-height="50" data-offset-y="0" class=" before" data-offset-x="30"></div>
-offsetLeft expected 30 but got 0
</del><ins>+PASS .before 3 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges004expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-004-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-004-expected.txt   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-004-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,7 +1,5 @@
</span><span class="cx"> 
</span><span class="cx"> PASS .before 1 
</span><span class="cx"> PASS .before 2 
</span><del>-FAIL .before 3 assert_equals: 
-<div id="item1" data-expected-width="20" data-expected-height="50" data-offset-y="0" class=" before" data-offset-x="10"></div>
-offsetLeft expected 10 but got 0
</del><ins>+PASS .before 3 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges005expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-005-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-005-expected.txt   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-005-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -2,11 +2,7 @@
</span><span class="cx"> É
</span><span class="cx"> É
</span><span class="cx"> 
</span><del>-FAIL .before 1 assert_equals: 
-<div id="item3" data-expected-width="50" data-expected-height="30" data-offset-x="100" class=" before" data-offset-y="8">É</div>
-offsetTop expected 8 but got 0
</del><ins>+PASS .before 1 
</ins><span class="cx"> PASS .before 2 
</span><del>-FAIL .before 3 assert_equals: 
-<div id="item1" data-expected-width="50" data-expected-height="20" data-offset-x="0" class=" before" data-offset-y="16">É</div>
-offsetTop expected 16 but got 0
</del><ins>+PASS .before 3 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges006expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-006-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-006-expected.txt   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-006-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -4,7 +4,5 @@
</span><span class="cx"> 
</span><span class="cx"> PASS .before 1 
</span><span class="cx"> PASS .before 2 
</span><del>-FAIL .before 3 assert_equals: 
-<div id="item1" data-expected-width="50" data-expected-height="20" data-offset-x="0" class=" before" data-offset-y="8">É</div>
-offsetTop expected 8 but got 0
</del><ins>+PASS .before 3 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges007expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-007-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-007-expected.txt   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-007-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -2,11 +2,7 @@
</span><span class="cx"> É
</span><span class="cx"> É
</span><span class="cx"> 
</span><del>-FAIL .before 1 assert_equals: 
-<div id="item3" data-expected-width="30" data-expected-height="50" data-offset-y="100" class=" before" data-offset-x="2">É</div>
-offsetLeft expected 2 but got 0
</del><ins>+PASS .before 1 
</ins><span class="cx"> PASS .before 2 
</span><del>-FAIL .before 3 assert_equals: 
-<div id="item1" data-expected-width="20" data-expected-height="50" data-offset-y="0" class=" before" data-offset-x="4">É</div>
-offsetLeft expected 4 but got 0
</del><ins>+PASS .before 3 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridalignmentstylechanges008expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-008-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-008-expected.txt   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-008-expected.txt      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -6,5 +6,5 @@
</span><span class="cx"> PASS .before 2 
</span><span class="cx"> FAIL .before 3 assert_equals: 
</span><span class="cx"> <div id="item1" data-expected-width="20" data-expected-height="50" data-offset-y="0" class=" before" data-offset-x="5">É</div>
</span><del>-offsetLeft expected 5 but got 0
</del><ins>+offsetLeft expected 5 but got 2
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridcolumnaxisselfbaselinesynthesized001expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-001-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-001-expected.txt     2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-001-expected.txt        2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -11,32 +11,8 @@
</span><span class="cx"> ÉÉ É ÉÉÉ É ÉÉ É
</span><span class="cx"> É É ÉÉ
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-<div class="grid alignItemsBaseline verticalRL">
-  <div class="firstRowFirstColumn horizontalTB" data-offset-x="100" data-offset-y="0" data-expected-width="200" data-expected-height="100">ÉÉ É ÉÉÉ É ÉÉ É</div>
-  <div class="firstRowSecondColumn bigFont paddingRight" data-offset-x="40" data-offset-y="100" data-expected-width="125" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 width25"></div>
-</div>
-offsetLeft expected 40 but got 175
-FAIL .grid 2 assert_equals: 
-<div class="grid alignItemsBaseline verticalLR">
-  <div class="firstRowFirstColumn horizontalTB" data-offset-x="35" data-offset-y="0" data-expected-width="200" data-expected-height="100">ÉÉ É ÉÉÉ É ÉÉ É</div>
-  <div class="firstRowSecondColumn bigFont paddingLeft" data-offset-x="0" data-offset-y="100" data-expected-width="125" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 width25"></div>
-</div>
-offsetLeft expected 35 but got 0
-FAIL .grid 3 assert_equals: 
-<div class="grid width300 alignItemsBaseline">
-  <div class="firstRowFirstColumn verticalLR" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="200">ÉÉ É ÉÉÉ É ÉÉ É</div>
-  <div class="firstRowSecondColumn bigFont" data-offset-x="100" data-offset-y="160" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 height25"></div>
-</div>
-offsetTop expected 160 but got 0
-FAIL .grid 4 assert_equals: 
-<div class="grid width300 alignItemsBaseline">
-  <div class="firstRowFirstColumn verticalRL" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="200">ÉÉ É ÉÉÉ É ÉÉ É</div>
-  <div class="firstRowSecondColumn bigFont" data-offset-x="100" data-offset-y="160" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 height25"></div>
-</div>
-offsetTop expected 160 but got 0
</del><ins>+PASS .grid 1 
+PASS .grid 2 
+PASS .grid 3 
+PASS .grid 4 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridcolumnaxisselfbaselinesynthesized002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-002-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-002-expected.txt     2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-002-expected.txt        2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -5,25 +5,7 @@
</span><span class="cx"> VerticalRL grid and item with fixed width
</span><span class="cx"> É É ÉÉ
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-<div class="grid alignItemsBaseline verticalRL">
-  <div class="firstRowFirstColumn fixedWidth" data-offset-x="175" data-offset-y="0" data-expected-width="125" data-expected-height="100"></div>
-  <div class="firstRowSecondColumn bigFont paddingRight" data-offset-x="115" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 width25"></div>
-</div>
-offsetLeft expected 115 but got 180
-FAIL .grid 2 assert_equals: 
-<div class="grid alignItemsBaseline verticalLR">
-  <div class="firstRowFirstColumn fixedWidth" data-offset-x="30" data-offset-y="0" data-expected-width="125" data-expected-height="100"></div>
-  <div class="firstRowSecondColumn bigFont paddingLeft" data-offset-x="0" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 width25"></div>
-</div>
-offsetLeft expected 30 but got 0
-FAIL .grid 3 assert_equals: 
-<div class="grid width300 alignItemsBaseline">
-  <div class="firstRowFirstColumn fixedHeight" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="125"></div>
-  <div class="firstRowSecondColumn bigFont" data-offset-x="100" data-offset-y="85" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 height25"></div>
-</div>
-offsetTop expected 85 but got 0
</del><ins>+PASS .grid 1 
+PASS .grid 2 
+PASS .grid 3 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridcolumnaxisselfbaselinesynthesized003expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-003-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-003-expected.txt     2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-003-expected.txt        2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -5,25 +5,7 @@
</span><span class="cx"> VerticalRL grid and item with rlative width
</span><span class="cx"> É É ÉÉ
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-<div class="grid alignItemsBaseline verticalRL">
-  <div class="firstRowFirstColumn relativeWidth" data-offset-x="200" data-offset-y="0" data-expected-width="100" data-expected-height="100"></div>
-  <div class="firstRowSecondColumn bigFont paddingRight" data-offset-x="140" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 width25"></div>
-</div>
-offsetLeft expected 140 but got 180
-FAIL .grid 2 assert_equals: 
-<div class="grid alignItemsBaseline verticalLR">
-  <div class="firstRowFirstColumn relativeWidth" data-offset-x="30" data-offset-y="0" data-expected-width="100" data-expected-height="100"></div>
-  <div class="firstRowSecondColumn bigFont paddingLeft" data-offset-x="0" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 width25"></div>
-</div>
-offsetLeft expected 30 but got 0
-FAIL .grid 3 assert_equals: 
-<div class="grid width300 alignItemsBaseline">
-  <div class="firstRowFirstColumn relativeHeight" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="100"></div>
-  <div class="firstRowSecondColumn bigFont" data-offset-x="100" data-offset-y="60" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 height25"></div>
-</div>
-offsetTop expected 60 but got 0
</del><ins>+PASS .grid 1 
+PASS .grid 2 
+PASS .grid 3 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridcolumnaxisselfbaselinesynthesized004expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-004-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-004-expected.txt     2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-004-expected.txt        2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -5,25 +5,7 @@
</span><span class="cx"> VerticalRL grid and item with fixed width
</span><span class="cx"> É É ÉÉ
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-<div class="grid alignItemsBaseline verticalRL">
-  <div class="firstRowFirstColumn fixedWidth" data-offset-x="85" data-offset-y="0" data-expected-width="125" data-expected-height="100"></div>
-  <div class="firstRowSecondColumn bigFont paddingRight" data-offset-x="25" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 width25"></div>
-</div>
-offsetLeft expected 85 but got 25
-FAIL .grid 2 assert_equals: 
-<div class="grid alignItemsBaseline verticalLR">
-  <div class="firstRowFirstColumn fixedWidth" data-offset-x="30" data-offset-y="0" data-expected-width="125" data-expected-height="100"></div>
-  <div class="firstRowSecondColumn bigFont paddingLeft" data-offset-x="0" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 width25"></div>
-</div>
-offsetLeft expected 30 but got 0
-FAIL .grid 3 assert_equals: 
-<div class="grid width300 alignItemsBaseline">
-  <div class="firstRowFirstColumn fixedHeight" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="125"></div>
-  <div class="firstRowSecondColumn bigFont" data-offset-x="100" data-offset-y="85" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowAutoColumnSpanning2 height25"></div>
-</div>
-offsetTop expected 85 but got 0
</del><ins>+PASS .grid 1 
+PASS .grid 2 
+PASS .grid 3 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridrowaxisselfbaselinesynthesized001expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-001-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-001-expected.txt        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-001-expected.txt   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -11,32 +11,8 @@
</span><span class="cx"> ÉÉ É ÉÉÉ É ÉÉ É
</span><span class="cx"> É É ÉÉ
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-<div class="grid justifyItemsBaseline verticalRL">
-  <div class="firstRowFirstColumn" data-offset-x="200" data-offset-y="0" data-expected-width="100" data-expected-height="200">ÉÉ É ÉÉÉ É ÉÉ É</div>
-  <div class="secondRowFirstColumn bigFont horizontalTB" data-offset-x="0" data-offset-y="160" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn height25"></div>
-</div>
-offsetTop expected 160 but got 0
-FAIL .grid 2 assert_equals: 
-<div class="grid justifyItemsBaseline verticalLR">
-  <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="200">ÉÉ É ÉÉÉ É ÉÉ É</div>
-  <div class="secondRowFirstColumn bigFont horizontalTB" data-offset-x="100" data-offset-y="160" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn height25"></div>
-</div>
-offsetTop expected 160 but got 0
-FAIL .grid 3 assert_equals: 
-<div class="grid width300 justifyItemsBaseline">
-  <div class="firstRowFirstColumn" data-offset-x="35" data-offset-y="0" data-expected-width="200" data-expected-height="100">ÉÉ É ÉÉÉ É ÉÉ É</div>
-  <div class="secondRowFirstColumn bigFont paddingLeft verticalLR" data-offset-x="0" data-offset-y="100" data-expected-width="125" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn width25"></div>
-</div>
-offsetLeft expected 35 but got 0
-FAIL .grid 4 assert_equals: 
-<div class="grid width300 justifyItemsBaseline">
-  <div class="firstRowFirstColumn" data-offset-x="60" data-offset-y="0" data-expected-width="200" data-expected-height="100">ÉÉ É ÉÉÉ É ÉÉ É</div>
-  <div class="secondRowFirstColumn bigFont paddingRight verticalRL" data-offset-x="0" data-offset-y="100" data-expected-width="125" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn width25"></div>
-</div>
-offsetLeft expected 60 but got 0
</del><ins>+PASS .grid 1 
+PASS .grid 2 
+PASS .grid 3 
+PASS .grid 4 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridrowaxisselfbaselinesynthesized002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-002-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-002-expected.txt        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-002-expected.txt   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -7,32 +7,8 @@
</span><span class="cx"> VerticalRL grid and item with fixed width
</span><span class="cx"> É É ÉÉ
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-<div class="grid justifyItemsBaseline verticalRL">
-  <div class="firstRowFirstColumn fixedHeight" data-offset-x="200" data-offset-y="0" data-expected-width="100" data-expected-height="125"></div>
-  <div class="secondRowFirstColumn bigFont horizontalTB" data-offset-x="0" data-offset-y="85" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn height25"></div>
-</div>
-offsetTop expected 85 but got 0
-FAIL .grid 2 assert_equals: 
-<div class="grid justifyItemsBaseline verticalLR">
-  <div class="firstRowFirstColumn fixedHeight" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="125"></div>
-  <div class="secondRowFirstColumn bigFont horizontalTB" data-offset-x="100" data-offset-y="85" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn height25"></div>
-</div>
-offsetTop expected 85 but got 0
-FAIL .grid 3 assert_equals: 
-<div class="grid width300 justifyItemsBaseline">
-  <div class="firstRowFirstColumn fixedWidth" data-offset-x="60" data-offset-y="0" data-expected-width="125" data-expected-height="100"></div>
-  <div class="secondRowFirstColumn bigFont paddingRight verticalRL" data-offset-x="0" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn width25"></div>
-</div>
-offsetLeft expected 60 but got 0
-FAIL .grid 4 assert_equals: 
-<div class="grid width300 justifyItemsBaseline">
-  <div class="firstRowFirstColumn fixedWidth" data-offset-x="30" data-offset-y="0" data-expected-width="125" data-expected-height="100"></div>
-  <div class="secondRowFirstColumn bigFont paddingLeft verticalLR" data-offset-x="0" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn width25"></div>
-</div>
-offsetLeft expected 30 but got 0
</del><ins>+PASS .grid 1 
+PASS .grid 2 
+PASS .grid 3 
+PASS .grid 4 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridrowaxisselfbaselinesynthesized003expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-003-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-003-expected.txt        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-003-expected.txt   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -7,32 +7,8 @@
</span><span class="cx"> VerticalRL grid and item with relative height
</span><span class="cx"> É É ÉÉ
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-<div class="grid justifyItemsBaseline verticalRL">
-  <div class="firstRowFirstColumn relativeHeight" data-offset-x="200" data-offset-y="0" data-expected-width="100" data-expected-height="100"></div>
-  <div class="secondRowFirstColumn bigFont horizontalTB" data-offset-x="0" data-offset-y="60" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn height25"></div>
-</div>
-offsetTop expected 60 but got 0
-FAIL .grid 2 assert_equals: 
-<div class="grid justifyItemsBaseline verticalLR">
-  <div class="firstRowFirstColumn relativeHeight" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="100"></div>
-  <div class="secondRowFirstColumn bigFont horizontalTB" data-offset-x="100" data-offset-y="60" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn height25"></div>
-</div>
-offsetTop expected 60 but got 0
-FAIL .grid 3 assert_equals: 
-<div class="grid width300 justifyItemsBaseline">
-  <div class="firstRowFirstColumn relativeWidth" data-offset-x="60" data-offset-y="0" data-expected-width="100" data-expected-height="100"></div>
-  <div class="secondRowFirstColumn bigFont paddingRight verticalRL" data-offset-x="0" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn width25"></div>
-</div>
-offsetLeft expected 60 but got 0
-FAIL .grid 4 assert_equals: 
-<div class="grid width300 justifyItemsBaseline">
-  <div class="firstRowFirstColumn relativeWidth" data-offset-x="30" data-offset-y="0" data-expected-width="100" data-expected-height="100"></div>
-  <div class="secondRowFirstColumn bigFont paddingLeft verticalLR" data-offset-x="0" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn width25"></div>
-</div>
-offsetLeft expected 30 but got 0
</del><ins>+PASS .grid 1 
+PASS .grid 2 
+PASS .grid 3 
+PASS .grid 4 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridrowaxisselfbaselinesynthesized004expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-004-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-004-expected.txt        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-004-expected.txt   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -7,32 +7,8 @@
</span><span class="cx">  VerticalRL grid and item with fixed height
</span><span class="cx"> É É ÉÉ
</span><span class="cx"> 
</span><del>-FAIL .inline-grid 1 assert_equals: 
-<div class="inline-grid justifyItemsBaseline verticalRL">
-  <div class="firstRowFirstColumn fixedHeight" data-offset-x="200" data-offset-y="0" data-expected-width="100" data-expected-height="125"></div>
-  <div class="secondRowFirstColumn bigFont horizontalTB" data-offset-x="0" data-offset-y="85" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn height25"></div>
-</div>
-offsetTop expected 85 but got 0
-FAIL .inline-grid 2 assert_equals: 
-<div class="inline-grid justifyItemsBaseline verticalLR">
-  <div class="firstRowFirstColumn fixedHeight" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="125"></div>
-  <div class="secondRowFirstColumn bigFont horizontalTB" data-offset-x="100" data-offset-y="85" data-expected-width="200" data-expected-height="100">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn height25"></div>
-</div>
-offsetTop expected 85 but got 0
-FAIL .inline-grid 3 assert_equals: 
-<div class="inline-grid justifyItemsBaseline" data-expected-width="210" data-expected-height="300">
-  <div class="firstRowFirstColumn fixedWidth" data-offset-x="60" data-offset-y="0" data-expected-width="125" data-expected-height="100"></div>
-  <div class="secondRowFirstColumn bigFont paddingRight verticalRL" data-offset-x="0" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn width25"></div>
-</div>
-width expected 210 but got 150
-FAIL .inline-grid 4 assert_equals: 
-<div class="inline-grid justifyItemsBaseline" data-expected-width="180" data-expected-height="300">
-  <div class="firstRowFirstColumn fixedWidth" data-offset-x="30" data-offset-y="0" data-expected-width="125" data-expected-height="100"></div>
-  <div class="secondRowFirstColumn bigFont paddingLeft verticalLR" data-offset-x="0" data-offset-y="100" data-expected-width="120" data-expected-height="200">É É ÉÉ</div>
-  <div class="autoRowSpanning2AutoColumn width25"></div>
-</div>
-width expected 180 but got 150
</del><ins>+PASS .inline-grid 1 
+PASS .inline-grid 2 
+PASS .inline-grid 3 
+PASS .inline-grid 4 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridselfbaselinenotappliedifsizingcyclicdependency001expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-001-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-001-expected.txt     2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-001-expected.txt        2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -18,48 +18,12 @@
</span><span class="cx">  flex max-function columns - items with relative width
</span><span class="cx"> baseline is not applied initially, but orthogonal items force repeating the track sizing and height is not indefinite in that phase.
</span><span class="cx"> 
</span><del>-FAIL .inline-grid 1 assert_equals: 
-<div class="inline-grid justifyItemsBaseline rows max-flex-columns">
-        <div class="firstRowFirstColumn verticalRL width50" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
-        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="-50" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div>
-        <div class="firstRowSpanning2AutoColumn verticalRL width25" data-offset-x="50" data-offset-y="0" data-expected-width="25" data-expected-height="200"></div>
-    </div>
-offsetLeft expected -50 but got 0
-FAIL .inline-grid 2 assert_equals: 
-<div class="inline-grid justifyItemsBaseline rows flex-columns">
-        <div class="firstRowFirstColumn verticalRL width50" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
-        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="0" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div>
-        <div class="firstRowSpanning2AutoColumn verticalRL width25" data-offset-x="50" data-offset-y="0" data-expected-width="25" data-expected-height="200"></div>
-    </div>
-width expected 100 but got 300
-FAIL .inline-grid 3 assert_equals: 
-<div class="inline-grid justifyItemsBaseline rows fit-content-columns">
-        <div class="firstRowFirstColumn verticalRL" data-offset-x="0" data-offset-y="0" data-expected-width="80" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
-        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="0" data-offset-y="100" data-expected-width="160" data-expected-height="100"></div>
-        <div class="firstRowSpanning2AutoColumn verticalRL width25" data-offset-x="80" data-offset-y="0" data-expected-width="25" data-expected-height="200"></div>
-    </div>
-width expected 160 but got 420
-FAIL .inline-grid 4 assert_equals: 
-<div class="inline-grid justifyItemsBaseline rows max-content-columns">
-        <div class="firstRowFirstColumn verticalRL" data-offset-x="0" data-offset-y="0" data-expected-width="80" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
-        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="0" data-offset-y="100" data-expected-width="160" data-expected-height="100"></div>
-        <div class="firstRowSpanning2AutoColumn verticalRL width25" data-offset-x="80" data-offset-y="0" data-expected-width="25" data-expected-height="200"></div>
-    </div>
-width expected 160 but got 420
-FAIL .inline-grid 5 assert_equals: 
-<div class="inline-grid justifyItemsBaseline rows min-content-columns">
-        <div class="firstRowFirstColumn verticalRL" data-offset-x="0" data-offset-y="0" data-expected-width="80" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
-        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="0" data-offset-y="100" data-expected-width="160" data-expected-height="100"></div>
-        <div class="firstRowSpanning2AutoColumn verticalRL width25" data-offset-x="80" data-offset-y="0" data-expected-width="25" data-expected-height="200"></div>
-    </div>
-width expected 160 but got 420
-FAIL .inline-grid 6 assert_equals: 
-<div class="inline-grid justifyItemsBaseline rows">
-        <div class="firstRowFirstColumn verticalRL width50" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
-        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="0" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div>
-        <div class="firstRowSpanning2AutoColumn verticalRL width25" data-offset-x="50" data-offset-y="0" data-expected-width="25" data-expected-height="200"></div>
-    </div>
-width expected 100 but got 300
</del><ins>+PASS .inline-grid 1 
+PASS .inline-grid 2 
+PASS .inline-grid 3 
+PASS .inline-grid 4 
+PASS .inline-grid 5 
+PASS .inline-grid 6 
</ins><span class="cx"> PASS .inline-grid 7 
</span><span class="cx"> PASS .inline-grid 8 
</span><span class="cx"> PASS .inline-grid 9 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridselfbaselinenotappliedifsizingcyclicdependency002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-002-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-002-expected.txt     2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-002-expected.txt        2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -75,49 +75,25 @@
</span><span class="cx"> É
</span><span class="cx"> ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É
</span><span class="cx"> 
</span><del>-FAIL .inline-grid 1 assert_equals: 
-<div class="inline-grid verticalRL alignItemsBaseline columns max-flex-rows">
-  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="-10" data-offset-y="0" data-expected-width="75" data-expected-height="100">É</div>
-  <div class="firstRowSecondColumn horizontalTB" data-offset-x="25" data-offset-y="100" data-expected-width="416" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
-  <div class="autoRowAutoColumnSpanning2 width25" data-offset-x="0" data-offset-y="0" data-expected-width="25" data-expected-height="200"></div>
-</div>
-offsetLeft expected -10 but got 366
</del><ins>+PASS .inline-grid 1 
</ins><span class="cx"> PASS .inline-grid 2 
</span><span class="cx"> PASS .inline-grid 3 
</span><span class="cx"> PASS .inline-grid 4 
</span><span class="cx"> PASS .inline-grid 5 
</span><span class="cx"> PASS .inline-grid 6 
</span><del>-FAIL .inline-grid 7 assert_equals: 
-<div class="inline-grid verticalLR alignItemsBaseline columns max-flex-rows">
-  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="0" data-offset-y="0" data-expected-width="75" data-expected-height="100">É</div>
-  <div class="firstRowSecondColumn horizontalTB" data-offset-x="35" data-offset-y="100" data-expected-width="416" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
-  <div class="autoRowAutoColumnSpanning2 width25" data-offset-x="416" data-offset-y="0" data-expected-width="25" data-expected-height="200"></div>
-</div>
-offsetLeft expected 35 but got 0
</del><ins>+PASS .inline-grid 7 
</ins><span class="cx"> PASS .inline-grid 8 
</span><span class="cx"> PASS .inline-grid 9 
</span><span class="cx"> PASS .inline-grid 10 
</span><span class="cx"> PASS .inline-grid 11 
</span><span class="cx"> PASS .inline-grid 12 
</span><del>-FAIL .inline-grid 13 assert_equals: 
-<div class="inline-grid justifyItemsBaseline rows max-flex-columns">
-  <div class="firstRowFirstColumn bigFont verticalLR paddingLeft" data-offset-x="0" data-offset-y="0" data-expected-width="75" data-expected-height="100">É</div>
-  <div class="secondRowFirstColumn" data-offset-x="35" data-offset-y="100" data-expected-width="416" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
-  <div class="firstRowSpanning2AutoColumn width25" data-offset-x="416" data-offset-y="0" data-expected-width="25" data-expected-height="200"></div>
-</div>
-offsetLeft expected 35 but got 0
</del><ins>+PASS .inline-grid 13 
</ins><span class="cx"> PASS .inline-grid 14 
</span><span class="cx"> PASS .inline-grid 15 
</span><span class="cx"> PASS .inline-grid 16 
</span><span class="cx"> PASS .inline-grid 17 
</span><span class="cx"> PASS .inline-grid 18 
</span><del>-FAIL .inline-grid 19 assert_equals: 
-<div class="inline-grid alignItemsBaseline columns max-flex-rows">
-  <div class="firstRowFirstColumn bigFont paddingBottom" data-offset-x="0" data-offset-y="376" data-expected-width="100" data-expected-height="75">É</div>
-  <div class="firstRowSecondColumn verticalLR" data-offset-x="100" data-offset-y="0" data-expected-width="100" data-expected-height="416">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
-  <div class="autoRowAutoColumnSpanning2 height25" data-offset-x="0" data-offset-y="416" data-expected-width="200" data-expected-height="25"></div>
-</div>
-offsetTop expected 376 but got 0
</del><ins>+PASS .inline-grid 19 
</ins><span class="cx"> PASS .inline-grid 20 
</span><span class="cx"> PASS .inline-grid 21 
</span><span class="cx"> PASS .inline-grid 22 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentgridselfbaselinenotappliedifsizingcyclicdependency003expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003-expected.txt     2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003-expected.txt        2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -19,46 +19,10 @@
</span><span class="cx"> É
</span><span class="cx"> É
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-<div class="grid column justifyItemsBaseline">
-  <div class="item1 relativeWidth height50" data-offset-x="16" data-offset-y="0" data-expected-width="40" data-expected-height="50"></div>
-  <div class="item2" data-offset-x="16" data-offset-y="50" data-expected-width="20" data-expected-height="50">É</div>
-  <div class="item3 verticalLR" data-offset-x="0" data-offset-y="100" data-expected-width="80" data-expected-height="100">É</div>
-</div>
-offsetLeft expected 16 but got 0
-FAIL .grid 2 assert_equals: 
-<div class="grid column justifyItemsBaseline">
-  <div class="item1 relativeWidth height50" data-offset-x="16" data-offset-y="0" data-expected-width="40" data-expected-height="50"></div>
-  <div class="item2 verticalLR" data-offset-x="12" data-offset-y="50" data-expected-width="20" data-expected-height="50">É</div>
-  <div class="item3 verticalLR" data-offset-x="0" data-offset-y="100" data-expected-width="80" data-expected-height="100">É</div>
-</div>
-offsetLeft expected 16 but got 0
-FAIL .grid 3 assert_equals: 
-<div class="grid column justifyItemsBaseline">
-  <div class="item1" data-offset-x="16" data-offset-y="0" data-expected-width="30" data-expected-height="50">É</div>
-  <div class="item2 verticalLR" data-offset-x="12" data-offset-y="50" data-expected-width="20" data-expected-height="50">É</div>
-  <div class="item3 verticalLR" data-offset-x="0" data-offset-y="100" data-expected-width="80" data-expected-height="100">É</div>
-</div>
-offsetLeft expected 16 but got 0
-FAIL .grid 4 assert_equals: 
-<div class="grid row alignItemsBaseline">
-  <div class="item1 relativeHeight" data-offset-x="0" data-offset-y="24" data-expected-width="50" data-expected-height="40"></div>
-  <div class="item2 verticalLR" data-offset-x="50" data-offset-y="44" data-expected-width="50" data-expected-height="20">É</div>
-  <div class="item3" data-offset-x="100" data-offset-y="0" data-expected-width="100" data-expected-height="80">É</div>
-</div>
-offsetTop expected 24 but got 0
-FAIL .grid 5 assert_equals: 
-<div class="grid row alignItemsBaseline ">
-  <div class="item1 relativeHeight" data-offset-x="0" data-offset-y="40" data-expected-width="50" data-expected-height="40"></div>
-  <div class="item2" data-offset-x="50" data-offset-y="64" data-expected-width="50" data-expected-height="20">É</div>
-  <div class="item3 verticalLR" data-offset-x="100" data-offset-y="0" data-expected-width="100" data-expected-height="80">É</div>
-</div>
-offsetTop expected 40 but got 0
-FAIL .grid 6 assert_equals: 
-<div class="grid row alignItemsBaseline">
-  <div class="item1 verticalLR" data-offset-x="0" data-offset-y="34" data-expected-width="50" data-expected-height="30">É</div>
-  <div class="item2" data-offset-x="50" data-offset-y="48" data-expected-width="50" data-expected-height="20">É</div>
-  <div class="item3" data-offset-x="100" data-offset-y="0" data-expected-width="100" data-expected-height="80">É</div>
-</div>
-offsetTop expected 34 but got 0
</del><ins>+PASS .grid 1 
+PASS .grid 2 
+PASS .grid 3 
+PASS .grid 4 
+PASS .grid 5 
+PASS .grid 6 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize002html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-002.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-002.html        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-002.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -28,7 +28,8 @@
</span><span class="cx">   color: green;
</span><span class="cx">   grid-auto-columns: 50px;
</span><span class="cx">   align-items: baseline;
</span><del>-  align-content: space-evenly;
</del><ins>+  align-content: space-between;
+  -webkit-text-orientation: sideways;
</ins><span class="cx"> }
</span><span class="cx"> .firstRowFirstColumn {
</span><span class="cx">   grid-row: 1;
</span><span class="lines">@@ -45,12 +46,14 @@
</span><span class="cx"> </style>
</span><span class="cx"> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
</span><span class="cx"> <div class="block">
</span><del>-  <div style="top: 25px; left: 0px;">XX<br>XXXX<br>XX</div>
-  <div style="top: 73px; left: 0px;">XX X</div>
-  <div style="top: 17px; left: 50px" class="big">X</div>
</del><ins>+  <div style="top: 8px; left: 0px;">XX<br>XXXX<br>XX</div>
+  <div style="top: 70px; left: 0px;">XX X</div>
+  <div style="top: 80px; left: 0px;">X XX</div>
+  <div style="top: 90px; left: 0px;">X</div>
+  <div style="top: 0px; left: 50px" class="big">X</div>
</ins><span class="cx"> </div>
</span><span class="cx"> <div class="grid">
</span><span class="cx">   <div class="firstRowFirstColumn">XX XXXX XX</div>
</span><span class="cx">   <div class="firstRowSecondColumn big">X</div>
</span><del>-  <div class="secondRowFirstColumn">XX X</div>
</del><ins>+  <div class="secondRowFirstColumn">XX X X XX X</div>
</ins><span class="cx"> </div>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize007html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-007.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-007.html        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-007.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -13,9 +13,9 @@
</span><span class="cx"> .block {
</span><span class="cx">   position: absolute;
</span><span class="cx">   z-index: -1;
</span><del>-  background: green;
</del><span class="cx">   width: 100px;
</span><span class="cx">   height: 100px;
</span><ins>+  background: green;
</ins><span class="cx"> }
</span><span class="cx"> .block > div {
</span><span class="cx">   position: absolute;
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx">   grid-auto-rows: 50px;
</span><span class="cx">   justify-items: baseline;
</span><span class="cx">   justify-content: start;
</span><ins>+  -webkit-text-orientation: sideways;
</ins><span class="cx"> }
</span><span class="cx"> .grid > div { writing-mode: vertical-lr; }
</span><span class="cx"> .firstRowFirstColumn {
</span><span class="lines">@@ -46,9 +47,9 @@
</span><span class="cx"> </style>
</span><span class="cx"> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
</span><span class="cx"> <div class="block">
</span><del>-  <div style="top: 0px; left: 5px;">XXXX<br>XXXX</div>
-  <div style="top: 20px; left: 15px;">X</div>
-  <div style="top: 30px; left: 15px;">X X</div>
</del><ins>+  <div style="top: 0px; left: 2px;">XXXX<br>XXXX</div>
+  <div style="top: 20px; left: 12px;">X</div>
+  <div style="top: 30px; left: 12px;">X X</div>
</ins><span class="cx">   <div style="top: 50px; left: 0px" class="big">X</div>
</span><span class="cx"> </div>
</span><span class="cx"> <div class="grid">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize008html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-008.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-008.html        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-008.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -28,9 +28,11 @@
</span><span class="cx">   color: green;
</span><span class="cx">   grid-auto-rows: 50px;
</span><span class="cx">   justify-items: baseline;
</span><del>-  justify-content: space-evenly;
</del><ins>+  justify-content: space-between;
+  -webkit-text-orientation: sideways;
</ins><span class="cx"> }
</span><span class="cx"> .grid > div { writing-mode: vertical-lr; }
</span><ins>+.block > div { writing-mode: vertical-lr; }
</ins><span class="cx"> .firstRowFirstColumn {
</span><span class="cx">   grid-row: 1;
</span><span class="cx">   grid-column: 1;
</span><span class="lines">@@ -46,16 +48,14 @@
</span><span class="cx"> </style>
</span><span class="cx"> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
</span><span class="cx"> <div class="block">
</span><del>-  <div style="top: 0px; left: 23px;">XXX<br>XXX</div>
-  <div style="top: 0px; left: 72px;">X</div>
-  <div style="top: 10px; left: 72px;">X</div>
-  <div style="top: 20px; left: 33px;">X</div>
-  <div style="top: 30px; left: 33px;">X</div>
-  <div style="top: 30px; left: 72px;">X</div>
-  <div style="top: 50px; left: 18px" class="big">X</div>
</del><ins>+  <div style="top: 0px; left: 2px;">XX<br>XXXX<br>XX</div>
+  <div style="top: 0px; left: 70px;">XX X</div>
+  <div style="top: 0px; left: 80px;">X XX</div>
+  <div style="top: 0px; left: 90px;">X</div>
+  <div style="top: 50px; left: 0px" class="big">X</div>
</ins><span class="cx"> </div>
</span><span class="cx"> <div class="grid">
</span><span class="cx">   <div class="firstRowFirstColumn">XX XXXX XX</div>
</span><span class="cx">   <div class="secondRowFirstColumn big">X</div>
</span><del>-  <div class="firstRowSecondColumn">XX X</div>
</del><ins>+  <div class="firstRowSecondColumn">XX X X XX X</div>
</ins><span class="cx"> </div>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize009html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-009.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-009.html        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-009.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx">   grid-auto-rows: 50px;
</span><span class="cx">   justify-items: baseline;
</span><span class="cx">   justify-content: start;
</span><ins>+  -webkit-text-orientation: sideways;
</ins><span class="cx"> }
</span><span class="cx"> .grid > div { writing-mode: vertical-lr; }
</span><span class="cx"> .firstRowFirstColumn {
</span><span class="lines">@@ -46,10 +47,10 @@
</span><span class="cx"> </style>
</span><span class="cx"> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
</span><span class="cx"> <div class="block">
</span><del>-  <div style="top: 0px; left: 10px; width: 40px; background: red; height: 40px;"></div>
-  <div style="top: 0px; left: 50px;">X</div>
-  <div style="top: 10px; left: 50px;">X</div>
-  <div style="top: 30px; left: 50px;">X</div>
</del><ins>+  <div style="top: 0px; left: 4px; width: 40px; background: red; height: 40px;"></div>
+  <div style="top: 0px; left: 44px;">X</div>
+  <div style="top: 10px; left: 44px;">X</div>
+  <div style="top: 30px; left: 44px;">X</div>
</ins><span class="cx">   <div style="top: 50px; left: 0px" class="big">X</div>
</span><span class="cx"> </div>
</span><span class="cx"> <div class="grid">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize010html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-010.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-010.html        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-010.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx">   grid-auto-rows: 50px;
</span><span class="cx">   justify-items: baseline;
</span><span class="cx">   justify-content: start;
</span><ins>+  text-orientation: sideways;
</ins><span class="cx"> }
</span><span class="cx"> .grid > div { writing-mode: vertical-lr; }
</span><span class="cx"> .big { font-size: 20px; }
</span><span class="lines">@@ -45,9 +46,9 @@
</span><span class="cx"> </style>
</span><span class="cx"> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
</span><span class="cx"> <div class="block">
</span><del>-  <div style="top: 0px; left: 5px;">XXXX<br>XXXX</div>
-  <div style="top: 20px; left: 15px;">X</div>
-  <div style="top: 30px; left: 15px;">X X</div>
</del><ins>+  <div style="top: 0px; left: 2px;">XXXX<br>XXXX</div>
+  <div style="top: 20px; left: 12px;">X</div>
+  <div style="top: 30px; left: 12px;">X X</div>
</ins><span class="cx">   <div style="top: 50px; left: 0px" class="big">X</div>
</span><span class="cx"> </div>
</span><span class="cx"> <div class="grid">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize011html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-011.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-011.html        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-011.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -44,12 +44,12 @@
</span><span class="cx"> </style>
</span><span class="cx"> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
</span><span class="cx"> <div class="block">
</span><del>-  <div style="top: 0px; left: 5px;">XXX<br>XXX</div>
-  <div style="top: 0px; left: 55px;">X</div>
-  <div style="top: 10px; left: 55px;">X</div>
-  <div style="top: 20px; left: 15px;">X</div>
-  <div style="top: 30px; left: 15px;">X</div>
-  <div style="top: 30px; left: 55px;">X</div>
</del><ins>+  <div style="top: 0px; left: 2px;">XXX<br>XXX</div>
+  <div style="top: 0px; left: 52px;">X</div>
+  <div style="top: 10px; left: 52px;">X</div>
+  <div style="top: 20px; left: 12px;">X</div>
+  <div style="top: 30px; left: 12px;">X</div>
+  <div style="top: 30px; left: 52px;">X</div>
</ins><span class="cx">   <div style="top: 50px; left: 0px" class="big">X</div>
</span><span class="cx"> </div>
</span><span class="cx"> <div class="grid">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridalignmentselfbaselinegridselfbaselinechangesgridareasize012html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-012.html (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-012.html        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-012.html   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx">   grid-auto-rows: 50px;
</span><span class="cx">   justify-items: baseline;
</span><span class="cx">   justify-content: start;
</span><ins>+  -webkit-text-orientation: sideways;
</ins><span class="cx"> }
</span><span class="cx"> .grid > div { writing-mode: vertical-lr; }
</span><span class="cx"> .firstRowFirstColumn {
</span><span class="lines">@@ -44,11 +45,11 @@
</span><span class="cx"> </style>
</span><span class="cx"> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
</span><span class="cx"> <div class="block">
</span><del>-  <div style="top: 0px; left: 10px; width: 40px; background: red; height: 40px;"></div>
-  <div style="top: 0px; left: 50px;">X</div>
-  <div style="top: 10px; left: 50px;">X</div>
-  <div style="top: 30px; left: 50px;">X</div>
-  <div style="top: 50px; left: 0px;">X</div>
</del><ins>+  <div style="top: 0px; left: 4px; width: 40px; background: red; height: 40px;"></div>
+  <div style="top: 0px; left: 44px;">X</div>
+  <div style="top: 10px; left: 44px;">X</div>
+  <div style="top: 30px; left: 44px;">X</div>
+  <div style="top: 50px; left: 0px;" class="big">X</div>
</ins><span class="cx"> </div>
</span><span class="cx"> <div class="grid">
</span><span class="cx">   <div class="firstRowFirstColumn" style="background: green; width: 40px; height: 40px;"></div>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagemargins002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-002-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-002-expected.txt 2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-002-expected.txt    2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,32 +1,12 @@
</span><span class="cx"> 
</span><span class="cx"> PASS .grid 1 
</span><span class="cx"> PASS .grid 2 
</span><del>-FAIL .grid 3 assert_equals: 
-<div class="grid directionRTL">
-  <div class="marginRight50Percent" data-expected-margin-right="50" data-offset-x="440" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="400" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
-</div>
-offsetLeft expected 440 but got 365
-FAIL .grid 4 assert_equals: 
-<div class="grid directionRTL">
-  <div class="marginLeft50Percent" data-expected-margin-left="50" data-offset-x="490" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="400" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
-</div>
-margin-left expected "50" but got "125"
</del><ins>+PASS .grid 3 
+PASS .grid 4 
</ins><span class="cx"> PASS .grid 5 
</span><span class="cx"> PASS .grid 6 
</span><del>-FAIL .grid 7 assert_equals: 
-<div class="grid">
-  <div class="marginRight50Percent" data-expected-margin-right="50" data-offset-x="0" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="0" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
-</div>
-margin-right expected "50" but got "125"
-FAIL .grid 8 assert_equals: 
-<div class="grid">
-  <div class="marginLeft50Percent" data-expected-margin-left="50" data-offset-x="50" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="0" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
-</div>
-offsetLeft expected 50 but got 125
</del><ins>+PASS .grid 7 
+PASS .grid 8 
</ins><span class="cx"> Direction LTR
</span><span class="cx"> 
</span><span class="cx"> Item margin-left: 50%;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagemarginsverticallr002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-lr-002-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-lr-002-expected.txt     2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-lr-002-expected.txt        2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,30 +1,10 @@
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-<div class="grid directionRTL">
-  <div class="marginBottom50Percent" data-expected-margin-bottom="50" data-offset-y="440" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="10" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
-</div>
-offsetTop expected 440 but got 365
-FAIL .grid 2 assert_equals: 
-<div class="grid directionRTL">
-  <div class="marginTop50Percent" data-expected-margin-top="50" data-offset-y="490" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="10" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
-</div>
-margin-top expected "50" but got "125"
</del><ins>+PASS .grid 1 
+PASS .grid 2 
</ins><span class="cx"> PASS .grid 3 
</span><span class="cx"> PASS .grid 4 
</span><del>-FAIL .grid 5 assert_equals: 
-<div class="grid">
-  <div class="marginBottom50Percent" data-expected-margin-bottom="50" data-offset-y="0" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="10" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
-</div>
-margin-bottom expected "50" but got "125"
-FAIL .grid 6 assert_equals: 
-<div class="grid">
-  <div class="marginTop50Percent" data-expected-margin-top="50" data-offset-y="50" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="10" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
-</div>
-offsetTop expected 50 but got 125
</del><ins>+PASS .grid 5 
+PASS .grid 6 
</ins><span class="cx"> PASS .grid 7 
</span><span class="cx"> PASS .grid 8 
</span><span class="cx"> Direction LTR
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagemarginsverticalrl002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-rl-002-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-rl-002-expected.txt     2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-rl-002-expected.txt        2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,30 +1,10 @@
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-<div class="grid directionRTL">
-  <div class="marginBottom50Percent" data-expected-margin-bottom="50" data-expected-y="440" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="0" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
-</div>
-margin-bottom expected "50" but got "125"
-FAIL .grid 2 assert_equals: 
-<div class="grid directionRTL">
-  <div class="marginTop50Percent" data-expected-margin-top="50" data-expected-y="490" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="0" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
-</div>
-margin-top expected "50" but got "125"
</del><ins>+PASS .grid 1 
+PASS .grid 2 
</ins><span class="cx"> PASS .grid 3 
</span><span class="cx"> PASS .grid 4 
</span><del>-FAIL .grid 5 assert_equals: 
-<div class="grid">
-  <div class="marginBottom50Percent" data-expected-margin-bottom="50" data-offset-y="0" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
-</div>
-margin-bottom expected "50" but got "125"
-FAIL .grid 6 assert_equals: 
-<div class="grid">
-  <div class="marginTop50Percent" data-expected-margin-top="50" data-offset-y="50" data-expected-width="10" data-expected-height="10">X</div>
-  <div data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
-</div>
-offsetTop expected 50 but got 125
</del><ins>+PASS .grid 5 
+PASS .grid 6 
</ins><span class="cx"> PASS .grid 7 
</span><span class="cx"> PASS .grid 8 
</span><span class="cx"> Direction LTR
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagepaddings002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -6,13 +6,13 @@
</span><span class="cx">   <div class="paddingRight50Percent" data-expected-padding-right="50" data-expected-width="60" data-expected-height="10">X</div>
</span><span class="cx">   <div data-offset-x="400" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
</span><span class="cx"> </div>
</span><del>-width expected 60 but got 260
</del><ins>+width expected 60 but got 50
</ins><span class="cx"> FAIL .grid 4 assert_equals: 
</span><span class="cx"> <div class="grid directionRTL">
</span><span class="cx">   <div class="paddingLeft50Percent" data-expected-padding-left="50" data-expected-width="60" data-expected-height="10">X</div>
</span><span class="cx">   <div data-offset-x="400" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
</span><span class="cx"> </div>
</span><del>-width expected 60 but got 260
</del><ins>+width expected 60 but got 50
</ins><span class="cx"> PASS .grid 5 
</span><span class="cx"> PASS .grid 6 
</span><span class="cx"> FAIL .grid 7 assert_equals: 
</span><span class="lines">@@ -20,13 +20,13 @@
</span><span class="cx">   <div class="paddingRight50Percent" data-expected-padding-right="50" data-expected-width="60" data-expected-height="10">X</div>
</span><span class="cx">   <div data-offset-x="0" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
</span><span class="cx"> </div>
</span><del>-width expected 60 but got 260
</del><ins>+width expected 60 but got 50
</ins><span class="cx"> FAIL .grid 8 assert_equals: 
</span><span class="cx"> <div class="grid">
</span><span class="cx">   <div class="paddingLeft50Percent" data-expected-padding-left="50" data-expected-width="60" data-expected-height="10">X</div>
</span><span class="cx">   <div data-offset-x="0" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
</span><span class="cx"> </div>
</span><del>-width expected 60 but got 260
</del><ins>+width expected 60 but got 50
</ins><span class="cx"> Direction LTR
</span><span class="cx"> 
</span><span class="cx"> Item padding-left: 50%;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagepaddingsverticallr002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt    2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt       2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -4,13 +4,13 @@
</span><span class="cx">   <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
</span><span class="cx">   <div data-offset-x="10" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
</span><span class="cx"> </div>
</span><del>-height expected 60 but got 260
</del><ins>+height expected 60 but got 50
</ins><span class="cx"> FAIL .grid 2 assert_equals: 
</span><span class="cx"> <div class="grid directionRTL">
</span><span class="cx">   <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
</span><span class="cx">   <div data-offset-x="10" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
</span><span class="cx"> </div>
</span><del>-height expected 60 but got 260
</del><ins>+height expected 60 but got 50
</ins><span class="cx"> PASS .grid 3 
</span><span class="cx"> PASS .grid 4 
</span><span class="cx"> FAIL .grid 5 assert_equals: 
</span><span class="lines">@@ -18,13 +18,13 @@
</span><span class="cx">   <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
</span><span class="cx">   <div data-offset-x="10" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
</span><span class="cx"> </div>
</span><del>-height expected 60 but got 260
</del><ins>+height expected 60 but got 50
</ins><span class="cx"> FAIL .grid 6 assert_equals: 
</span><span class="cx"> <div class="grid">
</span><span class="cx">   <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
</span><span class="cx">   <div data-offset-x="10" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
</span><span class="cx"> </div>
</span><del>-height expected 60 but got 260
</del><ins>+height expected 60 but got 50
</ins><span class="cx"> PASS .grid 7 
</span><span class="cx"> PASS .grid 8 
</span><span class="cx"> Direction LTR
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemspercentagepaddingsverticalrl002expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt    2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt       2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -4,13 +4,13 @@
</span><span class="cx">   <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
</span><span class="cx">   <div data-offset-x="0" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
</span><span class="cx"> </div>
</span><del>-height expected 60 but got 260
</del><ins>+height expected 60 but got 50
</ins><span class="cx"> FAIL .grid 2 assert_equals: 
</span><span class="cx"> <div class="grid directionRTL">
</span><span class="cx">   <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
</span><span class="cx">   <div data-offset-x="0" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
</span><span class="cx"> </div>
</span><del>-height expected 60 but got 260
</del><ins>+height expected 60 but got 50
</ins><span class="cx"> PASS .grid 3 
</span><span class="cx"> PASS .grid 4 
</span><span class="cx"> FAIL .grid 5 assert_equals: 
</span><span class="lines">@@ -18,13 +18,13 @@
</span><span class="cx">   <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
</span><span class="cx">   <div data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
</span><span class="cx"> </div>
</span><del>-height expected 60 but got 260
</del><ins>+height expected 60 but got 50
</ins><span class="cx"> FAIL .grid 6 assert_equals: 
</span><span class="cx"> <div class="grid">
</span><span class="cx">   <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
</span><span class="cx">   <div data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
</span><span class="cx"> </div>
</span><del>-height expected 60 but got 260
</del><ins>+height expected 60 but got 50
</ins><span class="cx"> PASS .grid 7 
</span><span class="cx"> PASS .grid 8 
</span><span class="cx"> Direction LTR
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -94,6 +94,17 @@
</span><span class="cx"> imported/w3c/web-platform-tests/css/selectors/selectors-empty-001.xml [ ImageOnlyFailure ]
</span><span class="cx"> imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https.html [ Pass Failure ]
</span><span class="cx"> 
</span><ins>+# Baseline Alignment tests affected by 1px diff failures only on Mac and iOS platforms
+webkit.org/b/170293 fast/css-grid-layout/grid-align-baseline-vertical.html [ Failure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-two-dimensional.html [ Failure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-03.html [ ImageOnlyFailure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-04.html [ ImageOnlyFailure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-vertical-rl-05.html [ ImageOnlyFailure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-vertical-rl-04.html [ ImageOnlyFailure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-06.html [ ImageOnlyFailure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-07.html [ ImageOnlyFailure ]
+
+
</ins><span class="cx"> # A sub-test in this test is extremely flaky and fails most of the time, messing up partial-failure expectations
</span><span class="cx"> webkit.org/b/189686 webgl/2.0.0/conformance2/renderbuffers/multisampled-renderbuffer-initialization.html [ Skip ]
</span><span class="cx"> webkit.org/b/189686 webgl/2.0.0/conformance/reading/read-pixels-test.html [ Slow ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations  2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/LayoutTests/platform/mac/TestExpectations     2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -589,6 +589,15 @@
</span><span class="cx"> webkit.org/b/112176 fast/canvas/canvas-composite-alpha.html [ Failure Pass ]
</span><span class="cx"> webkit.org/b/112176 fast/canvas/webgl/read-pixels-test.html [ Failure Pass ]
</span><span class="cx"> 
</span><ins>+# Baseline Alignment tests affected by 1px diff failures only on Mac and iOS platforms
+webkit.org/b/170293 fast/css-grid-layout/grid-align-baseline-vertical.html [ Failure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-03.html [ ImageOnlyFailure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-04.html [ ImageOnlyFailure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-vertical-rl-05.html [ ImageOnlyFailure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-vertical-rl-04.html [ ImageOnlyFailure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-06.html [ ImageOnlyFailure ]
+webkit.org/b/170293 fast/css-grid-layout/grid-self-baseline-07.html [ ImageOnlyFailure ]
+
</ins><span class="cx"> # The following ref-test appears to fail on EWS bots as well.
</span><span class="cx"> webkit.org/b/112176 fast/css/sticky/inline-sticky-abspos-child.html [ ImageOnlyFailure Pass ]
</span><span class="cx"> webkit.org/b/112176 fast/css/sticky/inline-sticky.html [ ImageOnlyFailure Pass ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/Source/WebCore/ChangeLog      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1,3 +1,96 @@
</span><ins>+2018-11-23  Javier Fernandez  <jfernandez@igalia.com>
+
+        [css-grid] Implement Baseline Alignment for grid items
+        https://bugs.webkit.org/show_bug.cgi?id=145566
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        This patch impements the Baseline Self-Alignment feature for grid items according to
+        the CSS Box Alignment specification [1].
+
+        This new layout logic is handled by the Self-Alignment (justify-self and align-self)
+        and Default-Alignment (justify-items and align-items) CSS properties.
+
+        This feature allows users to align the grid items sharing a Baseline Alignment Context,
+        either row or column contexts, based on their respective baselines.
+
+        [1] https://drafts.csswg.org/css-align-3/#baseline-align-self
+
+        Tests: fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html
+               fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html
+               fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html
+               fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html
+               fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html
+               fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html
+
+        * Sources.txt:
+        * rendering/GridBaselineAlignment.cpp: Added.
+        (WebCore::GridBaselineAlignment::marginOverForChild const):
+        (WebCore::GridBaselineAlignment::marginUnderForChild const):
+        (WebCore::GridBaselineAlignment::logicalAscentForChild const):
+        (WebCore::GridBaselineAlignment::ascentForChild const):
+        (WebCore::GridBaselineAlignment::descentForChild const):
+        (WebCore::GridBaselineAlignment::isDescentBaselineForChild const):
+        (WebCore::GridBaselineAlignment::isHorizontalBaselineAxis const):
+        (WebCore::GridBaselineAlignment::isOrthogonalChildForBaseline const):
+        (WebCore::GridBaselineAlignment::isParallelToBaselineAxisForChild const):
+        (WebCore::GridBaselineAlignment::baselineGroupForChild const):
+        (WebCore::GridBaselineAlignment::updateBaselineAlignmentContext):
+        (WebCore::GridBaselineAlignment::baselineOffsetForChild const):
+        (WebCore::GridBaselineAlignment::clear):
+        (WebCore::BaselineGroup::BaselineGroup):
+        (WebCore::BaselineGroup::update):
+        (WebCore::BaselineGroup::isOppositeBlockFlow const):
+        (WebCore::BaselineGroup::isOrthogonalBlockFlow const):
+        (WebCore::BaselineGroup::isCompatible const):
+        (WebCore::BaselineContext::BaselineContext):
+        (WebCore::BaselineContext::sharedGroup const):
+        (WebCore::BaselineContext::updateSharedGroup):
+        (WebCore::BaselineContext::findCompatibleSharedGroup):
+        * rendering/GridBaselineAlignment.h: Added.
+        (WebCore::BaselineGroup::maxAscent const):
+        (WebCore::BaselineGroup::maxDescent const):
+        (WebCore::BaselineGroup::size const):
+        (WebCore::isBaselinePosition):
+        (WebCore::GridBaselineAlignment::setBlockFlow):
+        * rendering/GridLayoutFunctions.h:
+        * rendering/GridTrackSizingAlgorithm.cpp:
+        (WebCore::gridAxisForDirection):
+        (WebCore::gridDirectionForAxis):
+        (WebCore::GridTrackSizingAlgorithm::availableSpace const):
+        (WebCore::GridTrackSizingAlgorithm::isIntrinsicSizedGridArea const):
+        (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
+        (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
+        (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
+        (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
+        (WebCore::GridTrackSizingAlgorithm::canParticipateInBaselineAlignment const):
+        (WebCore::GridTrackSizingAlgorithm::participateInBaselineAlignment const):
+        (WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext):
+        (WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const):
+        (WebCore::GridTrackSizingAlgorithm::clearBaselineItemsCache):
+        (WebCore::GridTrackSizingAlgorithm::cacheBaselineAlignedItem):
+        (WebCore::GridTrackSizingAlgorithm::copyBaselineItemsCache):
+        (WebCore::GridTrackSizingAlgorithm::setup):
+        (WebCore::GridTrackSizingAlgorithm::computeBaselineAlignmentContext):
+        * rendering/GridTrackSizingAlgorithm.h:
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::firstLineBaseline const):
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::layoutBlock):
+        (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
+        (WebCore::RenderGrid::placeItemsOnGrid const):
+        (WebCore::RenderGrid::performGridItemsPreLayout const):
+        (WebCore::synthesizedBaselineFromMarginBox):
+        (WebCore::RenderGrid::isBaselineAlignmentForChild const):
+        (WebCore::RenderGrid::baselinePosition const):
+        (WebCore::RenderGrid::firstLineBaseline const):
+        (WebCore::RenderGrid::inlineBlockBaseline const):
+        (WebCore::RenderGrid::columnAxisBaselineOffsetForChild const):
+        (WebCore::RenderGrid::rowAxisBaselineOffsetForChild const):
+        (WebCore::RenderGrid::columnAxisOffsetForChild const):
+        (WebCore::RenderGrid::rowAxisOffsetForChild const):
+        * rendering/RenderGrid.h:
+
</ins><span class="cx"> 2018-11-22  Wenson Hsieh  <wenson_hsieh@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Address post-review feedback after r238438
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/Source/WebCore/Sources.txt    2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -1899,6 +1899,7 @@
</span><span class="cx"> rendering/FixedTableLayout.cpp
</span><span class="cx"> rendering/FloatingObjects.cpp
</span><span class="cx"> rendering/Grid.cpp
</span><ins>+rendering/GridBaselineAlignment.cpp
</ins><span class="cx"> rendering/GridLayoutFunctions.cpp
</span><span class="cx"> rendering/GridTrackSizingAlgorithm.cpp
</span><span class="cx"> rendering/HitTestLocation.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingGridBaselineAlignmentcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/GridBaselineAlignment.cpp (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/GridBaselineAlignment.cpp                         (rev 0)
+++ trunk/Source/WebCore/rendering/GridBaselineAlignment.cpp    2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,243 @@
</span><ins>+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GridBaselineAlignment.h"
+
+#include "RenderStyle.h"
+
+namespace WebCore {
+
+// This function gives the margin 'over' based on the baseline-axis, since in grid we can have 2-dimensional
+// alignment by baseline. In horizontal writing-mode, the row-axis is the horizontal axis. When we use this
+// axis to move the grid items so that they are baseline-aligned, we want their "horizontal" margin (right);
+// the same will happen when using the column-axis under vertical writing mode, we also want in this case the
+// 'right' margin.
+LayoutUnit GridBaselineAlignment::marginOverForChild(const RenderBox& child, GridAxis axis) const
+{
+    return isHorizontalBaselineAxis(axis) ? child.marginRight() : child.marginTop();
+}
+
+// This function gives the margin 'under' based on the baseline-axis, since in grid we can can 2-dimensional
+// alignment by baseline. In horizontal writing-mode, the row-axis is the horizontal axis. When we use this
+// axis to move the grid items so that they are baseline-aligned, we want their "horizontal" margin (left);
+// the same will happen when using the column-axis under vertical writing mode, we also want in this case the
+// 'left' margin.
+LayoutUnit GridBaselineAlignment::marginUnderForChild(const RenderBox& child, GridAxis axis) const
+{
+    return isHorizontalBaselineAxis(axis) ? child.marginLeft() : child.marginBottom();
+}
+
+LayoutUnit GridBaselineAlignment::logicalAscentForChild(const RenderBox& child, GridAxis baselineAxis) const
+{
+    LayoutUnit ascent = ascentForChild(child, baselineAxis);
+    return isDescentBaselineForChild(child, baselineAxis) ? descentForChild(child, ascent, baselineAxis) : ascent;
+}
+
+LayoutUnit GridBaselineAlignment::ascentForChild(const RenderBox& child, GridAxis baselineAxis) const
+{
+    LayoutUnit margin = isDescentBaselineForChild(child, baselineAxis) ? marginUnderForChild(child, baselineAxis) : marginOverForChild(child, baselineAxis);
+    LayoutUnit baseline(isParallelToBaselineAxisForChild(child, baselineAxis) ? child.firstLineBaseline().value_or(-1) : -1);
+    // We take border-box's under edge if no valid baseline.
+    if (baseline == -1) {
+        if (isHorizontalBaselineAxis(baselineAxis))
+            return isFlippedWritingMode(m_blockFlow) ? child.size().width().toInt() + margin : margin;
+        return child.size().height() + margin;
+    }
+    return baseline + margin;
+}
+
+LayoutUnit GridBaselineAlignment::descentForChild(const RenderBox& child, LayoutUnit ascent, GridAxis baselineAxis) const
+{
+    if (isParallelToBaselineAxisForChild(child, baselineAxis))
+        return child.marginLogicalHeight() + child.logicalHeight() - ascent;
+    return child.marginLogicalWidth() + child.logicalWidth() - ascent;
+}
+
+bool GridBaselineAlignment::isDescentBaselineForChild(const RenderBox& child, GridAxis baselineAxis) const
+{
+    return isHorizontalBaselineAxis(baselineAxis)
+        && ((child.style().isFlippedBlocksWritingMode() && !isFlippedWritingMode(m_blockFlow))
+            || (child.style().isFlippedLinesWritingMode() && isFlippedWritingMode(m_blockFlow)));
+}
+
+bool GridBaselineAlignment::isHorizontalBaselineAxis(GridAxis axis) const
+{
+    return axis == GridRowAxis ? isHorizontalWritingMode(m_blockFlow) : !isHorizontalWritingMode(m_blockFlow);
+}
+
+bool GridBaselineAlignment::isOrthogonalChildForBaseline(const RenderBox& child) const
+{
+    return isHorizontalWritingMode(m_blockFlow) != child.isHorizontalWritingMode();
+}
+
+bool GridBaselineAlignment::isParallelToBaselineAxisForChild(const RenderBox& child, GridAxis axis) const
+{
+    return axis == GridColumnAxis ? !isOrthogonalChildForBaseline(child) : isOrthogonalChildForBaseline(child);
+}
+
+const BaselineGroup& GridBaselineAlignment::baselineGroupForChild(ItemPosition preference, unsigned sharedContext, const RenderBox& child, GridAxis baselineAxis) const
+{
+    ASSERT(isBaselinePosition(preference));
+    bool isRowAxisContext = baselineAxis == GridColumnAxis;
+    auto& contextsMap = isRowAxisContext ? m_rowAxisAlignmentContext : m_colAxisAlignmentContext;
+    auto* context = contextsMap.get(sharedContext);
+    ASSERT(context);
+    return context->sharedGroup(child, preference);
+}
+
+void GridBaselineAlignment::updateBaselineAlignmentContext(ItemPosition preference, unsigned sharedContext, const RenderBox& child, GridAxis baselineAxis)
+{
+    ASSERT(isBaselinePosition(preference));
+    ASSERT(!child.needsLayout());
+
+    // Determine Ascent and Descent values of this child with respect to
+    // its grid container.
+    LayoutUnit ascent = ascentForChild(child, baselineAxis);
+    LayoutUnit descent = descentForChild(child, ascent, baselineAxis);
+    if (isDescentBaselineForChild(child, baselineAxis))
+        std::swap(ascent, descent);
+
+    // Looking up for a shared alignment context perpendicular to the
+    // baseline axis.
+    bool isRowAxisContext = baselineAxis == GridColumnAxis;
+    auto& contextsMap = isRowAxisContext ? m_rowAxisAlignmentContext : m_colAxisAlignmentContext;
+    auto addResult = contextsMap.add(sharedContext, nullptr);
+
+    // Looking for a compatible baseline-sharing group.
+    if (addResult.isNewEntry)
+        addResult.iterator->value = std::make_unique<BaselineContext>(child, preference, ascent, descent);
+    else {
+        auto* context = addResult.iterator->value.get();
+        context->updateSharedGroup(child, preference, ascent, descent);
+    }
+}
+
+LayoutUnit GridBaselineAlignment::baselineOffsetForChild(ItemPosition preference, unsigned sharedContext, const RenderBox& child, GridAxis baselineAxis) const
+{
+    ASSERT(isBaselinePosition(preference));
+    auto& group = baselineGroupForChild(preference, sharedContext, child, baselineAxis);
+    if (group.size() > 1)
+        return group.maxAscent() - logicalAscentForChild(child, baselineAxis);
+    return LayoutUnit();
+}
+
+void GridBaselineAlignment::clear(GridAxis baselineAxis)
+{
+    if (baselineAxis == GridColumnAxis)
+        m_rowAxisAlignmentContext.clear();
+    else
+        m_colAxisAlignmentContext.clear();
+}
+
+BaselineGroup::BaselineGroup(WritingMode blockFlow, ItemPosition childPreference)
+    : m_maxAscent(0), m_maxDescent(0), m_items()
+{
+    m_blockFlow = blockFlow;
+    m_preference = childPreference;
+}
+
+void BaselineGroup::update(const RenderBox& child, LayoutUnit ascent, LayoutUnit descent)
+{
+    if (m_items.add(&child).isNewEntry) {
+        m_maxAscent = std::max(m_maxAscent, ascent);
+        m_maxDescent = std::max(m_maxDescent, descent);
+    }
+}
+
+bool BaselineGroup::isOppositeBlockFlow(WritingMode blockFlow) const
+{
+    switch (blockFlow) {
+    case WritingMode::TopToBottomWritingMode:
+        return false;
+    case WritingMode::LeftToRightWritingMode:
+        return m_blockFlow == WritingMode::RightToLeftWritingMode;
+    case WritingMode::RightToLeftWritingMode:
+        return m_blockFlow == WritingMode::LeftToRightWritingMode;
+    default:
+        ASSERT_NOT_REACHED();
+        return false;
+    }
+}
+
+bool BaselineGroup::isOrthogonalBlockFlow(WritingMode blockFlow) const
+{
+    switch (blockFlow) {
+    case WritingMode::TopToBottomWritingMode:
+        return m_blockFlow != WritingMode::TopToBottomWritingMode;
+    case WritingMode::LeftToRightWritingMode:
+    case WritingMode::RightToLeftWritingMode:
+        return m_blockFlow == WritingMode::TopToBottomWritingMode;
+    default:
+        ASSERT_NOT_REACHED();
+        return false;
+    }
+}
+
+bool BaselineGroup::isCompatible(WritingMode childBlockFlow, ItemPosition childPreference) const
+{
+    ASSERT(isBaselinePosition(childPreference));
+    ASSERT(size() > 0);
+    return ((m_blockFlow == childBlockFlow || isOrthogonalBlockFlow(childBlockFlow)) && m_preference == childPreference) || (isOppositeBlockFlow(childBlockFlow) && m_preference != childPreference);
+}
+
+BaselineContext::BaselineContext(const RenderBox& child, ItemPosition preference, LayoutUnit ascent, LayoutUnit descent)
+{
+    ASSERT(isBaselinePosition(preference));
+    updateSharedGroup(child, preference, ascent, descent);
+}
+
+const BaselineGroup& BaselineContext::sharedGroup(const RenderBox& child, ItemPosition preference) const
+{
+    ASSERT(isBaselinePosition(preference));
+    return const_cast<BaselineContext*>(this)->findCompatibleSharedGroup(child, preference);
+}
+
+void BaselineContext::updateSharedGroup(const RenderBox& child, ItemPosition preference, LayoutUnit ascent, LayoutUnit descent)
+{
+    ASSERT(isBaselinePosition(preference));
+    BaselineGroup& group = findCompatibleSharedGroup(child, preference);
+    group.update(child, ascent, descent);
+}
+
+// FIXME: Properly implement baseline-group compatibility.
+// See https://github.com/w3c/csswg-drafts/issues/721
+BaselineGroup& BaselineContext::findCompatibleSharedGroup(const RenderBox& child, ItemPosition preference)
+{
+    WritingMode blockDirection = child.style().writingMode();
+    for (auto& group : m_sharedGroups) {
+        if (group.isCompatible(blockDirection, preference))
+            return group;
+    }
+    m_sharedGroups.insert(0, BaselineGroup(blockDirection, preference));
+    return m_sharedGroups[0];
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingGridBaselineAlignmenth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/GridBaselineAlignment.h (0 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/GridBaselineAlignment.h                           (rev 0)
+++ trunk/Source/WebCore/rendering/GridBaselineAlignment.h      2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -0,0 +1,169 @@
</span><ins>+/*
+ * Copyright (C) 2018 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "GridLayoutFunctions.h"
+
+namespace WebCore {
+
+// These classes are used to implement the Baseline Alignment logic, as described in the CSS Box Alignment
+// specification.
+// https://drafts.csswg.org/css-align/#baseline-terms
+//
+// A baseline-sharing group is composed of boxes that participate in baseline alignment together. This is
+// possible only if they:
+//
+//   * Share an alignment context along an axis perpendicular to their baseline alignment axis.
+//   * Have compatible baseline alignment preferences (i.e., the baselines that want to align are on the same
+//     side of the alignment context).
+//
+// Once the BaselineGroup is instantiated, defined by a 'block-direction' (WritingMode) and a 'baseline-preference'
+// (first/last baseline), it's ready to collect the items that will participate in the Baseline Alignment logic.
+//
+class BaselineGroup {
+public:
+    // It stores an item (if not already present) and update the max_ascent and max_descent associated to this
+    // baseline-sharing group.
+    void update(const RenderBox&, LayoutUnit ascent, LayoutUnit descent);
+    LayoutUnit maxAscent() const { return m_maxAscent; }
+    LayoutUnit maxDescent() const { return m_maxDescent; }
+    int size() const { return m_items.size(); }
+
+private:
+    friend class BaselineContext;
+    BaselineGroup(WritingMode blockFlow, ItemPosition childPreference);
+
+    // Determines whether a baseline-sharing group is compatible with an item, based on its 'block-flow' and
+    // 'baseline-preference'
+    bool isCompatible(WritingMode, ItemPosition) const;
+
+    // Determines whether the baseline-sharing group's associated block-flow is opposite (LR vs RL) to particular
+    // item's writing-mode.
+    bool isOppositeBlockFlow(WritingMode blockFlow) const;
+
+    // Determines whether the baseline-sharing group's associated block-flow is orthogonal (vertical vs horizontal)
+    // to particular item's writing-mode.
+    bool isOrthogonalBlockFlow(WritingMode blockFlow) const;
+
+    WritingMode m_blockFlow;
+    ItemPosition m_preference;
+    LayoutUnit m_maxAscent;
+    LayoutUnit m_maxDescent;
+    HashSet<const RenderBox*> m_items;
+};
+
+// https://drafts.csswg.org/css-align-3/#shared-alignment-context
+// Boxes share an alignment context along a particular axis when they are:
+//
+//  * table cells in the same row, along the table's row (inline) axis
+//  * table cells in the same column, along the table's column (block) axis
+//  * grid items in the same row, along the grid's row (inline) axis
+//  * grid items in the same column, along the grid's colum (block) axis
+//  * flex items in the same flex line, along the flex container's main axis
+//
+// https://drafts.csswg.org/css-align-3/#baseline-sharing-group
+// A Baseline alignment-context may handle several baseline-sharing groups. In order to create an instance, we
+// need to pass the required data to define the first baseline-sharing group; a Baseline Context must have at
+// least one baseline-sharing group.
+//
+// By adding new items to a Baseline Context, the baseline-sharing groups it handles are automatically updated,
+// if there is one that is compatible with such item. Otherwise, a new baseline-sharing group is created,
+// compatible with the new item.
+class BaselineContext {
+public:
+    BaselineContext(const RenderBox& child, ItemPosition preference, LayoutUnit ascent, LayoutUnit descent);
+    const BaselineGroup& sharedGroup(const RenderBox& child, ItemPosition preference) const;
+
+    // Updates the baseline-sharing group compatible with the item.
+    // We pass the item's baseline-preference to avoid dependencies with the LayoutGrid class, which is the one
+    // managing the alignment behavior of the Grid Items.
+    void updateSharedGroup(const RenderBox& child, ItemPosition preference, LayoutUnit ascent, LayoutUnit descent);
+
+private:
+    // Returns the baseline-sharing group compatible with an item.
+    // We pass the item's baseline-preference to avoid dependencies with the LayoutGrid class, which is the one
+    // managing the alignment behavior of the Grid Items.
+    // FIXME: Properly implement baseline-group compatibility.
+    // See https://github.com/w3c/csswg-drafts/issues/721
+    BaselineGroup& findCompatibleSharedGroup(const RenderBox& child, ItemPosition preference);
+
+    Vector<BaselineGroup> m_sharedGroups;
+};
+
+static inline bool isBaselinePosition(ItemPosition position)
+{
+    return position == ItemPosition::Baseline || position == ItemPosition::LastBaseline;
+}
+
+// This is the class that implements the Baseline Alignment logic, using internally the BaselineContext and
+// BaselineGroupd classes (described above).
+//
+// The first phase is to collect the items that will participate in baseline alignment together. During this
+// phase the required baseline-sharing groups will be created for each Baseline alignment-context shared by
+// the items participating in the baseline alignment.
+//
+// Additionally, the baseline-sharing groups' offsets, max-ascend and max-descent will be computed and stored.
+// This class also computes the baseline offset for a particular item, based on the max-ascent for its associated
+// baseline-sharing group.
+class GridBaselineAlignment {
+public:
+    // Collects the items participating in baseline alignment and updates the corresponding baseline-sharing
+    // group of the Baseline Context the items belongs to.
+    // All the baseline offsets are updated accordingly based on the added item.
+    void updateBaselineAlignmentContext(ItemPosition, unsigned sharedContext, const RenderBox&, GridAxis);
+
+    // Returns the baseline offset of a particular item, based on the max-ascent for its associated
+    // baseline-sharing group
+    LayoutUnit baselineOffsetForChild(ItemPosition, unsigned sharedContext, const RenderBox&, GridAxis) const;
+
+    // Sets the Grid Container's writing-mode so that we can avoid the dependecy of the LayoutGrid class for
+    // determining whether a grid item is orthogonal or not.
+    void setBlockFlow(WritingMode blockFlow) { m_blockFlow = blockFlow; };
+
+    // Clearing the Baseline Alignment context and their internal classes and data structures.
+    void clear(GridAxis);
+
+private:
+    const BaselineGroup& baselineGroupForChild(ItemPosition, unsigned sharedContext, const RenderBox&, GridAxis) const;
+    LayoutUnit marginOverForChild(const RenderBox&, GridAxis) const;
+    LayoutUnit marginUnderForChild(const RenderBox&, GridAxis) const;
+    LayoutUnit logicalAscentForChild(const RenderBox&, GridAxis) const;
+    LayoutUnit ascentForChild(const RenderBox&, GridAxis) const;
+    LayoutUnit descentForChild(const RenderBox&, LayoutUnit, GridAxis) const;
+    bool isDescentBaselineForChild(const RenderBox&, GridAxis) const;
+    bool isHorizontalBaselineAxis(GridAxis) const;
+    bool isOrthogonalChildForBaseline(const RenderBox&) const;
+    bool isParallelToBaselineAxisForChild(const RenderBox&, GridAxis) const;
+
+    typedef HashMap<unsigned, std::unique_ptr<BaselineContext>, DefaultHash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned>> BaselineContextsMap;
+
+    // Grid Container's WritingMode, used to determine grid item's orthogonality.
+    WritingMode m_blockFlow;
+    BaselineContextsMap m_rowAxisAlignmentContext;
+    BaselineContextsMap m_colAxisAlignmentContext;
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingGridLayoutFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/GridLayoutFunctions.h (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/GridLayoutFunctions.h     2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/Source/WebCore/rendering/GridLayoutFunctions.h        2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -30,6 +30,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+enum GridAxis { GridRowAxis, GridColumnAxis };
+
</ins><span class="cx"> namespace GridLayoutFunctions {
</span><span class="cx"> 
</span><span class="cx"> LayoutUnit computeMarginLogicalSizeForChild(const RenderGrid&, GridTrackSizingDirection, const RenderBox&);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingGridTrackSizingAlgorithmcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp      2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp 2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -91,6 +91,16 @@
</span><span class="cx"> 
</span><span class="cx"> // Static helper methods.
</span><span class="cx"> 
</span><ins>+static GridAxis gridAxisForDirection(GridTrackSizingDirection direction)
+{
+    return direction == ForColumns ? GridRowAxis : GridColumnAxis;
+}
+
+static GridTrackSizingDirection gridDirectionForAxis(GridAxis axis)
+{
+    return axis == GridRowAxis ? ForColumns : ForRows;
+}
+
</ins><span class="cx"> static bool shouldClearOverrideContainingBlockContentSizeForChild(const RenderBox& child, GridTrackSizingDirection direction)
</span><span class="cx"> {
</span><span class="cx">     if (direction == ForColumns)
</span><span class="lines">@@ -132,6 +142,12 @@
</span><span class="cx">         m_freeSpaceRows = freeSpace;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+std::optional<LayoutUnit> GridTrackSizingAlgorithm::availableSpace() const
+{
+    ASSERT(wasSetup());
+    return availableSpace(m_direction);
+}
+
</ins><span class="cx"> void GridTrackSizingAlgorithm::setAvailableSpace(GridTrackSizingDirection direction, std::optional<LayoutUnit> availableSpace)
</span><span class="cx"> {
</span><span class="cx">     if (direction == ForColumns)
</span><span class="lines">@@ -599,6 +615,27 @@
</span><span class="cx">     return length.isPercentage() && !availableSpace(direction);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool GridTrackSizingAlgorithm::isIntrinsicSizedGridArea(const RenderBox& child, GridAxis axis) const
+{
+    ASSERT(wasSetup());
+    GridTrackSizingDirection direction = gridDirectionForAxis(axis);
+    const GridSpan& span = m_grid.gridItemSpan(child, direction);
+    for (auto trackPosition : span) {
+        GridTrackSize trackSize = rawGridTrackSize(direction, trackPosition);
+        // We consider fr units as 'auto' for the min sizing function.
+        // FIXME(jfernandez): https://github.com/w3c/csswg-drafts/issues/2611
+        //
+        // The use of AvailableSize function may imply different results
+        // for the same item when assuming indefinite or definite size
+        // constraints depending on the phase we evaluate the item's
+        // baseline participation.
+        // FIXME(jfernandez): https://github.com/w3c/csswg-drafts/issues/3046
+        if (trackSize.isContentSized() || trackSize.isFitContent() || trackSize.minTrackBreadth().isFlex() || (trackSize.maxTrackBreadth().isFlex() && !availableSpace(direction)))
+            return true;
+    }
+    return false;
+}
+
</ins><span class="cx"> GridTrackSize GridTrackSizingAlgorithm::gridTrackSize(GridTrackSizingDirection direction, unsigned translatedIndex) const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(wasSetup());
</span><span class="lines">@@ -727,7 +764,7 @@
</span><span class="cx">         child.clearOverrideContentLogicalHeight();
</span><span class="cx"> 
</span><span class="cx">     child.layoutIfNeeded();
</span><del>-    return child.logicalHeight() + GridLayoutFunctions::marginLogicalSizeForChild(*renderGrid(), childBlockDirection, child);
</del><ins>+    return child.logicalHeight() + GridLayoutFunctions::marginLogicalSizeForChild(*renderGrid(), childBlockDirection, child) + m_algorithm.baselineOffsetForChild(child, gridAxisForDirection(direction()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutUnit GridTrackSizingAlgorithmStrategy::minContentForChild(RenderBox& child) const
</span><span class="lines">@@ -736,7 +773,7 @@
</span><span class="cx">     if (direction() == childInlineDirection) {
</span><span class="cx">         // FIXME: It's unclear if we should return the intrinsic width or the preferred width.
</span><span class="cx">         // See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html
</span><del>-        return child.minPreferredLogicalWidth() + GridLayoutFunctions::marginLogicalSizeForChild(*renderGrid(), childInlineDirection, child);
</del><ins>+        return child.minPreferredLogicalWidth() + GridLayoutFunctions::marginLogicalSizeForChild(*renderGrid(), childInlineDirection, child) + m_algorithm.baselineOffsetForChild(child, gridAxisForDirection(direction()));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (updateOverrideContainingBlockContentSizeForChild(child, childInlineDirection))
</span><span class="lines">@@ -750,7 +787,7 @@
</span><span class="cx">     if (direction() == childInlineDirection) {
</span><span class="cx">         // FIXME: It's unclear if we should return the intrinsic width or the preferred width.
</span><span class="cx">         // See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html
</span><del>-        return child.maxPreferredLogicalWidth() + GridLayoutFunctions::marginLogicalSizeForChild(*renderGrid(), childInlineDirection, child);
</del><ins>+        return child.maxPreferredLogicalWidth() + GridLayoutFunctions::marginLogicalSizeForChild(*renderGrid(), childInlineDirection, child) + m_algorithm.baselineOffsetForChild(child, gridAxisForDirection(direction()));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (updateOverrideContainingBlockContentSizeForChild(child, childInlineDirection))
</span><span class="lines">@@ -786,16 +823,85 @@
</span><span class="cx">     if (!childSize.isAuto())
</span><span class="cx">         return minContentForChild(child);
</span><span class="cx"> 
</span><ins>+    LayoutUnit baselineShim = m_algorithm.baselineOffsetForChild(child, gridAxisForDirection(direction()));
</ins><span class="cx">     LayoutUnit gridAreaSize = m_algorithm.gridAreaBreadthForChild(child, childInlineDirection);
</span><span class="cx">     if (isRowAxis)
</span><del>-        return minLogicalWidthForChild(child, childMinSize, gridAreaSize);
</del><ins>+        return minLogicalWidthForChild(child, childMinSize, gridAreaSize) + baselineShim;
</ins><span class="cx"> 
</span><span class="cx">     bool overrideSizeHasChanged = updateOverrideContainingBlockContentSizeForChild(child, childInlineDirection, gridAreaSize);
</span><span class="cx">     layoutGridItemForMinSizeComputation(child, overrideSizeHasChanged);
</span><span class="cx"> 
</span><del>-    return child.computeLogicalHeightUsing(MinSize, childMinSize, std::nullopt).value_or(0) + child.marginLogicalHeight() + child.scrollbarLogicalHeight();
</del><ins>+    return child.computeLogicalHeightUsing(MinSize, childMinSize, std::nullopt).value_or(0) + child.marginLogicalHeight() + child.scrollbarLogicalHeight() + baselineShim;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool GridTrackSizingAlgorithm::canParticipateInBaselineAlignment(const RenderBox& child, GridAxis baselineAxis) const
+{
+    ASSERT(baselineAxis == GridColumnAxis ? m_columnBaselineItemsMap.contains(&child) : m_rowBaselineItemsMap.contains(&child));
+
+    // Baseline cyclic dependencies only happen with synthesized
+    // baselines. These cases include orthogonal or empty grid items
+    // and replaced elements.
+    bool isParallelToBaselineAxis = baselineAxis == GridColumnAxis ? !GridLayoutFunctions::isOrthogonalChild(*m_renderGrid, child) : GridLayoutFunctions::isOrthogonalChild(*m_renderGrid, child);
+    if (isParallelToBaselineAxis && child.firstLineBaseline())
+        return true;
+
+    // Baseline cyclic dependencies only happen in grid areas with
+    // intrinsically-sized tracks. 
+    if (!isIntrinsicSizedGridArea(child, baselineAxis))
+        return true;
+
+    return isParallelToBaselineAxis ? !child.hasRelativeLogicalHeight() : !child.hasRelativeLogicalWidth() && !child.style().logicalWidth().isAuto();
+}
+
+bool GridTrackSizingAlgorithm::participateInBaselineAlignment(const RenderBox& child, GridAxis baselineAxis) const
+{
+    return baselineAxis == GridColumnAxis ? m_columnBaselineItemsMap.get(&child) : m_rowBaselineItemsMap.get(&child);
+}
+
+void GridTrackSizingAlgorithm::updateBaselineAlignmentContext(const RenderBox& child, GridAxis baselineAxis)
+{
+    ASSERT(wasSetup());
+    ASSERT(canParticipateInBaselineAlignment(child, baselineAxis));
+    ASSERT(!child.needsLayout());
+
+    ItemPosition align = m_renderGrid->selfAlignmentForChild(baselineAxis, child).position();
+    const auto& span = m_grid.gridItemSpan(child, gridDirectionForAxis(baselineAxis));
+    m_baselineAlignment.updateBaselineAlignmentContext(align, span.startLine(), child, baselineAxis);
+}
+
+LayoutUnit GridTrackSizingAlgorithm::baselineOffsetForChild(const RenderBox& child, GridAxis baselineAxis) const
+{
+    if (!participateInBaselineAlignment(child, baselineAxis))
+        return LayoutUnit();
+
+    ItemPosition align = m_renderGrid->selfAlignmentForChild(baselineAxis, child).position();
+    const auto& span = m_grid.gridItemSpan(child, gridDirectionForAxis(baselineAxis));
+    return m_baselineAlignment.baselineOffsetForChild(align, span.startLine(), child, baselineAxis);
+}
+
+void GridTrackSizingAlgorithm::clearBaselineItemsCache()
+{
+    m_columnBaselineItemsMap.clear();
+    m_rowBaselineItemsMap.clear();
+}
+
+void GridTrackSizingAlgorithm::cacheBaselineAlignedItem(const RenderBox& item, GridAxis axis)
+{
+    ASSERT(m_renderGrid->isBaselineAlignmentForChild(item, axis));
+    if (axis == GridColumnAxis)
+        m_columnBaselineItemsMap.add(&item, true);
+    else
+        m_rowBaselineItemsMap.add(&item, true);
+}
+
+void GridTrackSizingAlgorithm::copyBaselineItemsCache(const GridTrackSizingAlgorithm& source, GridAxis axis)
+{
+    if (axis == GridColumnAxis)
+        m_columnBaselineItemsMap = source.m_columnBaselineItemsMap;
+    else
+        m_rowBaselineItemsMap = source.m_rowBaselineItemsMap;
+}
+
</ins><span class="cx"> bool GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild(RenderBox& child, GridTrackSizingDirection direction, std::optional<LayoutUnit> overrideSize) const
</span><span class="cx"> {
</span><span class="cx">     if (!overrideSize)
</span><span class="lines">@@ -1174,8 +1280,29 @@
</span><span class="cx"> 
</span><span class="cx">     m_needsSetup = false;
</span><span class="cx">     m_hasPercentSizedRowsIndefiniteHeight = false;
</span><ins>+
+    computeBaselineAlignmentContext();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void GridTrackSizingAlgorithm::computeBaselineAlignmentContext()
+{
+    GridAxis axis = gridAxisForDirection(m_direction);
+    m_baselineAlignment.clear(axis);
+    m_baselineAlignment.setBlockFlow(m_renderGrid->style().writingMode());
+    BaselineItemsCache& baselineItemsCache = axis == GridColumnAxis ? m_columnBaselineItemsMap : m_rowBaselineItemsMap;
+    BaselineItemsCache tmpBaselineItemsCache = baselineItemsCache;
+    for (auto* child : tmpBaselineItemsCache.keys()) {
+        // FIXME (jfernandez): We may have to get rid of the baseline participation
+        // flag (hence just using a HashSet) depending on the CSS WG resolution on
+        // https://github.com/w3c/csswg-drafts/issues/3046
+        if (canParticipateInBaselineAlignment(*child, axis)) {
+            updateBaselineAlignmentContext(*child, axis);
+            baselineItemsCache.set(child, true);
+        } else
+            baselineItemsCache.set(child, false);
+    }
+}
+
</ins><span class="cx"> void GridTrackSizingAlgorithm::run()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(wasSetup());
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingGridTrackSizingAlgorithmh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.h (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.h        2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.h   2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "Grid.h"
</span><ins>+#include "GridBaselineAlignment.h"
</ins><span class="cx"> #include "GridTrackSize.h"
</span><span class="cx"> #include "LayoutUnit.h"
</span><span class="cx"> 
</span><span class="lines">@@ -110,7 +111,12 @@
</span><span class="cx">     LayoutUnit maxContentSize() const { return m_maxContentSize; };
</span><span class="cx"> 
</span><span class="cx">     LayoutSize estimatedGridAreaBreadthForChild(const RenderBox&) const;
</span><ins>+    LayoutUnit baselineOffsetForChild(const RenderBox&, GridAxis) const;
</ins><span class="cx"> 
</span><ins>+    void cacheBaselineAlignedItem(const RenderBox&, GridAxis);
+    void copyBaselineItemsCache(const GridTrackSizingAlgorithm&, GridAxis);
+    void clearBaselineItemsCache();
+
</ins><span class="cx">     Vector<GridTrack>& tracks(GridTrackSizingDirection direction) { return direction == ForColumns ? m_columns : m_rows; }
</span><span class="cx">     const Vector<GridTrack>& tracks(GridTrackSizingDirection direction) const { return direction == ForColumns ? m_columns : m_rows; }
</span><span class="cx"> 
</span><span class="lines">@@ -129,7 +135,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    std::optional<LayoutUnit> availableSpace() const { return availableSpace(m_direction); }
</del><ins>+    std::optional<LayoutUnit> availableSpace() const;
</ins><span class="cx">     bool isRelativeGridLengthAsAuto(const GridLength&, GridTrackSizingDirection) const;
</span><span class="cx">     GridTrackSize gridTrackSize(GridTrackSizingDirection, unsigned translatedIndex) const;
</span><span class="cx">     const GridTrackSize& rawGridTrackSize(GridTrackSizingDirection, unsigned translatedIndex) const;
</span><span class="lines">@@ -148,6 +154,12 @@
</span><span class="cx">     LayoutUnit estimatedGridAreaBreadthForChild(const RenderBox&, GridTrackSizingDirection) const;
</span><span class="cx">     LayoutUnit gridAreaBreadthForChild(const RenderBox&, GridTrackSizingDirection) const;
</span><span class="cx"> 
</span><ins>+    void computeBaselineAlignmentContext();
+    void updateBaselineAlignmentContext(const RenderBox&, GridAxis);
+    bool canParticipateInBaselineAlignment(const RenderBox&, GridAxis) const;
+    bool participateInBaselineAlignment(const RenderBox&, GridAxis) const;
+
+    bool isIntrinsicSizedGridArea(const RenderBox&, GridAxis) const;
</ins><span class="cx">     void computeGridContainerIntrinsicSizes();
</span><span class="cx"> 
</span><span class="cx">     // Helper methods for step 4. Strech flexible tracks.
</span><span class="lines">@@ -210,6 +222,11 @@
</span><span class="cx">     };
</span><span class="cx">     SizingState m_sizingState;
</span><span class="cx"> 
</span><ins>+    GridBaselineAlignment m_baselineAlignment;
+    typedef HashMap<const RenderBox*, bool> BaselineItemsCache;
+    BaselineItemsCache m_columnBaselineItemsMap;
+    BaselineItemsCache m_rowBaselineItemsMap;
+
</ins><span class="cx">     // This is a RAII class used to ensure that the track sizing algorithm is
</span><span class="cx">     // executed as it is suppossed to be, i.e., first resolve columns and then
</span><span class="cx">     // rows. Only if required a second iteration is run following the same order,
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp       2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp  2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -3000,7 +3000,7 @@
</span><span class="cx"> 
</span><span class="cx"> std::optional<int> RenderBlockFlow::firstLineBaseline() const
</span><span class="cx"> {
</span><del>-    if (isWritingModeRoot() && !isRubyRun())
</del><ins>+    if (isWritingModeRoot() && !isRubyRun() && !isGridItem())
</ins><span class="cx">         return std::nullopt;
</span><span class="cx"> 
</span><span class="cx">     if (!childrenInline())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp    2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp       2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -206,8 +206,18 @@
</span><span class="cx">             // We may need to repeat the track sizing in case of any grid item was orthogonal.
</span><span class="cx">             if (GridLayoutFunctions::isOrthogonalChild(*this, *child))
</span><span class="cx">                 m_hasAnyOrthogonalItem = true;
</span><ins>+
+            // We keep a cache of items with baseline as alignment values so
+            // that we only compute the baseline shims for such items. This
+            // cache is needed for performance related reasons due to the
+            // cost of evaluating the item's participation in a baseline
+            // context during the track sizing algorithm.
+            if (isBaselineAlignmentForChild(*child, GridColumnAxis))
+                m_trackSizingAlgorithm.cacheBaselineAlignedItem(*child, GridColumnAxis);
+            if (isBaselineAlignmentForChild(*child, GridRowAxis))
+                m_trackSizingAlgorithm.cacheBaselineAlignedItem(*child, GridRowAxis);
</ins><span class="cx">         }
</span><del>-
</del><ins>+        m_baselineItemsCached = true;
</ins><span class="cx">         setLogicalHeight(0);
</span><span class="cx">         updateLogicalWidth();
</span><span class="cx"> 
</span><span class="lines">@@ -298,6 +308,9 @@
</span><span class="cx">     repainter.repaintAfterLayout();
</span><span class="cx"> 
</span><span class="cx">     clearNeedsLayout();
</span><ins>+
+    m_trackSizingAlgorithm.clearBaselineItemsCache();
+    m_baselineItemsCached = false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutUnit RenderGrid::gridGap(GridTrackSizingDirection direction, std::optional<LayoutUnit> availableSize) const
</span><span class="lines">@@ -392,6 +405,17 @@
</span><span class="cx"> 
</span><span class="cx">     performGridItemsPreLayout(algorithm);
</span><span class="cx"> 
</span><ins>+    if (m_baselineItemsCached)
+        algorithm.copyBaselineItemsCache(m_trackSizingAlgorithm, GridRowAxis);
+    else {
+        for (auto* child = firstChildBox(); child; child = child->nextSiblingBox()) {
+            if (child->isOutOfFlowPositioned())
+                continue;
+            if (isBaselineAlignmentForChild(*child, GridRowAxis))
+                algorithm.cacheBaselineAlignedItem(*child, GridRowAxis);
+        }
+    }
+
</ins><span class="cx">     computeTrackSizesForIndefiniteSize(algorithm, ForColumns, minLogicalWidth, maxLogicalWidth);
</span><span class="cx"> 
</span><span class="cx">     if (hadExcludedChildren) {
</span><span class="lines">@@ -593,6 +617,13 @@
</span><span class="cx">         if (grid.orderIterator().shouldSkipChild(*child))
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><ins>+        // Grid items should use the grid area sizes instead of the containing block (grid container)
+        // sizes, we initialize the overrides here if needed to ensure it.
+        if (!child->hasOverrideContainingBlockContentLogicalWidth())
+            child->setOverrideContainingBlockContentLogicalWidth(LayoutUnit());
+        if (!child->hasOverrideContainingBlockContentLogicalHeight())
+            child->setOverrideContainingBlockContentLogicalHeight(LayoutUnit(-1));
+
</ins><span class="cx">         GridArea area = grid.gridItemArea(*child);
</span><span class="cx">         if (!area.rows.isIndefinite())
</span><span class="cx">             area.rows.translate(std::abs(grid.smallestTrackStart(ForRows)));
</span><span class="lines">@@ -652,7 +683,15 @@
</span><span class="cx">         if (GridLayoutFunctions::isOrthogonalChild(*this, *child)) {
</span><span class="cx">             updateGridAreaLogicalSize(*child, algorithm.estimatedGridAreaBreadthForChild(*child));
</span><span class="cx">             child->layoutIfNeeded();
</span><ins>+            continue;
</ins><span class="cx">         }
</span><ins>+        // We need to layout the item to know whether it must synthesize its
+        // baseline or not, which may imply a cyclic sizing dependency.
+        // FIXME: Can we avoid it ?
+        if (isBaselineAlignmentForChild(*child)) {
+            updateGridAreaLogicalSize(*child, algorithm.estimatedGridAreaBreadthForChild(*child));
+            child->layoutIfNeeded();
+        }
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1182,11 +1221,25 @@
</span><span class="cx">     return (direction == HorizontalLine ? box.size().height() : box.size().width()).toInt();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderGrid::isInlineBaselineAlignedChild(const RenderBox& child) const
</del><ins>+static int synthesizedBaselineFromMarginBox(const RenderBox& box, LineDirectionMode direction)
</ins><span class="cx"> {
</span><del>-    return alignSelfForChild(child).position() == ItemPosition::Baseline && !GridLayoutFunctions::isOrthogonalChild(*this, child) && !hasAutoMarginsInColumnAxis(child);
</del><ins>+    return (direction == HorizontalLine ? box.size().height() + box.verticalMarginExtent() : box.size().width() + box.horizontalMarginExtent()).toInt();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderGrid::isBaselineAlignmentForChild(const RenderBox& child) const
+{
+    return isBaselineAlignmentForChild(child, GridRowAxis) || isBaselineAlignmentForChild(child, GridColumnAxis);
+}
+
+bool RenderGrid::isBaselineAlignmentForChild(const RenderBox& child, GridAxis baselineAxis) const
+{
+    if (child.isOutOfFlowPositioned())
+        return false;
+    ItemPosition align = selfAlignmentForChild(baselineAxis, child).position();
+    bool hasAutoMargins = baselineAxis == GridColumnAxis ? hasAutoMarginsInColumnAxis(child) : hasAutoMarginsInRowAxis(child);
+    return isBaselinePosition(align) && !hasAutoMargins;
+}
+
</ins><span class="cx"> // FIXME: This logic is shared by RenderFlexibleBox, so it might be refactored somehow.
</span><span class="cx"> int RenderGrid::baselinePosition(FontBaseline, bool, LineDirectionMode direction, LinePositionMode mode) const
</span><span class="cx"> {
</span><span class="lines">@@ -1195,10 +1248,7 @@
</span><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(mode);
</span><span class="cx"> #endif
</span><del>-    int baseline = firstLineBaseline().value_or(synthesizedBaselineFromBorderBox(*this, direction));
-
-    int marginSize = direction == HorizontalLine ? verticalMarginExtent() : horizontalMarginExtent();
-    return baseline + marginSize;
</del><ins>+    return firstLineBaseline().value_or(synthesizedBaselineFromMarginBox(*this, direction));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::optional<int> RenderGrid::firstLineBaseline() const
</span><span class="lines">@@ -1213,7 +1263,7 @@
</span><span class="cx">         for (auto& child : m_grid.cell(0, column)) {
</span><span class="cx">             ASSERT(child.get());
</span><span class="cx">             // If an item participates in baseline alignment, we select such item.
</span><del>-            if (isInlineBaselineAlignedChild(*child)) {
</del><ins>+            if (isBaselineAlignmentForChild(*child)) {
</ins><span class="cx">                 // FIXME: self-baseline and content-baseline alignment not implemented yet.
</span><span class="cx">                 baselineChild = child.get();
</span><span class="cx">                 break;
</span><span class="lines">@@ -1242,10 +1292,20 @@
</span><span class="cx">     if (std::optional<int> baseline = firstLineBaseline())
</span><span class="cx">         return baseline;
</span><span class="cx"> 
</span><del>-    int marginAscent = direction == HorizontalLine ? marginTop() : marginRight();
</del><ins>+    int marginAscent = direction == HorizontalLine ? marginBottom() : marginRight();
</ins><span class="cx">     return synthesizedBaselineFromBorderBox(*this, direction) + marginAscent;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LayoutUnit RenderGrid::columnAxisBaselineOffsetForChild(const RenderBox& child) const
+{
+    return m_trackSizingAlgorithm.baselineOffsetForChild(child, GridColumnAxis);
+}
+
+LayoutUnit RenderGrid::rowAxisBaselineOffsetForChild(const RenderBox& child) const
+{
+    return m_trackSizingAlgorithm.baselineOffsetForChild(child, GridRowAxis);
+}
+
</ins><span class="cx"> GridAxisPosition RenderGrid::columnAxisPositionForChild(const RenderBox& child) const
</span><span class="cx"> {
</span><span class="cx">     bool hasSameWritingMode = child.style().writingMode() == style().writingMode();
</span><span class="lines">@@ -1393,7 +1453,7 @@
</span><span class="cx">     GridAxisPosition axisPosition = columnAxisPositionForChild(child);
</span><span class="cx">     switch (axisPosition) {
</span><span class="cx">     case GridAxisStart:
</span><del>-        return startPosition;
</del><ins>+        return startPosition + columnAxisBaselineOffsetForChild(child);
</ins><span class="cx">     case GridAxisEnd:
</span><span class="cx">     case GridAxisCenter: {
</span><span class="cx">         LayoutUnit columnAxisChildSize = GridLayoutFunctions::isOrthogonalChild(*this, child) ? child.logicalWidth() + child.marginLogicalWidth() : child.logicalHeight() + child.marginLogicalHeight();
</span><span class="lines">@@ -1418,7 +1478,7 @@
</span><span class="cx">     GridAxisPosition axisPosition = rowAxisPositionForChild(child);
</span><span class="cx">     switch (axisPosition) {
</span><span class="cx">     case GridAxisStart:
</span><del>-        return startPosition;
</del><ins>+        return startPosition + rowAxisBaselineOffsetForChild(child);
</ins><span class="cx">     case GridAxisEnd:
</span><span class="cx">     case GridAxisCenter: {
</span><span class="cx">         LayoutUnit rowAxisChildSize = GridLayoutFunctions::isOrthogonalChild(*this, child) ? child.logicalHeight() + child.marginLogicalHeight() : child.logicalWidth() + child.marginLogicalWidth();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.h (238456 => 238457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.h      2018-11-23 04:36:38 UTC (rev 238456)
+++ trunk/Source/WebCore/rendering/RenderGrid.h 2018-11-23 11:04:23 UTC (rev 238457)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum GridAxisPosition {GridAxisStart, GridAxisEnd, GridAxisCenter};
</span><del>-enum GridAxis { GridRowAxis, GridColumnAxis };
</del><span class="cx"> 
</span><span class="cx"> class RenderGrid final : public RenderBlock {
</span><span class="cx">     WTF_MAKE_ISO_ALLOCATED(RenderGrid);
</span><span class="lines">@@ -75,7 +74,11 @@
</span><span class="cx">     LayoutUnit gridItemOffset(GridTrackSizingDirection) const;
</span><span class="cx"> 
</span><span class="cx">     void updateGridAreaLogicalSize(RenderBox&, LayoutSize) const;
</span><ins>+    bool isBaselineAlignmentForChild(const RenderBox&) const;
+    bool isBaselineAlignmentForChild(const RenderBox&, GridAxis) const;
</ins><span class="cx"> 
</span><ins>+    StyleSelfAlignmentData selfAlignmentForChild(GridAxis, const RenderBox&, const RenderStyle* = nullptr) const;
+
</ins><span class="cx">     StyleContentAlignmentData contentAlignment(GridTrackSizingDirection) const;
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="lines">@@ -90,7 +93,6 @@
</span><span class="cx">     bool isRenderGrid() const override { return true; }
</span><span class="cx">     void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override;
</span><span class="cx"> 
</span><del>-    StyleSelfAlignmentData selfAlignmentForChild(GridAxis, const RenderBox&, const RenderStyle* = nullptr) const;
</del><span class="cx">     bool selfAlignmentChangedToStretch(GridAxis, const RenderStyle& oldStyle, const RenderStyle& newStyle, const RenderBox&) const;
</span><span class="cx">     bool selfAlignmentChangedFromStretch(GridAxis, const RenderStyle& oldStyle, const RenderStyle& newStyle, const RenderBox&) const;
</span><span class="cx"> 
</span><span class="lines">@@ -173,6 +175,9 @@
</span><span class="cx">     std::optional<int> inlineBlockBaseline(LineDirectionMode) const final;
</span><span class="cx">     bool isInlineBaselineAlignedChild(const RenderBox&) const;
</span><span class="cx"> 
</span><ins>+    LayoutUnit columnAxisBaselineOffsetForChild(const RenderBox&) const;
+    LayoutUnit rowAxisBaselineOffsetForChild(const RenderBox&) const;
+
</ins><span class="cx">     LayoutUnit gridGap(GridTrackSizingDirection) const;
</span><span class="cx">     LayoutUnit gridGap(GridTrackSizingDirection, std::optional<LayoutUnit> availableSize) const;
</span><span class="cx"> 
</span><span class="lines">@@ -199,6 +204,7 @@
</span><span class="cx">     std::optional<LayoutUnit> m_maxContentHeight;
</span><span class="cx"> 
</span><span class="cx">     bool m_hasAnyOrthogonalItem {false};
</span><ins>+    bool m_baselineItemsCached {false};
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>