[Selectors4] UA Hint Pseudo Elements

Authors and users should probably be able to style certain text highlighting done by user agents (mostly) independent of markup:

  ::typo | ::spelling | ::hint(orthography) | …
  Words that are unknown to the built-in dictionary, 
  roughly equivalent to words containing spelling errors.
  Often rendered as red squiggly underlines.

  ::grammar | ::hint(grammar), ::hint(style) | …
  Hints for improvements or corrections of grammar.

  ::match | ::search | ::find | ::found | …
  Matches for the full page search. Often indicated by background color.
  ::any-match | ::matches; ::first-match, ::last-match
  It may make sense to differentiate current/active match and all matches, 
  maybe also first and last matches. 
  We can probably live well without ‘::nth-match’.

Actually there are more kinds of hints with which browsers (may) augment documents, e.g. for translation of foreign terms within text, expansion of abbreviations, glossary information or formatting. Therefore a generic ‘::hint’ or easily extendable  ‘::hint()’ may be the best solution.

Note that ‘::match’ differs considerably from previous proposals for matching text from within style sheets, like ‘::matches('foo')’ or ‘::text('foo')’. I believe it has been suggested before to select and style user (text) selections with ‘::selection’ or the like – this proposal belongs into that same category and ‘:target’ is also related.

Received on Thursday, 28 October 2010 06:19:02 UTC