Skip to main content

Preferences

Struct Preferences 

Source
pub struct Preferences {
Show 168 fields pub fonts_default: String, pub fonts_serif: String, pub fonts_sans_serif: String, pub fonts_monospace: String, pub fonts_default_size: i64, pub fonts_default_monospace_size: i64, pub editing_caret_blink_time: i64, pub css_animations_testing_enabled: bool, pub devtools_server_enabled: bool, pub devtools_server_listen_address: String, pub dom_webgpu_enabled: bool, pub dom_webgpu_wgpu_backend: String, pub dom_abort_controller_enabled: bool, pub dom_adoptedstylesheet_enabled: bool, pub dom_allow_preloading_module_descendants: bool, pub dom_async_clipboard_enabled: bool, pub dom_bluetooth_enabled: bool, pub dom_bluetooth_testing_enabled: bool, pub dom_allow_scripts_to_close_windows: bool, pub dom_canvas_capture_enabled: bool, pub dom_canvas_text_enabled: bool, pub dom_canvas_backend: String, pub dom_canvas_msg_buffer_size: u64, pub dom_clipboardevent_enabled: bool, pub dom_composition_event_enabled: bool, pub dom_cookiestore_enabled: bool, pub dom_credential_management_enabled: bool, pub dom_crypto_subtle_enabled: bool, pub dom_document_dblclick_timeout: i64, pub dom_document_dblclick_dist: i64, pub dom_entries_api_enabled: bool, pub dom_exec_command_enabled: bool, pub dom_fontface_enabled: bool, pub dom_fullscreen_test: bool, pub dom_gamepad_enabled: bool, pub dom_geolocation_enabled: bool, pub dom_wakelock_enabled: bool, pub dom_indexeddb_enabled: bool, pub dom_intersection_observer_enabled: bool, pub dom_microdata_testing_enabled: bool, pub dom_uievent_which_enabled: bool, pub dom_mutation_observer_enabled: bool, pub dom_navigator_protocol_handlers_enabled: bool, pub dom_notification_enabled: bool, pub dom_offscreen_canvas_enabled: bool, pub dom_parallel_css_parsing_enabled: bool, pub dom_permissions_enabled: bool, pub dom_permissions_testing_allowed_in_nonsecure_contexts: bool, pub dom_resize_observer_enabled: bool, pub dom_sanitizer_enabled: bool, pub dom_script_asynch: bool, pub dom_storage_manager_api_enabled: bool, pub dom_serviceworker_enabled: bool, pub dom_serviceworker_timeout_seconds: i64, pub dom_sharedworker_enabled: bool, pub dom_servo_helpers_enabled: bool, pub dom_servoparser_async_html_tokenizer_enabled: bool, pub dom_testbinding_enabled: bool, pub dom_testbinding_prefcontrolled_enabled: bool, pub dom_testbinding_prefcontrolled2_enabled: bool, pub dom_testbinding_preference_value_falsy: bool, pub dom_testbinding_preference_value_quote_string_test: String, pub dom_testbinding_preference_value_space_string_test: String, pub dom_testbinding_preference_value_string_empty: String, pub dom_testbinding_preference_value_string_test: String, pub dom_testbinding_preference_value_truthy: bool, pub dom_testing_element_activation_enabled: bool, pub dom_testing_html_input_element_select_files_enabled: bool, pub dom_testperf_enabled: bool, pub dom_testutils_enabled: bool, pub dom_touch_events_legacy_apis_enabled: bool, pub dom_transient_activation_duration_ms: i64, pub dom_web_animations_enabled: bool, pub dom_webgl2_enabled: bool, pub dom_webrtc_enabled: bool, pub dom_webrtc_transceiver_enabled: bool, pub dom_webvtt_enabled: bool, pub dom_webxr_enabled: bool, pub dom_webxr_test: bool, pub dom_webxr_first_person_observer_view: bool, pub dom_webxr_glwindow_enabled: bool, pub dom_webxr_glwindow_left_right: bool, pub dom_webxr_glwindow_red_cyan: bool, pub dom_webxr_glwindow_spherical: bool, pub dom_webxr_glwindow_cubemap: bool, pub dom_webxr_hands_enabled: bool, pub dom_webxr_layers_enabled: bool, pub dom_webxr_openxr_enabled: bool, pub dom_webxr_sessionavailable: bool, pub dom_webxr_unsafe_assume_user_intent: bool, pub dom_worklet_enabled: bool, pub dom_worklet_blockingsleep_enabled: bool, pub dom_worklet_testing_enabled: bool, pub dom_worklet_timeout_ms: i64, pub dom_visual_viewport_enabled: bool, pub gfx_precache_shaders: bool, pub gfx_text_antialiasing_enabled: bool, pub gfx_subpixel_text_antialiasing_enabled: bool, pub gfx_texture_swizzling_enabled: bool, pub image_key_batch_size: i64, pub inspector_show_servo_internal_shadow_roots: bool, pub intl_locale_override: String, pub js_asmjs_enabled: bool, pub js_baseline_interpreter_enabled: bool, pub js_disable_jit: bool, pub js_baseline_jit_enabled: bool, pub js_baseline_jit_unsafe_eager_compilation_enabled: bool, pub js_ion_enabled: bool, pub js_ion_unsafe_eager_compilation_enabled: bool, pub js_mem_gc_compacting_enabled: bool, pub js_mem_gc_empty_chunk_count_min: i64, pub js_mem_gc_high_frequency_heap_growth_max: i64, pub js_mem_gc_high_frequency_heap_growth_min: i64, pub js_mem_gc_high_frequency_high_limit_mb: i64, pub js_mem_gc_high_frequency_low_limit_mb: i64, pub js_mem_gc_high_frequency_time_limit_ms: i64, pub js_mem_gc_incremental_enabled: bool, pub js_mem_gc_incremental_slice_ms: i64, pub js_mem_gc_low_frequency_heap_growth: i64, pub js_mem_gc_per_zone_enabled: bool, pub js_mem_gc_zeal_frequency: i64, pub js_mem_gc_zeal_level: i64, pub js_mem_max: i64, pub js_native_regex_enabled: bool, pub js_offthread_compilation_enabled: bool, pub js_timers_minimum_duration: i64, pub js_wasm_baseline_enabled: bool, pub js_wasm_enabled: bool, pub js_wasm_ion_enabled: bool, pub largest_contentful_paint_enabled: bool, pub layout_animations_test_enabled: bool, pub layout_columns_enabled: bool, pub layout_grid_enabled: bool, pub layout_container_queries_enabled: bool, pub layout_css_attr_enabled: bool, pub layout_style_sharing_cache_enabled: bool, pub layout_threads: i64, pub layout_parallelism_job_count_minimum: u64, pub layout_parallelism_job_size_minimum: u64, pub layout_unimplemented: bool, pub layout_variable_fonts_enabled: bool, pub layout_writing_mode_enabled: bool, pub media_glvideo_enabled: bool, pub media_testing_enabled: bool, pub network_connection_timeout: u64, pub network_enforce_tls_enabled: bool, pub network_enforce_tls_localhost: bool, pub network_enforce_tls_onion: bool, pub network_http_cache_disabled: bool, pub network_http_proxy_uri: String, pub network_https_proxy_uri: String, pub network_http_no_proxy: String, pub network_http_cache_size: u64, pub network_local_directory_listing_enabled: bool, pub network_use_webpki_roots: bool, pub session_history_max_length: i64, pub shell_background_color_rgba: [f64; 4], pub webgl_testing_context_creation_error: bool, pub thread_pool_workers_max: u64, pub thread_pool_fallback_workers: u64, pub thread_pool_async_runtime_workers_max: u64, pub thread_pool_webrender_workers_max: u64, pub user_agent: String, pub viewport_meta_enabled: bool, pub log_filter: String, pub accessibility_enabled: bool, pub expensive_accessibility_test_assertions_enabled: bool, pub expose_servointernals_globally: bool,
}
Expand description

