LibWeb: Add ad-hoc implementation for Element::scroll(x, y)

Adds very naive implementation for js function to trigger scroll but
that is enough to start using it in tests :)
This commit is contained in:
Aliaksandr Kalenik 2023-08-06 21:36:05 +02:00 committed by Andreas Kling
parent 4160f13174
commit 433d3f988d
Notes: sideshowbarker 2024-07-17 02:06:40 +09:00

View File

@ -1779,7 +1779,8 @@ HashMap<DeprecatedFlyString, CSS::StyleProperty> const& Element::custom_properti
// https://drafts.csswg.org/cssom-view/#dom-element-scroll
void Element::scroll(double x, double y)
{
dbgln("FIXME: Implement Element::scroll(x: {}, y: {}", x, y);
// AD-HOC:
const_cast<Painting::PaintableBox*>(paintable_box())->scroll_by(x, y);
}
// https://drafts.csswg.org/cssom-view/#dom-element-scroll