transformed_scrolling_repaints_3_window.html (1571B)
1 <!DOCTYPE HTML> 2 <html style="overflow: hidden;"> 3 <head> 4 <title>Test that scaled elements with scrolled contents don't repaint unnecessarily when we scroll inside them</title> 5 <script src="/tests/SimpleTest/paint_listener.js"></script> 6 </head> 7 <!-- Need a timeout here to allow paint unsuppression before we start the test --> 8 <body onload="setTimeout(startTest,0)" style="background:white;"> 9 <iframe id="t" style="transform: scale(0.48979); transform-origin:top left; width:500px; height:600px;" 10 src="transformed_scrolling_repaints_3_window_frame.html"> 11 </iframe> 12 <pre id="test"> 13 <script type="application/javascript"> 14 var SimpleTest = window.opener.SimpleTest; 15 var SpecialPowers = window.opener.SpecialPowers; 16 var is = window.opener.is; 17 var smoothScrollPref = "general.smoothScroll"; 18 19 function startTest() { 20 SpecialPowers.pushPrefEnv({"set":[[smoothScrollPref, false]]}, runTest); 21 } 22 23 async function runTest() { 24 let t = document.getElementById("t"); 25 let e = t.contentDocument.getElementById("e"); 26 t.contentWindow.scrollTo(0,0); 27 let utils = SpecialPowers.getDOMWindowUtils(window); 28 29 for (let i = 0; i < 15; i++) { 30 let painted = utils.checkAndClearPaintedState(e); 31 // We ignore the first few scrolls, to ensure we have triggered activity 32 // heuristics. 33 if (i >= 5) { 34 is(painted, false, 35 "Fully-visible scrolled element should not have been painted"); 36 } 37 t.contentWindow.scrollByLines(1); 38 await promiseAllPaintsDone(null, true); 39 } 40 SimpleTest.finish(); 41 window.close(); 42 } 43 </script> 44 </pre> 45 </body> 46 </html>