commit 1f8a97e419d84519cb1e796c7a152a0067df42d3
parent 6e65a3b7e5783b4f2a116af92be232c2eddb8dfd
Author: Tiaan Louw <tlouw@mozilla.com>
Date: Thu, 16 Oct 2025 14:49:09 +0000
Bug 1962472 - Add a frame state bit when position-visibility hides frames r=layout-anchor-positioning-reviewers,layout-reviewers,dshin
When the flag is set, the frame will not be rendered.
Differential Revision: https://phabricator.services.mozilla.com/D268388
Diffstat:
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/layout/generic/nsFrameStateBits.h b/layout/generic/nsFrameStateBits.h
@@ -144,6 +144,10 @@ FRAME_STATE_BIT(Generic, 11, NS_FRAME_TOO_DEEP_IN_FRAME_TREE)
// PresShell::FrameNeedsReflow. Pass the right arguments instead.
FRAME_STATE_BIT(Generic, 12, NS_FRAME_HAS_DIRTY_CHILDREN)
+// If this bit is set, the frame will not be rendered, because of it's
+// 'position-visibility' values.
+FRAME_STATE_BIT(Generic, 13, NS_FRAME_POSITION_VISIBILITY_HIDDEN)
+
// If this bit is set, the frame is part of the mangled frame hierarchy
// that results when an inline has been split because of a nested block.
// See the comments in nsCSSFrameConstructor::ConstructInline for
diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp
@@ -4180,8 +4180,9 @@ static bool ShouldSkipFrame(nsDisplayListBuilder* aBuilder,
!aFrame->IsSelected()) {
return true;
}
- static const nsFrameState skipFlags =
- NS_FRAME_TOO_DEEP_IN_FRAME_TREE | NS_FRAME_IS_NONDISPLAY;
+ static const nsFrameState skipFlags = NS_FRAME_TOO_DEEP_IN_FRAME_TREE |
+ NS_FRAME_IS_NONDISPLAY |
+ NS_FRAME_POSITION_VISIBILITY_HIDDEN;
if (aFrame->HasAnyStateBits(skipFlags)) {
return true;
}