ladybird/Tests/LibWeb/Text/input/link-re-enable-crash.html
Andreas Kling 0c0650e60a LibWeb: Implement more of the "script-blocking style sheet" mechanism
The basic idea is that style sheets can block script execution under
some circumstances. With this commit, we now handle the simplest cases
where a parser-inserted link element gets to download its style sheet
before script execution continues.

This improves performance on Speedometer 3 where JavaScript APIs that
depend on layout results (like Element.scrollIntoView()) would get
called too early (before the relevant CSS was downloaded), and so we'd
perform premature layout work. This work then had to be redone after
downloading the CSS anyway, wasting time.

Note that our Text/input/link-re-enable-crash.html test had to be
tweaked after these changes, since it relied on the old, incorrect,
behavior where scripts would run before downloading CSS.
2025-04-20 14:54:21 +02:00

11 lines
299 B
HTML

<!DOCTYPE html>
<script src="include.js"></script>
<script>
var scriptOnloadWasInvoked = false;
</script>
<link id="link" rel="stylesheet" href="valid.css" onload="link.disabled = true; link.disabled = false;">
<script>
test(() => {
println("PASS (didn't crash)");
});
</script>