mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-11 13:42:52 +00:00
LibWeb: Make CallbackType take a realm instead of settings object
In line with the ShadowRealm proposal changes in the WebIDL spec: webidl#1437 and supporting changes in HTML spec. This is required for ShadowRealms as they have no relevant settings object on the shadow realm, so fixes a crash in the QueueingStrategy test in this commit.
This commit is contained in:
parent
d527c5df5d
commit
d6bcd3fb0b
Notes:
github-actions[bot]
2024-11-21 01:10:31 +00:00
Author: https://github.com/shannonbooth
Commit: d6bcd3fb0b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2416
Reviewed-by: https://github.com/ADKaster ✅
15 changed files with 56 additions and 36 deletions
|
@ -167,9 +167,8 @@ JS::Completion call_user_object_operation(WebIDL::CallbackType& callback, String
|
|||
// 4. Let relevant realm be O’s associated Realm.
|
||||
auto& relevant_realm = object->shape().realm();
|
||||
|
||||
// FIXME: We should get the realm directly from the callback context.
|
||||
// 5. Let stored realm be value’s callback context.
|
||||
auto& stored_realm = callback.callback_context->realm();
|
||||
auto& stored_realm = callback.callback_context;
|
||||
|
||||
// 6. Prepare to run script with relevant realm.
|
||||
HTML::prepare_to_run_script(relevant_realm);
|
||||
|
@ -252,9 +251,8 @@ JS::Completion invoke_callback(WebIDL::CallbackType& callback, Optional<JS::Valu
|
|||
// 5. Let relevant realm be F’s associated Realm.
|
||||
auto& relevant_realm = function_object->shape().realm();
|
||||
|
||||
// FIXME: We should get the realm directly from the callback context.
|
||||
// 6. Let stored realm be value’s callback context.
|
||||
auto& stored_realm = callback.callback_context->realm();
|
||||
auto& stored_realm = callback.callback_context;
|
||||
|
||||
// 8. Prepare to run script with relevant realm.
|
||||
HTML::prepare_to_run_script(relevant_realm);
|
||||
|
@ -297,9 +295,8 @@ JS::Completion construct(WebIDL::CallbackType& callback, GC::MarkedVector<JS::Va
|
|||
if (!JS::Value(function_object).is_constructor())
|
||||
return relevant_realm.vm().template throw_completion<JS::TypeError>(JS::ErrorType::NotAConstructor, JS::Value(function_object).to_string_without_side_effects());
|
||||
|
||||
// FIXME: We should get the realm directly from the callback context.
|
||||
// 4. Let stored realm be callable’s callback context.
|
||||
auto& stored_realm = callback.callback_context->realm();
|
||||
auto& stored_realm = callback.callback_context;
|
||||
|
||||
// 5. Prepare to run script with relevant realm.
|
||||
HTML::prepare_to_run_script(relevant_realm);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue