mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +00:00
LibWeb: Return a representation of an 'Agent' in 'relevant agent'
This makes it more convenient to use the 'relvant agent' concept, instead of the awkward dynamic casts we needed to do for every call site. mutation_observers is also changed to hold a GC::Root instead of raw GC::Ptr. Somehow this was not causing problems before, but trips up CI after these changes.
This commit is contained in:
parent
5bed8f4055
commit
64eeda6450
Notes:
github-actions[bot]
2025-01-11 15:40:39 +00:00
Author: https://github.com/shannonbooth
Commit: 64eeda6450
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3142
15 changed files with 140 additions and 98 deletions
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2021-2023, Luke Wilde <lukew@serenityos.org>
|
||||
* Copyright (c) 2025, Shannon Booth <shannon@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGC/Root.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-reactions-stack
|
||||
struct CustomElementReactionsStack {
|
||||
CustomElementReactionsStack() = default;
|
||||
~CustomElementReactionsStack() = default;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/custom-elements.html#element-queue
|
||||
// Each item in the stack is an element queue, which is initially empty as well. Each item in an element queue is an element.
|
||||
// (The elements are not necessarily custom yet, since this queue is used for upgrades as well.)
|
||||
Vector<Vector<GC::Root<DOM::Element>>> element_queue_stack;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/custom-elements.html#backup-element-queue
|
||||
// Each custom element reactions stack has an associated backup element queue, which an initially-empty element queue.
|
||||
Vector<GC::Root<DOM::Element>> backup_element_queue;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/custom-elements.html#processing-the-backup-element-queue
|
||||
// To prevent reentrancy when processing the backup element queue, each custom element reactions stack also has a processing the backup element queue flag, initially unset.
|
||||
bool processing_the_backup_element_queue { false };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue