LibWeb+WebContent: Change event loop to synchronously paint next frame

...instead of scheduling repaint timer in PageClient.

This change fixes flickering on Discord that happened because:
- Event loop schedules repainting by activating repaint timer
- `Document::tear_down_layout_tree()` destroys paintable tree
- Repaint timer invokes callback and renders an empty frame because
  paintable tree was destroyed
This commit is contained in:
Aliaksandr Kalenik
2024-05-28 15:51:53 +02:00
committed by Andreas Kling
parent e806136116
commit b8d18ebcf7
7 changed files with 29 additions and 24 deletions

View File

@@ -2133,8 +2133,9 @@ void Navigable::paint(Painting::RecordingPainter& recording_painter, PaintConfig
auto background_color = document->background_color();
recording_painter.fill_rect(bitmap_rect, background_color);
if (!document->paintable())
return;
if (!document->paintable()) {
VERIFY_NOT_REACHED();
}
Web::PaintContext context(recording_painter, page.palette(), page.client().device_pixels_per_css_pixel());
context.set_device_viewport_rect(viewport_rect);