@@ -696,12 +696,11 @@ Styling Highlights</h3>
696
696
697
697
Issue: Are there any other properties that should be included here?
698
698
699
- In particular,
700
- 'color' and 'background-color' are known as <dfn>highlight colors</dfn> ,
701
- and their [=used values=] are handled specially (see [[#paired-cascade]] ).
699
+ 'color' and 'background-color'
700
+ are known as <dfn>highlight colors</dfn> .
702
701
Because this concept exists for compatibility reasons,
703
702
other similar properties
704
- like 'fill-color'
703
+ like 'fill-color' or 'stroke-color'
705
704
must not be treated as highlight colors.
706
705
707
706
<!-- Add this back if for some reason someone wants to implement 'outline' ?
@@ -716,7 +715,7 @@ Styling Highlights</h3>
716
715
-->
717
716
718
717
Note: Historically (and at the time of writing)
719
- only the [= highlight colors=] have been interoperably supported.
718
+ only the highlight colors have been interoperably supported.
720
719
721
720
<h3 id=highlight-ua-styles>
722
721
Default UA Styles</h3>
@@ -894,44 +893,39 @@ Painting the Highlight</h3>
894
893
<h4 id="paired-cascade">
895
894
Highlight Colors</h4>
896
895
897
- With the exception of ''revert'' (see below) ,
896
+ For compatibility reasons ,
898
897
[=default highlight colors=]
899
- for a given [=highlight pseudo-element=]
900
898
must only be [=used value|used=]
901
- instead of [=initial values=]
902
- when neither the originating element’s [=cascade=] ,
903
- nor those of any of the originating element’s ancestors,
904
- yield any highlight colors
899
+ when neither of the [=highlight colors=]
900
+ yield a [=cascaded value=]
901
+ or [=specified value=]
905
902
of the [=author origin=] .
906
- In other words,
907
- when the author sets one “custom” highlight color,
908
- defaults for the other highlight color are suppressed.
909
-
910
- Note: 'stroke-color' and 'fill-color' have their usual effects
911
- on the foreground color,
912
- but unlike 'color' ,
913
- they do not suppress the default 'background-color' .
914
-
915
- When a highlight color is ''revert'' ,
916
- [=default highlight colors=] are suppressed
917
- if and only if the cascade is “rolled back”
918
- to one of the origins listed above.
919
- For example,
920
- ''revert'' in an [=author-origin=] rule
921
- rolls back the cascade to the [=user origin=] ,
922
- so defaults are not suppressed.
923
-
924
- Note: all other explicit defaults,
925
- including ''unset'' ,
926
- suppress [=default highlight colors=] like any ordinary value.
927
- This happens to be consistent with
928
- how [=explicit defaulting=] is defined:
929
- it affects [=specified values=]
930
- based on [=cascaded values=] .
931
- Even though the outcome is <em> as if</em>
932
- the [=cascade=] was modified in some way,
933
- the [=cascade=] is already done,
934
- so they exist unchanged as [=cascaded values=] .
903
+ When a highlight color is ''revert'' or ''revert-layer'' ,
904
+ the origin <em> after</em> rolling back the cascade
905
+ determines whether this is the case.
906
+
907
+ <div class="example">
908
+ For example,
909
+ given the following markup:
910
+ <pre class="lang-markup">
911
+ <p>Highlight this <em>and this</em>.</p>
912
+ </pre>
913
+ Any of the following rules
914
+ would suppress the default 'background-color'
915
+ for ''::selection''
916
+ in the <code> <em></code> element
917
+ if given by the author:
918
+ <pre class="lang-css">
919
+ /* cascaded value is author origin */
920
+ em::selection { color: initial; }
921
+ em::selection { color: inherit; }
922
+ em::selection { color: unset; }
923
+ em::selection { color: green; }
924
+
925
+ /* specified value is author origin */
926
+ p::selection { color: green; }
927
+ </pre>
928
+ </div>
935
929
936
930
<h4 id="highlight-backgrounds">
937
931
Backgrounds</h4>
0 commit comments