mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-23 17:33:12 +00:00
LibWeb: Implement the unreachable scrollable overflow
Whenever we end up with a scrollable overflow rect that goes beyond either of its axes (i.e. the rect has a negative X or Y position relative to its parent's absolute padding box position), we need to clip that rect to prevent going into the "unreachable scrollable overflow". This fixes the horizontal scrolling on https://ladybird.org (gets more pronounced if you make the window very narrow).
This commit is contained in:
parent
05ddf5c718
commit
2998049fe9
Notes:
github-actions[bot]
2025-07-11 06:24:49 +00:00
Author: https://github.com/gmta
Commit: 2998049fe9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5384
33 changed files with 140 additions and 98 deletions
|
@ -1917,9 +1917,9 @@ int Element::scroll_width()
|
|||
return 0;
|
||||
|
||||
// 7. Return the width of the element’s scrolling area.
|
||||
if (auto scrollable_overflow_rect = paintable_box()->scrollable_overflow_rect(); scrollable_overflow_rect.has_value()) {
|
||||
if (auto scrollable_overflow_rect = paintable_box()->scrollable_overflow_rect(); scrollable_overflow_rect.has_value())
|
||||
return scrollable_overflow_rect->width().to_int();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue