mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb/HTML: Enable callbacks in postMessage deserialization
Interestingly, the spec has a note saying: > window.postMessage() performs StructuredSerializeWithTransfer on > its arguments, but is careful to do so immediately, inside the > synchronous portion of its algorithm. Thus it is able to use the > algorithms without needing to prepare to run script and prepare > to run a callback. But there is no note about the deserialization steps. In any case, we do need callbacks enabled here.
This commit is contained in:
@@ -1136,7 +1136,7 @@ WebIDL::ExceptionOr<void> Window::window_post_message_steps(JS::Value message, W
|
||||
auto& source = verify_cast<WindowProxy>(incumbent_settings.realm().global_environment().global_this_value());
|
||||
|
||||
// 4. Let deserializeRecord be StructuredDeserializeWithTransfer(serializeWithTransferResult, targetRealm).
|
||||
auto temporary_execution_context = TemporaryExecutionContext { target_realm };
|
||||
auto temporary_execution_context = TemporaryExecutionContext { target_realm, TemporaryExecutionContext::CallbacksEnabled::Yes };
|
||||
auto deserialize_record_or_error = structured_deserialize_with_transfer(vm(), serialize_with_transfer_result);
|
||||
|
||||
// If this throws an exception, catch it, fire an event named messageerror at targetWindow, using MessageEvent,
|
||||
|
||||
Reference in New Issue
Block a user