[csswg-drafts] [css-contain] Top layer interactions with content-visibility: hidden. (#6728)

vmpstr has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-contain] Top layer interactions with content-visibility: hidden. ==
`content-visibility: hidden` [skips its content](https://www.w3.org/TR/css-contain-2/#skips-its-contents) which it defines as flat-tree descendants. Part of skipping the contents is that they are not painted. 

When we put an element into the top layer, however, its box goes into a [top layer stacking context](https://fullscreen.spec.whatwg.org/#top-layer) which changes to a different topology than the flat-tree. (Note that I think this type of definition is well suited for CSS, so I think CSSWG is the proper body to decide this question)

We have three options, I think:
1. We don't create a layout object for top layer element in `content-visibility: hidden` subtrees, similar to what display: none would do.
2. We refuse to put the element into the top layer if it's in `content-visibility: hidden` subtree. The developer would need to try again when the element is not under `content-visibility: hidden`.
3. Show the element in the top layer list. This defeats some optimizations that `content-visibility` provides. It is also inconsistent with other approaches that hide content (neither `display: none` nor `visibility: hidden` would show the content, but `content-visibility: hidden` would)

I recommend option 1 since it would be the most consistent with display: none

/cc @chrishtr 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6728 using your GitHub account


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

Received on Wednesday, 13 October 2021 20:43:25 UTC