mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Exclude fixed positioned boxes from scrollable overflow
Sometimes fixed positioned boxes would extend the viewport's scrollable overflow, which according to the spec should never happen. There are some nuances to this, such as properly determining the fixed positioning containing block for a fixed position box, but for now this prevents some pages from being overly scrollable. Fixes horizontal scrollability of https://tweakers.net.
This commit is contained in:
parent
5ae069a031
commit
2fc1cafb8a
Notes:
github-actions[bot]
2025-04-25 12:08:40 +00:00
Author: https://github.com/gmta
Commit: 2fc1cafb8a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4467
3 changed files with 29 additions and 0 deletions
|
@ -85,6 +85,13 @@ static CSSPixelRect measure_scrollable_overflow(Box const& box)
|
|||
if (child.containing_block() != &box)
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
// https://drafts.csswg.org/css-position/#fixed-positioning-containing-block
|
||||
// [..] As a result, parts of fixed-positioned boxes that extend outside the layout viewport/page area
|
||||
// cannot be scrolled to and will not print.
|
||||
// FIXME: Properly establish the fixed positioning containing block for `position: fixed`
|
||||
if (child.is_fixed_position())
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
auto child_border_box = child.paintable_box()->absolute_border_box_rect();
|
||||
|
||||
// Border boxes with zero area do not affect the scrollable overflow area.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue