blob: 880b9fef96a6d246f46b0369e2eec4130db27f91 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<title>This tests the case when 2 visible and actionable elements show up and the first one gets destroyed right away.</title>
<script src="../../../../../resources/ui-helper.js"></script>
<style>
#tapThis {
width: 400px;
height: 400px;
border: 1px solid green;
}
#willBecomeVisibleMomentarily {
display: none;
width: 100px;
height: 100px;
background-color: red;
}
#willBecomeVisible {
display: none;
width: 100px;
height: 100px;
background-color: green;
}
</style>
<script>
async function test() {
if (!window.testRunner || !testRunner.runUIScript)
return;
if (window.internals)
internals.settings.setContentChangeObserverEnabled(true);
testRunner.waitUntilDone();
testRunner.dumpAsText();
await UIHelper.activateElement(tapThis);
}
</script>
</head>
<body onload="test()">
<div id=tapThis>PASS if 'clicked' text is not shown below.</div>
<div id=willBecomeVisibleMomentarily></div>
<div id=willBecomeVisible></div>
<pre id=result></pre>
<script>
tapThis.addEventListener("touchstart", function( event ) {
willBecomeVisibleMomentarily.style.display = "block";
willBecomeVisible.style.display = "block";
}, false);
tapThis.addEventListener("mouseover", function( event ) {
willBecomeVisibleMomentarily.style.display = "none";
if (window.testRunner)
setTimeout("testRunner.notifyDone()", 50);
}, false);
willBecomeVisibleMomentarily.addEventListener("click", function( event ) {
result.innerHTML = "clicked willBecomeVisibleMomentarily";
}, false);
willBecomeVisible.addEventListener("click", function( event ) {
result.innerHTML = "clicked willBecomeVisible";
}, false);
tapThis.addEventListener("click", function( event ) {
result.innerHTML = "clicked";
}, false);
</script>
</body>
</html>