
The environment settings object is effectively the context a piece of script is running under, for example, it contains the origin, responsible document, realm, global object and event loop for the current context. This effectively replaces ScriptExecutionContext, but it cannot be removed in this commit as EventTarget still depends on it. https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
32 lines
1 KiB
C++
32 lines
1 KiB
C++
/*
|
|
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/DOM/Window.h>
|
|
#include <LibWeb/HTML/Scripting/Environments.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
class WindowEnvironmentSettingsObject final : public EnvironmentSettingsObject {
|
|
public:
|
|
static void setup(AK::URL& creation_url, JS::ExecutionContext& execution_context /* FIXME: null or an environment reservedEnvironment, a URL topLevelCreationURL, and an origin topLevelOrigin */);
|
|
|
|
virtual ~WindowEnvironmentSettingsObject() override = default;
|
|
|
|
virtual RefPtr<DOM::Document> responsible_document() override;
|
|
virtual String api_url_character_encoding() override;
|
|
virtual AK::URL api_base_url() override;
|
|
virtual Origin origin() override;
|
|
virtual CanUseCrossOriginIsolatedAPIs cross_origin_isolated_capability() override;
|
|
|
|
private:
|
|
WindowEnvironmentSettingsObject(DOM::Window&, JS::ExecutionContext& execution_context);
|
|
|
|
NonnullRefPtr<DOM::Window> m_window;
|
|
};
|
|
|
|
}
|