ladybird/Tests/LibWeb/Text/input/link-changed-rel.html

20 lines
588 B
HTML

<!DOCTYPE html>
<script src="include.js"></script>
<script>
asyncTest(done => {
let link = document.createElement("link");
link.setAttribute("href", "valid.css");
link.addEventListener("load", function() {
println("Got load event");
// link is still a stylesheet (no event)
link.setAttribute("rel", "preconnect stylesheet");
});
document.head.appendChild(link);
// link becomes a stylesheet (event)
link.setAttribute("rel", "stylesheet");
setTimeout(done, 1000);
});
</script>