blob: 5efd2cae96d2522b10158c3400118fe434b100f8 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<title>This tests the case when visible content gets removed and later added back and should not be considered as new content</title>
<script src="../../../../../resources/ui-helper.js"></script>
<style>
#tapThis {
width: 400px;
height: 400px;
border: 1px solid green;
}
#alreadyVisible {
display: block;
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 shown below.</div>
<div id=alreadyVisible></div>
<pre id=result></pre>
<script>
tapThis.addEventListener("touchstart", function( event ) {
alreadyVisible.style.display = "none";
}, false);
tapThis.addEventListener("mouseover", function( event ) {
alreadyVisible.style.display = "block";
}, false);
alreadyVisible.addEventListener("click", function( event ) {
result.innerHTML = "clicked alreadyVisible";
}, false);
tapThis.addEventListener("click", function( event ) {
result.innerHTML = "clicked";
if (window.testRunner)
testRunner.notifyDone();
}, false);
</script>
</body>
</html>