From fe7d7f6f6b9956fc86481abcf68d6027663c8bd0 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sun, 22 Dec 2024 01:53:10 +1300 Subject: [PATCH] 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. --- Libraries/LibWeb/HTML/Window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/HTML/Window.cpp b/Libraries/LibWeb/HTML/Window.cpp index 850a5a8c80f..839d8f72453 100644 --- a/Libraries/LibWeb/HTML/Window.cpp +++ b/Libraries/LibWeb/HTML/Window.cpp @@ -1136,7 +1136,7 @@ WebIDL::ExceptionOr Window::window_post_message_steps(JS::Value message, W auto& source = verify_cast(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,