blob: c57193e99dbe5fb27be6082788f8fcb0c5b2ac2f [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
Forced colors mode - active selection.
<link rel="help" href="">
<link rel=match href="forced-colors-mode-14-ref.html">
br::selection {
background-color: transparent;
forced-color-adjust: none;
span {
/* inline-block to ensure the selection bounding rectangle matches that of the
span. This allows us to test selection using a reference test. */
display: inline-block;
.select::selection {
background-color: rgba(255, 0, 0, 0.99); /* alpha < 1 so that we don't blend the background color with white. */
color: blue;
#adjust-none::selection {
forced-color-adjust: none;
<span class="select">AAA</span>
<span class="select" id="adjust-none">AAA</span>
var node1 = document.getElementsByClassName('select')[0].firstChild;
var node2 = document.getElementsByClassName('select')[1].firstChild;
var range = document.createRange();
range.setStart(node1, 0);
range.setEnd(node2, node2.length);