diff --git a/Libraries/LibWeb/Bindings/MainThreadVM.cpp b/Libraries/LibWeb/Bindings/MainThreadVM.cpp index 66e4283bca5..2f56b3c0f12 100644 --- a/Libraries/LibWeb/Bindings/MainThreadVM.cpp +++ b/Libraries/LibWeb/Bindings/MainThreadVM.cpp @@ -822,12 +822,8 @@ void invoke_custom_element_reactions(Vector>& 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); }); } } diff --git a/Tests/LibWeb/Text/expected/wpt-import/custom-elements/cross-realm-callback-report-exception.txt b/Tests/LibWeb/Text/expected/wpt-import/custom-elements/cross-realm-callback-report-exception.txt new file mode 100644 index 00000000000..f8866dd7d64 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/custom-elements/cross-realm-callback-report-exception.txt @@ -0,0 +1,11 @@ +Harness status: OK + +Found 5 tests + +4 Pass +1 Fail +Fail constructor +Pass connectedCallback +Pass disconnectedCallback +Pass attributeChangedCallback +Pass adoptedCallback \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/custom-elements/cross-realm-callback-report-exception.html b/Tests/LibWeb/Text/input/wpt-import/custom-elements/cross-realm-callback-report-exception.html new file mode 100644 index 00000000000..f20481aa6cb --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/custom-elements/cross-realm-callback-report-exception.html @@ -0,0 +1,83 @@ + + +Exceptions raised in constructors / lifecycle callbacks are reported in their global objects + + + + + +