LibWeb: Use weak references in the custom elements reaction stack

This commit is contained in:
Andreas Kling
2025-12-24 12:45:03 +01:00
committed by Andreas Kling
parent aa9c478ee9
commit 9a5c648b2f
Notes: github-actions[bot] 2025-12-25 19:23:29 +00:00
4 changed files with 8 additions and 6 deletions

View File

@@ -21,11 +21,11 @@ struct CustomElementReactionsStack {
// 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;
Vector<Vector<GC::Weak<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;
Vector<GC::Weak<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.