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

@ -1867,7 +1867,7 @@ void Element::set_scroll_left(double x)
// FIXME: Implement this in terms of calling "scroll the element".
auto scroll_offset = paintable_box()->scroll_offset();
scroll_offset.set_x(CSSPixels::nearest_value_for(x));
paintable_box()->set_scroll_offset(scroll_offset);
(void)paintable_box()->set_scroll_offset(scroll_offset);
}
void Element::set_scroll_top(double y)
@ -1924,7 +1924,7 @@ void Element::set_scroll_top(double y)
// FIXME: Implement this in terms of calling "scroll the element".
auto scroll_offset = paintable_box()->scroll_offset();
scroll_offset.set_y(CSSPixels::nearest_value_for(y));
paintable_box()->set_scroll_offset(scroll_offset);
(void)paintable_box()->set_scroll_offset(scroll_offset);
}
// https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth
@ -3144,7 +3144,7 @@ void Element::scroll(double x, double y)
auto scroll_offset = paintable_box()->scroll_offset();
scroll_offset.set_x(CSSPixels::nearest_value_for(x));
scroll_offset.set_y(CSSPixels::nearest_value_for(y));
paintable_box()->set_scroll_offset(scroll_offset);
(void)paintable_box()->set_scroll_offset(scroll_offset);
}
// https://drafts.csswg.org/cssom-view/#dom-element-scroll