W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2020

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

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Wed, 13 May 2020 22:16:04 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-628274177-1589408162-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:06 UTC