Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/paint/invalidation/selection/selection-background-repaint.html |
| diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/selection/selection-background-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/selection/selection-background-repaint.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ee9a3e353e4c6886455de78a6cfc15b8990837d8 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/paint/invalidation/selection/selection-background-repaint.html |
| @@ -0,0 +1,32 @@ |
| +<!DOCTYPE html> |
| +<style> |
| + ::selection { |
| + background-color: transparent; |
| + color: red |
| + } |
| + .green::selection { |
| + color: green |
| + } |
| +</style> |
| +<p>The words GREEN below should be green.</p> |
| +<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.
|
| +<script> |
| + if (window.testRunner) |
| + testRunner.waitUntilDone(); |
| + |
| + function setSelection(startTextNode, endTextNode) { |
| + window.getSelection().removeAllRanges(); |
| + var range = document.createRange(); |
| + range.setStart(startTextNode, 0); |
| + range.setEnd(endTextNode, endTextNode.data.length); |
| + window.getSelection().addRange(range); |
| + } |
| + |
| + setSelection(t1.firstChild, t1.lastChild); |
| + requestAnimationFrame(() => |
| + requestAnimationFrame(() => { |
| + t1.className = "green"; |
| + if (window.testRunner) |
| + testRunner.notifyDone(); |
| + })); |
| +</script> |