layout: Remove workaround for body while building overflow frame for StackingContextTree construction. (#38825)

While building the stacking context tree we were assuming that `<body>`
would have propagated its `overflow` value to the viewport, and thus its
used `overflow` would be `visible`.

However, the element that propagates `overflow` can be the root element
instead. Since #38598 we are correctly taking this into account in
`effective_overflow()`, so we no longer need to do anything special in
the stacking context logic.

Testing: `css/css-overflow/overflow-body-propagation-012.html`

Fixes: #38799

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
This commit is contained in:
Shubham Gupta 2025-08-22 15:59:02 +08:00 committed by GitHub
parent 4784ff0375
commit 09db6b8669
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 61 additions and 19 deletions

View file

@ -1449,25 +1449,6 @@ impl BoxFragment {
});
}
// scrollable overflow path
// From https://drafts.csswg.org/css-overflow/#propdef-overflow:
// > UAs must apply the overflow-* values set on the root element to the viewport when the
// > root elements display value is not none. However, when the root element is an [HTML]
// > html element (including XML syntax for HTML) whose overflow value is visible (in both
// > axes), and that element has as a child a body element whose display value is also not
// > none, user agents must instead apply the overflow-* values of the first such child
// > element to the viewport. The element from which the value is propagated must then have a
// > used overflow value of visible.
//
// TODO: This should only happen when the `display` value is actually propagated.
if self
.base
.flags
.contains(FragmentFlags::IS_BODY_ELEMENT_OF_HTML_ELEMENT_ROOT)
{
return None;
}
let scroll_frame_rect = self
.padding_rect()
.translate(containing_block_rect.origin.to_vector())