Struct script::script_thread::ScriptThread
source · pub struct ScriptThread {Show 70 fields
last_render_opportunity_time: DomRefCell<Option<Instant>>,
update_the_rendering_task_queued_for_pipeline: DomRefCell<HashSet<PipelineId>>,
documents: DomRefCell<Documents>,
window_proxies: DomRefCell<HashMapTracedValues<BrowsingContextId, Dom<WindowProxy>>>,
incomplete_loads: DomRefCell<Vec<InProgressLoad>>,
incomplete_parser_contexts: IncompleteParserContexts,
image_cache: Arc<dyn ImageCache>,
resource_threads: ResourceThreads,
bluetooth_thread: IpcSender<BluetoothRequest>,
task_queue: TaskQueue<MainThreadScriptMsg>,
background_hang_monitor: Box<dyn BackgroundHangMonitor>,
closing: Arc<AtomicBool>,
chan: MainThreadScriptChan,
dom_manipulation_task_sender: Box<dyn ScriptChan>,
gamepad_task_sender: Box<dyn ScriptChan>,
media_element_task_sender: Sender<MainThreadScriptMsg>,
user_interaction_task_sender: Sender<MainThreadScriptMsg>,
networking_task_sender: Box<dyn ScriptChan>,
history_traversal_task_sender: Sender<MainThreadScriptMsg>,
file_reading_task_sender: Box<dyn ScriptChan>,
performance_timeline_task_sender: Box<dyn ScriptChan>,
port_message_sender: Box<dyn ScriptChan>,
timer_task_sender: Box<dyn ScriptChan>,
remote_event_task_sender: Box<dyn ScriptChan>,
rendering_task_sender: Box<dyn ScriptChan>,
control_chan: IpcSender<ConstellationControlMsg>,
control_port: Receiver<ConstellationControlMsg>,
script_sender: IpcSender<(PipelineId, ScriptMsg)>,
layout_to_constellation_chan: IpcSender<LayoutMsg>,
system_font_service: Arc<SystemFontServiceProxy>,
image_cache_port: Receiver<ImageCacheMsg>,
image_cache_channel: Sender<ImageCacheMsg>,
time_profiler_chan: ProfilerChan,
mem_profiler_chan: ProfilerChan,
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
devtools_port: Receiver<DevtoolScriptControlMsg>,
devtools_sender: IpcSender<DevtoolScriptControlMsg>,
js_runtime: Rc<Runtime>,
topmost_mouse_over_target: MutNullableDom<Element>,
closed_pipelines: DomRefCell<HashSet<PipelineId>>,
scheduler_chan: IpcSender<TimerSchedulerMsg>,
content_process_shutdown_chan: Sender<()>,
microtask_queue: Rc<MicrotaskQueue>,
mutation_observer_microtask_queued: Cell<bool>,
mutation_observers: DomRefCell<Vec<Dom<MutationObserver>>>,
webgl_chan: Option<WebGLPipeline>,
webxr_registry: Option<Registry>,
worklet_thread_pool: DomRefCell<Option<Rc<WorkletThreadPool>>>,
docs_with_no_blocking_loads: DomRefCell<HashSet<Dom<Document>>>,
custom_element_reaction_stack: CustomElementReactionStack,
webrender_document: DocumentId,
compositor_api: CrossProcessCompositorApi,
profile_script_events: bool,
print_pwm: bool,
relayout_event: bool,
prepare_for_screenshot: bool,
unminify_js: bool,
local_script_source: Option<String>,
unminify_css: bool,
userscripts_path: Option<String>,
headless: bool,
replace_surrogates: bool,
user_agent: Cow<'static, str>,
player_context: WindowGLContext,
node_ids: DomRefCell<HashSet<String>>,
is_user_interacting: Cell<bool>,
gpu_id_hub: Arc<IdentityHub>,
webgpu_port: RefCell<Option<Receiver<WebGPUMsg>>>,
inherited_secure_context: Option<bool>,
layout_factory: Arc<dyn LayoutFactory>,
}
Fields§
§last_render_opportunity_time: DomRefCell<Option<Instant>>
§update_the_rendering_task_queued_for_pipeline: DomRefCell<HashSet<PipelineId>>
Used to batch rendering opportunities
documents: DomRefCell<Documents>
The documents for pipelines managed by this thread
window_proxies: DomRefCell<HashMapTracedValues<BrowsingContextId, Dom<WindowProxy>>>
The window proxies known by this thread TODO: this map grows, but never shrinks. Issue #15258.
incomplete_loads: DomRefCell<Vec<InProgressLoad>>
A list of data pertaining to loads that have not yet received a network response
incomplete_parser_contexts: IncompleteParserContexts
A vector containing parser contexts which have not yet been fully processed
image_cache: Arc<dyn ImageCache>
Image cache for this script thread.
resource_threads: ResourceThreads
A handle to the resource thread. This is an Arc
to avoid running out of file descriptors if
there are many iframes.
bluetooth_thread: IpcSender<BluetoothRequest>
A handle to the bluetooth thread.
task_queue: TaskQueue<MainThreadScriptMsg>
A queue of tasks to be executed in this script-thread.
background_hang_monitor: Box<dyn BackgroundHangMonitor>
The dedicated means of communication with the background-hang-monitor for this script-thread.
closing: Arc<AtomicBool>
A flag set to true
by the BHM on exit, and checked from within the interrupt handler.
chan: MainThreadScriptChan
A channel to hand out to script thread-based entities that need to be able to enqueue events in the event queue.
dom_manipulation_task_sender: Box<dyn ScriptChan>
§gamepad_task_sender: Box<dyn ScriptChan>
§media_element_task_sender: Sender<MainThreadScriptMsg>
§user_interaction_task_sender: Sender<MainThreadScriptMsg>
§networking_task_sender: Box<dyn ScriptChan>
§history_traversal_task_sender: Sender<MainThreadScriptMsg>
§file_reading_task_sender: Box<dyn ScriptChan>
§performance_timeline_task_sender: Box<dyn ScriptChan>
§port_message_sender: Box<dyn ScriptChan>
§timer_task_sender: Box<dyn ScriptChan>
§remote_event_task_sender: Box<dyn ScriptChan>
§rendering_task_sender: Box<dyn ScriptChan>
§control_chan: IpcSender<ConstellationControlMsg>
A channel to hand out to threads that need to respond to a message from the script thread.
control_port: Receiver<ConstellationControlMsg>
The port on which the constellation and layout can communicate with the script thread.
script_sender: IpcSender<(PipelineId, ScriptMsg)>
For communicating load url messages to the constellation
layout_to_constellation_chan: IpcSender<LayoutMsg>
A sender for layout to communicate to the constellation.
system_font_service: Arc<SystemFontServiceProxy>
A proxy to the SystemFontService
to use for accessing system font lists.
image_cache_port: Receiver<ImageCacheMsg>
The port on which we receive messages from the image cache
image_cache_channel: Sender<ImageCacheMsg>
The channel on which the image cache can send messages to ourself.
time_profiler_chan: ProfilerChan
For providing contact with the time profiler.
mem_profiler_chan: ProfilerChan
For providing contact with the memory profiler.
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>
For providing instructions to an optional devtools server.
devtools_port: Receiver<DevtoolScriptControlMsg>
For receiving commands from an optional devtools server. Will be ignored if no such server exists.
devtools_sender: IpcSender<DevtoolScriptControlMsg>
§js_runtime: Rc<Runtime>
The JavaScript runtime.
topmost_mouse_over_target: MutNullableDom<Element>
The topmost element over the mouse.
closed_pipelines: DomRefCell<HashSet<PipelineId>>
List of pipelines that have been owned and closed by this script thread.
scheduler_chan: IpcSender<TimerSchedulerMsg>
§content_process_shutdown_chan: Sender<()>
§microtask_queue: Rc<MicrotaskQueue>
§mutation_observer_microtask_queued: Cell<bool>
Microtask Queue for adding support for mutation observer microtasks
mutation_observers: DomRefCell<Vec<Dom<MutationObserver>>>
The unit of related similar-origin browsing contexts’ list of MutationObserver objects
webgl_chan: Option<WebGLPipeline>
A handle to the WebGL thread
webxr_registry: Option<Registry>
The WebXR device registry
worklet_thread_pool: DomRefCell<Option<Rc<WorkletThreadPool>>>
The worklet thread pool
docs_with_no_blocking_loads: DomRefCell<HashSet<Dom<Document>>>
A list of pipelines containing documents that finished loading all their blocking resources during a turn of the event loop.
custom_element_reaction_stack: CustomElementReactionStack
§webrender_document: DocumentId
The Webrender Document ID associated with this thread.
compositor_api: CrossProcessCompositorApi
Cross-process access to the compositor’s API.
profile_script_events: bool
Periodically print out on which events script threads spend their processing time.
print_pwm: bool
Print Progressive Web Metrics to console.
relayout_event: bool
Emits notifications when there is a relayout.
prepare_for_screenshot: bool
True if it is safe to write to the image.
unminify_js: bool
Unminify Javascript.
local_script_source: Option<String>
Directory with stored unminified scripts
unminify_css: bool
Unminify Css.
userscripts_path: Option<String>
Where to load userscripts from, if any. An empty string will load from the resources/user-agent-js directory, and if the option isn’t passed userscripts won’t be loaded
headless: bool
True if headless mode.
replace_surrogates: bool
Replace unpaired surrogates in DOM strings with U+FFFD. See https://github.com/servo/servo/issues/6564
user_agent: Cow<'static, str>
An optional string allowing the user agent to be set for testing.
player_context: WindowGLContext
Application window’s GL Context for Media player
node_ids: DomRefCell<HashSet<String>>
A set of all nodes ever created in this script thread
is_user_interacting: Cell<bool>
Code is running as a consequence of a user interaction
gpu_id_hub: Arc<IdentityHub>
Identity manager for WebGPU resources
webgpu_port: RefCell<Option<Receiver<WebGPUMsg>>>
Receiver to receive commands from optional WebGPU server.
inherited_secure_context: Option<bool>
§layout_factory: Arc<dyn LayoutFactory>
A factory for making new layouts. This allows layout to depend on script.
Implementations§
source§impl ScriptThread
impl ScriptThread
pub fn note_rendering_opportunity(pipeline_id: PipelineId)
pub fn runtime_handle() -> ParentRuntime
pub fn can_continue_running() -> bool
pub fn prepare_for_shutdown()
pub fn set_mutation_observer_microtask_queued(value: bool)
pub fn is_mutation_observer_microtask_queued() -> bool
pub fn add_mutation_observer(observer: &MutationObserver)
pub fn get_mutation_observers() -> Vec<Root<Dom<MutationObserver>>>
pub fn mark_document_with_no_blocked_loads(doc: &Document)
pub fn page_headers_available( id: &PipelineId, metadata: Option<Metadata>, can_gc: CanGc, ) -> Option<Root<Dom<ServoParser>>>
sourcepub fn process_event(msg: CommonScriptMsg) -> bool
pub fn process_event(msg: CommonScriptMsg) -> bool
Process a single event as if it were the next event in the queue for this window event-loop. Returns a boolean indicating whether further events should be processed.
pub fn await_stable_state(task: Microtask)
sourcepub fn check_load_origin(source: &LoadOrigin, target: &ImmutableOrigin) -> bool
pub fn check_load_origin(source: &LoadOrigin, target: &ImmutableOrigin) -> bool
Check that two origins are “similar enough”, for now only used to prevent cross-origin JS url evaluation.
pub fn process_attach_layout( new_layout_info: NewLayoutInfo, origin: MutableOrigin, )
pub fn get_top_level_for_browsing_context( sender_pipeline: PipelineId, browsing_context_id: BrowsingContextId, ) -> Option<TopLevelBrowsingContextId>
pub fn find_document(id: PipelineId) -> Option<Root<Dom<Document>>>
pub fn set_user_interacting(interacting: bool)
pub fn is_user_interacting() -> bool
pub fn get_fully_active_document_ids() -> HashSet<PipelineId>
pub fn find_window_proxy( id: BrowsingContextId, ) -> Option<Root<Dom<WindowProxy>>>
pub fn find_window_proxy_by_name( name: &DOMString, ) -> Option<Root<Dom<WindowProxy>>>
pub fn worklet_thread_pool() -> Rc<WorkletThreadPool>
fn handle_register_paint_worklet( &self, pipeline_id: PipelineId, name: Atom, properties: Vec<Atom>, painter: Box<dyn Painter>, )
pub fn push_new_element_queue()
pub fn pop_current_element_queue(can_gc: CanGc)
pub fn enqueue_callback_reaction( element: &Element, reaction: CallbackReaction, definition: Option<Rc<CustomElementDefinition>>, )
pub fn enqueue_upgrade_reaction( element: &Element, definition: Rc<CustomElementDefinition>, )
pub fn invoke_backup_element_queue(can_gc: CanGc)
pub fn save_node_id(node_id: String)
pub fn has_node_id(node_id: &str) -> bool
sourcepub fn new(
state: InitialScriptState,
port: Receiver<MainThreadScriptMsg>,
chan: Sender<MainThreadScriptMsg>,
layout_factory: Arc<dyn LayoutFactory>,
system_font_service: Arc<SystemFontServiceProxy>,
user_agent: Cow<'static, str>,
) -> ScriptThread
pub fn new( state: InitialScriptState, port: Receiver<MainThreadScriptMsg>, chan: Sender<MainThreadScriptMsg>, layout_factory: Arc<dyn LayoutFactory>, system_font_service: Arc<SystemFontServiceProxy>, user_agent: Cow<'static, str>, ) -> ScriptThread
Creates a new script thread.
pub fn get_cx(&self) -> JSContext
sourcefn can_continue_running_inner(&self) -> bool
fn can_continue_running_inner(&self) -> bool
Check if we are closing.
sourcefn prepare_for_shutdown_inner(&self)
fn prepare_for_shutdown_inner(&self)
We are closing, ensure no script can run and potentially hang.
sourcepub fn start(&self, can_gc: CanGc)
pub fn start(&self, can_gc: CanGc)
Starts the script thread. After calling this method, the script thread will loop receiving messages on its port.
sourcefn run_the_resize_steps(
&self,
id: PipelineId,
size: WindowSizeData,
size_type: WindowSizeType,
can_gc: CanGc,
)
fn run_the_resize_steps( &self, id: PipelineId, size: WindowSizeData, size_type: WindowSizeType, can_gc: CanGc, )
sourcefn process_mouse_move_event(
&self,
document: &Document,
window: &Window,
point: Point2D<f32>,
node_address: Option<UntrustedNodeAddress>,
pressed_mouse_buttons: u16,
can_gc: CanGc,
)
fn process_mouse_move_event( &self, document: &Document, window: &Window, point: Point2D<f32>, node_address: Option<UntrustedNodeAddress>, pressed_mouse_buttons: u16, can_gc: CanGc, )
Process a compositor mouse move event.
sourcefn process_pending_compositor_events(
&self,
pipeline_id: PipelineId,
can_gc: CanGc,
)
fn process_pending_compositor_events( &self, pipeline_id: PipelineId, can_gc: CanGc, )
Process compositor events as part of a “update the rendering task”.
sourcefn update_the_rendering(&self, can_gc: CanGc)
fn update_the_rendering(&self, can_gc: CanGc)
sourcefn rendering_opportunity(&self, pipeline_id: PipelineId)
fn rendering_opportunity(&self, pipeline_id: PipelineId)
sourcefn handle_msgs(&self, can_gc: CanGc) -> bool
fn handle_msgs(&self, can_gc: CanGc) -> bool
Handle incoming messages from other tasks and the task queue.
fn update_animations_and_send_events(&self, can_gc: CanGc)
fn categorize_msg(&self, msg: &MixedMessage) -> ScriptThreadEventCategory
fn notify_activity_to_hang_monitor(&self, category: &ScriptThreadEventCategory)
fn message_to_pipeline(&self, msg: &MixedMessage) -> Option<PipelineId>
fn profile_event<F, R>(
&self,
category: ScriptThreadEventCategory,
pipeline_id: Option<PipelineId>,
f: F,
) -> Rwhere
F: FnOnce() -> R,
fn handle_msg_from_constellation( &self, msg: ConstellationControlMsg, can_gc: CanGc, )
fn handle_set_scroll_states_msg( &self, pipeline_id: PipelineId, scroll_states: Vec<ScrollState>, )
fn handle_set_epoch_paint_time( &self, pipeline_id: PipelineId, epoch: Epoch, time: CrossProcessInstant, )
fn handle_msg_from_webgpu_server(&self, msg: WebGPUMsg, can_gc: CanGc)
fn handle_msg_from_script(&self, msg: MainThreadScriptMsg)
fn handle_msg_from_devtools(&self, msg: DevtoolScriptControlMsg, can_gc: CanGc)
fn handle_msg_from_image_cache( &self, (id, response): (PipelineId, PendingImageResponse), )
fn handle_webdriver_msg( &self, pipeline_id: PipelineId, msg: WebDriverScriptCommand, can_gc: CanGc, )
sourcefn handle_resize_message(
&self,
id: PipelineId,
size: WindowSizeData,
size_type: WindowSizeType,
)
fn handle_resize_message( &self, id: PipelineId, size: WindowSizeData, size_type: WindowSizeType, )
Batch window resize operations into a single “update the rendering” task, or, if a load is in progress, set the window size directly.
fn handle_exit_fullscreen(&self, id: PipelineId, can_gc: CanGc)
fn handle_viewport(&self, id: PipelineId, rect: Rect<f32>, can_gc: CanGc)
fn handle_new_layout( &self, new_layout_info: NewLayoutInfo, origin: MutableOrigin, )
fn collect_reports(&self, reports_chan: ReportsChan)
sourcefn handle_set_throttled_in_containing_iframe_msg(
&self,
parent_pipeline_id: PipelineId,
browsing_context_id: BrowsingContextId,
throttled: bool,
)
fn handle_set_throttled_in_containing_iframe_msg( &self, parent_pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, throttled: bool, )
Updates iframe element after a change in visibility
fn handle_set_throttled_msg(&self, id: PipelineId, throttled: bool)
sourcefn handle_set_document_activity_msg(
&self,
id: PipelineId,
activity: DocumentActivity,
)
fn handle_set_document_activity_msg( &self, id: PipelineId, activity: DocumentActivity, )
Handles activity change message
fn handle_focus_iframe_msg( &self, parent_pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, can_gc: CanGc, )
fn handle_post_message_msg( &self, pipeline_id: PipelineId, source_pipeline_id: PipelineId, source_browsing_context: TopLevelBrowsingContextId, origin: Option<ImmutableOrigin>, source_origin: ImmutableOrigin, data: StructuredSerializedData, )
fn handle_stop_delaying_load_events_mode(&self, pipeline_id: PipelineId)
fn handle_unload_document(&self, pipeline_id: PipelineId, can_gc: CanGc)
fn handle_update_pipeline_id( &self, parent_pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId, new_pipeline_id: PipelineId, reason: UpdatePipelineIdReason, can_gc: CanGc, )
fn handle_update_history_state_msg( &self, pipeline_id: PipelineId, history_state_id: Option<HistoryStateId>, url: ServoUrl, can_gc: CanGc, )
fn handle_remove_history_states( &self, pipeline_id: PipelineId, history_states: Vec<HistoryStateId>, )
sourcefn handle_resize_inactive_msg(&self, id: PipelineId, new_size: WindowSizeData)
fn handle_resize_inactive_msg(&self, id: PipelineId, new_size: WindowSizeData)
Window was resized, but this script was not active, so don’t reflow yet
sourcefn handle_page_headers_available(
&self,
id: &PipelineId,
metadata: Option<Metadata>,
can_gc: CanGc,
) -> Option<Root<Dom<ServoParser>>>
fn handle_page_headers_available( &self, id: &PipelineId, metadata: Option<Metadata>, can_gc: CanGc, ) -> Option<Root<Dom<ServoParser>>>
We have received notification that the response associated with a load has completed. Kick off the document and frame tree creation process using the result.
pub fn dom_manipulation_task_source( &self, pipeline_id: PipelineId, ) -> DOMManipulationTaskSource
pub fn gamepad_task_source(&self, pipeline_id: PipelineId) -> GamepadTaskSource
pub fn media_element_task_source( &self, pipeline_id: PipelineId, ) -> MediaElementTaskSource
pub fn performance_timeline_task_source( &self, pipeline_id: PipelineId, ) -> PerformanceTimelineTaskSource
pub fn history_traversal_task_source( &self, pipeline_id: PipelineId, ) -> HistoryTraversalTaskSource
pub fn user_interaction_task_source( &self, pipeline_id: PipelineId, ) -> UserInteractionTaskSource
pub fn networking_task_source( &self, pipeline_id: PipelineId, ) -> NetworkingTaskSource
pub fn port_message_queue(&self, pipeline_id: PipelineId) -> PortMessageQueue
pub fn file_reading_task_source( &self, pipeline_id: PipelineId, ) -> FileReadingTaskSource
pub fn remote_event_task_source( &self, pipeline_id: PipelineId, ) -> RemoteEventTaskSource
fn rendering_task_source(&self, pipeline_id: PipelineId) -> RenderingTaskSource
pub fn timer_task_source(&self, pipeline_id: PipelineId) -> TimerTaskSource
pub fn websocket_task_source( &self, pipeline_id: PipelineId, ) -> WebsocketTaskSource
sourcefn handle_get_title_msg(&self, pipeline_id: PipelineId)
fn handle_get_title_msg(&self, pipeline_id: PipelineId)
Handles a request for the window title.
sourcefn handle_exit_pipeline_msg(
&self,
id: PipelineId,
discard_bc: DiscardBrowsingContext,
can_gc: CanGc,
)
fn handle_exit_pipeline_msg( &self, id: PipelineId, discard_bc: DiscardBrowsingContext, can_gc: CanGc, )
Handles a request to exit a pipeline and shut down layout.
sourcefn handle_exit_script_thread_msg(&self, can_gc: CanGc)
fn handle_exit_script_thread_msg(&self, can_gc: CanGc)
Handles a request to exit the script thread and shut down layout.
sourcepub fn handle_tick_all_animations_for_testing(id: PipelineId)
pub fn handle_tick_all_animations_for_testing(id: PipelineId)
Handles animation tick requested during testing.
sourcefn handle_web_font_loaded(&self, pipeline_id: PipelineId, _success: bool)
fn handle_web_font_loaded(&self, pipeline_id: PipelineId, _success: bool)
Handles a Web font being loaded. Does nothing if the page no longer exists.
sourcefn handle_worklet_loaded(&self, pipeline_id: PipelineId, can_gc: CanGc)
fn handle_worklet_loaded(&self, pipeline_id: PipelineId, can_gc: CanGc)
Handles a worklet being loaded. Does nothing if the page no longer exists.
sourcefn handle_storage_event(
&self,
pipeline_id: PipelineId,
storage_type: StorageType,
url: ServoUrl,
key: Option<String>,
old_value: Option<String>,
new_value: Option<String>,
)
fn handle_storage_event( &self, pipeline_id: PipelineId, storage_type: StorageType, url: ServoUrl, key: Option<String>, old_value: Option<String>, new_value: Option<String>, )
Notify a window of a storage event
sourcefn handle_iframe_load_event(
&self,
parent_id: PipelineId,
browsing_context_id: BrowsingContextId,
child_id: PipelineId,
can_gc: CanGc,
)
fn handle_iframe_load_event( &self, parent_id: PipelineId, browsing_context_id: BrowsingContextId, child_id: PipelineId, can_gc: CanGc, )
Notify the containing document of a child iframe that has completed loading.
fn ask_constellation_for_browsing_context_info( &self, pipeline_id: PipelineId, ) -> Option<(BrowsingContextId, Option<PipelineId>)>
fn ask_constellation_for_top_level_info( &self, sender_pipeline: PipelineId, browsing_context_id: BrowsingContextId, ) -> Option<TopLevelBrowsingContextId>
fn remote_window_proxy( &self, global_to_clone: &GlobalScope, top_level_browsing_context_id: TopLevelBrowsingContextId, pipeline_id: PipelineId, opener: Option<BrowsingContextId>, ) -> Option<Root<Dom<WindowProxy>>>
fn local_window_proxy( &self, window: &Window, browsing_context_id: BrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId, parent_info: Option<PipelineId>, opener: Option<BrowsingContextId>, ) -> Root<Dom<WindowProxy>>
sourcefn load(
&self,
metadata: Metadata,
incomplete: InProgressLoad,
can_gc: CanGc,
) -> Root<Dom<ServoParser>>
fn load( &self, metadata: Metadata, incomplete: InProgressLoad, can_gc: CanGc, ) -> Root<Dom<ServoParser>>
The entry point to document loading. Defines bindings, sets up the window and document objects, parses HTML and CSS, and kicks off initial layout.
fn notify_devtools( &self, title: DOMString, url: ServoUrl, (bc, p, w): (BrowsingContextId, PipelineId, Option<WorkerId>), )
sourcefn rebuild_and_force_reflow(
&self,
document: &Document,
reason: ReflowReason,
can_gc: CanGc,
)
fn rebuild_and_force_reflow( &self, document: &Document, reason: ReflowReason, can_gc: CanGc, )
Reflows non-incrementally, rebuilding the entire layout tree in the process.
sourcefn handle_event(&self, pipeline_id: PipelineId, event: CompositorEvent)
fn handle_event(&self, pipeline_id: PipelineId, event: CompositorEvent)
Queue compositor events for later dispatching as part of a
update_the_rendering
task.
fn handle_touch_event( &self, pipeline_id: PipelineId, event_type: TouchEventType, identifier: TouchId, point: Point2D<f32>, node_address: Option<UntrustedNodeAddress>, can_gc: CanGc, ) -> TouchEventResult
fn handle_wheel_event( &self, pipeline_id: PipelineId, wheel_delta: WheelDelta, point: Point2D<f32>, node_address: Option<UntrustedNodeAddress>, can_gc: CanGc, )
Handle a “navigate an iframe” message from the constellation.
sourcepub fn eval_js_url(
global_scope: &GlobalScope,
load_data: &mut LoadData,
can_gc: CanGc,
)
pub fn eval_js_url( global_scope: &GlobalScope, load_data: &mut LoadData, can_gc: CanGc, )
Turn javascript: URL into JS code to eval, according to the steps in https://html.spec.whatwg.org/multipage/#javascript-protocol
fn handle_resize_event( &self, pipeline_id: PipelineId, new_size: WindowSizeData, size_type: WindowSizeType, can_gc: CanGc, )
sourcefn pre_page_load(&self, incomplete: InProgressLoad, load_data: LoadData)
fn pre_page_load(&self, incomplete: InProgressLoad, load_data: LoadData)
Instructs the constellation to fetch the document that will be loaded. Stores the InProgressLoad argument until a notification is received that the fetch is complete.
fn handle_fetch_metadata( &self, id: PipelineId, request_id: RequestId, fetch_metadata: Result<FetchMetadata, NetworkError>, )
fn handle_fetch_chunk( &self, pipeline_id: PipelineId, request_id: RequestId, chunk: Vec<u8>, )
fn handle_fetch_eof( &self, id: PipelineId, request_id: RequestId, eof: Result<ResourceFetchTiming, NetworkError>, )
sourcefn start_page_load_about_blank(
&self,
incomplete: InProgressLoad,
js_eval_result: Option<JsEvalResult>,
)
fn start_page_load_about_blank( &self, incomplete: InProgressLoad, js_eval_result: Option<JsEvalResult>, )
Synchronously fetch about:blank
. Stores the InProgressLoad
argument until a notification is received that the fetch is complete.
sourcefn page_load_about_srcdoc(
&self,
incomplete: InProgressLoad,
load_data: LoadData,
)
fn page_load_about_srcdoc( &self, incomplete: InProgressLoad, load_data: LoadData, )
Synchronously parse a srcdoc document from a giving HTML string.
fn handle_css_error_reporting( &self, pipeline_id: PipelineId, filename: String, line: u32, column: u32, msg: String, )
fn handle_reload(&self, pipeline_id: PipelineId, can_gc: CanGc)
fn handle_paint_metric( &self, pipeline_id: PipelineId, metric_type: ProgressiveWebMetricType, metric_value: CrossProcessInstant, can_gc: CanGc, )
fn handle_media_session_action( &self, pipeline_id: PipelineId, action: MediaSessionActionType, can_gc: CanGc, )
pub fn enqueue_microtask(job: Microtask)
fn perform_a_microtask_checkpoint(&self, can_gc: CanGc)
Trait Implementations§
source§impl Drop for ScriptThread
impl Drop for ScriptThread
source§impl ScriptThreadFactory for ScriptThread
impl ScriptThreadFactory for ScriptThread
source§fn create(
state: InitialScriptState,
layout_factory: Arc<dyn LayoutFactory>,
system_font_service: Arc<SystemFontServiceProxy>,
load_data: LoadData,
user_agent: Cow<'static, str>,
)
fn create( state: InitialScriptState, layout_factory: Arc<dyn LayoutFactory>, system_font_service: Arc<SystemFontServiceProxy>, load_data: LoadData, user_agent: Cow<'static, str>, )
ScriptThread
.Auto Trait Implementations§
impl !Freeze for ScriptThread
impl !RefUnwindSafe for ScriptThread
impl !Send for ScriptThread
impl !Sync for ScriptThread
impl Unpin for ScriptThread
impl !UnwindSafe for ScriptThread
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> 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