Re: [csswg-drafts] [css-anchor] anchor-name should not leak out of a shadow tree (#7916)

> that is avoidable if container names were tree-scoped?

Right, we could additionally add tree-scoping and avoid some additional leakage. But also some amount of boundary leakage *is* still unavoidable, since if both light and shadow set a name on the host *one* of them will win and cause the other to lose. ^_^ Tree-scoped would prevent `::part(foo) { container-name: foo; }` from messing with the shadow content, too, tho as I note there's no use-case for doing so right now *except* messing with the shadow so that's probably not very important.

If they were tree-scoped, [my example](https://github.com/w3c/csswg-drafts/issues/7916#issuecomment-1291086054) would result in the CQ in the shadow succeeding (it would skip the container-name set from the light and find the expected CQ on the host) and the CQ in the light failing (it starts its search for container names on the host, and fails to find any container names at all).

> I think you're right. The fact that a value "originates" from a pseudo-element-rule is long gone by the time we're ready to apply the effects of that value. We'd have to invent some new concept which would retain that fact. And at that point it seems preferable to re-use tree-scoped references.

Ok, thanks for confirming my intuition. I'll get something written more explicitly in Scoping defining the behavior of tree-scoped names established by properties.

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


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

Received on Wednesday, 30 November 2022 15:35:44 UTC