Re: [csswg-drafts] [css-contain] Container queries within display:none are difficult to implement (#8197)

> Blink implements it partially: the testcase above is good, but adding this breaks it [...]

Thanks, landed a fix for this now. (https://crbug.com/1399755).

> [general issue]

The current spec intentionally has no special case directly on display:none, and instead delays dealing with that until container-query-evaluation time (via having a principle box or not). This is to get a "stable" container situation in display:none. I.e. the container (which is an element, not a layout box) is always the "intended" container, and not a "random" container outside of display:none.

A related point is that container selection intentionally doesn't care whether an element has a pricinple box or not. I.e. we can select the right container without building the layout tree. This is important for Blink, since we need to know if something is a container or not sufficiently early in the pipeline. (This may be besides the point of this issue, but who knows where the discussion will lead).

> Firefox skips #inner-container and thinks that the query container is #outer-container.

I think we should avoid this behavior for the reasons I said. (#outer-container is not the intended container).

> Maybe elements inside display: none subtrees should be considered to not have any container?

That on the other hand seems probably OK? Although gCS would be worse than it needs to be when only the querying element (and not the container) is in display:none. And it's possibly unfortunate for style queries. But at least it's stable.

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


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

Received on Wednesday, 14 December 2022 08:30:17 UTC