Re: [Selectors4] Reference combinators

Anne van Kesteren:

> Might it be a better idea to let the markup language define how two elements are related

This would have the added benefit that the direction of the relationship didn’t matter, i.e. with the current draft you would do

  label /for/ input {}

to select the form widget and

  $label /for/ input {}

to select its label, whereas with UA knowledge of the markup language these could be, respectively,

  label // input {}

  input // label {}

> and have the reference combinator simply be "/"?

A double symbol enables it to work magically in most cases and makes it possible to add an explicit IDREF attribute where that fails. 

In the wiki page <http://wiki.csswg.org/spec/selectors4> it was also suggested to use something like

  label[for#] // input[id#] {}

to identify the source and target attributes. (It could be a single slash in this case.)

Received on Monday, 25 July 2011 09:49:20 UTC