paintedlayer-recycling-6.html (1495B)
1 <!DOCTYPE html> 2 <html lang="en" class="reftest-wait"> 3 <meta charset="utf-8"> 4 <title>Adding a new display item that has its own PaintedLayer shouldn't cause invalidations in other PaintedLayers on top of it</title> 5 6 <style> 7 8 .content { 9 box-sizing: border-box; 10 width: 200px; 11 height: 200px; 12 border: 1px solid black; 13 } 14 15 .fixed { 16 position: fixed; 17 top: 20px; 18 left: 140px; 19 } 20 21 .onTopOfFixed { 22 position: absolute; 23 top: 120px; 24 left: 260px; 25 } 26 27 .reftest-no-paint { 28 border-color: lime; 29 } 30 31 #aboutToBecomeVisible { 32 left: 20px; 33 } 34 35 body { 36 margin: 0; 37 padding: 20px; 38 height: 3000px; 39 } 40 41 </style> 42 43 <div class="fixed content"> 44 <!-- 45 This layer is just there to force .onTopOfFixed into PaintedLayers above 46 the page background. 47 --> 48 </div> 49 50 <div class="onTopOfFixed content" id="aboutToBecomeVisible" style="visibility: hidden"> 51 <!-- 52 This item starts out hidden, and will get its own PaintedLayer when it 53 becomes visible. 54 --> 55 </div> 56 57 <div class="fixed content"> 58 <!-- 59 This layer is just there to force the next .onTopOfFixed into its own 60 PaintedLayer. 61 --> 62 </div> 63 64 <div class="onTopOfFixed reftest-no-paint content"> 65 <!-- 66 This item shouldn't repaint when the other .onTopOfFixed item becomes visible. 67 --> 68 </div> 69 70 <script> 71 72 function doTest() { 73 document.querySelector("#aboutToBecomeVisible").style.visibility = "visible"; 74 document.documentElement.removeAttribute("class"); 75 } 76 document.addEventListener("MozReftestInvalidate", doTest); 77 78 </script>