blob: edf750961926bab1400bd9570935138c747f26a4 [file] [log] [blame]
<!DOCTYPE html>
<link href="resources/grid.css" rel="stylesheet">
<link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel=stylesheet>
<style>
.gridWithAbsolutePositionedItem {
/* Ensures that the grid container is the containing block of the absolutely positioned grid children. */
position: relative;
}
.grid {
grid-auto-columns: 200px;
grid-auto-rows: 200px;
}
.item {
position: absolute;
font: 10px/1 Ahem;
}
</style>
<script>
function addRemoveItem()
{
var gridItem = document.createElement("div");
gridItem.style.width = "100px";
gridItem.style.height = "100px";
gridItem.style.backgroundColor = "red";
var gridElement = document.getElementById("dynamicGrid");
gridElement.appendChild(gridItem);
gridElement.removeChild(gridItem);
}
function doTest() {
addRemoveItem();
checkLayout(".grid");
}
</script>
<script src="../../resources/check-layout.js"></script>
<body onload="doTest()">
<p>This test checks that grids with no in-flow items are actually empty.</p>
<div class="grid min-content" data-expected-width="0" data-expected-height="0"></div>
<div class="grid min-content gridWithAbsolutePositionedItem" data-expected-width="0" data-expected-height="0">
<div class="item" data-expected-width="40" data-expected-height="10">XXXX</div>
</div>
<div id="dynamicGrid" class="grid min-content" data-expected-width="0" data-expected-height="0"></div>
<div class="grid min-content" style="grid-template-rows: 100px;" data-expected-width="0" data-expected-height="100"></div>
<div class="grid min-content" style="grid-template-rows: auto;" data-expected-width="0" data-expected-height="0"></div>
<div class="grid min-content" style="grid-template-rows: 1fr;" data-expected-width="0" data-expected-height="0"></div>
<div class="grid min-content" style="grid-template-columns: 100px;" data-expected-width="100" data-expected-height="0"></div>
<div class="grid min-content" style="grid-template-columns: auto;" data-expected-width="0" data-expected-height="0"></div>
<div class="grid min-content" style="grid-template-columns: 1fr;" data-expected-width="0" data-expected-height="0"></div>
</body>