mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
Documentation: Update AddNewIDLFile for GC and Exposed changes
This commit is contained in:
parent
a838cf2725
commit
a74251ca91
Notes:
sideshowbarker
2024-07-18 08:59:31 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/a74251ca91 Pull-request: https://github.com/SerenityOS/serenity/pull/15520
1 changed files with 3 additions and 13 deletions
|
@ -23,20 +23,10 @@ interface CSSRule {
|
|||
};
|
||||
```
|
||||
|
||||
3. If the IDL starts with `[Exposed=Window]`, add the following to [`LibWeb/Bindings/WindowObjectHelper.h`](../../Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h):
|
||||
- `#include <LibWeb/Bindings/HTMLDetailsElementConstructor.h>` and
|
||||
- `#include <LibWeb/Bindings/HTMLDetailsElementPrototype.h>` to the includes list.
|
||||
- `ADD_WINDOW_OBJECT_INTERFACE(HTMLDetailsElement) \` to the macro at the bottom.
|
||||
3. Add a `libweb_js_bindings(HTML/HTMLDetailsElement)` call to [`LibWeb/idl_files.cmake`](../../Userland/Libraries/LibWeb/idl_files.cmake)
|
||||
|
||||
4. Add a `libweb_js_bindings(HTML/HTMLDetailsElement)` call to [`LibWeb/idl_files.cmake`](../../Userland/Libraries/LibWeb/idl_files.cmake)
|
||||
|
||||
5. Forward declare the generated classes in [`LibWeb/Forward.h`](../../Userland/Libraries/LibWeb/Forward.h):
|
||||
4. Forward declare the generated class in [`LibWeb/Forward.h`](../../Userland/Libraries/LibWeb/Forward.h):
|
||||
- `HTMLDetailsElement` in its namespace.
|
||||
- `HTMLDetailsElementWrapper` in the `Web::Bindings` namespace.
|
||||
|
||||
6. The C++ class equivalent of the IDL interface has a few requirements:
|
||||
- It must inherit from `public RefCounted<HTMLDetailsElement>` and `public Bindings::Wrappable`
|
||||
- It must have a public `using WrapperType = Bindings::HTMLDetailsElementWrapper;`
|
||||
|
||||
8. If your type isn't an Event or Element, you will need to add it to [`is_wrappable_type()`](../../Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp)
|
||||
5. If your type isn't an Event or Element, you will need to add it to [`is_platform_object()`](../../Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp)
|
||||
so that it can be accepted as an IDL parameter, attribute or return type.
|
||||
|
|
Loading…
Reference in a new issue