diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 59c656201a2..627cd472e27 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -2814,6 +2814,8 @@ private: virtual JS::ThrowCompletionOr internal_set_prototype_of(JS::Object* prototype) override; virtual JS::ThrowCompletionOr internal_prevent_extensions() override; + virtual void visit_edges(Visitor&) override; + JS::NonnullGCPtr m_realm; // [[Realm]] }; )~~~"); @@ -2953,6 +2955,12 @@ JS::ThrowCompletionOr @named_properties_class@::internal_prevent_extension // Note: this keeps named properties object extensible by making [[PreventExtensions]] fail. return false; } + +void @named_properties_class@::visit_edges(Visitor& visitor) +{ + Base::visit_edges(visitor); + visitor.visit(m_realm); +} )~~~"); } diff --git a/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.cpp b/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.cpp index 754d7370d76..fb3d018fd97 100644 --- a/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.cpp +++ b/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.cpp @@ -57,6 +57,12 @@ JS_DEFINE_NATIVE_FUNCTION(KeyAlgorithm::name_getter) return JS::PrimitiveString::create(vm, name); } +void KeyAlgorithm::visit_edges(Visitor& visitor) +{ + Base::visit_edges(visitor); + visitor.visit(m_realm); +} + JS::NonnullGCPtr RsaKeyAlgorithm::create(JS::Realm& realm) { return realm.heap().allocate(realm, realm); @@ -143,11 +149,6 @@ JS_DEFINE_NATIVE_FUNCTION(EcKeyAlgorithm::named_curve_getter) return JS::PrimitiveString::create(vm, impl->named_curve()); } -void EcKeyAlgorithm::visit_edges(Visitor& visitor) -{ - Base::visit_edges(visitor); -} - JS::NonnullGCPtr RsaHashedKeyAlgorithm::create(JS::Realm& realm) { return realm.heap().allocate(realm, realm); diff --git a/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.h b/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.h index a51f5c3c406..27cd299472d 100644 --- a/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.h +++ b/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.h @@ -17,7 +17,7 @@ namespace Web::Crypto { // https://w3c.github.io/webcrypto/#key-algorithm-dictionary class KeyAlgorithm : public JS::Object { - JS_OBJECT(KeyAlgorithm, Object); + JS_OBJECT(KeyAlgorithm, JS::Object); JS_DECLARE_ALLOCATOR(KeyAlgorithm); public: @@ -33,6 +33,7 @@ protected: KeyAlgorithm(JS::Realm&); virtual void initialize(JS::Realm&) override; + virtual void visit_edges(Visitor&) override; private: JS_DECLARE_NATIVE_FUNCTION(name_getter); @@ -113,7 +114,6 @@ protected: EcKeyAlgorithm(JS::Realm&); virtual void initialize(JS::Realm&) override; - virtual void visit_edges(Visitor&) override; private: JS_DECLARE_NATIVE_FUNCTION(named_curve_getter); diff --git a/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp b/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp index 3f35835fabf..20883e57754 100644 --- a/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp @@ -513,4 +513,13 @@ void ViewportPaintable::recompute_selection_states() } } +void ViewportPaintable::visit_edges(Visitor& visitor) +{ + Base::visit_edges(visitor); + for (auto it : scroll_state) + visitor.visit(it.key); + for (auto it : clip_state) + visitor.visit(it.key); +} + } diff --git a/Userland/Libraries/LibWeb/Painting/ViewportPaintable.h b/Userland/Libraries/LibWeb/Painting/ViewportPaintable.h index 5f828bf129a..02a87b8a32b 100644 --- a/Userland/Libraries/LibWeb/Painting/ViewportPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/ViewportPaintable.h @@ -37,6 +37,8 @@ private: void build_stacking_context_tree(); explicit ViewportPaintable(Layout::Viewport const&); + + virtual void visit_edges(Visitor&) override; }; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp index d92ed02f362..ae6bd03be46 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp @@ -167,4 +167,11 @@ Optional SVGDecodedImageData::intrinsic_aspect_ratio() const return {}; } +void SVGDecodedImageData::SVGPageClient::visit_edges(Visitor& visitor) +{ + Base::visit_edges(visitor); + visitor.visit(m_host_page); + visitor.visit(m_svg_page); +} + } diff --git a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h index 3925c5f00ab..399641d6ecf 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h +++ b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h @@ -81,6 +81,8 @@ private: : m_host_page(host_page) { } + + virtual void visit_edges(Visitor&) override; }; }