Skip to content

[css-pseudo] clarify highlight color:currentColor + gCS (closes #6818) #7220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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