LibWeb: Make HTML::Environment a GC-allocated type

The only subclass was already GC-allocated, so let's hoist the JS::Cell
inheritance up one level. This ends up simplifying a bit of rather
dubious looking code where we were previously slicing ESOs.
This commit is contained in:
Andreas Kling
2024-04-24 11:09:36 +02:00
parent 7fa45c5fdf
commit f60d82eb85
9 changed files with 29 additions and 26 deletions

View File

@@ -263,13 +263,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> Document::create_and_initialize(
browsing_context->page(),
creation_url.value(),
move(realm_execution_context),
navigation_params.reserved_environment.visit(
// FIXME: Environment is virtual. We *really* shouldn't be slicing it here
[](Empty const&) -> Optional<HTML::Environment> { return {}; },
[](HTML::Environment* env) -> Optional<HTML::Environment> { if (env) return *env; return {}; },
[](JS::NonnullGCPtr<HTML::EnvironmentSettingsObject>) -> Optional<HTML::Environment> {
TODO();
}),
navigation_params.reserved_environment,
top_level_creation_url.value(),
top_level_origin);
}