mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Save ScrollState snapshot in DisplayList to avoid race condition
With this change we save a copy of of scroll state at the time of recording a display list, instead of actual ScrollState pointer that could be modifed by the main thread while display list is beings rasterized on the rendering thread, which leads to a frame painted with inconsistent scroll state. Fixes https://github.com/LadybirdBrowser/ladybird/issues/4288
This commit is contained in:
committed by
Alexander Kalenik
parent
d855adf767
commit
6507d23e29
Notes:
github-actions[bot]
2025-04-12 00:56:11 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/6507d23e290 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4327
@@ -1426,7 +1426,8 @@ RefPtr<Painting::DisplayList> TraversableNavigable::record_display_list(DevicePi
|
||||
|
||||
void TraversableNavigable::start_display_list_rendering(NonnullRefPtr<Painting::DisplayList> display_list, NonnullRefPtr<Painting::BackingStore> backing_store, Function<void()>&& callback)
|
||||
{
|
||||
m_rendering_thread.enqueue_rendering_task(move(display_list), move(backing_store), move(callback));
|
||||
auto scroll_state_snapshot = active_document()->paintable()->scroll_state().snapshot();
|
||||
m_rendering_thread.enqueue_rendering_task(move(display_list), move(scroll_state_snapshot), move(backing_store), move(callback));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user