mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
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:
parent
38e224cd9f
commit
adeedabf54
Notes:
github-actions[bot]
2025-10-07 17:44:30 +00:00
Author: https://github.com/Lubrsi
Commit: adeedabf54
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6419
Reviewed-by: https://github.com/kalenikaliaksandr ✅
4 changed files with 22 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue