mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-15 15:42:52 +00:00
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.
14 lines
457 B
HTML
14 lines
457 B
HTML
<!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>
|