mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 23:22:52 +00:00
Before this change, removing a style element from inside a shadow tree would cause it to be unregistered with the document-level list of sheets instead of the shadow-root-level list. This would eventually lead to a verification failure if someone tried to update the text contents of that style element, since it was still in the shadow-root-level list, but now with a null owner element. Fixes a crash on https://www.swedbank.se/
20 lines
647 B
HTML
20 lines
647 B
HTML
<div id=foo>
|
|
<template shadowrootmode="open">
|
|
<style>
|
|
div { border: 5px solid black; }
|
|
</style>
|
|
<div>hello</div>
|
|
</template>
|
|
</div>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
println(foo.shadowRoot.styleSheets);
|
|
println("Before remove, sheet count: " + foo.shadowRoot.styleSheets.length);
|
|
let style = foo.shadowRoot.firstElementChild;
|
|
style.remove()
|
|
println("After remove, sheet count: " + foo.shadowRoot.styleSheets.length);
|
|
style.innerText = "div { border: 10px solid red; }";
|
|
println("After setting innerText of removed sheet, we're still alive!");
|
|
});
|
|
</script>
|