From d0e8a416cdcc2b431344aafe24f1f1bfad3bc4b1 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Sat, 30 Sep 2023 12:33:07 -0400 Subject: [PATCH 1/3] Add discussion of properties from the originating element Spec issue: https://github.com/w3c/csswg-drafts/issues/7591 Per resolution, properties not allowed on highlights but otherwise required to resolve units or modify colors are instead taken from the originating element. --- css-pseudo-4/Overview.bs | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/css-pseudo-4/Overview.bs b/css-pseudo-4/Overview.bs index 26622b914254..06c0c245aa9e 100644 --- a/css-pseudo-4/Overview.bs +++ b/css-pseudo-4/Overview.bs @@ -698,12 +698,10 @@ Styling Highlights - 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 @@ -712,6 +710,23 @@ Styling Highlights applied to the text by the originating element and its ancestors and descendants. + 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: + + + + 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=] are 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. + - Note: Historically (and at the time of writing) - only 'color' and 'background-color' have been interoperably supported.

Default UA Styles

From aadf706b8311ea68aab293ca366136a5d02aa0e3 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Wed, 1 Nov 2023 17:19:00 -0400 Subject: [PATCH 2/3] Update Overview.bs Fix typo. --- css-pseudo-4/Overview.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css-pseudo-4/Overview.bs b/css-pseudo-4/Overview.bs index 06c0c245aa9e..6e5376959723 100644 --- a/css-pseudo-4/Overview.bs +++ b/css-pseudo-4/Overview.bs @@ -722,7 +722,7 @@ Styling Highlights 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=] are taken from the [=originating element=]’s + [=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. From 8ff1c4fc7f69394d2a4f14473d5b2c784b6c7e63 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Thu, 25 Apr 2024 13:55:29 -0400 Subject: [PATCH 3/3] Add discussion of custom properties The CSS working group resolved that custom property values should come from the originating element, and here I update the spec. --- css-pseudo-4/Overview.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css-pseudo-4/Overview.bs b/css-pseudo-4/Overview.bs index ae0947e1f65e..e3ce7c508335 100644 --- a/css-pseudo-4/Overview.bs +++ b/css-pseudo-4/Overview.bs @@ -696,8 +696,6 @@ Styling Highlights css/css-pseudo/textpath-selection-011.html - -
  • [=custom properties=] [[!CSS-VARIABLES-1]] Issue: Are there any other properties that should be included here? @@ -712,6 +710,7 @@ Styling Highlights applied to the text by the originating element and its ancestors and descendants. +

    Values Resolved From Originating Elements

    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: @@ -720,6 +719,7 @@ Styling Highlights
  • 'forced-color-adjust' (used with [=forced colors mode=], which [=highlight pseudo-elements=] must respect)
  • 'font', 'font-size', etc. used to resolve 'em' and other font-relative units.
  • 'line-height' used to resolve 'lh' units. +
  • [=custom properties=] [[!CSS-VARIABLES-1]] used as property values. These properties are ignored if defined on the [=highlight pseudo-element=]