mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Reschedule repaint for navigables with ongoing painting
Fixes delayed repainting in the following case: 1. Style or layout invalidation triggers html event loop processing. 2. Event loop processing does nothing because there is no rendering opportunity. 3. Style or layout change won't be reflected until something else triggers event loop processing
This commit is contained in:
parent
3bdfca1119
commit
b31fb36ed3
Notes:
sideshowbarker
2024-07-16 22:26:05 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: b31fb36ed3
Pull-request: https://github.com/SerenityOS/serenity/pull/23698
Reviewed-by: https://github.com/nico
2 changed files with 21 additions and 2 deletions
|
@ -105,8 +105,11 @@ void PageClient::ready_to_paint()
|
|||
{
|
||||
auto old_paint_state = exchange(m_paint_state, PaintState::Ready);
|
||||
|
||||
if (old_paint_state == PaintState::PaintWhenReady)
|
||||
schedule_repaint();
|
||||
if (old_paint_state == PaintState::PaintWhenReady) {
|
||||
// NOTE: Repainting always has to be scheduled from HTML event loop processing steps
|
||||
// to make sure style and layout are up-to-date.
|
||||
page().top_level_traversable()->set_needs_display();
|
||||
}
|
||||
}
|
||||
|
||||
void PageClient::add_backing_store(i32 front_bitmap_id, Gfx::ShareableBitmap const& front_bitmap, i32 back_bitmap_id, Gfx::ShareableBitmap const& back_bitmap)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue