mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-05 10:42:51 +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:
parent
6047f1adcb
commit
521ed0e911
Notes:
sideshowbarker
2024-07-17 01:28:15 +09:00
Author: https://github.com/ADKaster
Commit: 521ed0e911
Pull-request: https://github.com/SerenityOS/serenity/pull/22675
Reviewed-by: https://github.com/shannonbooth ✅
41 changed files with 684 additions and 801 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue