mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Prevent scrolling viewport with overflow:hidden
This commit is contained in:
Notes:
github-actions[bot]
2025-12-15 09:48:57 +00:00
Author: https://github.com/Psychpsyo Commit: https://github.com/LadybirdBrowser/ladybird/commit/3a4f7eeb4af Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6727 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -2826,6 +2826,8 @@ void Navigable::scroll_viewport_by_delta(CSSPixelPoint delta)
|
||||
// 13. Let element be doc’s root element if there is one, null otherwise.
|
||||
|
||||
// 14. Perform a scroll of the viewport’s scrolling box to its current scroll position + (layout dx, layout dy) with element as the associated element, and behavior as the scroll behavior.
|
||||
if (!doc->paintable_box()->could_be_scrolled_by_wheel_event())
|
||||
return;
|
||||
auto scrolling_area = doc->paintable_box()->scrollable_overflow_rect()->to_type<float>();
|
||||
auto new_viewport_scroll_offset = m_viewport_scroll_offset.to_type<double>() + Gfx::Point(layout_dx, layout_dy);
|
||||
// NOTE: Clamp to the scrolling area.
|
||||
|
||||
Reference in New Issue
Block a user