mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibWeb: Move updating the rendering into HTML task
Implements https://github.com/whatwg/html/pull/10007 which basically moves style, layout and painting from HTML processing task into HTML task with "rendering" source. The biggest difference is that now we no longer schedule HTML event loop processing whenever we might need a repaint, but instead queue a global rendering task 60 times per second that will check if any documents need a style/layout/paint update. That is a great simplification of our repaint scheduling model. Before we had: - Optional timer that schedules animation updates 60 hz - Optional timer that schedules rAF updates - PaintWhenReady state to schedule a paint if navigable doesn't have a rendering opportunity on the last event loop iteration Now all that is gone and replaced with a single timer that drives repainting at 60 hz and we don't have to worry about excessive repaints. In the future, hard-coded 60 hz refresh interval could be replaced with CADisplayLink on macOS and similar API on linux to drive repainting in synchronization with display's refresh rate.
This commit is contained in:
parent
9754b480fa
commit
4a43d0ac98
Notes:
github-actions[bot]
2024-10-04 05:07:56 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 4a43d0ac98
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1616
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/awesomekling
12 changed files with 225 additions and 288 deletions
|
@ -42,6 +42,7 @@ public:
|
|||
void spin_until(JS::SafeFunction<bool()> goal_condition);
|
||||
void spin_processing_tasks_with_source_until(Task::Source, JS::SafeFunction<bool()> goal_condition);
|
||||
void process();
|
||||
void queue_task_to_update_the_rendering();
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#termination-nesting-level
|
||||
size_t termination_nesting_level() const { return m_termination_nesting_level; }
|
||||
|
@ -114,7 +115,7 @@ private:
|
|||
|
||||
bool m_skip_event_loop_processing_steps { false };
|
||||
|
||||
bool m_is_running_reflow_steps { false };
|
||||
bool m_is_running_rendering_task { false };
|
||||
};
|
||||
|
||||
EventLoop& main_thread_event_loop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue