not-able-to-scrollTo.html (1038B)
1 <html class="reftest-wait"> 2 <meta name="viewport" content="width=device-width minimum-scale=0.5 initial-scale=1.0"> 3 <style> 4 html, body { 5 margin: 0; 6 width: 100%; 7 height: 100%; 8 scrollbar-width: none; 9 } 10 div { 11 position: absolute; 12 } 13 .B { 14 width: 200%; 15 height: 200%; 16 background: green; 17 } 18 .C { 19 width: 100%; 20 height: 100%; 21 background: white; 22 } 23 </style> 24 <div class="B"></div> 25 <div class="C"></div> 26 <script> 27 document.addEventListener('MozReftestInvalidate', () => { 28 // The page here is twice as large as the ICB. 29 // If the layout viewport is sized to the ICB, we have a layout 30 // scroll range equal to the ICB size, and the scrollTo() call 31 // below will bring a green area into view. 32 // If the layout viewport is expanded to the whole page, we 33 // have an empty layout scroll range, and the scrollTo() call 34 // below will have no effect. 35 window.scrollTo(window.scrollMaxX, window.scrollMaxY); 36 document.documentElement.classList.remove('reftest-wait'); 37 }); 38 </script> 39 </html>