The set of global preferences supported by Servo.

Each preference has a default value that determines its initial state. These defaults fall into roughly three categories:

  • Stable: enabled by default.
  • Experimental: disabled by default, but intended to be enabled for experimental use.
  • Unstable: disabled by default.

For a full overview of which preferences are experimental, see the experimental features documentation.

Fields§

§fonts_default: String§fonts_serif: String§fonts_sans_serif: String§fonts_monospace: String§fonts_default_size: i64§fonts_default_monospace_size: i64§editing_caret_blink_time: i64

The amount of time that a half cycle of a text caret blink takes in milliseconds. If this value is less than or equal to zero, then caret blink is disabled.

§css_animations_testing_enabled: bool§devtools_server_enabled: bool

Start the devtools server at startup

§devtools_server_listen_address: String

The address:port the devtools server listens to, default to 127.0.0.1:7000.

§dom_webgpu_enabled: bool§dom_webgpu_wgpu_backend: String

List of comma-separated backends to be used by wgpu.

§dom_abort_controller_enabled: bool§dom_adoptedstylesheet_enabled: bool§dom_allow_preloading_module_descendants: bool§dom_async_clipboard_enabled: bool§dom_bluetooth_enabled: bool§dom_bluetooth_testing_enabled: bool§dom_allow_scripts_to_close_windows: bool§dom_canvas_capture_enabled: bool§dom_canvas_text_enabled: bool§dom_canvas_backend: String

