Skip to content

Commit e6ec959

Browse files
committed
fix problems with ::{spelling,grammar}-error + ::highlight (w3c#6779)
1 parent f639d98 commit e6ec959

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

css-highlight-api-1/Overview.bs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,12 @@ Applicable Properties
308308

309309
Default Styles
310310

311-
UAs must not define any styles for [=custom highlight pseudo-elements=] in the default UA
312-
stylesheet. A [=custom highlight pseudo-element=] inherits the styles of its
313-
[=originating element=].
311+
UAs must not define any default UA stylesheet rules
312+
313+
for any [=custom highlight pseudo-elements=].
314+
In other words,
315+
when some content is highlighted by an unstyled custom highlight,
316+
its presentation must not change.
314317

315318

316319
Cascading and Inheritance

css-pseudo-4/Overview.bs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,16 +605,30 @@ Default UA Styles
605605
:root::grammar-error { text-decoration-line: grammar-error; }
606606
607607

608-
For ''::selection'' and ''::target-text'',
609-
the recommended default styling is to use [=highlight colors=].
610-
611608
Note: the “paired cascade” behavior of [=highlight colors=]
612609
means that UA defaults for these colors
613610
can't be expressed in terms of 'color' and 'background-color'
614611
in [=UA style sheet=] rules.
615612
However it has been interoperably implemented in browsers
616613
and is thus probably a Web-compatibility requirement.
617614

615+
UAs may define default highlight colors
616+
for each highlight pseudo-element,
617+
consisting of a 'color' and a 'background-color',
618+
and doing so is recommended
619+
for ''::selection'' and ''::target-text''.
620+
Otherwise,
621+
the default highlight colors for that highlight must be
622+
'currentColor' (not 'initial' or 'inherit')
623+
and 'transparent' respectively.
624+
625+
Note: In other words,
626+
when the UA doesn’t define default highlight colors
627+
for a given highlight,
628+
highlighted content retains the 'color'
629+
that would otherwise have been used
630+
without that highlight.
631+
618632
UAs may apply additional effects to enhance the presentation
619633
of highlighted content,
620634
for example dimming content other than the highlighted text

0 commit comments

Comments
 (0)