LadybirdBrowser/ladybird

LibWeb: Support highlight pseudo-elements

tjk113 opened this issue · 0 comments

Highlight pseudo-elements control styling for selected/highlighted elements. The spec only allows for limited, non-layout-altering properties to be applied to these selectors. The allowed properties are as follows:

  • color
  • background-color
  • text-decoration and its associated properties (including text-underline-position and text-underline-offset)
  • text-shadow
  • stroke-color
  • fill-color
  • stroke-width

Supported pseudo-elements:

  • ::selection
    Applies to elements that have been selected by the user. Currently, this selector does get parsed, but goes unused, as the selection colors are hard-coded to their CSS::SystemColor defaults. See this discussion in the SerenityOS Discord server for more information regarding implementation.
  • ::target-text
    Applies to a page's targeted text fragment. Text fragments are currently unimplemented in Ladybird.
  • ::spelling-error
    Applies to text that has been reported by the browser to be misspelled. This requires a spellcheck engine to be integrated into Ladybird.
  • ::grammar-error
    Applies to text that has been reported by the browser to be grammatically incorrect. This requires a grammar checking engine to be integrated into Ladybird.