mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 03:57:15 +02:00
LibWeb: Implement whether scripting is disabled based on a realm
Instead of a settings object. This matches updates to the HTML spec as part of the shadow realm proposal, and begins the refactor of running scripts on a realm instead of a settings environment object. Some of the spec steps are slightly messy here (such as in MainThreadVM.cpp) as this partially implements the ShadowRealm changes but not other pieces which we have not implemented yet, such as preparing to run a script also being based on a realm instead of an environment. But this will be addressed in further commits.
This commit is contained in:
committed by
Andrew Kaster
parent
583a8f41d3
commit
aef18435fb
Notes:
github-actions[bot]
2024-11-01 19:16:37 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/aef18435fb3 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1932 Reviewed-by: https://github.com/ADKaster ✅
@@ -94,16 +94,12 @@ public:
|
||||
// https://fetch.spec.whatwg.org/#concept-fetch-group
|
||||
Vector<JS::NonnullGCPtr<Fetch::Infrastructure::FetchRecord>>& fetch_group() { return m_fetch_group; }
|
||||
|
||||
RunScriptDecision can_run_script();
|
||||
void prepare_to_run_script();
|
||||
void clean_up_after_running_script();
|
||||
|
||||
void prepare_to_run_callback();
|
||||
void clean_up_after_running_callback();
|
||||
|
||||
bool is_scripting_enabled() const;
|
||||
bool is_scripting_disabled() const;
|
||||
|
||||
bool module_type_allowed(StringView module_type) const;
|
||||
|
||||
void disallow_further_import_maps();
|
||||
@@ -139,6 +135,10 @@ private:
|
||||
bool m_discarded { false };
|
||||
};
|
||||
|
||||
RunScriptDecision can_run_script(JS::Realm const&);
|
||||
bool is_scripting_enabled(JS::Realm const&);
|
||||
bool is_scripting_disabled(JS::Realm const&);
|
||||
|
||||
EnvironmentSettingsObject& incumbent_settings_object();
|
||||
JS::Realm& incumbent_realm();
|
||||
JS::Object& incumbent_global_object();
|
||||
|
||||
Reference in New Issue
Block a user