Re: [csswg-drafts] [css-contain] CQ vs shadow boundaries (#5984)

> By ancestor search, do you mean looking up ancestors in the light tree without walking past shadow roots?

No, I was referring to jumping up shadow roots as well; CSS *almost always* operates on the flat tree and doesn't care about shadow boundaries, particularly when layout is involved.

That said, while shadows being able to see ancestor light containers seems reasonable, i agree that parts being able to see shadow containers isn't good.

> Possibly stupid question: why is this worse than e.g. host::part(thing) { background-color: var(--defined-in-shadow-tree); }?

Name collisions among variables, while possible, aren't *too* likely in general. On the other hand, the *common* use-case for CQs doesn't even refer to the container by name, so you'll *often* end up accidentally being intercepted by the shadow's container, when you intended to be querying off of some light-dom container that's an ancestor to the shadow.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 11 November 2021 18:39:07 UTC