blob: aef535ac888073be02319a720e7515ab5c93056a [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<title>This tests the case when the new hover content comes on top of the tap target, we update the "node under the mouse" state.</title>
<script src="../../../../../resources/basic-gestures.js"></script>
<style>
#tapthis {
width: 400px;
height: 400px;
border: 1px solid green;
}
#becomesVisible {
visibility: hidden;
position: absolute;
left: 40px;
top: 40px;
width: 320px;
height: 320px;
background-color: blue;
}
</style>
<script>
async function test() {
if (!window.testRunner || !testRunner.runUIScript)
return;
if (window.internals)
internals.settings.setContentChangeObserverEnabled(true);
testRunner.waitUntilDone();
testRunner.dumpAsText();
let rect = tapthis.getBoundingClientRect();
let x = rect.left + rect.width / 2;
let y = rect.top + rect.height / 2;
await tapAtPoint(x, y);
}
</script>
</head>
<body onload="test()">
<div id=tapthis>PASS if 'mouseout' text is not shown below.</div>
<div id=becomesVisible></div>
<pre id=result></pre>
<script>
// 1. Tap -> hover
// 2. hover content comes on top of the tap target
// 3. Check if tap target gets mouseout
tapthis.addEventListener("mousemove", function( event ) {
becomesVisible.style.visibility = "visible";
}, false);
tapthis.addEventListener("mouseout", function( event ) {
result.innerHTML = "mouseout";
if (window.testRunner)
testRunner.notifyDone();
}, false);
</script>
</body>
</html>