helper_hittest_sticky_bug1478304.html (1403B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>APZ hit-testing with sticky element inside a transform (bug 1478304)</title> 5 <script type="application/javascript" src="apz_test_utils.js"></script> 6 <script type="application/javascript" src="apz_test_native_event_utils.js"></script> 7 <script src="/tests/SimpleTest/paint_listener.js"></script> 8 <meta name="viewport" content="width=device-width"/> 9 <style> 10 #subframe { 11 width: 500px; 12 height: 200px; 13 overflow-y: auto; 14 } 15 #transform { 16 transform: translate(0); 17 } 18 #sticky { 19 background-color: white; 20 position: sticky; 21 top: 0; 22 } 23 #spacer { 24 width: 100px; 25 height: 1000px; 26 } 27 </style> 28 </head> 29 <body> 30 <div id="subframe"> 31 <div id="transform"> 32 <div id="sticky">sticky with transformed parent (click me or hover me and try a scroll)</div> 33 <div id="spacer"></div> 34 </div> 35 </div> 36 </body> 37 <script type="application/javascript"> 38 39 async function test() { 40 var utils = getHitTestConfig().utils; 41 42 var subframe = document.getElementById("subframe"); 43 var sticky = document.getElementById("sticky"); 44 45 checkHitResult( 46 hitTest(centerOf(sticky)), 47 APZHitResultFlags.VISIBLE, 48 utils.getViewId(subframe), 49 utils.getLayersId(), 50 "subframe was successfully hit"); 51 } 52 53 waitUntilApzStable() 54 .then(test) 55 .then(subtestDone, subtestFailed); 56 57 </script> 58 </html>