Bug 1480711 [wpt PR 12292] - [css-grid] Apply content alignment during second pass, a=testonly
authorManuel Rego Casasnovas <rego@igalia.com>
Wed, 08 Aug 2018 12:19:25 +0000
changeset 430949 a2645ddde8aeb9a7353643c126760f869d075cdc
parent 430948 d559e07b5faf7fb6d649d8f832572d8051cbfcf0
child 430950 449629a122f6e5588e322fa029ca96e8bf441710
push id34417
push usernbeleuzu@mozilla.com
push dateFri, 10 Aug 2018 16:00:49 +0000
treeherdermozilla-central@61e553ff703e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1480711, 12292, 870634, 1161925, 580890
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1480711 [wpt PR 12292] - [css-grid] Apply content alignment during second pass, a=testonly Automatic update from web-platform-tests[css-grid] Apply content alignment during second pass When we integrated content alignment in the track sizing algorithm (r566412) we forgot to do it too when the 2nd pass is needed. The patch is very simple and just adds the calls to apply content alignment in LayoutGrid::RepeatTracksSizingIfNeeded() for each axis. The spec also mentions it in the new 3 and 4 steps: https://drafts.csswg.org/css-grid/#algo-overview So the new code just aligns with the spec. BUG=870634 TEST=external/wpt/css/css-grid/alignment/grid-content-alignment-second-pass-001.html Change-Id: Iccbcea5da1011eae37b4923bb78334cddc76d027 Reviewed-on: https://chromium-review.googlesource.com/1161925 Reviewed-by: Sergio Villar <svillar@igalia.com> Commit-Queue: Manuel Rego <rego@igalia.com> Cr-Commit-Position: refs/heads/master@{#580890} -- wpt-commits: 0bc8ef9382a661bcb48b70de19f3d0fedd0646f2 wpt-pr: 12292
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/css/css-grid/alignment/grid-content-alignment-second-pass-001.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -329050,16 +329050,22 @@
     ]
    ],
    "css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-004.html": [
     [
      "/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-004.html",
      {}
     ]
    ],
+   "css/css-grid/alignment/grid-content-alignment-second-pass-001.html": [
+    [
+     "/css/css-grid/alignment/grid-content-alignment-second-pass-001.html",
+     {}
+    ]
+   ],
    "css/css-grid/alignment/grid-fit-content-tracks-dont-stretch-001.html": [
     [
      "/css/css-grid/alignment/grid-fit-content-tracks-dont-stretch-001.html",
      {}
     ]
    ],
    "css/css-grid/alignment/grid-row-axis-alignment-positioned-items-001.html": [
     [
@@ -532517,16 +532523,20 @@
   "css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-003.html": [
    "22e03201b38209f0714c9178a42f840a38964cde",
    "testharness"
   ],
   "css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-004.html": [
    "3630eee37558bfa33c84b9c5ec467224b747edef",
    "testharness"
   ],
+  "css/css-grid/alignment/grid-content-alignment-second-pass-001.html": [
+   "5b4bbabbb160079796aa4eb6786ea15383f6dd75",
+   "testharness"
+  ],
   "css/css-grid/alignment/grid-content-distribution-001.html": [
    "7b53a2897b83d20ff7cd12db85f576830953b56e",
    "reftest"
   ],
   "css/css-grid/alignment/grid-content-distribution-002.html": [
    "194934bb93e5fdfdc57f573a6ef6235c19a99ed9",
    "reftest"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-grid/alignment/grid-content-alignment-second-pass-001.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: Content alignment second pass</title>
+<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/css-grid-1/#grid-align">
+<link rel="help" href="https://drafts.csswg.org/css-grid-1/#algo-overview">
+<meta name="flags" content="ahem dom">
+<meta name="assert" content="This test checks that content alignment is properly applied when the size of the tracks changes in the second pass of the track sizing algorithm.">
+<link rel="stylesheet" href="../../support/grid.css">
+<link rel="stylesheet" href="../../support/alignment.css">
+
+<style>
+.grid {
+  position: relative;
+  width: 100px;
+  height: 50px;
+  font: 25px/1 Ahem;
+  margin: 10px;
+}
+</style>
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/check-layout-th.js"></script>
+
+<body onLoad="checkLayout('.grid');">
+
+<div id="log"></div>
+
+<div class="grid">
+  <div class="firstRowFirstColumn verticalLR" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="50">XX X</div>
+</div>
+
+<div class="grid contentStretch">
+  <div class="firstRowFirstColumn verticalLR" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="50">XX X</div>
+</div>
+
+<div class="grid contentStart">
+  <div class="firstRowFirstColumn verticalLR" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">XX X</div>
+</div>
+
+<div class="grid contentCenter">
+  <div class="firstRowFirstColumn verticalLR" data-offset-x="25" data-offset-y="0" data-expected-width="50" data-expected-height="50">XX X</div>
+</div>
+
+<div class="grid contentEnd">
+  <div class="firstRowFirstColumn verticalLR" data-offset-x="50" data-offset-y="0" data-expected-width="50" data-expected-height="50">XX X</div>
+</div>
+
+<div class="grid contentSpaceBetween">
+  <div class="firstRowFirstColumn verticalLR" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">XX X</div>
+  <div class="firstRowSecondColumn" data-offset-x="75" data-offset-y="0" data-expected-width="25" data-expected-height="50">X</div>
+</div>
+
+<div class="grid contentSpaceEvenly" style="width: 105px;">
+  <div class="firstRowFirstColumn verticalLR" data-offset-x="10" data-offset-y="0" data-expected-width="50" data-expected-height="50">XX X</div>
+  <div class="firstRowSecondColumn" data-offset-x="70" data-offset-y="0" data-expected-width="25" data-expected-height="50">X</div>
+</div>
+
+<div class="grid contentSpaceAround" style="width: 115px;">
+  <div class="firstRowFirstColumn verticalLR" data-offset-x="10" data-offset-y="0" data-expected-width="50" data-expected-height="50">XX X</div>
+  <div class="firstRowSecondColumn" data-offset-x="80" data-offset-y="0" data-expected-width="25" data-expected-height="50">X</div>
+</div>
+
+</body>