blob: 6292047e4dfc0d5dcb08c40ee667979c0d2ecff1 [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
if (window.internals) {
// Disable timers that trigger delayed flushes, since these will make
// this test pass spuriously, even if IntersectionObserver never
// schedules any rendering updates.
internals.setSpeculativeTilingDelayDisabledForTesting(true);
internals.disableTileSizeUpdateDelay();
}
window.onload = function() {
async_test((t) => {
var observer = new IntersectionObserver(t.step_func_done(() => {
observer.disconnect();
}));
requestAnimationFrame(() => {
requestAnimationFrame(() => {
setTimeout(() => {
observer.observe(document.getElementById("target"));
}, 0);
});
});
}, "An initial observation is fired even when nothing else triggers rendering");
};
</script>
<style>
#target {
width: 100px;
height: 100px;
background-color: green;
}
</style>
<div id="target"></div>