[Selectors4] Semantic pseudo-classes (was: "Headings" selector?)

I found this rotting in my drafts folder.

Boris Zbarsky (2010-10-06):
> 
> Now what one _could_ do is introduce a :header pseudo-class or something, if it's felt that it would be sufficiently useful….

We have or might have soon these pseduo-classes, some of which are arguably semantic (e.g. ‘:link’) and require special knowledge about the markup language:

  link
    :link, :visited
  target
    :target
  user action
    :focus, :hover
  language
    :lang()
  structural
    contextual reference
      :root
      :scope
    sibling
      :first-child
      :nth-child(N)
      :nth-last-child(N)
      :last-child
      :only-child
    typed sibling
      :first-of-type
      :nth-of-type(N)
      :nth-last-of-type(N)
      :last-of-type
      :only-of-type
    contents
      :empty
  UI element state
    :enabled, :disabled
    :checked
    :indeterminate
  UI state
    :active	
    :default
    :valid, :invalid
    :in-range, :out-of-range
    :required, :optional
    :read-only, :read-write
  negation
    :not(S)
[   :contains(S)   ]
  page
    :left, :right, :first
    :blank

We might want to have any of these (and more):

  table
    :cell
    :col(N), :row(N), :slot(N,N)
  page
    :odd, :even, :last
    :title, :cover
    :front, :back
    :center, :center-left, :center-right
    :spread-left, :spread-right
  structure
    :image – 2D replaced elements, incl. video
    :stream – continuous media like audio and video
    :input – textual form widgets
    :interactive – all kinds of form widget elements
    :text – does not contain anything but a text node
  semantic block
    :heading, :paragraph, :list, …
  semantic phrase
    :emphasis, …

Also see <http://wiki.csswg.org/spec/selectors4>, e.g. for table cell selectors.

Received on Saturday, 5 March 2011 17:31:18 UTC