blob: 50655e46fea694e3467a3c11508f36d068f234a9 [file] [log] [blame]
<!-- Based on fast/css-grid-layout/grid-item-z-index-change-repaint.html -->
<!DOCTYPE html>
<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
.grid {
grid-template-rows: 100px;
grid-template-columns: 200px 200px;
width: -webkit-fit-content;
margin-top: 10px;
.red {
background-color: red;
.green {
background-color: green;
.negativeZIndex {
z-index: -1;
<script src="resources/paint-invalidation-test.js"></script>
window.expectedPaintInvalidationObjects = [
"LayoutBlockFlow DIV id='item1' class='sizedToGridArea green negativeZIndex'",
"LayoutBlockFlow DIV id='item2' class='sizedToGridArea green'",
function paintInvalidationTest()
document.getElementById('item1').style.zIndex = 1;
document.getElementById('item2').style.zIndex = 1;
window.onload = runPaintInvalidationTest;
<div style="height: 100px">
<p>This test checks that grid items correctly repaint when 'z-index' changes.</p>
<p>For this test to pass, there should be no red below.</p>
<div class="grid">
<div id="item1" class="sizedToGridArea green negativeZIndex"></div>
<div class="sizedToGridArea red"></div>
<div class="grid">
<div id="item2" class="sizedToGridArea green"></div>
<div class="sizedToGridArea red"></div>