inert-node-is-not-highlighted-ref.html (836B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <style> 5 body p, span { 6 -webkit-user-select: none; 7 user-select: none; 8 } 9 10 ::backdrop { 11 display: none; 12 } 13 </style> 14 </head> 15 <body> 16 <p>Test that inert nodes are not painted as being selected. The test passes if 17 none of the text outside the dialog is highlighted when selected.</p> 18 19 <p>Although not shown as selected, the inert nodes are in window.getSelection() 20 and copied to the clipboard, which is the same behavior as user-select: 21 none (crbug.com/147490).</p> 22 23 <br><span>This text shouldn't be highlighted as selected.</span> 24 25 <dialog> 26 <div id="selectable">I'm selectable.</div> 27 </dialog> 28 29 <script> 30 dialog = document.querySelector('dialog'); 31 dialog.showModal(); 32 selectable = document.querySelector('#selectable'); 33 window.getSelection().selectAllChildren(selectable); 34 </script> 35 </body> 36 </html>