LibWeb: Schedule input event processing on HTML event loop

Our existing coalescing mechanism for input events didn't prevent
multiple mousemove/mousewheel events from being processed between paint
cycles. Since handling these events can trigger style & layout updates
solely for hit-testing purposes, we might end up doing work that won't
be observable by a user and could be avoided by shceduling input events
processing to happen right before painting the next frame.
This commit is contained in:
Aliaksandr Kalenik 2025-02-14 23:25:12 +01:00 committed by Andreas Kling
commit d3c481f71a
Notes: github-actions[bot] 2025-02-15 20:10:12 +00:00
10 changed files with 90 additions and 70 deletions

View file

@ -80,6 +80,8 @@ public:
virtual void process_screenshot_requests() override { }
virtual void paint(DevicePixelRect const&, Painting::BackingStore&, Web::PaintOptions = {}) override { }
virtual bool is_ready_to_paint() const override { return true; }
virtual Queue<QueuedInputEvent>& input_event_queue() override { VERIFY_NOT_REACHED(); }
virtual void report_finished_handling_input_event([[maybe_unused]] u64 page_id, [[maybe_unused]] EventResult event_was_handled) override { }
virtual DisplayListPlayerType display_list_player_type() const override { return m_host_page->client().display_list_player_type(); }
virtual bool is_headless() const override { return m_host_page->client().is_headless(); }