blob: 2f11f2192d60e796950ca200f60fd2d234f1ca52 [file] [log] [blame]
<!DOCTYPE html>
<style>
#myframe {
height: 35px;
width: 100px;
}
</style>
<script src="../../resources/js-test.js"></script>
<script>
setPrintTestResultsLazily();
window.jsTestIsAsync = true;
description("Ensure hit test cache is cleared across iframes.");
function loaded() {
document.body.insertAdjacentHTML('beforeend', '<iframe id="myframe" srcdoc="" onload="iFrameLoaded()"></iframe>');
doHit();
}
function iFrameLoaded() {
doHit();
document.getElementById('myframe').contentDocument.body.insertAdjacentHTML('beforeend', '<div>AAA</div>');
doHit();
finishJSTest();
}
function doHit() {
var rect = document.getElementById('myframe').getBoundingClientRect();
window.internals.elementFromPoint(document, rect.left + 8, rect.top + 8, false, false);
shouldBe("window.internals.hitTestCacheHits(document)", "0");
}
</script>
<body onload="loaded()" />