Ready for Developer Testing: CSS Highlight Inheritance

86 views
Skip to first unread message

Stephen Chenney

unread,
Oct 30, 2023, 4:25:12 PM10/30/23
to blink-dev

Contact emails

sche...@chromium.org

Specification

https://drafts.csswg.org/css-pseudo-4/#highlight-cascade

Summary

With CSS Highlight Inheritance, the CSS Highlight pseudo classes, such as ::selection and ::highlight, inherit their properties through the pseudo highlight chain, rather than the element chain. The result is a more intuitive model for inheritance of properties in highlights. Specifically, "When any supported property is not given a value by the cascade ... its specified value is determined by inheritance from the corresponding highlight pseudo-element of its originating element’s parent element." (https://drafts.csswg.org/css-pseudo-4/#highlight-cascade)



Blink component

Blink>CSS

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

The feature is still under implementation in other browser engines, but the standards are well developed and there is general agreement on the spec. I think compat risk is very limited at this time.



Gecko: Neutral (https://github.com/mozilla/standards-positions/issues/548) emilio@ is active in standards discussions on the issues, but I am not aware of implementation. https://bugzilla.mozilla.org/show_bug.cgi?id=1703963 https://bugzilla.mozilla.org/show_bug.cgi?id=1703961

WebKit: In development (https://github.com/WebKit/standards-positions/issues/95) I have a private email from the Apple engineer tasked with implementing. I don't want to reveal PI.

Web developers: No signals Developer ergonomics is the primary concern motivating highlight inheritance. See https://github.com/w3c/csswg-drafts/issues/2474 for the initial spec discussion related to the behavior of ::selection. See https://bugs.chromium.org/p/chromium/issues/detail?id=1490471 for an example of a user seeing unexpected behavior without this feature.

Other signals:

Ergonomics

None.



Activation

No. This reflects the already active behavior for ::selection in Firefox and the already used behavior for ::highlight, ::spelling and ::grammar.



Security

There are no security risks.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Goals for experimentation

Identify any remaining bugs.

Ongoing technical constraints

None



Debuggability

Devtools supports highlight pseudos and correctly shows the inheritance chain.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

There are no cross-platform issues with implementation and no reason to discriminate on platform.



Is this feature fully tested by web-platform-tests?

Yes

https://wpt.fyi/results/css/css-pseudo?label=experimental&label=master&aligned highlight-cascade-* covers this functionality. There are additional WPT that make use of the feature in https://wpt.fyi/results/css/css-highlight-api?label=experimental&label=master&aligned



Flag name on chrome://flags

experimental-web-platform-features

Finch feature name

HighlightInheritance

Non-finch justification

The feature was enabled as experimental way back in M111 and stayed that way until M116 when it was switched back to test, and it is back on experimental for M118. Developers have significant experience with the feature enabled via experimental web platform features. There is no value to running a finch trial given the large amount of existing experience with the feature.



Requires code in //chrome?

False

Estimated milestones

Shipping on desktop120
DevTrial on desktop118
Shipping on Android120
DevTrial on Android118
Shipping on WebView120


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5090853643354112

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages