2 <html reftest-print-range=
"selection">
5 <link href=
"print.css" rel=
"stylesheet">
7 function selectNodesInShadowTree() {
8 let host
= document
.getElementById("host");
9 host
.attachShadow({ mode
: "open" }).innerHTML
= `
10 <p>This text should not be there</p>
11 <p id="selection">This text should appear on page 1</p>
12 <p>This text should not be there</p>
14 let rng
= document
.createRange();
15 rng
.selectNode(host
.shadowRoot
.getElementById("selection"));
16 window
.getSelection().addRange(rng
);
20 <body onload=
"selectNodesInShadowTree()">
21 <p>This text should not be there
</p>
22 <div id=
"host">Shouldn't show up (in the shadows)
</div>
23 <p>This text should not be there
</p>