pub struct Preferences {Show 160 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_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_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_transient_activation_duration_ms: i64,
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_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,
}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: i64The 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: boolStart the devtools server at startup
devtools_server_listen_address: StringThe address:port the devtools server listens to, default to 127.0.0.1:7000.
dom_webgpu_enabled: bool§dom_webgpu_wgpu_backend: StringList 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: StringSelects canvas backend
Available values:
/auto- vello
- vello_cpu
dom_clipboardevent_enabled: bool§dom_composition_event_enabled: bool§dom_credential_management_enabled: bool§dom_crypto_subtle_enabled: bool§dom_document_dblclick_timeout: i64§dom_document_dblclick_dist: i64§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_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_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_transient_activation_duration_ms: i64§dom_webgl2_enabled: boolEnable 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_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: boolTrue 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: boolWhether or not antialiasing is enabled for text rendering.
gfx_subpixel_text_antialiasing_enabled: boolWhether or not subpixel antialiasing is enabled for text rendering.
gfx_texture_swizzling_enabled: bool§image_key_batch_size: i64The amount of image keys we request per batch for the image cache.
inspector_show_servo_internal_shadow_roots: boolWhether or not the DOM inspector should show shadow roots of user-agent shadow trees
intl_locale_override: StringA 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: boolWhether 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_unimplemented: bool§layout_variable_fonts_enabled: bool§layout_writing_mode_enabled: bool§media_glvideo_enabled: boolEnable hardware acceleration for video playback.
media_testing_enabled: boolEnable a non-standard event handler for verifying behavior of media elements during tests.
network_connection_timeout: u64The 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: StringA url for a http proxy. We treat an empty string as no proxy.
network_https_proxy_uri: StringA url for a https proxy. We treat an empty string as no proxy.
network_http_no_proxy: StringThe 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: u64The 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: boolForce 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: i64The 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: u64Maximum number of workers for the main thread pool
thread_pool_fallback_workers: u64Number of workers per thread pool, if we fail to detect how much parallelism is available at runtime.
thread_pool_async_runtime_workers_max: u64Maximum number of workers for the asynchronous networking runtime thread pool
thread_pool_webrender_workers_max: u64Maximum number of workers for WebRender
user_agent: StringThe 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: boolWhether or not the viewport meta tag is enabled.
log_filter: String§accessibility_enabled: boolWhether the accessibility code is enabled.
Implementations§
Source§impl Preferences
impl Preferences
pub fn exists(name: &str) -> bool
pub fn get_value(&self, name: &str) -> PrefValue
pub fn set_value(&mut self, name: &str, value: PrefValue)
pub fn type_of(name: &str) -> &'static str
pub fn diff(&self, other: &Preferences) -> Vec<(&'static str, PrefValue)>
pub fn all_fields() -> Vec<&'static str>
Source§impl Preferences
impl Preferences
Sourcepub fn editing_caret_blink_time(&self) -> Option<Duration>
pub fn editing_caret_blink_time(&self) -> Option<Duration>
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
impl Clone for Preferences
Source§fn clone(&self) -> Preferences
fn clone(&self) -> Preferences
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for Preferences
impl Default for Preferences
Source§fn default() -> Preferences
fn default() -> Preferences
Source§impl<'de> Deserialize<'de> for Preferences
impl<'de> Deserialize<'de> for Preferences
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Preferences, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Preferences, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Preferences
impl Serialize for Preferences
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Preferences
impl RefUnwindSafe for Preferences
impl Send for Preferences
impl Sync for Preferences
impl Unpin for Preferences
impl UnsafeUnpin for Preferences
impl UnwindSafe for Preferences
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more