mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibWeb: Actually traverse the shadow root of the inclusive descendant
Previously, the inclusive descendant, which is the node that for_each_shadow_including_inclusive_descendant was called on, would not have it's shadow root traversed if it had one. This is because the shadow root traversal was in the `for` loop, which begins with the node's first child. The fix here is to move the shadow root traversal outside of the loop, and check if the current node is an element instead.
This commit is contained in:
committed by
Andreas Kling
parent
d3c21e4038
commit
6df4e5f5e7
Notes:
github-actions[bot]
2024-11-13 13:41:02 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/6df4e5f5e75 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2310
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const div = document.createElement("div");
|
||||
const shadowRoot = div.attachShadow({ mode: "closed" });
|
||||
|
||||
const script = document.createElement("script");
|
||||
script.innerText = "println('Hello from script in the shadow root of the just inserted div!')";
|
||||
shadowRoot.appendChild(script);
|
||||
|
||||
document.body.appendChild(div);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user