Bug 1494362 [wpt PR 13226] - [css-grid] Properly align items next to collapsed tracks with gutters, a=testonly
authorOriol Brufau <obrufau@igalia.com>
Fri, 05 Oct 2018 14:20:44 +0000
changeset 488344 7266f1e665b409c435870089f732cb12accbd02a
parent 488343 dec7a9d8dd15ce58b6d064b824a09789628e543b
child 488345 abfd3714cb3ef5a31ca6dc488e4942f5c6428fd5
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
bugs1494362, 13226, 801881, 1245727, 595045
Bug 1494362 [wpt PR 13226] - [css-grid] Properly align items next to collapsed tracks with gutters, a=testonly Automatic update from web-platform-tests[css-grid] Properly align items next to collapsed tracks with gutters GridAreaPositionForInFlowChild could return a wrong end position for grid items adjacent to a collapsed track, because it didn't take into account that gutters collapse in that case. Therefore, "center" or "end" alignments displayed the item at the wrong position. BUG=801881 TEST=external/wpt/css/css-grid/alignment/grid-gutters-013.html Change-Id: I8223f102e3fd581ab0a2d6f23d18c188e23807c7 Reviewed-on: https://chromium-review.googlesource.com/1245727 Reviewed-by: Javier Fernandez <jfernandez@igalia.com> Reviewed-by: Sergio Villar <svillar@igalia.com> Reviewed-by: Manuel Rego <rego@igalia.com> Commit-Queue: Javier Fernandez <jfernandez@igalia.com> Cr-Commit-Position: refs/heads/master@{#595045} -- wpt-commits: c617da67a8710c84bbda3b71c149faad4f53b222 wpt-pr: 13226
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-grid/alignment/grid-gutters-013.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: Gutters adjacent to collapsed tracks also collapse</title>
+<link rel="help" href="https://www.w3.org/TR/css-grid-1/#gutters">
+<link rel="help" href="https://www.w3.org/TR/css-align-3/#gap-shorthand">
+<link rel="help" href="https://www.w3.org/TR/css-align-3/#gap-legacy">
+<link rel="help" href="https://www.w3.org/TR/css-grid-1/#repeat-notation">
+<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
+<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
+<meta name="assert" content="This test checks that gutters adjacent to collapsed tracks don't reduce the space available for aligning adjacent grid items." />
+    #grid {
+        display: grid;
+        margin-top: -50px;
+        margin-left: -50px;
+        width: 500px;
+        height: 500px;
+        grid-gap: 100px;
+        grid-template-rows: repeat(auto-fit, 200px);
+        grid-template-columns: repeat(auto-fit, 200px);
+        align-items: center;
+        justify-items: center;
+        background: linear-gradient(red, red) no-repeat 50px 50px / 100px 100px;
+    }
+    #grid > div {
+        background-color: green;
+        width: 50%;
+        height: 50%;
+    }
+<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+<div id="grid">
+    <div></div>