mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:37:36 +00:00
LibWeb: Introduce Mutation{Record,Observer} and observer microtasks
This commit is contained in:
parent
116a7b74fe
commit
c9ba5531e0
15 changed files with 531 additions and 0 deletions
|
@ -7,9 +7,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Runtime/JobCallback.h>
|
||||
#include <LibJS/Runtime/VM.h>
|
||||
#include <LibWeb/DOM/MutationObserver.h>
|
||||
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
||||
|
||||
namespace Web::Bindings {
|
||||
|
@ -18,6 +20,15 @@ struct WebEngineCustomData final : public JS::VM::CustomData {
|
|||
virtual ~WebEngineCustomData() override = default;
|
||||
|
||||
HTML::EventLoop event_loop;
|
||||
|
||||
// FIXME: These should only be on similar-origin window agents, but we don't currently differentiate agent types.
|
||||
|
||||
// https://dom.spec.whatwg.org/#mutation-observer-compound-microtask-queued-flag
|
||||
bool mutation_observer_microtask_queued { false };
|
||||
|
||||
// https://dom.spec.whatwg.org/#mutation-observer-list
|
||||
// FIXME: This should be a set.
|
||||
NonnullRefPtrVector<DOM::MutationObserver> mutation_observers;
|
||||
};
|
||||
|
||||
struct WebEngineCustomJobCallbackData final : public JS::JobCallback::CustomData {
|
||||
|
@ -35,5 +46,6 @@ struct WebEngineCustomJobCallbackData final : public JS::JobCallback::CustomData
|
|||
|
||||
HTML::ClassicScript* active_script();
|
||||
JS::VM& main_thread_vm();
|
||||
void queue_mutation_observer_microtask(DOM::Document&);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue