1546856-1.html (1417B)
1 <!DOCTYPE html> 2 <html class="reftest-wait" 3 reftest-displayport-x="0" reftest-displayport-y="0" 4 reftest-displayport-w="800" reftest-displayport-h="1500"> 5 <meta charset="utf-8"> 6 <title>Test for bug 1546856: When the first painted item in a layer is removed, invalidation takes the wrong last paint offset because it hasn't initialized the last paint offset for that layer yet for this paint</title> 7 <style> 8 html { 9 background: linear-gradient(white, white) 0 0 / 100vw 100vh no-repeat fixed; 10 } 11 12 body { 13 height: 4000px; 14 padding: 200px 0; 15 } 16 17 div { 18 width: 600px; 19 height: 200px; 20 box-sizing: border-box; 21 margin-bottom: -200px; 22 } 23 24 #main.fill { 25 background-color: rgba(255, 0, 0, 0.9); 26 } 27 28 #main.ownLayer { 29 will-change: opacity; 30 } 31 32 #layerBoundsMaintainer { 33 position: relative; 34 border: 1px solid black; 35 } 36 37 </style> 38 39 <div id="main"></div> 40 <div id="layerBoundsMaintainer"></div> 41 42 <script> 43 44 const mainElement = document.querySelector('#main'); 45 46 document.scrollingElement.scrollTop = 0; 47 document.addEventListener('MozReftestInvalidate', () => { 48 requestAnimationFrame(() => { 49 document.scrollingElement.scrollTop = 200; 50 mainElement.className = 'fill'; 51 requestAnimationFrame(() => { 52 mainElement.className = 'fill ownLayer'; 53 requestAnimationFrame(() => { 54 mainElement.className = ''; 55 document.documentElement.className = ''; 56 }); 57 }); 58 }); 59 }); 60 61 </script>