mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibWeb: Add virtual destructor to Environment
This makes it polymorphic and allows checking the subclass of an Environment with is<T>(). We also need to change the inheritance order so JS::Cell comes first for this to work. Unfortunately, I have no idea why that is. Co-Authored-By: Andreas Kling <kling@serenityos.org>
This commit is contained in:
parent
e40c8f550f
commit
93405b4aff
1 changed files with 4 additions and 2 deletions
|
@ -20,6 +20,8 @@ namespace Web::HTML {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#environment
|
||||
struct Environment {
|
||||
virtual ~Environment() = default;
|
||||
|
||||
// An id https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-id
|
||||
String id;
|
||||
|
||||
|
@ -53,8 +55,8 @@ enum class RunScriptDecision {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
|
||||
struct EnvironmentSettingsObject
|
||||
: public Environment
|
||||
, public JS::Cell {
|
||||
: public JS::Cell
|
||||
, public Environment {
|
||||
JS_CELL(EnvironmentSettingsObject, JS::Cell);
|
||||
|
||||
virtual ~EnvironmentSettingsObject() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue