diff --git a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp index 883e39e48e..8806e05fa3 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp @@ -68,6 +68,12 @@ DOMTokenList::DOMTokenList(Element const& associated_element, FlyString associat associated_attribute_changed(value); } +void DOMTokenList::visit_edges(Cell::Visitor& visitor) +{ + Base::visit_edges(visitor); + visitor.visit(m_associated_element); +} + // https://dom.spec.whatwg.org/#ref-for-domtokenlist%E2%91%A0%E2%91%A1 void DOMTokenList::associated_attribute_changed(StringView value) { diff --git a/Userland/Libraries/LibWeb/DOM/DOMTokenList.h b/Userland/Libraries/LibWeb/DOM/DOMTokenList.h index 3e56117537..40b3704d35 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.h +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.h @@ -45,10 +45,12 @@ public: private: DOMTokenList(Element const& associated_element, FlyString associated_attribute); + virtual void visit_edges(Cell::Visitor&) override; + WebIDL::ExceptionOr validate_token(StringView token) const; void run_update_steps(); - WeakPtr m_associated_element; + JS::NonnullGCPtr m_associated_element; FlyString m_associated_attribute; Vector m_token_set; };