<!DOCTYPE html>
<html>
<script src="../../resources/gc.js"></script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<title>Absence of blocking doesn't defer frames until complete document parsed</title>
<script>
function jank(ms) {
let start = performance.now();
while (performance.now() < start + ms);
}
function jankMany(ms, times) {
for (let i = 0; i < times; i++) {
jank(ms);
}
}
promise_test(() => {
return new Promise((resolve, reject) => {
requestAnimationFrame(() => {
if (document.getElementById("last"))
reject();
else
resolve();
});
});
}, "frames not deferred until full parsing");
</script>
</head>
<body>
<div id="first"></div>
<script>
jankMany(100, 10);
</script>
<div id="second"></div>
<script>
jankMany(100, 10);
</script>
<div id="last"></div>
</body>
</html>