Selects canvas backend

Available values:

  • vello
  • Everything else selects vello_cpu
§dom_canvas_msg_buffer_size: u64

Maximum number of buffered canvas commands before an automatic flush is triggered.

A lower value keeps the paint thread fed with work (better parallelism), while a higher value improves batching efficiency (fewer channel operations, lower power).

See https://github.com/servo/servo/pull/45301 for measurements.

§dom_clipboardevent_enabled: bool§dom_composition_event_enabled: bool§dom_cookiestore_enabled: bool§dom_credential_management_enabled: bool§dom_crypto_subtle_enabled: bool§dom_document_dblclick_timeout: i64§dom_document_dblclick_dist: i64§dom_entries_api_enabled: bool§dom_exec_command_enabled: bool§dom_fontface_enabled: bool§dom_fullscreen_test: bool§dom_gamepad_enabled: bool§dom_geolocation_enabled: bool§dom_wakelock_enabled: bool§dom_indexeddb_enabled: bool§dom_intersection_observer_enabled: bool§dom_microdata_testing_enabled: bool§dom_uievent_which_enabled: bool§dom_mutation_observer_enabled: bool§dom_navigator_protocol_handlers_enabled: bool§dom_notification_enabled: bool§dom_offscreen_canvas_enabled: bool§dom_parallel_css_parsing_enabled: bool§dom_permissions_enabled: bool§dom_permissions_testing_allowed_in_nonsecure_contexts: bool§dom_resize_observer_enabled: bool§dom_sanitizer_enabled: bool§dom_script_asynch: bool§dom_storage_manager_api_enabled: bool§dom_serviceworker_enabled: bool§dom_serviceworker_timeout_seconds: i64§dom_sharedworker_enabled: bool§dom_servo_helpers_enabled: bool§dom_servoparser_async_html_tokenizer_enabled: bool§dom_testbinding_enabled: bool§dom_testbinding_prefcontrolled_enabled: bool§dom_testbinding_prefcontrolled2_enabled: bool§dom_testbinding_preference_value_falsy: bool§dom_testbinding_preference_value_quote_string_test: String§dom_testbinding_preference_value_space_string_test: String§dom_testbinding_preference_value_string_empty: String§dom_testbinding_preference_value_string_test: String§dom_testbinding_preference_value_truthy: bool§dom_testing_element_activation_enabled: bool§dom_testing_html_input_element_select_files_enabled: bool§dom_testperf_enabled: bool§dom_testutils_enabled: bool§dom_touch_events_legacy_apis_enabled: bool§dom_transient_activation_duration_ms: i64§dom_web_animations_enabled: bool§dom_webgl2_enabled: bool

