Closed
Description
content-visibility: hidden
skips its content 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 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:
- We don't create a layout object for top layer element in
content-visibility: hidden
subtrees, similar to what display: none would do. - 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 undercontent-visibility: hidden
. - 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 (neitherdisplay: none
norvisibility: hidden
would show the content, butcontent-visibility: hidden
would)
I recommend option 1 since it would be the most consistent with display: none
/cc @chrishtr