From 433d3f988d6aec843ba39da11a1f44e8b184c23a Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sun, 6 Aug 2023 21:36:05 +0200 Subject: [PATCH] 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 :) --- Userland/Libraries/LibWeb/DOM/Element.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 762a50a06d..1888d0f458 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -1779,7 +1779,8 @@ HashMap 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(paintable_box())->scroll_by(x, y); } // https://drafts.csswg.org/cssom-view/#dom-element-scroll