Enable WebGL2 APIs.

§dom_webrtc_enabled: bool§dom_webrtc_transceiver_enabled: bool§dom_webvtt_enabled: bool§dom_webxr_enabled: bool§dom_webxr_test: bool§dom_webxr_first_person_observer_view: bool§dom_webxr_glwindow_enabled: bool§dom_webxr_glwindow_left_right: bool§dom_webxr_glwindow_red_cyan: bool§dom_webxr_glwindow_spherical: bool§dom_webxr_glwindow_cubemap: bool§dom_webxr_hands_enabled: bool§dom_webxr_layers_enabled: bool§dom_webxr_openxr_enabled: bool§dom_webxr_sessionavailable: bool§dom_webxr_unsafe_assume_user_intent: bool§dom_worklet_enabled: bool§dom_worklet_blockingsleep_enabled: bool§dom_worklet_testing_enabled: bool§dom_worklet_timeout_ms: i64§dom_visual_viewport_enabled: bool§gfx_precache_shaders: bool

True to compile all WebRender shaders when Servo initializes. This is mostly useful when modifying the shaders, to ensure they all compile after each change is made.

§gfx_text_antialiasing_enabled: bool

Whether or not antialiasing is enabled for text rendering.

§gfx_subpixel_text_antialiasing_enabled: bool

Whether or not subpixel antialiasing is enabled for text rendering.

§gfx_texture_swizzling_enabled: bool§image_key_batch_size: i64

The amount of image keys we request per batch for the image cache.

§inspector_show_servo_internal_shadow_roots: bool

Whether or not the DOM inspector should show shadow roots of user-agent shadow trees

§intl_locale_override: String

A locale tag (eg. es-ES) to use for language negotiation instead of the system locale. An empty string represents no override. TODO: Option<> support in PrefValue

§js_asmjs_enabled: bool§js_baseline_interpreter_enabled: bool§js_disable_jit: bool

Whether to disable the jit within SpiderMonkey

§js_baseline_jit_enabled: bool§js_baseline_jit_unsafe_eager_compilation_enabled: bool§js_ion_enabled: bool§js_ion_unsafe_eager_compilation_enabled: bool§js_mem_gc_compacting_enabled: bool§js_mem_gc_empty_chunk_count_min: i64§js_mem_gc_high_frequency_heap_growth_max: i64§js_mem_gc_high_frequency_heap_growth_min: i64§js_mem_gc_high_frequency_high_limit_mb: i64§js_mem_gc_high_frequency_low_limit_mb: i64§js_mem_gc_high_frequency_time_limit_ms: i64§js_mem_gc_incremental_enabled: bool§js_mem_gc_incremental_slice_ms: i64§js_mem_gc_low_frequency_heap_growth: i64§js_mem_gc_per_zone_enabled: bool§js_mem_gc_zeal_frequency: i64§js_mem_gc_zeal_level: i64§js_mem_max: i64§js_native_regex_enabled: bool§js_offthread_compilation_enabled: bool§js_timers_minimum_duration: i64§js_wasm_baseline_enabled: bool§js_wasm_enabled: bool§js_wasm_ion_enabled: bool§largest_contentful_paint_enabled: bool§layout_animations_test_enabled: bool§layout_columns_enabled: bool§layout_grid_enabled: bool§layout_container_queries_enabled: bool§layout_css_attr_enabled: bool§layout_style_sharing_cache_enabled: bool§layout_threads: i64§layout_parallelism_job_count_minimum: u64

The minimum number of parallelizable jobs required before turning on parallelism for a set of jobs.

When deciding whether or not to parallelize layout, this is the minimum number of jobs that must be larger than Self::layout_parallelism_job_size_minimum to turn on parallelism. An exception is when doing box tree layout, where Servo does not know the depth of the tree. In that case any task that has more jobs than this value will be parallelized.

The goal of these two values is to allow tuning Servo’s parallelism for both wide and deep trees.

§layout_parallelism_job_size_minimum: u64

The minimum size of a layout job to be considered for parallelization.

