test_click_pointerId_of_single_tap.html (1056B)
1 <!doctype html> 2 <head> 3 <meta charset="utf-8"> 4 <title>`click` event after compatibility mouse event should have proper `pointerId`</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <script src="/tests/SimpleTest/EventUtils.js"></script> 7 <script src="/tests/SimpleTest/paint_listener.js"></script> 8 <script src="apz_test_utils.js"></script> 9 <link rel="stylesheet" href="/tests/SimpleTest/test.css" /> 10 <style> 11 #target { 12 width: 100px; 13 height: 100px; 14 background-color: green; 15 } 16 </style> 17 <script> 18 "use strict"; 19 20 SimpleTest.waitForExplicitFinish(); 21 waitUntilApzStable().then(async () => { 22 await SpecialPowers.pushPrefEnv({set: [["test.events.async.enabled", true]]}); 23 const target = document.getElementById("target"); 24 target.addEventListener("click", event => { 25 is( 26 event.pointerId, 27 5, 28 "pointerId of `click` should be the specified ID of the touch" 29 ); 30 SimpleTest.finish(); 31 }, {once: true}); 32 synthesizeTouchAtCenter(target, {id: 5}); 33 }); 34 </script> 35 </head> 36 <body> 37 <div id="target"></div> 38 </body> 39 </html>