mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Change agent's signal_slots into a GC::RootVector
As part of this, also move the constructor out of line so we don't unnecessarily add transitive includes.
This commit is contained in:
parent
4cca341315
commit
c0939725a2
Notes:
github-actions[bot]
2025-11-24 12:46:33 +00:00
Author: https://github.com/gmta
Commit: c0939725a2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6917
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 12 additions and 8 deletions
|
|
@ -1,10 +1,13 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Shannon Booth <shannon@serenityos.org>
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||
#include <LibWeb/DOM/MutationObserver.h>
|
||||
#include <LibWeb/HTML/HTMLSlotElement.h>
|
||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||
#include <LibWeb/HTML/Scripting/SimilarOriginWindowAgent.h>
|
||||
#include <LibWeb/Platform/EventLoopPlugin.h>
|
||||
|
|
@ -27,4 +30,11 @@ SimilarOriginWindowAgent& relevant_similar_origin_window_agent(JS::Object const&
|
|||
return as<SimilarOriginWindowAgent>(*relevant_realm(object).vm().agent());
|
||||
}
|
||||
|
||||
SimilarOriginWindowAgent::SimilarOriginWindowAgent(GC::Heap& heap, CanBlock can_block)
|
||||
: Agent(can_block)
|
||||
, pending_mutation_observers(heap)
|
||||
, signal_slots(heap)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
#include <LibGC/Root.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Runtime/Agent.h>
|
||||
#include <LibWeb/DOM/MutationObserver.h>
|
||||
#include <LibWeb/Export.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/HTML/CustomElements/CustomElementReactionsStack.h>
|
||||
#include <LibWeb/HTML/Scripting/Agent.h>
|
||||
|
||||
|
|
@ -38,7 +36,7 @@ struct SimilarOriginWindowAgent : public Agent {
|
|||
|
||||
// https://dom.spec.whatwg.org/#signal-slot-list
|
||||
// Each similar-origin window agent has signal slots (a set of slots), which is initially empty. [HTML]
|
||||
Vector<GC::Root<HTML::HTMLSlotElement>> signal_slots;
|
||||
GC::RootVector<GC::Ref<HTMLSlotElement>> signal_slots;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/custom-elements.html#current-element-queue
|
||||
// A similar-origin window agent's current element queue is the element queue at the top of its custom element reactions stack.
|
||||
|
|
@ -46,11 +44,7 @@ struct SimilarOriginWindowAgent : public Agent {
|
|||
Vector<GC::Root<DOM::Element>> const& current_element_queue() const { return custom_element_reactions_stack.element_queue_stack.last(); }
|
||||
|
||||
private:
|
||||
SimilarOriginWindowAgent(GC::Heap& heap, CanBlock can_block)
|
||||
: Agent(can_block)
|
||||
, pending_mutation_observers(heap)
|
||||
{
|
||||
}
|
||||
SimilarOriginWindowAgent(GC::Heap&, CanBlock);
|
||||
};
|
||||
|
||||
WEB_API SimilarOriginWindowAgent& relevant_similar_origin_window_agent(JS::Object const&);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue