Re: [csswg-drafts] [css-selectors] has-child selector (#4903)

Right, I get that's what `.dark < .my-component` would mean.

But Adam's comment said:

> Eg, they want a child to own how it responds to a class or state findable further up the DOM.

That is just standard selectors: `.dark .my-component` means the .my-component is owning how it responds to a class (.dark) further up in the DOM.

> Further some seem to intuit that this would just "change the directionality" such that space (descendant) becomes ancestor. So body .my-component < .x would make body the subject. 

Ooooof, no, this would be real bad: contextual re-interpretation of the entire selector based on a combinator that might not show up until the very end! That's a ["garden-path" issue](https://en.wikipedia.org/wiki/Garden-path_sentence), where your initial read seems to lead you down one direction, only for something at the end to make you realize you were going the wrong way the whole time, requiring you to back up and re-interpret the entire thing. Not to mention it makes selectors like `foo > bar < baz` either non-sensical or, at best, dramatically more confusing. So no, definitely not going that way.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4903#issuecomment-609050613 using your GitHub account

Received on Saturday, 4 April 2020 16:06:33 UTC