[CSS Grid Layout] Properly support for z-index on grid items
[WebKit-https.git] / LayoutTests / fast / css-grid-layout / grid-item-z-index-support.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <div id="grid">
8     <div id="item"></div>
9 </div>
10 <script>
11 description('Test that an element supports z-index once it is a grid item and it is repainted properly.');
12
13 debug('Test z-index property for a regular element');
14 var item = document.getElementById("item");
15 shouldBe("getComputedStyle(item, '').getPropertyValue('z-index')", "'auto'");
16 item.style.zIndex = "-10";
17 shouldBe("getComputedStyle(item, '').getPropertyValue('z-index')", "'auto'");
18
19 debug('Test z-index property once the element becomes a grid item');
20 var grid = document.getElementById("grid");
21 grid.style.display = "-webkit-grid";
22 shouldBe("getComputedStyle(item, '').getPropertyValue('z-index')", "'-10'");
23 item.style.zIndex = "10";
24 shouldBe("getComputedStyle(item, '').getPropertyValue('z-index')", "'10'");
25
26 </script>
27 <script src="../../resources/js-test-post.js"></script>
28 </body>
29 </html>