mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +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:
committed by
Andreas Kling
parent
5b7926fa53
commit
fee5b4deb6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user