| OLD | NEW |
| 1 <!-- Based on fast/css-grid-layout/grid-item-z-index-change-repaint.html --> |
| 1 <!DOCTYPE html> | 2 <!DOCTYPE html> |
| 2 <html> | 3 <html> |
| 3 <head> | 4 <head> |
| 4 <link href="resources/grid.css" rel="stylesheet"> | 5 <link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet"> |
| 5 <style> | 6 <style> |
| 6 .grid { | 7 .grid { |
| 7 grid-template-rows: 100px; | 8 grid-template-rows: 100px; |
| 8 grid-template-columns: 200px 200px; | 9 grid-template-columns: 200px 200px; |
| 9 width: -webkit-fit-content; | 10 width: -webkit-fit-content; |
| 10 margin-top: 10px; | 11 margin-top: 10px; |
| 11 } | 12 } |
| 12 .red { | 13 .red { |
| 13 background-color: red; | 14 background-color: red; |
| 14 } | 15 } |
| 15 .green { | 16 .green { |
| 16 background-color: green; | 17 background-color: green; |
| 17 } | 18 } |
| 18 .negativeZIndex { | 19 .negativeZIndex { |
| 19 z-index: -1; | 20 z-index: -1; |
| 20 } | 21 } |
| 21 </style> | 22 </style> |
| 22 <script src="../repaint/resources/text-based-repaint.js"></script> | 23 <script src="resources/paint-invalidation-test.js"></script> |
| 23 <script> | 24 <script> |
| 24 function repaintTest() | 25 window.expectedPaintInvalidationObjects = [ |
| 26 "LayoutBlockFlow DIV id='item1' class='sizedToGridArea green negativeZIndex'
", |
| 27 "LayoutBlockFlow DIV id='item2' class='sizedToGridArea green'", |
| 28 ]; |
| 29 function paintInvalidationTest() |
| 25 { | 30 { |
| 26 document.getElementById('item1').style.zIndex = 1; | 31 document.getElementById('item1').style.zIndex = 1; |
| 27 document.getElementById('item2').style.zIndex = 1; | 32 document.getElementById('item2').style.zIndex = 1; |
| 28 } | 33 } |
| 29 | 34 |
| 30 window.onload = runRepaintTest; | 35 window.onload = runPaintInvalidationTest; |
| 31 </script> | 36 </script> |
| 32 </head> | 37 </head> |
| 33 <body> | 38 <body> |
| 34 <div style="height: 100px"> | 39 <div style="height: 100px"> |
| 35 <p>This test checks that grid items correctly repaint when 'z-index' changes
.</p> | 40 <p>This test checks that grid items correctly repaint when 'z-index' changes
.</p> |
| 36 <p>For this test to pass, there should be no red below.</p> | 41 <p>For this test to pass, there should be no red below.</p> |
| 37 </div> | 42 </div> |
| 38 | 43 |
| 39 <div class="grid"> | 44 <div class="grid"> |
| 40 <div id="item1" class="sizedToGridArea green negativeZIndex"></div> | 45 <div id="item1" class="sizedToGridArea green negativeZIndex"></div> |
| 41 <div class="sizedToGridArea red"></div> | 46 <div class="sizedToGridArea red"></div> |
| 42 </div> | 47 </div> |
| 43 | 48 |
| 44 <div class="grid"> | 49 <div class="grid"> |
| 45 <div id="item2" class="sizedToGridArea green"></div> | 50 <div id="item2" class="sizedToGridArea green"></div> |
| 46 <div class="sizedToGridArea red"></div> | 51 <div class="sizedToGridArea red"></div> |
| 47 </div> | 52 </div> |
| 48 | 53 |
| 49 </body> | 54 </body> |
| 50 </html> | 55 </html> |
| OLD | NEW |