blob: 77b804f795039e611f56989fdfb838349438c3a7 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<title>This tests the case when visible content gets rebuilt and should not be considered as new content</title>
<script src="../../../../../resources/basic-gestures.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();
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 'clicked' text is shown below.</div>
<div id=visibleParent><div id=alreadyVisible>content</div></div>
<pre id=result></pre>
<script>
tapthis.addEventListener("mouseover", function( event ) {
visibleParent.style.display = "inline-block";
document.body.offsetHeight;
}, false);
alreadyVisible.addEventListener("click", function( event ) {
result.innerHTML = "clicked hidden";
}, false);
tapthis.addEventListener("click", function( event ) {
result.innerHTML = "clicked";
if (window.testRunner)
testRunner.notifyDone();
}, false);
</script>
</body>
</html>