Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<head>
<meta charset="utf-8">
<title>`click` event after compatibility mouse event should have proper `pointerId`</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
<script src="apz_test_utils.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css" />
<style>
#target {
width: 100px;
height: 100px;
background-color: green;
}
</style>
<script>
"use strict";
SimpleTest.waitForExplicitFinish();
waitUntilApzStable().then(async () => {
await SpecialPowers.pushPrefEnv({set: [["test.events.async.enabled", true]]});
const target = document.getElementById("target");
target.addEventListener("click", event => {
is(
event.pointerId,
5,
"pointerId of `click` should be the specified ID of the touch"
);
SimpleTest.finish();
}, {once: true});
synthesizeTouchAtCenter(target, {id: 5});
});
</script>
</head>
<body>
<div id="target"></div>
</body>
</html>