LibWeb: Unify WebIDL C++ type generation

Represent WebIDL C++ types with a single CppType model that tracks
nullability, optional presence, and contained storage.

GC-like values now use GC::Ref/GC::Ptr directly, while containers choose
"plain", "Root", or "Conservative" container types depending on what
they contain. For example, sequence<Element> becomes a RootVector of
GC::Ref values, while sequence<SomeDictionary> becomes a
ConservativeVector only when the dictionary contains GC-like values.
This moves the generated bindings away from wrapping GC values in
GC::Root by default.

This has broad fallout as the types passed to interfaces for GC
objects changes almost fully across the board.
This commit is contained in:
Shannon Booth 2026-05-20 20:58:46 +02:00 committed by Shannon Booth
parent aa0eb13a89
commit 637fd51595
Notes: github-actions[bot] 2026-05-23 16:27:03 +00:00
207 changed files with 1126 additions and 1255 deletions

View file

@ -764,7 +764,7 @@ WebIDL::ExceptionOr<void> HTMLScriptElement::set_src(TrustedTypes::TrustedScript
}
// https://w3c.github.io/trusted-types/dist/spec/#the-textContent-idl-attribute
Variant<GC::Root<TrustedTypes::TrustedScript>, Utf16String, Empty> HTMLScriptElement::text_content() const
Variant<GC::Ref<TrustedTypes::TrustedScript>, Utf16String, Empty> HTMLScriptElement::text_content() const
{
// 1. Return the result of running get text content with this.
return descendant_text_content();