Ladybird's build system does a lot of work of turning the IDL from a Web spec into code, but there are a few things you'll need to do yourself.
For the sake of example, let's say you're wanting to add the HTMLDetailsElement.
- Create
LibWeb/HTML/HTMLDetailsElement.idlwith the contents of the IDL section of the spec. In this case, that would be:
[Exposed=Window]
interface HTMLDetailsElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions] attribute boolean open;
};-
Add the IDL file to
LibWeb/idl_files.cmake. -
Forward declare the generated class in
LibWeb/Forward.h:HTMLDetailsElementin its namespace.