1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibWeb: Make StyleSheet and CSSStyleSheet GC-allocated

This commit is contained in:
Andreas Kling 2022-08-07 13:14:54 +02:00
parent 0fe923e355
commit 5d60212076
21 changed files with 166 additions and 96 deletions

View file

@ -73,9 +73,24 @@ static StringView sequence_storage_type_to_cpp_storage_type_name(SequenceStorage
}
}
static bool impl_is_wrapper(Type const& type)
{
if (type.name == "StyleSheet"sv)
return true;
if (type.name == "CSSStyleSheet"sv)
return true;
return false;
}
CppType idl_type_name_to_cpp_type(Type const& type, Interface const& interface)
{
if (is_wrappable_type(type)) {
if (impl_is_wrapper(type)) {
return { .name = String::formatted("JS::Handle<{}>", type.name), .sequence_storage_type = SequenceStorageType::MarkedVector };
}
if (type.nullable)
return { .name = String::formatted("RefPtr<{}>", type.name), .sequence_storage_type = SequenceStorageType::Vector };