Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-grid/subgrid/parent-repeat-auto-fit-002.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
-->
<html><head>
<meta charset="utf-8">
<title>CSS Grid Test: subgrid inside a parent with repeat(auto-fit) rows</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<link rel="match" href="parent-repeat-auto-fit-002-ref.html">
<style>
html,body {
color:black; background-color:white; font:10px/1 monospace; padding:0; margin:0;
}
#report {
white-space: pre-wrap;
}
.grid {
display: inline-grid;
height: 50px;
width: 50px;
grid-template-columns: repeat(auto-fit, 10px);
border: 1px solid;
vertical-align: top;
}
.subgrid {
display: grid;
grid: subgrid / subgrid;
grid-column: 1 / -1;
grid-row: 3 / span 4;
grid-auto-columns: 8px;
background: grey;
}
.fit-0a { grid-template-rows: repeat(auto-fit, [y] 30px) [z] 1px [z] 1px [z] 1px [z] 1px [z] minmax(0, auto) }
.fit-0b { grid-template-rows: [x] repeat(auto-fit, [y] 30px) [z] 1px [z] 1px [z] 1px [z] minmax(0, auto) minmax(0, auto) }
.fit-0c { grid-template-rows: [x] 1px [x] repeat(auto-fit, [y] 10px) [z] 1px [z] 1px [z] }
.fit-0d { grid-template-rows: [x] 2px [x] 2px [x] repeat(auto-fit, [y] 10px) [z] 1px [z] }
.fit-0e { grid-template-rows: [x] 2px [x] 2px [x] 2px [x] repeat(auto-fit, [y] 10px) [z] }
.fit-0f { grid-template-rows: [x] 2px [x] 2px [x] 2px [x] 2px [x] repeat(auto-fit, [y] 10px) }
.fit-0g { grid-template-rows: [x] 2px [x] 2px [x] 2px [x] 2px [x] repeat(auto-fit, [y] 10px) [z] 1px [z] }
.fit-0h { grid-template-rows: [x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x] repeat(auto-fit, [y] 10px) [z] 1px [z] }
.fit-0i { grid-template-rows: [x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x] repeat(auto-fit, [y] 10px) [z] }
.fit-0j { grid-template-rows: [x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x] repeat(auto-fit, [y] 10px) }
.fit-0k { grid-template-rows: repeat(auto-fit, [y] 10px) repeat(100, [z] 10px) }
.fit-0l { grid-template-rows: [x] repeat(auto-fit, [y] 10px) repeat(100, [z] 10px) }
.fit-0m { grid-template-rows: repeat(100, [x] 10px) repeat(auto-fit, [y] 10px) }
.fit-1a { grid-template-rows: repeat(auto-fit, [y] 10px) [z] 1px [z] 1px [z] 1px [z] }
.fit-1b { grid-template-rows: [x] repeat(auto-fit, [y] 10px) [z] 1px [z] 1px [z] }
.fit-1c { grid-template-rows: [x] 2px [x] repeat(auto-fit, [y] 10px) [z] 1px [z] }
.fit-1d { grid-template-rows: [x] 2px [x] 2px [x] repeat(auto-fit, [y] 10px) [z] }
.fit-1e { grid-template-rows: [x] 2px [x] 2px [x] 2px [x] repeat(auto-fit, [y] 10px) }
.fit-2a { grid-template-rows: repeat(auto-fit, [y] 10px) [z] 1px [z] 1px [z] }
.fit-2b { grid-template-rows: [x] repeat(auto-fit, [y] 10px) [z] 1px [z] minmax(0, auto) }
.fit-2c { grid-template-rows: [x] 2px [x] repeat(auto-fit, [y] 10px) [z] minmax(0, auto) }
.fit-2d { grid-template-rows: [x] 2px [x] 2px [x] repeat(auto-fit, [y] 10px) }
.fit-3a { grid-template-rows: repeat(auto-fit, [y] 10px) [z] 1px [z] minmax(0, auto) }
.fit-3b { grid-template-rows: [x] repeat(auto-fit, [y] 10px) [z] minmax(0, auto) }
.fit-3c { grid-template-rows: [x] 2px [x] repeat(auto-fit, [y] 10px) minmax(0, auto) }
.fit-4a { grid-template-rows: repeat(auto-fit, [y] 10px) [z] minmax(0, auto) }
.fit-4b { grid-template-rows: [x] repeat(auto-fit, [y] 10px) minmax(0, auto) }
.fit-5 { grid-template-rows: repeat(auto-fit, [y] 10px) minmax(0, auto) }
.subgrid > :nth-child(2n) { background: black; }
.subgrid > :nth-child(2n+1) { background: pink; }
</style>
</head>
<body>
<div class="grid fit-0a"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0b"><div class="subgrid" style="grid-column-start:2">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0c"><div class="subgrid" style="grid-column-start:3">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0d"><div class="subgrid" style="grid-column-start:4">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0e"><div class="subgrid" style="grid-column-start:5">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0f"><div class="subgrid" style="grid-column-start:6">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0g"><div class="subgrid" style="grid-column-end:-2">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0h"><div class="subgrid" style="grid-column-end:-3">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0i"><div class="subgrid" style="grid-column-end:-4">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0j"><div class="subgrid" style="grid-column-end:-5">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0k"><div class="subgrid" style="grid-column-end:-6">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0l"><div class="subgrid" style="grid-column:2/-2">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-0m"><div class="subgrid" style="grid-column:3/-3">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-1a"><div class="subgrid" style="grid-column:2/-3">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-1b"><div class="subgrid" style="grid-column:3/-2">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-1c"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-1d"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-1e"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-2a"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-2b"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-2c"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-2d"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-3a"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-3b"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-3c"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-4a"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-4b"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div class="grid fit-5"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div>
<div id="report"></div>
<script>
const expectedResults = [
"[y] 0px [z] 1px [z] 1px [z] 1px [z] 1px [z] 46px",
"[x y] 0px [z] 1px [z] 1px [z] 1px [z] 23.5px 23.5px",
"[x] 1px [x y] 0px [y] 10px [y] 10px [y] 10px [z] 1px [z] 1px [z]",
"[x] 2px [x] 2px [x y] 10px [y] 10px [y] 10px [y] 10px [z] 1px [z]",
"[x] 2px [x] 2px [x] 2px [x y] 10px [y] 10px [y] 10px [y] 0px [z]",
"[x] 2px [x] 2px [x] 2px [x] 2px [x y] 10px [y] 10px [y] 0px [y] 0px",
"[x] 2px [x] 2px [x] 2px [x] 2px [x y] 10px [y] 10px [y] 0px [y] 0px [z] 1px [z]",
"[x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x y] 0px [y] 0px [y] 0px [z] 1px [z]",
"[x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x y] 0px [y] 0px [y] 0px [z]",
"[x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x] 2px [x y] 0px [y] 0px [y] 0px",
"[y] 0px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px",
"[x y] 0px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px [z] 10px",
"[x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [x] 10px [y] 0px",
"[y] 0px [y] 0px [y] 10px [y] 10px [z] 1px [z] 1px [z] 1px [z]",
"[x y] 0px [y] 0px [y] 10px [y] 10px [z] 1px [z] 1px [z]",
"[x] 2px [x y] 0px [y] 10px [y] 10px [y] 10px [z] 1px [z]",
"[x] 2px [x] 2px [x y] 10px [y] 10px [y] 10px [y] 10px [z]",
"[x] 2px [x] 2px [x] 2px [x y] 10px [y] 10px [y] 10px [y] 0px",
"[y] 0px [y] 0px [y] 10px [y] 10px [z] 1px [z] 1px [z]",
"[x y] 0px [y] 0px [y] 10px [y] 10px [z] 1px [z] 29px",
"[x] 2px [x y] 0px [y] 10px [y] 10px [y] 10px [z] 18px",
"[x] 2px [x] 2px [x y] 10px [y] 10px [y] 10px [y] 10px",
"[y] 0px [y] 0px [y] 10px [y] 10px [z] 1px [z] 29px",
"[x y] 0px [y] 0px [y] 10px [y] 10px [y] 10px [z] 20px",
"[x] 2px [x y] 0px [y] 10px [y] 10px [y] 10px 18px",
"[y] 0px [y] 0px [y] 10px [y] 10px [y] 10px [z] 20px",
"[x y] 0px [y] 0px [y] 10px [y] 10px [y] 10px 20px",
"[y] 0px [y] 0px [y] 10px [y] 10px [y] 10px 20px",
];
[...document.querySelectorAll('.grid')].forEach(function(grid, i) {
let actual = window.getComputedStyle(grid)['grid-template-rows'];
let expected = expectedResults[i];
if (actual != expected) {
let err = "\nUnexpected getComputedStyle value for grid " + i + " with className '" + grid.className + "':" +
" Actual: \"" + actual + "\", Expected: \"" + expected + "\"\n";
report.appendChild(document.createTextNode(err));
}
});
</script>
</body>
</html>