helper_hittest_hidden_inactive_scrollframe.html (1764B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>APZ hit-testing with an inactive scrollframe that is visibility:hidden (bug 1673505)</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 </head> 10 <body style="height: 110vh"> 11 <div style="position:fixed; top:0px; bottom:0px; left:0px; right:0px; visibility:hidden"> 12 <div style="overflow-y: scroll; height: 100vh" id="nested"> 13 <div style="height: 200vh; background-color: red"> 14 The body of this document is scrollable and is the main scrollable 15 element. On top of that we have a hidden fixed-pos item containing another 16 scrollframe, but this nested scrollframe is inactive. 17 Since the fixed-pos item is hidden, the nested scrollframe is hidden 18 too and shouldn't be the target of hit-testing. However, because it is 19 an inactive scrollframe, code to generate the "this is an inactive 20 scrollframe" area was marking it as hit-testable. This bug led to hit- 21 tests being mis-targeted to the nested scrollframe's layers id instead 22 of whatever was underneath. 23 </div> 24 </div> 25 </div> 26 </body> 27 <script type="application/javascript"> 28 29 function test() { 30 var config = getHitTestConfig(); 31 var utils = config.utils; 32 33 checkHitResult( 34 hitTest(centerOf(document.body)), 35 APZHitResultFlags.VISIBLE, 36 utils.getViewId(document.scrollingElement), 37 utils.getLayersId(), 38 "hit went through the hidden scrollframe"); 39 } 40 41 waitUntilApzStable().then(test).then(subtestDone, subtestFailed); 42 43 </script> 44 </html>