LibWeb: Don't visit registered document observers from Document

`DocumentObserver` register itself in Document` from constructor and
unregister itself from `finalize()`. The problem is that `finalize()`
won't be invoked for as long as `DocumentObserver` is visited by
`Document`. By not visiting registered observers from `Document` we
move this responsibility to object that allocated observer, which is
always exactly what we want, e.g. once `SVGUseElement` that uses
observer is gone, observer won't be visited anymore which will lead to
`finalize()` being called.
This commit is contained in:
Aliaksandr Kalenik 2025-07-29 23:34:58 +02:00 committed by Andreas Kling
parent 9e1e4f3b15
commit 52b4f2a40a
Notes: github-actions[bot] 2025-07-29 22:56:31 +00:00
2 changed files with 3 additions and 2 deletions

View file

@ -581,7 +581,6 @@ void Document::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_scripts_to_execute_in_order_as_soon_as_possible);
visitor.visit(m_scripts_to_execute_as_soon_as_possible);
visitor.visit(m_node_iterators);
visitor.visit(m_document_observers);
visitor.visit(m_document_observers_being_notified);
visitor.visit(m_pending_scroll_event_targets);
visitor.visit(m_pending_scrollend_event_targets);