Skip to content

Commit

Permalink
[css-pseudo-4] Take certain non-applicable but required properties fr…
Browse files Browse the repository at this point in the history
…om the originating element #7591
  • Loading branch information
schenney-chromium authored Oct 15, 2024
1 parent ed29c24 commit 1dcf54e
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions css-pseudo-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -894,16 +894,12 @@ Styling Highlights</h3>
<wpt>
textpath-selection-011.html
</wpt>

<li>[=custom properties=] [[!CSS-VARIABLES-1]]
</ul>

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).

Issue: Are there any other properties that should be included here?

Note: Historically (and at the time of writing)
only 'color' and 'background-color' have been interoperably supported.

Note: The 'color' property sets the color of
both the text
Expand All @@ -912,6 +908,25 @@ Styling Highlights</h3>
applied to the text
by the <a>originating element</a> and its ancestors and descendants.

<h4>Values Resolved From Originating Elements</h4>
There are several properties that modify colors or resolve units but cannot be
used inside [=highlight pseudo-elements=], yet are important for specifyng the
appearance of properties that are used in the highlight. For example:

<ul>
<li>'forced-color-adjust' (used with [=forced colors mode=], which [=highlight pseudo-elements=] must respect)
<li>'font', 'font-size', etc. used to resolve 'em' and other font-relative units.
<li>'line-height' used to resolve 'lh' units.
<li>[=custom properties=] [[!CSS-VARIABLES-1]] used as property values.
</ul>

These properties are ignored if defined on the [=highlight pseudo-element=]
itself. Rather, any non-allowed property required to define the appearance of a
[=highlight pseudo-element=] is taken from the [=originating element=]’s
corresponding property. The computed style of the [=highlight pseudo-element=]
will include any properties taken from the originating element, even if not
allowed on the [=highlight pseudo-element=] itself.

<!-- Add this back if for some reason someone wants to implement 'outline'?
The outline, if supported, must be drawn
around the union of the active portions of the <a>highlight overlay</a>
Expand All @@ -923,8 +938,6 @@ Styling Highlights</h3>
into a single shape.
-->

Note: Historically (and at the time of writing)
only 'color' and 'background-color' have been interoperably supported.

<h3 id=highlight-ua-styles>
Default UA Styles</h3>
Expand Down

0 comments on commit 1dcf54e

Please sign in to comment.