From b2f3ed8b5a9c1dc5d858a237325b3f335c8f468d Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Mon, 21 Oct 2024 13:35:24 +1300 Subject: [PATCH] LibWeb: Rename current settings object to 'current principal' Aligning the name with the the PR implementing the javascript shadow realm proposal into the web platform. This commit simply performs the rename before implementing the behaviour change. The actual change to the behaviour of the AO is not implemented in this commit to support 'synthetic' shadow realms as the surrounding infrastructure is not in place yet. Not all specs have a MR open to align with this proposed change to the HTML standard. But in this case we can just apply the same mechanical change everywhere. --- .../Libraries/LibWeb/Bindings/MainThreadVM.cpp | 10 ++++++---- Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp | 2 +- Userland/Libraries/LibWeb/Fetch/Response.cpp | 2 +- Userland/Libraries/LibWeb/FileAPI/BlobURLStore.cpp | 4 ++-- .../LibWeb/HTML/CrossOrigin/AbstractOperations.cpp | 14 ++++++++------ .../CrossOrigin/CrossOriginPropertyDescriptorMap.h | 6 +++--- .../LibWeb/HTML/Scripting/Environments.cpp | 2 +- .../Libraries/LibWeb/HTML/Scripting/Environments.h | 2 +- .../Libraries/LibWeb/HTML/Scripting/Fetching.cpp | 9 +++++---- .../Libraries/LibWeb/HTML/StructuredSerialize.cpp | 5 +++-- Userland/Libraries/LibWeb/HTML/Window.cpp | 5 +++-- Userland/Libraries/LibWeb/HTML/WindowProxy.cpp | 14 ++++++++------ Userland/Libraries/LibWeb/HTML/Worker.cpp | 5 +++-- .../Libraries/LibWeb/HTML/WorkerGlobalScope.cpp | 5 +++-- Userland/Libraries/LibWeb/Page/Page.cpp | 2 +- .../Libraries/LibWeb/WebAudio/BaseAudioContext.cpp | 2 +- 16 files changed, 50 insertions(+), 39 deletions(-) diff --git a/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp b/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp index 8e50e57a0d1..958f93079dd 100644 --- a/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp +++ b/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp @@ -124,6 +124,7 @@ ErrorOr initialize_main_thread_vm(HTML::EventLoop::Type type) // FIXME: Implement 8.1.5.2 HostEnsureCanCompileStrings(callerRealm, calleeRealm), https://html.spec.whatwg.org/multipage/webappapis.html#hostensurecancompilestrings(callerrealm,-calleerealm) // 8.1.5.3 HostPromiseRejectionTracker(promise, operation), https://html.spec.whatwg.org/multipage/webappapis.html#the-hostpromiserejectiontracker-implementation + // https://whatpr.org/html/9893/webappapis.html#the-hostpromiserejectiontracker-implementation s_main_thread_vm->host_promise_rejection_tracker = [](JS::Promise& promise, JS::Promise::RejectionOperation operation) { // 1. Let script be the running script. // The running script is the script in the [[HostDefined]] field in the ScriptOrModule component of the running JavaScript execution context. @@ -147,8 +148,8 @@ ErrorOr initialize_main_thread_vm(HTML::EventLoop::Type type) } // 3. Let settings object be the current settings object. - // 4. If script is not null, then set settings object to script's settings object. - auto& settings_object = script ? script->settings_object() : HTML::current_settings_object(); + // 4. If script is not null, then set settings object to script's principal settings object. + auto& settings_object = script ? script->settings_object() : HTML::current_principal_settings_object(); // 5. Let global be settingsObject's global object. auto* global_mixin = dynamic_cast(&settings_object.global_object()); @@ -414,12 +415,13 @@ ErrorOr initialize_main_thread_vm(HTML::EventLoop::Type type) }; // 8.1.6.7.3 HostLoadImportedModule(referrer, moduleRequest, loadState, payload), https://html.spec.whatwg.org/multipage/webappapis.html#hostloadimportedmodule + // https://whatpr.org/html/9893/webappapis.html#hostloadimportedmodule s_main_thread_vm->host_load_imported_module = [](JS::ImportedModuleReferrer referrer, JS::ModuleRequest const& module_request, JS::GCPtr load_state, JS::ImportedModulePayload payload) -> void { auto& vm = *s_main_thread_vm; auto& realm = *vm.current_realm(); - // 1. Let settingsObject be the current settings object. - Optional settings_object = HTML::current_settings_object(); + // 1. Let settingsObject be the current principal settings object. + Optional settings_object = HTML::current_principal_settings_object(); // FIXME: 2. If settingsObject's global object implements WorkletGlobalScope or ServiceWorkerGlobalScope and loadState is undefined, then: diff --git a/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp b/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp index 2b6bede35f3..5fdc33836a9 100644 --- a/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp +++ b/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp @@ -144,7 +144,7 @@ WebIDL::ExceptionOr DOMURL::revoke_object_url(JS::VM& vm, StringView url) auto origin = url_record.origin(); // 4. Let settings be the current settings object. - auto& settings = HTML::current_settings_object(); + auto& settings = HTML::current_principal_settings_object(); // 5. If origin is not same origin with settings’s origin, return. if (!origin.is_same_origin(settings.origin())) diff --git a/Userland/Libraries/LibWeb/Fetch/Response.cpp b/Userland/Libraries/LibWeb/Fetch/Response.cpp index 4acc5c24b87..1f74a9a41fa 100644 --- a/Userland/Libraries/LibWeb/Fetch/Response.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Response.cpp @@ -168,7 +168,7 @@ WebIDL::ExceptionOr> Response::redirect(JS::VM& vm, S auto& realm = *vm.current_realm(); // 1. Let parsedURL be the result of parsing url with current settings object’s API base URL. - auto api_base_url = HTML::current_settings_object().api_base_url(); + auto api_base_url = HTML::current_principal_settings_object().api_base_url(); auto parsed_url = DOMURL::parse(url, api_base_url); // 2. If parsedURL is failure, then throw a TypeError. diff --git a/Userland/Libraries/LibWeb/FileAPI/BlobURLStore.cpp b/Userland/Libraries/LibWeb/FileAPI/BlobURLStore.cpp index 9b2648aaaa0..41b7132faf5 100644 --- a/Userland/Libraries/LibWeb/FileAPI/BlobURLStore.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/BlobURLStore.cpp @@ -33,7 +33,7 @@ ErrorOr generate_new_blob_url() TRY(result.try_append("blob:"sv)); // 3. Let settings be the current settings object - auto& settings = HTML::current_settings_object(); + auto& settings = HTML::current_principal_settings_object(); // 4. Let origin be settings’s origin. auto origin = settings.origin(); @@ -69,7 +69,7 @@ ErrorOr add_entry_to_blob_url_store(JS::NonnullGCPtr object) auto url = TRY(generate_new_blob_url()); // 3. Let entry be a new blob URL entry consisting of object and the current settings object. - BlobURLEntry entry { object, HTML::current_settings_object() }; + BlobURLEntry entry { object, HTML::current_principal_settings_object() }; // 4. Set store[url] to entry. TRY(store.try_set(url, move(entry))); diff --git a/Userland/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp b/Userland/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp index e53ba2e649d..795c2d9f59f 100644 --- a/Userland/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp +++ b/Userland/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp @@ -81,23 +81,25 @@ JS::ThrowCompletionOr cross_origin_property_fallback(JS: return throw_completion(WebIDL::SecurityError::create(*vm.current_realm(), MUST(String::formatted("Can't access property '{}' on cross-origin object", property_key)))); } -// 7.2.3.3 IsPlatformObjectSameOrigin ( O ), https://html.spec.whatwg.org/multipage/browsers.html#isplatformobjectsameorigin-(-o-) +// 7.2.3.3 IsPlatformObjectSameOrigin ( O ), https://html.spec.whatwg.org/multipage/nav-history-apis.html#isplatformobjectsameorigin-(-o-) +// https://whatpr.org/html/9893/nav-history-apis.html#isplatformobjectsameorigin-(-o-) bool is_platform_object_same_origin(JS::Object const& object) { - // 1. Return true if the current settings object's origin is same origin-domain with O's relevant settings object's origin, and false otherwise. - return HTML::current_settings_object().origin().is_same_origin_domain(HTML::relevant_settings_object(object).origin()); + // 1. Return true if the current principal settings object's origin is same origin-domain with O's relevant settings object's origin, and false otherwise. + return HTML::current_principal_settings_object().origin().is_same_origin_domain(HTML::relevant_settings_object(object).origin()); } -// 7.2.3.4 CrossOriginGetOwnPropertyHelper ( O, P ), https://html.spec.whatwg.org/multipage/browsers.html#crossorigingetownpropertyhelper-(-o,-p-) +// 7.2.3.4 CrossOriginGetOwnPropertyHelper ( O, P ), https://html.spec.whatwg.org/multipage/nav-history-apis.html#crossorigingetownpropertyhelper-(-o,-p-) +// https://whatpr.org/html/9893/nav-history-apis.html#crossorigingetownpropertyhelper-(-o,-p-) Optional cross_origin_get_own_property_helper(Variant const& object, JS::PropertyKey const& property_key) { auto& realm = *Bindings::main_thread_vm().current_realm(); auto const* object_ptr = object.visit([](auto* o) { return static_cast(o); }); auto const object_const_variant = object.visit([](auto* o) { return Variant { o }; }); - // 1. Let crossOriginKey be a tuple consisting of the current settings object, O's relevant settings object, and P. + // 1. Let crossOriginKey be a tuple consisting of the current principal settings object, O's relevant settings object, and P. auto cross_origin_key = CrossOriginKey { - .current_settings_object = (FlatPtr)&HTML::current_settings_object(), + .current_principal_settings_object = (FlatPtr)&HTML::current_principal_settings_object(), .relevant_settings_object = (FlatPtr)&HTML::relevant_settings_object(*object_ptr), .property_key = property_key, }; diff --git a/Userland/Libraries/LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h b/Userland/Libraries/LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h index 5b44062c0af..9a735c2fe76 100644 --- a/Userland/Libraries/LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h +++ b/Userland/Libraries/LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h @@ -22,7 +22,7 @@ struct CrossOriginProperty { }; struct CrossOriginKey { - FlatPtr current_settings_object; + FlatPtr current_principal_settings_object; FlatPtr relevant_settings_object; JS::PropertyKey property_key; }; @@ -39,12 +39,12 @@ struct Traits : public DefaultTraits::hash(key.property_key), - pair_int_hash(ptr_hash(key.current_settings_object), ptr_hash(key.relevant_settings_object))); + pair_int_hash(ptr_hash(key.current_principal_settings_object), ptr_hash(key.relevant_settings_object))); } static bool equals(Web::HTML::CrossOriginKey const& a, Web::HTML::CrossOriginKey const& b) { - return a.current_settings_object == b.current_settings_object + return a.current_principal_settings_object == b.current_principal_settings_object && a.relevant_settings_object == b.relevant_settings_object && Traits::equals(a.property_key, b.property_key); } diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp index 7becdf0d7d6..78c11fb5113 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp @@ -301,7 +301,7 @@ JS::Object& incumbent_global_object() } // https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object -EnvironmentSettingsObject& current_settings_object() +EnvironmentSettingsObject& current_principal_settings_object() { auto& event_loop = HTML::main_thread_event_loop(); auto& vm = event_loop.vm(); diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h index d2ef0104945..0bb0a2cf6b6 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h +++ b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h @@ -142,7 +142,7 @@ private: EnvironmentSettingsObject& incumbent_settings_object(); JS::Realm& incumbent_realm(); JS::Object& incumbent_global_object(); -EnvironmentSettingsObject& current_settings_object(); +EnvironmentSettingsObject& current_principal_settings_object(); JS::Object& current_global_object(); JS::Realm& relevant_realm(JS::Object const&); EnvironmentSettingsObject& relevant_settings_object(JS::Object const&); diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp index ea09c7631a1..f9f0387c52a 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp @@ -81,6 +81,7 @@ ByteString module_type_from_module_request(JS::ModuleRequest const& module_reque } // https://html.spec.whatwg.org/multipage/webappapis.html#resolve-a-module-specifier +// https://whatpr.org/html/9893/webappapis.html#resolve-a-module-specifier WebIDL::ExceptionOr resolve_module_specifier(Optional referring_script, ByteString const& specifier) { // 1. Let settingsObject and baseURL be null. @@ -97,11 +98,11 @@ WebIDL::ExceptionOr resolve_module_specifier(Optional referri } // 3. Otherwise: else { - // 1. Assert: there is a current settings object. - // NOTE: This is handled by the current_settings_object() accessor. + // 1. Assert: there is a current principal settings object. + // NOTE: This is handled by the current_principal_settings_object() accessor. - // 2. Set settingsObject to the current settings object. - settings_object = current_settings_object(); + // 2. Set settingsObject to the current principal settings object. + settings_object = current_principal_settings_object(); // 3. Set baseURL to settingsObject's API base URL. base_url = settings_object->api_base_url(); diff --git a/Userland/Libraries/LibWeb/HTML/StructuredSerialize.cpp b/Userland/Libraries/LibWeb/HTML/StructuredSerialize.cpp index 010d0a0e822..fcf08de15ff 100644 --- a/Userland/Libraries/LibWeb/HTML/StructuredSerialize.cpp +++ b/Userland/Libraries/LibWeb/HTML/StructuredSerialize.cpp @@ -157,6 +157,7 @@ public: } // https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal + // https://whatpr.org/html/9893/structured-data.html#structuredserializeinternal WebIDL::ExceptionOr serialize(JS::Value value) { // 2. If memory[value] exists, then return memory[value]. @@ -565,10 +566,10 @@ WebIDL::ExceptionOr serialize_array_buffer(JS::VM& vm, Vector& vector // FIXME: 1. If IsSharedArrayBuffer(value) is true, then: if (false) { - // 1. If the current settings object's cross-origin isolated capability is false, then throw a "DataCloneError" DOMException. + // 1. If the current principal settings object's cross-origin isolated capability is false, then throw a "DataCloneError" DOMException. // NOTE: This check is only needed when serializing (and not when deserializing) as the cross-origin isolated capability cannot change // over time and a SharedArrayBuffer cannot leave an agent cluster. - if (current_settings_object().cross_origin_isolated_capability() == CanUseCrossOriginIsolatedAPIs::No) + if (current_principal_settings_object().cross_origin_isolated_capability() == CanUseCrossOriginIsolatedAPIs::No) return WebIDL::DataCloneError::create(*vm.current_realm(), "Cannot serialize SharedArrayBuffer when cross-origin isolated"_string); // 2. If forStorage is true, then throw a "DataCloneError" DOMException. diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index cb58fb65a93..daa10a7dc80 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -994,6 +994,7 @@ JS::GCPtr Window::parent() const } // https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-frameelement +// https://whatpr.org/html/9893/nav-history-apis.html#dom-frameelement JS::GCPtr Window::frame_element() const { // 1. Let current be this's node navigable. @@ -1010,8 +1011,8 @@ JS::GCPtr Window::frame_element() const if (!container) return {}; - // 5. If container's node document's origin is not same origin-domain with the current settings object's origin, then return null. - if (!container->document().origin().is_same_origin_domain(current_settings_object().origin())) + // 5. If container's node document's origin is not same origin-domain with the current principal settings object's origin, then return null. + if (!container->document().origin().is_same_origin_domain(current_principal_settings_object().origin())) return {}; // 6. Return container. diff --git a/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp b/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp index 7d1f9f1035f..059f322270b 100644 --- a/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp +++ b/Userland/Libraries/LibWeb/HTML/WindowProxy.cpp @@ -152,15 +152,16 @@ JS::ThrowCompletionOr WindowProxy::internal_define_own_property(JS::Proper return throw_completion(WebIDL::SecurityError::create(m_window->realm(), MUST(String::formatted("Can't define property '{}' on cross-origin object", property_key)))); } -// 7.4.7 [[Get]] ( P, Receiver ), https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-get +// 7.4.7 [[Get]] ( P, Receiver ), https://html.spec.whatwg.org/multipage/nav-history-apis.html#windowproxy-get +// https://html.spec.whatwg.org/multipage/nav-history-apis.html#windowproxy-get JS::ThrowCompletionOr WindowProxy::internal_get(JS::PropertyKey const& property_key, JS::Value receiver, JS::CacheablePropertyMetadata*, PropertyLookupPhase) const { auto& vm = this->vm(); // 1. Let W be the value of the [[Window]] internal slot of this. - // 2. Check if an access between two browsing contexts should be reported, given the current global object's browsing context, W's browsing context, P, and the current settings object. - check_if_access_between_two_browsing_contexts_should_be_reported(*verify_cast(current_global_object()).browsing_context(), m_window->browsing_context(), property_key, current_settings_object()); + // 2. Check if an access between two browsing contexts should be reported, given the current global object's browsing context, W's browsing context, P, and the current principal settings object. + check_if_access_between_two_browsing_contexts_should_be_reported(*verify_cast(current_global_object()).browsing_context(), m_window->browsing_context(), property_key, current_principal_settings_object()); // 3. If IsPlatformObjectSameOrigin(W) is true, then return ? OrdinaryGet(this, P, Receiver). // NOTE: this is passed rather than W as OrdinaryGet and CrossOriginGet will invoke the [[GetOwnProperty]] internal method. @@ -172,15 +173,16 @@ JS::ThrowCompletionOr WindowProxy::internal_get(JS::PropertyKey const return cross_origin_get(vm, *this, property_key, receiver); } -// 7.4.8 [[Set]] ( P, V, Receiver ), https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-set +// 7.4.8 [[Set]] ( P, V, Receiver ), https://html.spec.whatwg.org/multipage/nav-history-apis.html#windowproxy-set +// https://html.spec.whatwg.org/multipage/nav-history-apis.html#windowproxy-set JS::ThrowCompletionOr WindowProxy::internal_set(JS::PropertyKey const& property_key, JS::Value value, JS::Value receiver, JS::CacheablePropertyMetadata*) { auto& vm = this->vm(); // 1. Let W be the value of the [[Window]] internal slot of this. - // 2. Check if an access between two browsing contexts should be reported, given the current global object's browsing context, W's browsing context, P, and the current settings object. - check_if_access_between_two_browsing_contexts_should_be_reported(*verify_cast(current_global_object()).browsing_context(), m_window->browsing_context(), property_key, current_settings_object()); + // 2. Check if an access between two browsing contexts should be reported, given the current global object's browsing context, W's browsing context, P, and the current principal settings object. + check_if_access_between_two_browsing_contexts_should_be_reported(*verify_cast(current_global_object()).browsing_context(), m_window->browsing_context(), property_key, current_principal_settings_object()); // 3. If IsPlatformObjectSameOrigin(W) is true, then: if (is_platform_object_same_origin(*m_window)) { diff --git a/Userland/Libraries/LibWeb/HTML/Worker.cpp b/Userland/Libraries/LibWeb/HTML/Worker.cpp index f79ee851d11..8f4ea71e296 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.cpp +++ b/Userland/Libraries/LibWeb/HTML/Worker.cpp @@ -40,6 +40,7 @@ void Worker::visit_edges(Cell::Visitor& visitor) } // https://html.spec.whatwg.org/multipage/workers.html#dom-worker +// https://whatpr.org/html/9893/workers.html#dom-worker WebIDL::ExceptionOr> Worker::create(String const& script_url, WorkerOptions const& options, DOM::Document& document) { dbgln_if(WEB_WORKER_DEBUG, "WebWorker: Creating worker with script_url = {}", script_url); @@ -55,8 +56,8 @@ WebIDL::ExceptionOr> Worker::create(String const& scrip // a policy decision (e.g. if the user agent is configured to not allow the page to start dedicated workers). // Technically not a fixme if our policy is not to throw errors :^) - // 2. Let outside settings be the current settings object. - auto& outside_settings = current_settings_object(); + // 2. Let outside settings be the current principal settings object. + auto& outside_settings = current_principal_settings_object(); // 3. Parse the scriptURL argument relative to outside settings. auto url = document.parse_url(script_url); diff --git a/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp b/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp index 1e798c19783..088e2486036 100644 --- a/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp +++ b/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp @@ -79,6 +79,7 @@ void WorkerGlobalScope::close_a_worker() } // https://html.spec.whatwg.org/multipage/workers.html#importing-scripts-and-libraries +// https://whatpr.org/html/9893/workers.html#importing-scripts-and-libraries WebIDL::ExceptionOr WorkerGlobalScope::import_scripts(Vector const& urls, PerformTheFetchHook perform_fetch) { // The algorithm may optionally be customized by supplying custom perform the fetch hooks, @@ -87,8 +88,8 @@ WebIDL::ExceptionOr WorkerGlobalScope::import_scripts(Vector const // FIXME: 1. If worker global scope's type is "module", throw a TypeError exception. - // 2. Let settings object be the current settings object. - auto& settings_object = HTML::current_settings_object(); + // 2. Let settings object be the current principal settings object. + auto& settings_object = HTML::current_principal_settings_object(); // 3. If urls is empty, return. if (urls.is_empty()) diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp index 60602a3c84e..a94efcf11fd 100644 --- a/Userland/Libraries/LibWeb/Page/Page.cpp +++ b/Userland/Libraries/LibWeb/Page/Page.cpp @@ -264,7 +264,7 @@ void Page::did_update_window_rect() template static ResponseType spin_event_loop_until_dialog_closed(PageClient& client, Optional& response, SourceLocation location = SourceLocation::current()) { - auto& event_loop = Web::HTML::current_settings_object().responsible_event_loop(); + auto& event_loop = Web::HTML::current_principal_settings_object().responsible_event_loop(); ScopeGuard guard { [&] { event_loop.set_execution_paused(false); } }; event_loop.set_execution_paused(true); diff --git a/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp b/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp index f1dc22884e7..9eda7e8ddcf 100644 --- a/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp +++ b/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp @@ -123,7 +123,7 @@ WebIDL::ExceptionOr BaseAudioContext::verify_audio_options_inside_nominal_ void BaseAudioContext::queue_a_media_element_task(JS::NonnullGCPtr> steps) { - auto task = HTML::Task::create(vm(), m_media_element_event_task_source.source, HTML::current_settings_object().responsible_document(), steps); + auto task = HTML::Task::create(vm(), m_media_element_event_task_source.source, HTML::current_principal_settings_object().responsible_document(), steps); HTML::main_thread_event_loop().task_queue().add(task); }