When deciding whether or not to parallelize layout, jobs greater than this size are counted when considering the Self::layout_parallelism_job_count_minimum threshold for turning on parallelism. Generally the size of the job is based on the number of tasks to process in the subtree. For instance, this might be the number of boxes to process in a box tree subtree.

The goal of these two values is to allow tuning Servo’s parallelism for both wide and deep trees.

§layout_unimplemented: bool§layout_variable_fonts_enabled: bool§layout_writing_mode_enabled: bool§media_glvideo_enabled: bool

Enable hardware acceleration for video playback.

§media_testing_enabled: bool

Enable a non-standard event handler for verifying behavior of media elements during tests.

§network_connection_timeout: u64

The default timeout set for establishing a network connection in seconds. This amount if for the entire process of connecting to an address. For instance, if a particular host is associated with multiple IP addresses, this timeout will be divided equally among each IP address.

§network_enforce_tls_enabled: bool§network_enforce_tls_localhost: bool§network_enforce_tls_onion: bool§network_http_cache_disabled: bool§network_http_proxy_uri: String

A url for a http proxy. We treat an empty string as no proxy.

§network_https_proxy_uri: String

A url for a https proxy. We treat an empty string as no proxy.

§network_http_no_proxy: String

The domains for which we will not have a proxy. No effect if network_http_proxy_uri is not set. The exact behavior is given by https://docs.rs/hyper-util/latest/hyper_util/client/proxy/matcher/struct.Builder.html#method.no

§network_http_cache_size: u64

The weight of the http memory cache Notice that this is not equal to the number of different urls in the cache.

§network_local_directory_listing_enabled: bool§network_use_webpki_roots: bool

Force the use of rust-webpki verification for CA roots. If this is false (the default), then rustls-platform-verifier will be used, except on Android where rust-webpki is always used.

§session_history_max_length: i64

The length of the session history, in navigations, for each WebView. Back-forward cache entries that are more than session_history_max_lengthsteps in the future orsession_history_max_length` steps in the past will be discarded. Navigating forward or backward to that entry will cause the entire page to be reloaded.

§shell_background_color_rgba: [f64; 4]

The background color of shell’s viewport. This will be used by OpenGL’s glClearColor.

§webgl_testing_context_creation_error: bool§thread_pool_workers_max: u64

Maximum number of workers for the main thread pool

§thread_pool_fallback_workers: u64

Number of workers per thread pool, if we fail to detect how much parallelism is available at runtime.

§thread_pool_async_runtime_workers_max: u64

Maximum number of workers for the asynchronous networking runtime thread pool

§thread_pool_webrender_workers_max: u64

Maximum number of workers for WebRender

§user_agent: String

The user-agent to use for Servo. This can also be set via UserAgentPlatform in order to set the value to the default value for the given platform.

§viewport_meta_enabled: bool

Whether or not the viewport meta tag is enabled.

§log_filter: String§accessibility_enabled: bool

Whether the accessibility code is enabled.

§expensive_accessibility_test_assertions_enabled: bool

Whether to run accessibility tree integrity checks, and any other expensive checks. This should only be true in tests.

§expose_servointernals_globally: bool

Exposes internal JS API functions that are usually restricted to about:... pages Useful if you want to get memory report or force GC in a test page

Implementations§

Source§

impl Preferences

Source

pub fn exists(name: &str) -> bool

Source

pub fn get_value(&self, name: &str) -> PrefValue

Source

pub fn set_value(&mut self, name: &str, value: PrefValue)

Source

pub fn type_of(name: &str) -> &'static str

Source

pub fn diff(&self, other: &Self) -> Vec<(&'static str, PrefValue)>

Source

pub fn all_fields() -> Vec<&'static str>

Source§

impl Preferences

Source

const fn const_default() -> Self

The amount of time that a half cycle of a text caret blink takes. If blinking is disabled this returns None.

Trait Implementations§

Source§

impl Clone for Preferences

Source§

fn clone(&self) -> Preferences

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Preferences

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Preferences

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Preferences

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,