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

LibWeb: Support interfaces with the [Global] extended attribute

These are treated differently as the interface members are placed on the
object itself, not its prototype.
As the object itself still needs to be hand-written code, and we can no
longer fully hide the gnarly generated code in the prototype object,
these now generate a 'mixin' class that is added to the actual object
through inheritance.

https://webidl.spec.whatwg.org/#Global
This commit is contained in:
Linus Groh 2023-03-05 15:50:56 +00:00
parent de83f5422d
commit 3316d247bf
5 changed files with 639 additions and 443 deletions

View file

@ -595,6 +595,7 @@ void Parser::parse_interface(Interface& interface)
interface.constructor_class = DeprecatedString::formatted("{}Constructor", interface.name);
interface.prototype_class = DeprecatedString::formatted("{}Prototype", interface.name);
interface.prototype_base_class = DeprecatedString::formatted("{}Prototype", interface.parent_name.is_empty() ? "Object" : interface.parent_name);
interface.global_mixin_class = DeprecatedString::formatted("{}GlobalMixin", interface.name);
consume_whitespace();
}