OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <style> | |
3 ::selection { | |
4 background-color: transparent; | |
5 color: red | |
6 } | |
7 .green::selection { | |
8 color: green | |
9 } | |
10 </style> | |
11 <p>The words GREEN below should be green.</p> | |
12 <span id="t1">GREEN<span> RED </span>GREEN</span> | |
mstensho (USE GERRIT)
2017/02/21 21:03:54
The fact that "RED" is indeed painted in red here
rune
2017/02/21 21:42:00
Yes, it was to prove to the reader of the test and
rune
2017/02/21 22:34:57
Done.
| |
13 <script> | |
14 if (window.testRunner) | |
15 testRunner.waitUntilDone(); | |
16 | |
17 function setSelection(startTextNode, endTextNode) { | |
18 window.getSelection().removeAllRanges(); | |
19 var range = document.createRange(); | |
20 range.setStart(startTextNode, 0); | |
21 range.setEnd(endTextNode, endTextNode.data.length); | |
22 window.getSelection().addRange(range); | |
23 } | |
24 | |
25 setSelection(t1.firstChild, t1.lastChild); | |
26 requestAnimationFrame(() => | |
27 requestAnimationFrame(() => { | |
28 t1.className = "green"; | |
29 if (window.testRunner) | |
30 testRunner.notifyDone(); | |
31 })); | |
32 </script> | |
OLD | NEW |