mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Report exceptions when invoking custom element reactions
This commit is contained in:
parent
d8511e39c9
commit
7cacf5ca55
Notes:
github-actions[bot]
2024-12-19 15:26:29 +00:00
Author: https://github.com/tcl3
Commit: 7cacf5ca55
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2739
Reviewed-by: https://github.com/shannonbooth
3 changed files with 96 additions and 6 deletions
|
@ -822,12 +822,8 @@ void invoke_custom_element_reactions(Vector<GC::Root<DOM::Element>>& element_que
|
|||
},
|
||||
[&](DOM::CustomElementCallbackReaction& custom_element_callback_reaction) -> void {
|
||||
// -> callback reaction
|
||||
// Invoke reaction's callback function with reaction's arguments, and with element as the callback this value.
|
||||
auto result = WebIDL::invoke_callback(*custom_element_callback_reaction.callback, element.ptr(), custom_element_callback_reaction.arguments);
|
||||
// FIXME: The error from CustomElementCallbackReaction is supposed
|
||||
// to use the new steps for IDL callback error reporting
|
||||
if (result.is_abrupt())
|
||||
HTML::report_exception(result, element->realm());
|
||||
// Invoke reaction's callback function with reaction's arguments and "report", and callback this value set to element.
|
||||
(void)WebIDL::invoke_callback(*custom_element_callback_reaction.callback, element.ptr(), WebIDL::ExceptionBehavior::Report, custom_element_callback_reaction.arguments);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue