mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb: Report exceptions when invoking intersection observer callback
This commit is contained in:
parent
7cacf5ca55
commit
7a41ab960c
Notes:
github-actions[bot]
2024-12-19 15:26:21 +00:00
Author: https://github.com/tcl3
Commit: 7a41ab960c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2739
Reviewed-by: https://github.com/shannonbooth
3 changed files with 38 additions and 3 deletions
|
@ -4009,9 +4009,8 @@ void Document::queue_intersection_observer_task()
|
|||
auto& callback = observer->callback();
|
||||
|
||||
// 5. Invoke callback with queue as the first argument, observer as the second argument, and observer as the callback this value. If this throws an exception, report the exception.
|
||||
auto completion = WebIDL::invoke_callback(callback, observer.ptr(), wrapped_queue, observer.ptr());
|
||||
if (completion.is_abrupt())
|
||||
HTML::report_exception(completion, realm);
|
||||
// NOTE: This does not follow the spec as written precisely, but this is the same thing we do elsewhere and there is a WPT test that relies on this.
|
||||
(void)WebIDL::invoke_callback(callback, observer.ptr(), WebIDL::ExceptionBehavior::Report, wrapped_queue, observer.ptr());
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue