mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWeb+WebContent: Add abstraction layer for event loop and timers
Instead of using Core::EventLoop and Core::Timer directly, LibWeb now goes through a Web::Platform abstraction layer instead. This will allow us to plug in Qt's event loop (and QTimer) over in Ladybird, to avoid having to deal with multiple event loops.
This commit is contained in:
parent
7e5a8bd4b0
commit
9567e211e7
Notes:
sideshowbarker
2024-07-17 18:38:54 +09:00
Author: https://github.com/awesomekling
Commit: 9567e211e7
28 changed files with 365 additions and 42 deletions
|
@ -10,7 +10,6 @@
|
|||
#include <AK/CharacterTypes.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Parser.h>
|
||||
#include <LibJS/Runtime/FunctionObject.h>
|
||||
|
@ -67,6 +66,7 @@
|
|||
#include <LibWeb/Layout/TreeBuilder.h>
|
||||
#include <LibWeb/Namespace.h>
|
||||
#include <LibWeb/Page/Page.h>
|
||||
#include <LibWeb/Platform/Timer.h>
|
||||
#include <LibWeb/SVG/TagNames.h>
|
||||
#include <LibWeb/UIEvents/EventNames.h>
|
||||
#include <LibWeb/UIEvents/FocusEvent.h>
|
||||
|
@ -286,11 +286,11 @@ Document::Document(HTML::Window& window, const AK::URL& url)
|
|||
|
||||
HTML::main_thread_event_loop().register_document({}, *this);
|
||||
|
||||
m_style_update_timer = Core::Timer::create_single_shot(0, [this] {
|
||||
m_style_update_timer = Platform::Timer::create_single_shot(0, [this] {
|
||||
update_style();
|
||||
});
|
||||
|
||||
m_layout_update_timer = Core::Timer::create_single_shot(0, [this] {
|
||||
m_layout_update_timer = Platform::Timer::create_single_shot(0, [this] {
|
||||
force_layout();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue