[selectors4] Should the reference combinator really be a combinator?

Hi,

I maintain a selector engine written in javascript[1]. I initially
didn't realize how awkward the reference combinator[2] was until I
tried to implement it.

The problem was apparent after I wrote the first implementation: every
combinator represents some kind of positional relationship between two
elements. The reference combinator, on the other hand, does not. An
element that references another could be located anywhere in the tree.
This requires a kind of hacky workaround to implement; a special case,
just for the reference combinator. It's awkward to implement and
awkward to understand. It doesn't really fit the description of a
combinator. The syntax is strange, as well as inconsistent with the
combinators we've known for years, and I'm sure it's confusing even to
long time css users who are seeing it for the first time.

On top of all this, there's the question of how practical and useful
it would be in reality. Would the average css user ever touch this
combinator, aside from the occasional label/input use-case?

I just want to spark some discussion about this.

[1]: https://github.com/chjj/zest
[2]: http://www.w3.org/TR/selectors4/#idref-combinators

-- 
Christopher Jeffrey <chjjeffrey@gmail.com>
http://github.com/chjj

Received on Wednesday, 7 March 2012 14:21:46 UTC