Skip to content

Commit

Permalink
Update test: forced-color-adjust does not apply to pseudo-highlights
Browse files Browse the repository at this point in the history
The updated tests relied on ‘forced-color-adjust’ being applicable
to highlight pseudos, which is no longer the case as of:
w3c/csswg-drafts#7264

Bug: 1400970
Change-Id: I0872a85903f2abf73edd50429be83a48c3bc735e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4705311
Reviewed-by: Stephen Chenney <[email protected]>
Commit-Queue: Stephen Chenney <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1175025}
  • Loading branch information
spectranaut authored and Lightning00Blade committed Dec 11, 2023
1 parent 5cacf5e commit 443df77
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions forced-colors-mode/forced-colors-mode-14-ref.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
</style>
<body>
<span class="select">AAA</span>
<br>
<span class="select" id="adjust-none">AAA</span>
<br>
<span class="select">AAA</span>
</body>
25 changes: 21 additions & 4 deletions forced-colors-mode/forced-colors-mode-14.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Forced colors mode - active selection.
</title>
<link rel="help" href="https://www.w3.org/TR/css-color-adjust-1/#forced-colors-properties">
<link rel="help" href="https://www.w3.org/TR/css-pseudo-4/#highlight-styling">
<link rel=match href="forced-colors-mode-14-ref.html">
<style>
br::selection {
Expand All @@ -19,14 +20,30 @@
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 {
#adjust-none {
forced-color-adjust: none;
}
#adjust-none-on-highlight::selection {
forced-color-adjust: none;
}

<!--
"
The forced-color-adjust property cannot be set on highlight pseudo-elements;
however a highlight pseudo-element must honor any forced colors mode applied
to its originating element (and is therefore subject to the control of the
originating element’s forced-color-adjust value).
"
coming from
https://www.w3.org/TR/css-pseudo-4/#highlight-styling
-->

</style>
<body>
<span class="select">AAA</span>
<br>
<span class="select" id="adjust-none">AAA</span>
<div id="adjust-none">
<span class="select">AAA</span>
</div>
<span id="adjust-none-on-highlight" class="select">AAA</span>
</body>

<script>
Expand Down

0 comments on commit 443df77

Please sign in to comment.