Files
Hiroyuki Ikezoe 8851ed32ff Bug 1950303 - Apply contain:layout overflow handling to absolutely positioned children in AbsoluteContainingBlock::ReflowAbsoluteFrame. r=layout-reviewers,emilio
When a containing block has `contain: layout`, scrollable overflow from its
children should not propagate to the parent. nsContainerFrame::ConsiderChildOverflow
already implements this by only unioning the child's ink overflow, but
AbsoluteContainingBlock::ReflowAbsoluteFrame took a separate code path that
unconditionally unioned the child's full overflow areas. As a result, a wide
absolutely positioned descendant of a `contain: layout` element could still
inflate the page's scrollable area (and the mobile viewport).

Extend OverflowAreaUnionFlags with ChildIsAbsPos so that ConsiderChildOverflow
performs OverflowAreas::UnionWithAbsoluteOverflowAreas (matching the prior
abspos behavior), and route ReflowAbsoluteFrame through ConsiderChildOverflow.
The contain:layout handling is then shared between in-flow and absolutely
positioned children.

Differential Revision: https://phabricator.services.mozilla.com/D299911
2026-05-12 04:18:08 +00:00
..