test-print-selection-shadow-crossing-flat-9.html (969B)
1 <!DOCTYPE html> 2 <html reftest-print-range="selection"> 3 <head> 4 <meta charset="utf-8"> 5 <link id="style" href="print.css" rel="stylesheet"> 6 <script> 7 function selectNodesInShadowTree() { 8 // Test 9: start is in Shadow DOM and end is in Light DOM. 9 window.getSelection() 10 .setBaseAndExtent( 11 host.shadowRoot.getElementById("inner").firstChild, 12 2, 13 slotted4.firstChild, 14 8); 15 } 16 </script> 17 </head> 18 <body onload="selectNodesInShadowTree()"> 19 <p id="lightContent1">LightContent1</p> 20 <div id="host">Shouldn't show up (in the shadows) 21 <template shadowrootmode="open"> 22 <slot name="s1"></slot> 23 <span id="inner">Inner</span> 24 <slot name="s2"></slot> 25 </template> 26 <span id="slotted3" slot="s2">Slotted3</span> 27 <span id="slotted1" slot="s1">Slotted1</span> 28 <span id="slotted4" slot="s2">Slotted4</span> 29 <span id="slotted2" slot="s1">Slotted2</span> 30 </div> 31 </body> 32 </html>