diff options
author | Andrew Kaster <akaster@serenityos.org> | 2022-10-08 17:14:30 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-10-09 10:14:57 +0200 |
commit | a74251ca91b9e4fc242420ac2a58387714b123d0 (patch) | |
tree | ed2962094fc1ff4f3baf89c8e10f5e44eb319440 /Documentation/Browser/AddNewIDLFile.md | |
parent | a838cf2725022d2457271b2a6f968168cfbf5b17 (diff) | |
download | serenity-a74251ca91b9e4fc242420ac2a58387714b123d0.zip |
Documentation: Update AddNewIDLFile for GC and Exposed changes
Diffstat (limited to 'Documentation/Browser/AddNewIDLFile.md')
-rw-r--r-- | Documentation/Browser/AddNewIDLFile.md | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/Documentation/Browser/AddNewIDLFile.md b/Documentation/Browser/AddNewIDLFile.md index 7f9609d5d8..512a3f5194 100644 --- a/Documentation/Browser/AddNewIDLFile.md +++ b/Documentation/Browser/AddNewIDLFile.md @@ -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. |