LibWeb+LibJS: Let JS::Realm::HostDefined objects mark things during GC

This allows us to mark the HTML::Window from our window environment
settings object.
This commit is contained in:
Andreas Kling 2022-09-01 21:22:02 +02:00
parent 2ff7e37048
commit abfb73f2e7
Notes: sideshowbarker 2024-07-17 20:33:50 +09:00
4 changed files with 18 additions and 3 deletions

View file

@ -16,6 +16,14 @@ WindowEnvironmentSettingsObject::WindowEnvironmentSettingsObject(Window& window,
{
}
WindowEnvironmentSettingsObject::~WindowEnvironmentSettingsObject() = default;
void WindowEnvironmentSettingsObject::visit_edges(JS::Cell::Visitor& visitor)
{
EnvironmentSettingsObject::visit_edges(visitor);
visitor.visit(m_window.ptr());
}
// https://html.spec.whatwg.org/multipage/window-object.html#set-up-a-window-environment-settings-object
void WindowEnvironmentSettingsObject::setup(AK::URL const& creation_url, NonnullOwnPtr<JS::ExecutionContext> execution_context, Optional<Environment> reserved_environment, AK::URL top_level_creation_url, Origin top_level_origin)
{