mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibWeb: Implement the infrastructure necessary for requestIdleCallback
This includes a bug fix for the event loop processing steps which has not been merged yet: https://github.com/whatwg/html/pull/7768
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 14:36:16 +09:00
Author: https://github.com/skyrising Commit: https://github.com/SerenityOS/serenity/commit/836d2ff259 Pull-request: https://github.com/SerenityOS/serenity/pull/13413 Reviewed-by: https://github.com/linusg
@@ -55,6 +55,8 @@ public:
|
||||
|
||||
NonnullRefPtrVector<DOM::Document> documents_in_this_event_loop() const;
|
||||
|
||||
NonnullRefPtrVector<Window> same_loop_windows() const;
|
||||
|
||||
void push_onto_backup_incumbent_settings_object_stack(Badge<EnvironmentSettingsObject>, EnvironmentSettingsObject& environment_settings_object);
|
||||
void pop_backup_incumbent_settings_object_stack(Badge<EnvironmentSettingsObject>);
|
||||
EnvironmentSettingsObject& top_of_backup_incumbent_settings_object_stack();
|
||||
@@ -63,6 +65,9 @@ public:
|
||||
void register_environment_settings_object(Badge<EnvironmentSettingsObject>, EnvironmentSettingsObject&);
|
||||
void unregister_environment_settings_object(Badge<EnvironmentSettingsObject>, EnvironmentSettingsObject&);
|
||||
|
||||
double unsafe_shared_current_time() const;
|
||||
double compute_deadline() const;
|
||||
|
||||
private:
|
||||
Type m_type { Type::Window };
|
||||
|
||||
@@ -72,6 +77,11 @@ private:
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#currently-running-task
|
||||
Task* m_currently_running_task { nullptr };
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#last-render-opportunity-time
|
||||
double m_last_render_opportunity_time { 0 };
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#last-idle-period-start-time
|
||||
double m_last_idle_period_start_time { 0 };
|
||||
|
||||
JS::VM* m_vm { nullptr };
|
||||
|
||||
RefPtr<Core::Timer> m_system_event_loop_timer;
|
||||
|
||||
Reference in New Issue
Block a user