Skip to content

Commit

Permalink
[css-pseudo] clarify highlight color:currentColor (closes w3c#6818)
Browse files Browse the repository at this point in the history
  • Loading branch information
delan committed Apr 15, 2022
1 parent 3236e39 commit 6988de2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion css-pseudo-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ Text and Text Decorations</h4>

For this purpose,
''currentColor'' on a [=highlight pseudo-element=]’s 'color' property represents
the 'color' of the next <a>highlight pseudo-element</a> layer below,
the 'color' of the next <em>active</em> <a>highlight pseudo-element</a> layer below,
falling back finally to the colors that would otherwise have been used
(those applied by the [=originating element=] or
an intervening [=pseudo-element=] such as ''::first-line'' or ''::first-letter'').
Expand Down Expand Up @@ -1295,6 +1295,18 @@ Additions to the CSS Object Model</h2>
See <a href="https://github.com/w3c/csswg-drafts/issues/3607">Issue 3607</a>
and <a href="https://github.com/w3c/csswg-drafts/issues/3603">Issue 3603</a>.

<h3 id="getComputedStyle">
{{Window/getComputedStyle()}}</h3>

When the second parameter <var>pseudoElt</var>
refers to a [=highlight pseudo-element=],
{{Window/getComputedStyle()}} returns styles
as if that highlight is active
and all other highlights are inactive.
This avoids the potential
ambiguity and privacy risks of returning a result
that depends on the actual highlight state.

<h2 id="css2-compat">
Compatibility Syntax</h2>

Expand Down

0 comments on commit 6988de2

Please sign in to comment.