<!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>
