LibWeb: Don't class mousewheel as handled if scroll offset isn't updated

Before this change, you could only scroll the current hovered scroll
container, even if it was at the beginning or end and thus having no
effect.

Now, if it doesn't update, it will not be classed as handled and will
move onto the next scroll container.
This commit is contained in:
Luke Wilde 2025-10-07 14:09:30 +01:00 committed by Alexander Kalenik
parent 38e224cd9f
commit adeedabf54
Notes: github-actions[bot] 2025-10-07 17:44:30 +00:00
4 changed files with 22 additions and 16 deletions

View file

@ -63,9 +63,14 @@ public:
// Offset from the top left of the containing block's content edge.
[[nodiscard]] CSSPixelPoint offset() const;
enum class ScrollHandled {
No,
Yes,
};
CSSPixelPoint scroll_offset() const;
void set_scroll_offset(CSSPixelPoint);
void scroll_by(int delta_x, int delta_y);
[[nodiscard]] ScrollHandled set_scroll_offset(CSSPixelPoint);
[[nodiscard]] ScrollHandled scroll_by(int delta_x, int delta_y);
void set_offset(CSSPixelPoint);
void set_offset(float x, float y) { set_offset({ x, y }); }