file_scroll_position_restore_no_bfcache.html (727B)
1 <!doctype html> 2 <style> 3 body { 4 height: 100%; 5 overflow: hidden; 6 display: flex; 7 flex-direction: column; 8 margin: 0; 9 } 10 #scroll { 11 overflow-y: auto; 12 max-height: 100vh; 13 } 14 #padding { 15 height: 100vh; 16 } 17 </style> 18 <script> 19 window.addEventListener("unload", () => { /* prevent bfcaching */ }); 20 window.addEventListener("pageshow", function(e) { 21 window.opener.handlePageShow(e.persisted); 22 }); 23 </script> 24 <!-- This is important as it delays layout, so that stuff goes through PresShell::Initialize under `mDelayedLayoutStart` instead of ContentAppended --> 25 <link rel="stylesheet" href="slow-stylesheet.sjs"> 26 <div id="scroll"> 27 <div id="padding"></div> 28 <a href="t1.html">t1.html</a> 29 <div id="padding"></div> 30 </div>