mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-13 10:26:37 +02:00
LibWeb/Bindings: Generate struct definitions from IDL dictionaries
Previously we were inconsistent by generating code for enum definitions but not generating code for dictionaries. With future changes to the IDL generator to expose helpers to convert to and from IDL values this produced circular depdendencies. To solve this problem, also generate the dictionary definitions in bindings headers.
This commit is contained in:
committed by
Andreas Kling
parent
7ad946c669
commit
5adfd1c43a
Notes:
github-actions[bot]
2026-05-09 08:51:32 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/5adfd1c43a8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/9094 Reviewed-by: https://github.com/AtkinsSJ
@@ -86,7 +86,7 @@ void HTMLDialogElement::queue_a_dialog_toggle_event_task(AK::String old_state, A
|
||||
auto task_id = queue_an_element_task(Task::Source::DOMManipulation, [this, old_state, new_state = move(new_state), source]() {
|
||||
// 1. Fire an event named toggle at element, using ToggleEvent, with the oldState attribute initialized to
|
||||
// oldState, the newState attribute initialized to newState, and the source attribute initialized to source.
|
||||
ToggleEventInit event_init {};
|
||||
Bindings::ToggleEventInit event_init {};
|
||||
event_init.old_state = move(old_state);
|
||||
event_init.new_state = move(new_state);
|
||||
event_init.source = source;
|
||||
@@ -118,7 +118,7 @@ WebIDL::ExceptionOr<void> HTMLDialogElement::show()
|
||||
// 3. If the result of firing an event named beforetoggle, using ToggleEvent,
|
||||
// with the cancelable attribute initialized to true, the oldState attribute initialized to "closed",
|
||||
// and the newState attribute initialized to "open" at this is false, then return.
|
||||
ToggleEventInit event_init {};
|
||||
Bindings::ToggleEventInit event_init {};
|
||||
event_init.cancelable = true;
|
||||
event_init.old_state = "closed"_string;
|
||||
event_init.new_state = "open"_string;
|
||||
@@ -201,7 +201,7 @@ WebIDL::ExceptionOr<void> HTMLDialogElement::show_a_modal_dialog(HTMLDialogEleme
|
||||
// with the cancelable attribute initialized to true, the oldState attribute initialized to "closed",
|
||||
// the newState attribute initialized to "open", and the source attribute initialized to source at subject is
|
||||
// false, then return.
|
||||
ToggleEventInit event_init {};
|
||||
Bindings::ToggleEventInit event_init {};
|
||||
event_init.cancelable = true;
|
||||
event_init.old_state = "closed"_string;
|
||||
event_init.new_state = "open"_string;
|
||||
@@ -336,7 +336,7 @@ void HTMLDialogElement::close_the_dialog(Optional<String> result, GC::Ptr<DOM::E
|
||||
|
||||
// 2. Fire an event named beforetoggle, using ToggleEvent, with the oldState attribute initialized to "open", the
|
||||
// newState attribute initialized to "closed", and the source attribute initialized to source at subject.
|
||||
ToggleEventInit event_init {};
|
||||
Bindings::ToggleEventInit event_init {};
|
||||
event_init.old_state = "open"_string;
|
||||
event_init.new_state = "closed"_string;
|
||||
event_init.source = source;
|
||||
|
||||
Reference in New Issue
Block a user