mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 17:02:56 +00:00
LibWeb: Move set_scroll_offset() from Layout::Box to PaintableBox
Nodes in layout tree should not be aware of scroll state.
This commit is contained in:
parent
5b7926fa53
commit
fee5b4deb6
Notes:
sideshowbarker
2024-07-16 21:30:46 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: fee5b4deb6
Pull-request: https://github.com/SerenityOS/serenity/pull/20395
Reviewed-by: https://github.com/MacDue
5 changed files with 24 additions and 23 deletions
|
@ -1054,7 +1054,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(static_cast<float>(x));
|
||||
box->set_scroll_offset(scroll_offset);
|
||||
const_cast<Painting::PaintableBox*>(paintable_box())->set_scroll_offset(scroll_offset);
|
||||
}
|
||||
|
||||
void Element::set_scroll_top(double y)
|
||||
|
@ -1122,7 +1122,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(static_cast<float>(y));
|
||||
box->set_scroll_offset(scroll_offset);
|
||||
const_cast<Painting::PaintableBox*>(paintable_box())->set_scroll_offset(scroll_offset);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue