Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-gutters-and-tracks.html

Issue 1309513008: [css-grid] Implement grid gutters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased patch for landing Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-gutters-and-tracks.html
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-gutters-and-tracks.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-gutters-and-tracks.html
new file mode 100644
index 0000000000000000000000000000000000000000..6d8bfac86f7d936f0e7b2b02998da50c7a65bccf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-gutters-and-tracks.html
@@ -0,0 +1,139 @@
+<!DOCTYPE html>
+<link href="resources/grid.css" rel="stylesheet">
+<link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel=stylesheet>
+<script src="../../resources/check-layout.js"></script>
+<script src="../../resources/js-test.js"></script>
+<style>
+body { margin: 0px; }
+
+.normalGap { grid-gap: normal; }
+
+.gridGap { grid-gap: 16px; }
+
+.gridRowColumnGaps {
+ grid-row-gap: 12px;
+ grid-column-gap: 23px;
+}
+
+.gridMultipleCols { grid-template-columns: 30px minmax(10px, 50px) 80px; }
+.gridMultipleRows { grid-template-rows: 90px 70px min-content; }
+.gridAutoAuto { grid-template: auto auto / auto auto; }
+.gridMultipleFixed { grid-template: [first] 15px [foo] 25px [bar] 35px [last] / [first] 37px [foo] 57px [bar] 77px [last]; }
+.gridFixed100 { grid-template: repeat(2, 100px) / repeat(2, 100px); }
+
+.thirdRowThirdColumn { grid-area: 3 / 3; }
+.firstRowThirdColumn { grid-area: 1 / 3; }
+
+div.grid > div { font: 10px/1 Ahem; }
+
+.gridItemMargins {
+ margin: 20px 30px 40px 50px;
+ width: 20px;
+ height: 40px;
+}
+
+</style>
+
+<body onload="checkLayout('.grid')">
+
+<!-- Check that gutters contribute to the size of the grid containers. -->
+
+<div style="position: relative;">
+ <div class="grid normalGap gridMultipleCols fit-content" data-expected-width="160" data-expected-height="0"></div>
+ <div class="grid normalGap gridMultipleRows" style="width: 400px" data-expected-width="400" data-expected-height="160"></div>
+</div>
+
+<div style="position: relative">
+ <div class="grid gridRowColumnGaps fit-content" data-expected-width="93" data-expected-height="52">
+ <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="10">XX</div>
+ <div class="secondRowSecondColumn" data-offset-x="43" data-offset-y="22" data-expected-width="50" data-expected-height="30">XX<br>X<br>XX XX</div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid gridMultipleCols gridRowColumnGaps fit-content" data-expected-width="206" data-expected-height="84">
+ <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="30" data-expected-height="10">XX</div>
+ <div class="secondRowSecondColumn" data-offset-x="53" data-offset-y="22" data-expected-width="50" data-expected-height="20">XX<br>XX XX</div>
+ <div class="thirdRowThirdColumn" data-offset-x="126" data-offset-y="54" data-expected-width="80" data-expected-height="30">XXXX XX<br>X<br>XX XX</div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid gridMultipleRows gridRowColumnGaps fit-content" data-expected-width="186" data-expected-height="214">
+ <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="90">XX</div>
+ <div class="secondRowSecondColumn" data-offset-x="43" data-offset-y="102" data-expected-width="50" data-expected-height="70">XX<br>XX XX</div>
+ <div class="thirdRowThirdColumn" data-offset-x="116" data-offset-y="184" data-expected-width="70" data-expected-height="30">XXXX XX<br>X<br>XX XX</div>
+ </div>
+</div>
+
+<!-- Check that gutters do not alter grid items positioning. -->
+<div style="position: relative">
+ <div class="grid gridMultipleFixed gridRowColumnGaps">
+ <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="15" data-expected-height="37">X X X</div>
+ <div class="secondRowSecondColumn" data-offset-x="38" data-offset-y="49" data-expected-width="25" data-expected-height="57">X X</div>
+ <div class="thirdRowThirdColumn" data-offset-x="86" data-offset-y="118" data-expected-width="35" data-expected-height="77">XXX XX X XX XX</div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid gridMultipleFixed gridRowColumnGaps">
+ <div style="grid-row: 2; grid-column: -2 / -1;" data-offset-x="86" data-offset-y="49" data-expected-width="35" data-expected-height="57">X X X</div>
+ <div style="grid-row: 1 / bar; grid-column: bar" data-offset-x="86" data-offset-y="0" data-expected-width="35" data-expected-height="106">X XX X XX XX XX X</div>
+ <div style="grid-row: -2; grid-column-end: foo" data-offset-x="0" data-offset-y="118" data-expected-width="15" data-expected-height="77">X X</div>
+ </div>
+</div>
+
+<!-- Check that gutters do not alter track sizing. -->
+<div style="position: relative">
+ <div class="grid gridRowColumnGaps fit-content" data-expected-width="156" data-expected-height="84">
+ <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="10">XX</div>
+ <div class="secondRowSecondColumn" data-offset-x="43" data-offset-y="22" data-expected-width="30" data-expected-height="20">X X<br>X X</div>
+ <div class="thirdRowThirdColumn" data-offset-x="96" data-offset-y="54" data-expected-width="60" data-expected-height="30">XXX XX<br>X<br>XX XX</div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid gridRowColumnGaps gridMultipleCols gridMultipleRows fit-content" data-expected-width="206" data-expected-height="214">
+ <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="30" data-expected-height="90">XX</div>
+ <div class="secondRowSecondColumn" data-offset-x="53" data-offset-y="102" data-expected-width="50" data-expected-height="70">X X<br>X X</div>
+ <div class="thirdRowThirdColumn" data-offset-x="126" data-offset-y="184" data-expected-width="80" data-expected-height="30">XXX XX<br>X<br>XX XX</div>
+ </div>
+</div>
+
+<!-- Check that gutters contribute to the size of spanning items. -->
+<div style="position: relative">
+ <div class="grid gridGap gridAutoAuto constrainedContainer">
+ <div class="secondRowBothColumn" data-offset-x="0" data-offset-y="26" data-expected-width="50" data-expected-height="10">XXXXX</div>
+ <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="17" data-expected-height="10">X</div>
+ <div class="firstRowSecondColumn" data-offset-x="33" data-offset-y="0" data-expected-width="17" data-expected-height="10">X</div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid gridMultipleFixed gridRowColumnGaps">
+ <div style="grid-row: 2; grid-column: 1 / -1;" data-offset-x="0" data-offset-y="49" data-expected-width="121" data-expected-height="57">XXXX X XXXX</div>
+ <div style="grid-row: first / last; grid-column-start: 2" data-offset-x="38" data-offset-y="0" data-expected-width="25" data-expected-height="195">X XX X XX X</div>
+ <div style="grid-row: 1 / 3; grid-column: first / bar" data-offset-x="0" data-offset-y="0" data-expected-width="63" data-expected-height="106">XXX XX<br>XX<br>XXXXX</div>
+ </div>
+</div>
+
+<!-- Check that gutters do not interfere with margins computation. -->
+<div style="position: relative">
+ <div class="grid gridFixed100 gridGap">
+ <div class="gridItemMargins firstRowFirstColumn" data-offset-x="50" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
+ <div class="gridItemMargins firstRowSecondColumn" data-offset-x="166" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
+ <div class="gridItemMargins secondRowFirstColumn" data-offset-x="50" data-offset-y="136" data-expected-width="20" data-expected-height="40"></div>
+ <div class="gridItemMargins secondRowSecondColumn" data-offset-x="166" data-offset-y="136" data-expected-width="20" data-expected-height="40"></div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid gridFixed100 verticalRL directionRTL gridGap">
+ <div class="gridItemMargins firstRowFirstColumn" data-offset-x="166" data-offset-y="136" data-expected-width="20" data-expected-height="40"></div>
+ <div class="gridItemMargins firstRowSecondColumn" data-offset-x="166" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
+ <div class="gridItemMargins secondRowFirstColumn" data-offset-x="50" data-offset-y="136" data-expected-width="20" data-expected-height="40"></div>
+ <div class="gridItemMargins secondRowSecondColumn" data-offset-x="50" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
+ </div>
+</div>
+
+</body>

Powered by Google App Engine
This is Rietveld 408576698