mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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. :^)
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 00:54:03 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8e56367092 Pull-request: https://github.com/SerenityOS/serenity/pull/24061
@@ -0,0 +1,11 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user