Skip to content

Commit

Permalink
Bug 1630973 [wpt PR 23061] - [css-grid] Migrate grid-gutters-and-flex…
Browse files Browse the repository at this point in the history
…-content.html to WPT, a=testonly

Automatic update from web-platform-tests
[css-grid] Migrate grid-gutters-and-flex-content.html to WPT

Drive-by: some \t are renamed at 4-spaces.

BUG=767015, 1063749
[email protected]

Change-Id: I369fc1fb602c4b87f33d8fe14b517743e82aec02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2154460
Commit-Queue: Antonio Gomes <[email protected]>
Reviewed-by: Manuel Rego <[email protected]>
Cr-Commit-Position: refs/heads/master@{#760071}

--

wpt-commits: f62712c2f7adfc432ea001a984f35c6c7be452f5
wpt-pr: 23061
  • Loading branch information
tonikitoo committed Apr 28, 2020
1 parent e34bcb9 commit 6fe1899
Show file tree
Hide file tree
Showing 2 changed files with 294 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!DOCTYPE html>
<title>CSS Grid: grid gutters and flex content.</title>
<link rel="author" title="Sergio Villar" href="mailto:[email protected]"/>
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#gutters"/>
<meta name="assert" content="Check that gutters do not interfere with flex content resolution for columns or with content sized tracks."/>
<link rel="stylesheet" href="/css/support/grid.css"/>
<link rel="stylesheet" href="/css/support/width-keyword-classes.css"/>
<link rel="stylesheet" href="/css/support/alignment.css">
<link rel="stylesheet" href="/fonts/ahem.css" type="text/css"/>
<style>
.gridPercentAndFlexContent { grid-template: 50px / 50% minmax(30px, 2fr); }
.gridTwoDoubleMaxFlexContent { grid-template: 50px / minmax(10px, 0.5fr) minmax(10px, 2fr); }
.gridIgnoreSecondGridItem { grid-template: 50px / minmax(300px, 3fr) minmax(150px, 1fr); }

.gridRowsPercentAndFlexContent { grid-template: minmax(30px, 2fr) 50% / 50px; }
.gridRowsTwoMaxFlexContent { grid-template: minmax(10px, 1fr) minmax(10px, 2fr) / 50px; }
.gridRowsTwoDoubleMaxFlexContent { grid-template: minmax(10px, 0.5fr) minmax(10px, 2fr) / 50px; }

.gridMinContentAndMinMaxFixedMinContentAndFlex { grid-template-columns: min-content minmax(20px, min-content) 2fr; }
.gridMaxContentAndMinMaxFixedMaxContentAndFlex { grid-template-columns: max-content minmax(20px, max-content) 1fr; }

div.grid > div { font: 10px/1 Ahem; }

.gridRowColumnGaps {
grid-row-gap: 33px;
grid-column-gap: 19px;
}
</style>

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<!-- Check that gutters do not interfere with flex content resolution for columns -->

<div style="width: 120px; height: 10px;">
<div class="grid gridTwoDoubleMaxFlexContent gridRowColumnGaps" data-expected-width="120" data-expected-height="50">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="20" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="81" data-expected-height="50"></div>
</div>
</div>

<div style="width: 570px; height: 10px;">
<div class="grid gridIgnoreSecondGridItem gridRowColumnGaps" data-expected-width="570" data-expected-height="50">
<div class="firstRowFirstColumn" data-expected-width="401" data-expected-height="50"></div>
<div class="firstRowSecondColumn" data-expected-width="150" data-expected-height="50"></div>
</div>
</div>

<div style="width: 120px; height: 10px;">
<div class="grid gridPercentAndFlexContent gridRowColumnGaps" data-expected-width="120" data-expected-height="50">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="60" data-expected-height="50"></div>
<div class="firstRowSecondColumn" data-expected-width="41" data-expected-height="50"></div>
</div>
</div>

<!-- Check that gutters do not interfere with flex content resolution for rows -->

<div style="width: 10px; height: 60px">
<div class="grid gridRowsTwoMaxFlexContent gridRowColumnGaps" style="height: 100%" data-expected-width="10" data-expected-height="60">
<div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
<div class="secondRowFirstColumn" data-expected-width="50" data-expected-height="17"></div>
</div>
</div>

<div style="width: 10px; height: 60px">
<div class="grid gridRowsTwoDoubleMaxFlexContent gridRowColumnGaps" data-expected-width="10" data-expected-height="63">
<div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
<div class="secondRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
</div>
</div>

<div style="width: 10px;">
<div class="grid gridRowsPercentAndFlexContent gridRowColumnGaps" style="height: 150px" data-expected-width="10" data-expected-height="150">
<div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="42"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="75"></div>
</div>
</div>

<!-- Check that gutters do not interfere with flex content resolution with content sized tracks -->

<div style="position: relative; width: 100px;">
<div class="grid gridMinContentAndMinMaxFixedMinContentAndFlex gridRowColumnGaps" data-expected-width="100" data-expected-height="149">
<div style="grid-column: 2 / span 2;" data-expected-width="80">XXXXX</div>
<div style="grid-column: 1 / -1; grid-row: 2;" data-expected-width="100">XXX XXX XXX</div>
<div style="grid-column: 1 / span 2; grid-row: 3;" data-expected-width="40">XXXX XXXX</div>
<div style="grid-column: 1; grid-row: 4;" data-expected-width="1" data-expected-height="0"></div>
</div>
</div>

<div style="position: relative; width: 100px;">
<div class="grid gridMaxContentAndMinMaxFixedMaxContentAndFlex gridRowColumnGaps" data-expected-width="100" data-expected-height="139">
<div style="grid-column: 2 / span 2;" data-expected-width="39">XX</div>
<div style="grid-column: 1 / -1; grid-row: 2;" data-expected-width="109">XXX XXX XXX</div>
<div style="grid-column: 1 / span 2; grid-row: 3;" data-expected-width="90">XXXX XXXX</div>
<div style="grid-column: 1; grid-row: 4;" data-expected-width="51" data-expected-height="0"></div>
</div>
</div>

</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
<!DOCTYPE html>
<title>CSS Grid: grid gutters and tracks.</title>
<link rel="author" title="Sergio Villar" href="mailto:[email protected]"/>
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#gutters"/>
<meta name="assert" content="Check that gutters contribute to the size of the grid containers and spanning items, and do not alter grid items positioning, margin computation and track sizing."/>
<link rel="stylesheet" href="/css/support/grid.css"/>
<link rel="stylesheet" href="/css/support/width-keyword-classes.css"/>
<link rel="stylesheet" href="/fonts/ahem.css" type="text/css"/>
<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] 37px [foo] 57px [bar] 77px [last] / [first] 15px [foo] 25px [bar] 35px [last]; }
.gridFixed100 { grid-template: repeat(2, 100px) / repeat(2, 100px); }
.gridWithPercent { grid-template-columns: 10px 20% repeat(2, 30px); }
.gridWithDoublePercent { grid-template-columns: 60% 40%; }
.gridWithRowPercent { grid-template: 10px 20% 30px / 20px; }
.gridWithRowDoublePercent { grid-template: 60% 40% / 20px; }

