Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<link rel="match" href="grid-item-overflow-paint-001-ref.html">
<meta name="assert" content="Grid items that overflow their grid areas through negative margins are painted in document order, including after scrolling.">
<html>
<head>
<link href="/css/support/width-keyword-classes.css" rel="stylesheet">
<link href="/css/support/grid.css" rel="stylesheet">
<style>
.grid {
display: grid;
grid-template-rows: repeat(5, 300px);
grid-template-columns: repeat(5, 300px);
background-color: gray;
}
.overflowingHorizontalGridItemBlue {
background-color: blue;
height: 100%;
width: 450px;
}
.overflowingHorizontalGridItemOrange {
background-color: orange;
height: 100%;
width: 450px;
}
.overflowingVerticalGridItemGreen {
background-color: green;
height: 500px;
width: 100%;
}
.overflowingVerticalGridItemYellow {
background-color: yellow;
height: 500px;
width: 100%;
}
.gridItem {
background-color: purple;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="grid fit-content">
<div class="overflowingVerticalGridItemGreen" style="grid-column: 3; grid-row: 1; margin-bottom: -200px;"></div>
<div class="overflowingVerticalGridItemYellow" style="grid-column: 3; grid-row: 1; margin-bottom: -200px;"></div>
<div class="overflowingVerticalGridItemYellow" style="grid-column: 3; grid-row: 5; margin-top: -200px;"></div>
<div class="overflowingVerticalGridItemGreen" style="grid-column: 3; grid-row: 5; margin-top: -200px;"></div>
<div class="gridItem" style="grid-column: 3; grid-row: 3;"></div>
<div class="overflowingHorizontalGridItemOrange" style="grid-column: 1; grid-row: 3; margin-right: -150px;"></div>
<div class="overflowingHorizontalGridItemBlue" style="grid-column: 1; grid-row: 3; margin-right: -150px;"></div>
<div class="overflowingHorizontalGridItemBlue" style="grid-column: 5; grid-row: 3; margin-left: -150px;"></div>
<div class="overflowingHorizontalGridItemOrange" style="grid-column: 5; grid-row: 3; margin-left: -150px;"></div>
</div>
</body>
<script>
window.scrollTo(400, 475);
</script>
</html>