summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-z-index-change-repaint.html
blob: 5a29fd1b61d1a526de60cf4981d305e32386c617 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel="stylesheet">
<link href="resources/grid.css" rel="stylesheet">
<style>
.grid {
    grid-template-rows: 100px;
    grid-template-columns: 200px 200px;
    margin-top: 10px;
}
.red {
    background-color: red;
}
.green {
    background-color: green;
}
.negativeZIndex {
    z-index: -1;
}
</style>
<script src="../repaint/resources/text-based-repaint.js"></script>
<script>
function repaintTest()
{
    document.getElementById('item1').style.zIndex = 1;
    document.getElementById('item2').style.zIndex = 1;
}

window.onload = runRepaintTest;
</script>
</head>
<body>
<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>

<div class="grid fit-content">
    <div id="item1" class="sizedToGridArea green negativeZIndex"></div>
    <div class="sizedToGridArea red"></div>
</div>

<div class="grid fit-content">
    <div id="item2" class="sizedToGridArea green"></div>
    <div class="sizedToGridArea red"></div>
</div>

</body>
</html>