helper_bug1806400-4.html (1361B)
1 <!DOCTYPE html> 2 <html> 3 <meta name="viewport" content="width=device-width; initial-scale=0.4"> 4 <title>Tests that double-tap-to-zoom never activates elements inside non scrollable container</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <script src="/tests/SimpleTest/paint_listener.js"></script> 7 <script src="apz_test_utils.js"></script> 8 <script src="apz_test_native_event_utils.js"></script> 9 <style> 10 #nonscrollabletarget { 11 height: 300px; 12 width: 300px; 13 background: green; 14 } 15 16 #nonscrollabletarget:active { 17 background: red; 18 } 19 20 </style> 21 <div id="nonscrollabletarget"> 22 </div> 23 <script> 24 async function test() { 25 ok(!nonscrollabletarget.matches(":active"), "should not be active initially"); 26 27 let rAFID = requestAnimationFrame(function ensureInactive() { 28 let isActive = nonscrollabletarget.matches(":active"); 29 ok(!isActive, "Element activation should never happen!"); 30 if (!isActive) { 31 rAFID = requestAnimationFrame(ensureInactive); 32 } 33 }); 34 35 await doubleTapOn(nonscrollabletarget, 50, 50, false /* useTouchpad */); 36 37 cancelAnimationFrame(rAFID); 38 } 39 40 if (getPlatform() != "mac" && getPlatform() != "android") { 41 ok(true, "Skipping test because double-tap-zoom isn't allowed on " + getPlatform()); 42 subtestDone(); 43 } else { 44 waitUntilApzStable() 45 .then(test) 46 .then(subtestDone, subtestFailed); 47 } 48 </script> 49 </html>