Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=2100"/>
<title>Tests that double tap to zoom doesn't work on touch-action: manipulation element</title>
<script src="apz_test_native_event_utils.js"></script>
<script src="apz_test_utils.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
<script>
async function test() {
let useTouchpad = (location.search == "?touchpad");
var resolution = await getResolution();
ok(resolution > 0,
"The initial_resolution is " + resolution + ", which is some sane value");
// A double tap on the touch-action: manipulation element.
await synthesizeDoubleTap(document.getElementById("target"), 20, 20, useTouchpad);
for (let i = 0; i < 10; i++) {
await promiseFrame();
}
// Flush state just in case.
await promiseApzFlushedRepaints();
var prev_resolution = resolution;
resolution = await getResolution();
if (!useTouchpad) {
is(resolution, prev_resolution, "No zoom should happen on touchscreen");
} else {
isnot(resolution, prev_resolution, "Zoom should happen on touchpad");
}
// Send another tap event outside of the area where
// `touch-action: manipulation` is specified so that it will create a new
await synthesizeNativeTap(target, 200, 200);
}
waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);
</script>
</head>
<body>
<div id="target" style="width: 100px; height: 100px; touch-action: manipulation;"></div>
</body>
</html>