diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index e0d2706b30e..4362a7b008d 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -2130,6 +2130,18 @@ void Element::scroll(HTML::ScrollToOptions const&) dbgln("FIXME: Implement Element::scroll(ScrollToOptions)"); } +// https://drafts.csswg.org/cssom-view/#dom-window-scrollby +void Element::scroll_by(double x, double y) +{ + dbgln("FIXME: Implement Element::scroll_by({}, {})", x, y); +} + +// https://drafts.csswg.org/cssom-view/#dom-window-scrollby +void Element::scroll_by(HTML::ScrollToOptions const&) +{ + dbgln("FIXME: Implement Element::scroll_by(ScrollToOptions)"); +} + bool Element::id_reference_exists(String const& id_reference) const { return document().get_element_by_id(id_reference); diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index c027988a326..08dc3af09da 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -336,6 +336,8 @@ public: void scroll(HTML::ScrollToOptions const&); void scroll(double x, double y); + void scroll_by(HTML::ScrollToOptions const&); + void scroll_by(double x, double y); void register_intersection_observer(Badge, IntersectionObserver::IntersectionObserverRegistration); void unregister_intersection_observer(Badge, JS::NonnullGCPtr); diff --git a/Userland/Libraries/LibWeb/DOM/Element.idl b/Userland/Libraries/LibWeb/DOM/Element.idl index ce00e6cb6e6..fe96e6ad14e 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.idl +++ b/Userland/Libraries/LibWeb/DOM/Element.idl @@ -82,8 +82,8 @@ interface Element : Node { undefined scroll(unrestricted double x, unrestricted double y); [ImplementedAs=scroll] undefined scrollTo(optional ScrollToOptions options = {}); [ImplementedAs=scroll] undefined scrollTo(unrestricted double x, unrestricted double y); - // FIXME: undefined scrollBy(optional ScrollToOptions options = {}); - // FIXME: undefined scrollBy(unrestricted double x, unrestricted double y); + undefined scrollBy(optional ScrollToOptions options = {}); + undefined scrollBy(unrestricted double x, unrestricted double y); attribute unrestricted double scrollTop; attribute unrestricted double scrollLeft; readonly attribute long scrollWidth;