1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:37:34 +00: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:
Simon Wanner 2022-03-31 21:55:01 +02:00 committed by Linus Groh
parent 73da139cd7
commit 836d2ff259
6 changed files with 209 additions and 31 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -18,16 +19,15 @@ public:
using WrapperType = Bindings::IdleDeadlineWrapper;
using AllowOwnPtr = TrueType;
static NonnullRefPtr<IdleDeadline> create(double time_remaining, bool did_timeout);
static NonnullRefPtr<IdleDeadline> create(bool did_timeout = false);
virtual ~IdleDeadline() override;
double time_remaining() const { return m_time_remaining; }
double time_remaining() const;
bool did_timeout() const { return m_did_timeout; }
private:
IdleDeadline(double time_remaining, bool did_timeout);
IdleDeadline(bool did_timeout);
double m_time_remaining { 0 };
bool m_did_timeout { false };
};