diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-02-07 21:04:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-07 20:04:31 +0000 |
commit | e227e0913bf1728c2fead8ae49c7511ddaabe996 (patch) | |
tree | 17164cbc788675ffaf63986e126a855b75fb3962 /components | |
parent | 1ba5d0e0936e6ab46a29c25b8fac9b583e608eb8 (diff) | |
download | servo-e227e0913bf1728c2fead8ae49c7511ddaabe996.tar.gz servo-e227e0913bf1728c2fead8ae49c7511ddaabe996.zip |
servoshell: Move `headless` setting to ServoShellPreferences (#35377)
This is only used in servoshell, even though it was plumbed through
script previously. It's just about how the `RenderingContext` is set up,
which is something managed entirely outside of servo itself.
In addition, make the name of `servo_shell_preferences` in `app.rs` more
consistent with the rest of the codebase.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components')
-rw-r--r-- | components/config/opts.rs | 3 | ||||
-rw-r--r-- | components/script/dom/dissimilaroriginwindow.rs | 1 | ||||
-rw-r--r-- | components/script/dom/globalscope.rs | 9 | ||||
-rw-r--r-- | components/script/dom/window.rs | 2 | ||||
-rw-r--r-- | components/script/dom/workerglobalscope.rs | 2 | ||||
-rw-r--r-- | components/script/dom/workletglobalscope.rs | 3 | ||||
-rw-r--r-- | components/script/script_thread.rs | 6 | ||||
-rw-r--r-- | components/shared/script/lib.rs | 2 |
8 files changed, 0 insertions, 28 deletions
diff --git a/components/config/opts.rs b/components/config/opts.rs index 212ce7cebc5..2bc90696a43 100644 --- a/components/config/opts.rs +++ b/components/config/opts.rs @@ -48,8 +48,6 @@ pub struct Opts { pub output_file: Option<String>, - pub headless: bool, - /// True to exit on thread failure instead of displaying about:failure. pub hard_fail: bool, @@ -218,7 +216,6 @@ impl Default for Opts { userscripts: None, user_stylesheets: Vec::new(), output_file: None, - headless: false, hard_fail: true, webdriver_port: None, initial_window_size: Size2D::new(1024, 740), diff --git a/components/script/dom/dissimilaroriginwindow.rs b/components/script/dom/dissimilaroriginwindow.rs index 1eb5d3b2c67..4e34cc6e52d 100644 --- a/components/script/dom/dissimilaroriginwindow.rs +++ b/components/script/dom/dissimilaroriginwindow.rs @@ -64,7 +64,6 @@ impl DissimilarOriginWindow { // FIXME(nox): The microtask queue is probably not important // here, but this whole DOM interface is a hack anyway. global_to_clone_from.microtask_queue().clone(), - global_to_clone_from.is_headless(), global_to_clone_from.get_user_agent(), #[cfg(feature = "webgpu")] global_to_clone_from.wgpu_id_hub(), diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs index 51d6b06b6f4..16d48a130d7 100644 --- a/components/script/dom/globalscope.rs +++ b/components/script/dom/globalscope.rs @@ -316,9 +316,6 @@ pub(crate) struct GlobalScope { #[allow(clippy::vec_box)] consumed_rejections: DomRefCell<Vec<Box<Heap<*mut JSObject>>>>, - /// True if headless mode. - is_headless: bool, - /// An optional string allowing the user agent to be set for testing. user_agent: Cow<'static, str>, @@ -716,7 +713,6 @@ impl GlobalScope { origin: MutableOrigin, creation_url: Option<ServoUrl>, microtask_queue: Rc<MicrotaskQueue>, - is_headless: bool, user_agent: Cow<'static, str>, #[cfg(feature = "webgpu")] gpu_id_hub: Arc<IdentityHub>, inherited_secure_context: Option<bool>, @@ -751,7 +747,6 @@ impl GlobalScope { event_source_tracker: DOMTracker::new(), uncaught_rejections: Default::default(), consumed_rejections: Default::default(), - is_headless, user_agent, #[cfg(feature = "webgpu")] gpu_id_hub, @@ -2911,10 +2906,6 @@ impl GlobalScope { ); } - pub(crate) fn is_headless(&self) -> bool { - self.is_headless - } - pub(crate) fn get_user_agent(&self) -> Cow<'static, str> { self.user_agent.clone() } diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 2315e92eba1..f496a1b8191 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -2778,7 +2778,6 @@ impl Window { unminify_css: bool, local_script_source: Option<String>, userscripts_path: Option<String>, - is_headless: bool, replace_surrogates: bool, user_agent: Cow<'static, str>, player_context: WindowGLContext, @@ -2807,7 +2806,6 @@ impl Window { origin, Some(creator_url), microtask_queue, - is_headless, user_agent, #[cfg(feature = "webgpu")] gpu_id_hub, diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index fe6e2c40c00..1cefa6972a8 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -79,7 +79,6 @@ pub(crate) fn prepare_workerscope_init( pipeline_id: global.pipeline_id(), origin: global.origin().immutable().clone(), creation_url: global.creation_url().clone(), - is_headless: global.is_headless(), user_agent: global.get_user_agent(), inherited_secure_context: Some(global.is_secure_context()), }; @@ -165,7 +164,6 @@ impl WorkerGlobalScope { MutableOrigin::new(init.origin), init.creation_url, runtime.microtask_queue.clone(), - init.is_headless, init.user_agent, #[cfg(feature = "webgpu")] gpu_id_hub, diff --git a/components/script/dom/workletglobalscope.rs b/components/script/dom/workletglobalscope.rs index 629bcd9a470..62c69e80509 100644 --- a/components/script/dom/workletglobalscope.rs +++ b/components/script/dom/workletglobalscope.rs @@ -96,7 +96,6 @@ impl WorkletGlobalScope { MutableOrigin::new(ImmutableOrigin::new_opaque()), None, Default::default(), - init.is_headless, init.user_agent.clone(), #[cfg(feature = "webgpu")] init.gpu_id_hub.clone(), @@ -186,8 +185,6 @@ pub(crate) struct WorkletGlobalScopeInit { pub(crate) to_constellation_sender: IpcSender<(PipelineId, ScriptMsg)>, /// The image cache pub(crate) image_cache: Arc<dyn ImageCache>, - /// True if in headless mode - pub(crate) is_headless: bool, /// An optional string allowing the user agent to be set for testing pub(crate) user_agent: Cow<'static, str>, /// Identity manager for WebGPU resources diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 22eea4d8c90..9fe4b10e9b6 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -318,9 +318,6 @@ pub struct ScriptThread { /// won't be loaded userscripts_path: Option<String>, - /// True if headless mode. - headless: bool, - /// Replace unpaired surrogates in DOM strings with U+FFFD. /// See <https://github.com/servo/servo/issues/6564> replace_surrogates: bool, @@ -753,7 +750,6 @@ impl ScriptThread { .pipeline_to_constellation_sender .clone(), image_cache: script_thread.image_cache.clone(), - is_headless: script_thread.headless, user_agent: script_thread.user_agent.clone(), #[cfg(feature = "webgpu")] gpu_id_hub: script_thread.gpu_id_hub.clone(), @@ -961,7 +957,6 @@ impl ScriptThread { local_script_source: opts.local_script_source.clone(), unminify_css: opts.unminify_css, userscripts_path: opts.userscripts.clone(), - headless: opts.headless, replace_surrogates: opts.debug.replace_surrogates, user_agent, player_context: state.player_context, @@ -3151,7 +3146,6 @@ impl ScriptThread { self.unminify_css, self.local_script_source.clone(), self.userscripts_path.clone(), - self.headless, self.replace_surrogates, self.user_agent.clone(), self.player_context.clone(), diff --git a/components/shared/script/lib.rs b/components/shared/script/lib.rs index bc00f582921..9ec97d717f0 100644 --- a/components/shared/script/lib.rs +++ b/components/shared/script/lib.rs @@ -770,8 +770,6 @@ pub struct WorkerGlobalScopeInit { pub origin: ImmutableOrigin, /// The creation URL pub creation_url: Option<ServoUrl>, - /// True if headless mode - pub is_headless: bool, /// An optional string allowing the user agnet to be set for testing. pub user_agent: Cow<'static, str>, /// True if secure context |