/* * Copyright (c) 2026, Jelle Raaijmakers * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace Web { class AutoScrollHandler { public: AutoScrollHandler(HTML::Navigable&, DOM::Element& container); void visit_edges(JS::Cell::Visitor&) const; CSSPixelPoint process(CSSPixelPoint mouse_position); void perform_tick(); bool is_active() const { return m_active; } static GC::Ptr find_scrollable_ancestor(Painting::Paintable const&); private: void activate(); void deactivate(); GC::Ref m_navigable; GC::Ref m_container_element; CSSPixelPoint m_mouse_position; CSSPixelPoint m_fractional_delta; bool m_active { false }; }; }