dbates@webkit.org | 17aa17f | 2018-03-01 22:35:38 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <style> |
| 3 | textarea { |
| 4 | font-size: 3em; |
| 5 | height: 300px; |
| 6 | outline: none; |
| 7 | } |
| 8 | ::selection { text-shadow: 1px 1px 2px blue; } |
| 9 | ::selection:window-inactive { |
| 10 | text-shadow: 1px 1px 2px rgba(63, 128, 33, 0.95); /* green; alpha < 1 so that we don't blend the background color with white. */ |
| 11 | } |
| 12 | </style> |
| 13 | <textarea>Any textual selection in this sentence should have a green shadow when the window is inactive.</textarea> |
| 14 | <script> |
| 15 | var textarea = document.querySelector("textarea"); |
| 16 | textarea.select(); |
| 17 | if (window.testRunner) |
| 18 | testRunner.setWindowIsKey(false); |
| 19 | </script> |