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