1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

LibWeb: Restore proper functionality of legacy platform objects

With the GC heap conversion, the functionality of legacy platform
objects was broken. This is because the generated implementation of one
of them was used for all of them, removing functionality such as
deletion.

This re-adds all functionality, where questions such as "does the
object support indexed properties?" is instead answered by virtual
functions instead of by the IDL generator checking the presence of
certain keywords/attributes.
This commit is contained in:
Luke Wilde 2023-02-28 00:05:39 +00:00 committed by Andreas Kling
parent 7e76a51cb0
commit 54f58e2662
23 changed files with 450 additions and 132 deletions

View file

@ -130,7 +130,7 @@ bool HTMLCollection::is_supported_property_index(u32 index) const
return index < elements.size();
}
JS::Value HTMLCollection::item_value(size_t index) const
WebIDL::ExceptionOr<JS::Value> HTMLCollection::item_value(size_t index) const
{
auto* element = item(index);
if (!element)
@ -138,7 +138,7 @@ JS::Value HTMLCollection::item_value(size_t index) const
return const_cast<Element*>(element);
}
JS::Value HTMLCollection::named_item_value(DeprecatedFlyString const& index) const
WebIDL::ExceptionOr<JS::Value> HTMLCollection::named_item_value(DeprecatedFlyString const& index) const
{
auto* element = named_item(index);
if (!element)