The CSS3 combinators I know of are:
~(all next siblings)
Below I've created an alternative list of combinators. What I would like to know is:
- Do any of the current selector engines stray from standard CSS selection methods? (I'm familiar with Sizzle and Sly, but none of the others)
- Do you see any reason why any of the combinators I've listed wouldn't work well?
- Do you think having more selector string options (more combinators, more filters, etc) is beneficial or are just a waste/confusing/dumb/etc?
Thanks all in advance for your thoughts!
>>(descendants) (also, space would still work)
++(all next siblings) (also, tilde would still work)
--(all previous siblings)
*(previous and next siblings)
div ^ span - get all spans with a div child
div ** span - get all span siblings of div
.lastListItem -- li - all li previous to the li with class
#thing ^ div ** .error - all items with class
.error that are siblings of #thing's parent (assuming #thing's parent is a div)
p.s. Oh, and I also thought of having a placeholder character that could stand in for any simple selector. So, Example 4 might look like this (with an underscore as a placeholder):
Example 4 alt:
#thing ^ _ ** .error - all items with class ".error" that are siblings of #thing's parent (no matter what kind of element #thing's parent is)