Elements with content-visibility: hidden in the top layer should not have boxes
Categories
(Core :: Layout, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: mrobinson, Assigned: mrobinson)
References
Details
Attachments
(1 file, 1 obsolete file)
https://w3c.github.io/csswg-drafts/css-contain-2/#cv-notes says:
If an element has an ancestor with content-visibility: hidden, and it is placed in the top
layer, it does not generate any boxes, as if it were display: none.
Note: An element skipped for other reasons, such as having a content-visibility: auto
ancestor, will still generate boxes as normal, and might thus become un-skipped.
This means we need to track when these kind of elements are added to the top layer and ensure they do not have a box.
Assignee | ||
Comment 1•3 years ago
|
||
When an element is in the top layer and an ancestor has
content-visibility: hidden
make sure that element does not generate
boxes. There are three cases to handle here:
- An element is added to the top layer and already has an ancestor with
content-visibility: hidden
: in that case we add a flag to the
element which prevents the creation of a frame. This should work
because addition to the top layer always triggers reframing. - An element is already in the top layer and an ancestor is restyled to
havecontent-visibility: hidden
: for this case, every time that a
content-visibility: hidden
frame is created check whether it is a
flat tree ancestor of a top layer element. If it is, add the flag to
the element and mark that element for reframing. - An element is disabled in the top layer due to a
content-visibility: hidden
ancestor: whenever acontent-visibility: hidden
frame is
destroyed queue a post-reflow task on the PresShell that verifies
that every disabled top layer element is still disabled.
This change adds some tests to verify various aspects of this. They are
not marked tentative, because this wording is already part of the draft
specification.
Assignee | ||
Comment 2•3 years ago
|
||
The CSS Contain specification says that descendants of elements with
content-visibility: hidden
that are in the top layer should not
generate boxes. Implementing this would lead to many open questions that
are currently not answered by the specification. While these questions
are hashed out in the specification, ensure that these top layer
elements do not generate display list items.
Comment 5•3 years ago
|
||
bugherder |
Updated•5 months ago
|
Description
•