mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
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:
parent
9072a7caef
commit
d3c481f71a
Notes:
github-actions[bot]
2025-02-15 20:10:12 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: d3c481f71a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3582
10 changed files with 90 additions and 70 deletions
|
@ -223,6 +223,16 @@ void PageClient::paint(Web::DevicePixelRect const& content_rect, Web::Painting::
|
|||
page().top_level_traversable()->paint(content_rect, target, paint_options);
|
||||
}
|
||||
|
||||
Queue<Web::QueuedInputEvent>& PageClient::input_event_queue()
|
||||
{
|
||||
return client().input_event_queue();
|
||||
}
|
||||
|
||||
void PageClient::report_finished_handling_input_event(u64 page_id, Web::EventResult event_was_handled)
|
||||
{
|
||||
client().async_did_finish_handling_input_event(page_id, event_was_handled);
|
||||
}
|
||||
|
||||
void PageClient::set_viewport_size(Web::DevicePixelSize const& size)
|
||||
{
|
||||
page().top_level_traversable()->set_viewport_size(page().device_to_css_size(size));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue