Re: [csswg-drafts] [css-selectors] Proposal: Selector Boundary (#5057)

That's right, they are not the same. Instead of adding a boundary to avoid undesired styles, you would scope these undesired styles to another subtree (which may not always be doable).

IMO your proposal makes selectors more confusing. Currently the selector model is not that complex, the simple selectors in a compound selector just impose additional constraints to the same element, and combinators specify the relationship between the elements matching the adjacent compound selectors.

With your proposal, the set of elements matched by a simple selector depends on whether the full selector contains some specific simple selector. From another point of view, type/pseudo-class selectors are no longer filtering the elements matched by `*`, they can also affect other simple selectors in the same selector.

There are already common misconceptions about the current model, I worry it may become worse with your proposal. Scoped styles seem less problematic to me, and can cover some of your usecases.

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

Received on Wednesday, 13 May 2020 22:16:06 UTC