-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathhighlight-painting-currentcolor-001.html
More file actions
30 lines (30 loc) · 1.15 KB
/
highlight-painting-currentcolor-001.html
File metadata and controls
30 lines (30 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: ‘currentColor’ in ‘color’ of overlapping highlights</title>
<link rel="author" title="Delan Azabani" href="mailto:dazabani@igalia.com">
<link rel="help" href="https://un5n798jx6qx6j0rmf2verhh.julianrbryant.com/css-pseudo-4/#highlight-painting">
<meta name="assert" content="This test checks that ::selection takes the ‘color’ of the next active highlight below when resolving ‘currentColor’ in ‘color’.">
<link rel="match" href="highlight-painting-currentcolor-001-ref.html">
<meta name="fuzzy" content="0-120;0-10">
<link rel="stylesheet" href="support/highlights.css">
<script src="support/selections.js"></script>
<style>
::highlight(a) {
color: yellow;
background-color: blue;
}
::highlight(b) {
color: lime;
background-color: blue;
}
::selection {
color: currentColor;
background-color: black;
}
</style>
<div class="highlight_reftest" id="target">test test</div>
<script>
CSS.highlights.set("b", new Highlight(createRangeForTextOnly(target, 0, 4)));
CSS.highlights.set("a", new Highlight(createRangeForTextOnly(target, 5, 9)));
selectNodeContents(target);
</script>