Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/LayoutTests/paint/invalidation/selection/selection-background-repaint.html

Issue 2709693003: Repaint selection when element with ::selection style is recalculated. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698