Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS highlight pseudo system #548

Open
delan opened this issue Jul 1, 2021 · 3 comments
Open

CSS highlight pseudo system #548

delan opened this issue Jul 1, 2021 · 3 comments
Labels
venue: W3C Specifications in W3C Working Groups

Comments

@delan
Copy link

delan commented Jul 1, 2021

Request for Mozilla Position on an Emerging Web Specification

Other information

css-pseudo-4 specifies the widely-supported but previously non-standard ::selection as one of several “highlight pseudos”, along with things like spelling/grammar errors and author-defined custom highlights. The highlight pseudos include a more powerful processing model:

  • highlights can now add their own decorations and shadows
  • highlights can now inherit applicable properties from ancestor highlight styles (was also true for Presto!)

This is mostly compatible with older ::selection impls but not completely:

  • originating shadows now paint below the backgrounds of ::selection and other highlights
  • ::selection can no longer remove or (in general) change the color of originating decorations and shadows
  • it was possible (albeit unlikely) for existing content to rely on ::selection styles not being inherited
  • custom properties on :root are no longer visible to ::selection pseudos unless defined on :root::selection

For more details, check out our explainer.

Although this new system is complex, we have successfully implemented it in Blink, and we’re planning to send an intent to ship for it soon. We recently shared our techniques for making it performant at BlinkOn 17. The main Blink features are HighlightOverlayPainting (stable in M105) and HighlightInheritance (stable in M105 for custom highlights only).

@delan
Copy link
Author

delan commented Oct 28, 2021

@emilio heads up, there’s a new compat risk scenario that I wasn’t previously aware of (w3c/csswg-drafts#6774). I’ve updated the request accordingly.

@annevk annevk added the venue: W3C Specifications in W3C Working Groups label Oct 28, 2021
@emilio
Copy link
Collaborator

emilio commented Oct 28, 2021

@delan thanks, commented there.

@delan
Copy link
Author

delan commented Nov 22, 2022

I’ve updated the request to cover the new highlight processing model in general, now that w3c/csswg-drafts#6774 and most of the other spec issues are resolved. Please take a look!

@delan delan changed the title CSS highlight inheritance (css-pseudo #highlight-cascade) CSS highlight pseudo system Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
venue: W3C Specifications in W3C Working Groups
Projects
Status: Unscreened
Development

No branches or pull requests

3 participants