ladybird/Tests/LibWeb/Text/input/css/move-loaded-link-stylesheet-between-documents.html
Andreas Kling 8e56367092 LibWeb: Allow moving StyleSheets between documents without falling apart
We have to unregister link element stylesheets from the old document's
StyleSheetList when moving them into a new document.

This makes it possible to load GitHub contributor graphs. :^)
2024-04-22 06:43:05 +02:00

11 lines
441 B
HTML

<script src="../include.js"></script>
<script>
let doc = new DOMParser().parseFromString(`<link rel="stylesheet" href="data:text/css,div{}">`, `text/html`);
let link = doc.head.firstChild;
document.head.appendChild(link);
test(() => {
println("Sheets in old doc: " + doc.styleSheets.length)
println("Sheets in new doc: " + document.styleSheets.length)
println("PASS (didn't crash)");
})
</script>