.width220 { width: 220px; }
.height100 { height: 100px; }
.gridAutoRows20 { grid-auto-rows: 20px; }

.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>

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="document.fonts.ready.then(() => { 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>

<div style="position: relative">
<div class="grid gridWithPercent width220 gridRowColumnGaps gridAutoRows20" data-expected-width="220" data-expected-height="84">
<div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="20"></div>
<div class="secondRowSecondColumn" data-offset-x="33" data-offset-y="32" data-expected-width="44" data-expected-height="20"></div>
<div class="thirdRowThirdColumn" data-offset-x="100" data-offset-y="64" data-expected-width="30" data-expected-height="20"></div>
</div>
</div>

<div style="position: relative">
<div class="grid gridWithRowPercent gridRowColumnGaps width220 height100" data-expected-width="220" data-expected-height="100">
<div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="10"></div>
<div class="secondRowFirstColumn" data-offset-x="0" data-offset-y="22" data-expected-width="20" data-expected-height="20"></div>
<div class="thirdRowAutoColumn" data-offset-x="0" data-offset-y="54" data-expected-width="20" data-expected-height="30"></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>

<div style="position: relative">
<div class="grid gridWithDoublePercent width220 gridRowColumnGaps gridAutoRows20" data-expected-width="220" data-expected-height="52">
<div class="firstRowFirstColumn sizedToGridArea" data-offset-x="0" data-offset-y="0" data-expected-width="132" data-expected-height="20"></div>
<div class="secondRowSecondColumn sizedToGridArea" data-offset-x="155" data-offset-y="32" data-expected-width="88" data-expected-height="20"></div>
<div class="secondRowBothColumn sizedToGridArea" data-offset-x="0" data-offset-y="32" data-expected-width="243" data-expected-height="20"></div>
</div>
</div>

<div style="position: relative">
<div class="grid gridWithRowDoublePercent gridRowColumnGaps width220 height100" data-expected-width="220" data-expected-height="100">
<div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="60"></div>
<div class="secondRowFirstColumn" data-offset-x="0" data-offset-y="72" data-expected-width="20" data-expected-height="40"></div>
<div class="bothRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="112"></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>

0 comments on commit 6fe1899

Please sign in to comment.