mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
LibWeb: Delete LegacyPlatformObject and move behavior to PlatformObject
We have two known PlatformObjects that need to implement some of the behavior of LegacyPlatformObjects to date: Window, and HTMLFormElement. To make this not require double (or virtual) inheritance of PlatformObject, move the behavior of LegacyPlatformObject into PlatformObject. The selection of LegacyPlatformObject behavior is done with a new bitfield of feature flags instead of a dozen virtual functions that return bool. This change simplifies every class involved in the diff with the notable exception of Window, which now needs some ugly const casts to implement named property access.
This commit is contained in:
committed by
Andreas Kling
parent
6047f1adcb
commit
521ed0e911
@@ -15,8 +15,13 @@ namespace Web::HTML {
|
||||
JS_DEFINE_ALLOCATOR(PluginArray);
|
||||
|
||||
PluginArray::PluginArray(JS::Realm& realm)
|
||||
: Bindings::LegacyPlatformObject(realm)
|
||||
: Bindings::PlatformObject(realm)
|
||||
{
|
||||
m_legacy_platform_object_flags = LegacyPlatformObjectFlags {
|
||||
.supports_indexed_properties = true,
|
||||
.supports_named_properties = true,
|
||||
.has_legacy_unenumerable_named_properties_interface_extended_attribute = true,
|
||||
};
|
||||
}
|
||||
|
||||
PluginArray::~PluginArray() = default;
|
||||
|
||||
Reference in New Issue
Block a user