1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:04:59 +00:00

LibWeb: Schedule repainting from EventLoop::process()

In this change, updating layout and painting are moved to the EventLoop
processing steps. This modification allows the addition of resize
observation dispatching that needs to happen in event loop processing
steps and must occur in the following order relative to layout and
painting:

1. Update layout.
2. Gather and broadcast resize observations.
3. Paint.
This commit is contained in:
Aliaksandr Kalenik 2024-02-18 19:40:11 +01:00 committed by Andreas Kling
parent fb8edcea00
commit 8ba18dfd40
6 changed files with 14 additions and 4 deletions

View file

@ -222,12 +222,12 @@ void PageClient::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& ta
void PageClient::set_viewport_rect(Web::DevicePixelRect const& rect)
{
page().top_level_traversable()->set_viewport_rect(page().device_to_css_rect(rect));
schedule_repaint();
Web::HTML::main_thread_event_loop().schedule();
}
void PageClient::page_did_invalidate(Web::CSSPixelRect const&)
{
schedule_repaint();
Web::HTML::main_thread_event_loop().schedule();
}
void PageClient::page_did_request_cursor_change(Gfx::StandardCursor cursor)