Skip to content

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

Closed
@vmpstr

Description

@vmpstr

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:

  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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions