1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

LibWeb: Add a visit_edges for DOM/Event

This commit is contained in:
Hendiadyoin1 2022-09-13 16:05:51 +02:00 committed by Andreas Kling
parent e68a35611b
commit 34439a04e8
2 changed files with 18 additions and 0 deletions

View file

@ -41,6 +41,23 @@ Event::Event(HTML::Window& window, FlyString const& type, EventInit const& event
{
}
void Event::visit_edges(Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_target.ptr());
visitor.visit(m_related_target.ptr());
visitor.visit(m_current_target.ptr());
for (auto& it : m_path) {
visitor.visit(it.invocation_target.ptr());
visitor.visit(it.shadow_adjusted_target.ptr());
visitor.visit(it.related_target.ptr());
for (auto& itit : it.touch_target_list)
visitor.visit(itit.ptr());
}
for (auto& it : m_touch_target_list)
visitor.visit(it.ptr());
}
// https://dom.spec.whatwg.org/#concept-event-path-append
void Event::append_to_path(EventTarget& invocation_target, JS::GCPtr<EventTarget> shadow_adjusted_target, JS::GCPtr<EventTarget> related_target, TouchTargetList& touch_targets, bool slot_in_closed_tree)
{