Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<meta charset="utf-8">
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="apz_test_native_event_utils.js"></script>
<script type="text/javascript" src="apz_test_utils.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style>
#target0 {
width: 200px;
height: 400px;
touch-action: auto;
}
</style>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1414336">Mozilla Bug 1414336</a>
<p id="display"></p>
<div id="target0">
</div>
<script type="text/javascript">
waitUntilApzStable().then(async () => {
let target0 = window.document.getElementById("target0");
let target0_events = ["pointerdown", "pointermove"];
target0_events.forEach((elem) => {
target0.addEventListener(elem, (event) => {
is(event.type, target0_events[0], "receive " + event.type + " on target0");
target0_events.shift();
}, { once: true });
});
target0.addEventListener("pointercancel", () => {
ok(false, "Shouldn't receive pointercancel when content prevents default on touchstart");
// Wait until the event is done processing before we end the subtest,
// otherwise on Android the pointer events pref is flipped back to false
// and debug builds will assert.
setTimeout(subtestDone, 0);
}, { once: true });
target0.addEventListener("touchstart", (event) => {
event.preventDefault();
}, { once: true });
target0.addEventListener("pointerup", () => {
ok(!target0_events.length, " should receive " + target0_events + " on target0");
// Wait until the event is done processing before we end the subtest,
// otherwise on Android the pointer events pref is flipped back to false
// and debug builds will assert.
setTimeout(subtestDone, 0);
}, { once: true });
await synthesizeNativeTouchDrag(target0, 2, 2, 0, 80);
});
</script>
</body>
</html>