RE: [selectors] Groups and repetition

Hi Benjamin,

> Hi,
> I was gonna start implementing the filtered sibling selector 
> (
> in WebKit but it occurred to me that there is another syntax
> with a simple implementation and more capabilities.

I’m glad to see you look so motivated to improve css selectors, but I’m
afraid you may be escalating too fast from idea to implementation. I’m not a
csswg member (yet ^_^), but I think the usual process (at least when someone
proposes new features that require syntactic changes to CSS) is to wait for
a consensus before trying to ship anything. I believe a minimum would be to
have the matter discussed at some telcon or during the next TPAC.

> Instead of creating a special purpose indirect sibling, we could
> just extend the existing syntax by allowing groups and
> repetition, similarly to regular expressions.
>    h1 ( + :not(h1, p))* + p
>    == a paragraph 
>    == preceded by any number of siblings matching :not(h1, p)
>    == preceded by a heading element

I very much like this idea. However, the syntax is problematic because "*"
already means something in the context of selectors.

I would note that we already have a syntax for repetitions in CSS (the
repeat function) which could be reused or adapted.

Received on Tuesday, 21 October 2014 16:58:22 UTC