Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!doctype html>
<title>Deleting touch-action elem after pointerdown has no effect</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="pointerevent_support.js"></script>
<style> {
margin: 10px;
height: 25vh;
border: 1px solid black;
#target {
background-color: lightgreen;
<h1>Deleting touch-action elem after pointerdown has no effect</h1>
<h4 id="desc">
Try to scroll up/down starting at the green element. Expectation: the
green element would vanish immediately and the content won't scroll.
<p>Note: this test is for touch-devices only</p>
<div class="box"></div>
<div class="box"></div>
<div class="box" id="target">Drag up or down from here</div>
<div class="box"></div>
<div class="box"></div>
let target = document.getElementById("target");
let pointercancel_received = false;
document.body.addEventListener("pointerdown", () => target.parentElement.removeChild(target));
document.body.addEventListener("pointercancel", () => pointercancel_received = true);
let detected_pointertypes = {};
promise_test(async () => {
let pointerup_event = getEvent("pointerup", document.body);
await touchScrollInTarget(target, "down");
await pointerup_event;
"a pointercancel event is unexpected because there should be no scrolling");
}, "Deleting touch-action elem after pointerdown");