From 738e603c2f936f5de1ef188c2178a70752a35e55 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Mon, 21 Oct 2024 13:58:29 +1300 Subject: [PATCH] LibWeb: Implement current_principal_global_object to shadow realm spec No functional change, as it is using the yet to be fully implemented 'current_principal_realm'. --- Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp index bab9131cf58..a2d4e770e56 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp @@ -319,13 +319,11 @@ EnvironmentSettingsObject& current_principal_settings_object() } // https://html.spec.whatwg.org/multipage/webappapis.html#current-global-object +// https://whatpr.org/html/9893/webappapis.html#current-principal-global-object JS::Object& current_principal_global_object() { - auto& event_loop = HTML::main_thread_event_loop(); - auto& vm = event_loop.vm(); - - // Similarly, the current global object is the global object of the current Realm Record. - return vm.current_realm()->global_object(); + // Similarly, the current principal global object is the global object of the current principal realm. + return current_principal_realm().global_object(); } // https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm