mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Split out SimilarOriginWindowAgent from HTML::Agent
To allow for adding the concept of a WorkerAgent to be reused between shared and dedicated workers. An event loop is the commonality between the different agent types, though, there are some differences between those event loops which we customize on the construction of the HTML::EventLoop.
This commit is contained in:
parent
939bb10828
commit
084cceab5c
Notes:
github-actions[bot]
2025-04-25 14:45:55 +00:00
Author: https://github.com/shannonbooth
Commit: 084cceab5c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4453
11 changed files with 103 additions and 54 deletions
|
@ -31,13 +31,13 @@
|
|||
#include <LibWeb/HTML/HTMLSlotElement.h>
|
||||
#include <LibWeb/HTML/Location.h>
|
||||
#include <LibWeb/HTML/PromiseRejectionEvent.h>
|
||||
#include <LibWeb/HTML/Scripting/Agent.h>
|
||||
#include <LibWeb/HTML/Scripting/ClassicScript.h>
|
||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||
#include <LibWeb/HTML/Scripting/ExceptionReporter.h>
|
||||
#include <LibWeb/HTML/Scripting/Fetching.h>
|
||||
#include <LibWeb/HTML/Scripting/ModuleScript.h>
|
||||
#include <LibWeb/HTML/Scripting/Script.h>
|
||||
#include <LibWeb/HTML/Scripting/SimilarOriginWindowAgent.h>
|
||||
#include <LibWeb/HTML/Scripting/SyntheticRealmSettings.h>
|
||||
#include <LibWeb/HTML/Scripting/TemporaryExecutionContext.h>
|
||||
#include <LibWeb/HTML/ShadowRealmGlobalScope.h>
|
||||
|
@ -76,7 +76,7 @@ ErrorOr<void> initialize_main_thread_vm(HTML::EventLoop::Type type)
|
|||
{
|
||||
VERIFY(!s_main_thread_vm);
|
||||
|
||||
s_main_thread_vm = TRY(JS::VM::create(make<HTML::Agent>()));
|
||||
s_main_thread_vm = TRY(JS::VM::create(make<HTML::SimilarOriginWindowAgent>()));
|
||||
|
||||
auto& agent = as<HTML::Agent>(*s_main_thread_vm->agent());
|
||||
agent.event_loop = s_main_thread_vm->heap().allocate<HTML::EventLoop>(type);
|
||||
|
@ -659,7 +659,7 @@ JS::VM& main_thread_vm()
|
|||
void queue_mutation_observer_microtask(DOM::Document const& document)
|
||||
{
|
||||
auto& vm = main_thread_vm();
|
||||
auto& surrounding_agent = as<HTML::Agent>(*vm.agent());
|
||||
auto& surrounding_agent = as<HTML::SimilarOriginWindowAgent>(*vm.agent());
|
||||
|
||||
// 1. If the surrounding agent’s mutation observer microtask queued is true, then return.
|
||||
if (surrounding_agent.mutation_observer_microtask_queued)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue