Enum ScriptThreadMessage

Source
pub enum ScriptThreadMessage {
Show 39 variants StopDelayingLoadEventsMode(PipelineId), AttachLayout(NewLayoutInfo), Resize(PipelineId, ViewportDetails, WindowSizeType), ThemeChange(PipelineId, Theme), ResizeInactive(PipelineId, ViewportDetails), ExitFullScreen(PipelineId), UnloadDocument(PipelineId), ExitPipeline(WebViewId, PipelineId, DiscardBrowsingContext), ExitScriptThread, SendInputEvent(PipelineId, ConstellationInputEvent), RefreshCursor(PipelineId), Viewport(PipelineId, Rect<f32, UnknownUnit>), GetTitle(PipelineId), SetDocumentActivity(PipelineId, DocumentActivity), SetThrottled(PipelineId, bool), SetThrottledInContainingIframe(PipelineId, BrowsingContextId, bool), NavigateIframe(PipelineId, BrowsingContextId, LoadData, NavigationHistoryBehavior), PostMessage { target: PipelineId, source: PipelineId, source_browsing_context: WebViewId, target_origin: Option<ImmutableOrigin>, source_origin: ImmutableOrigin, data: Box<StructuredSerializedData>, }, UpdatePipelineId(PipelineId, BrowsingContextId, WebViewId, PipelineId, UpdatePipelineIdReason), UpdateHistoryState(PipelineId, Option<HistoryStateId>, ServoUrl), RemoveHistoryStates(PipelineId, Vec<HistoryStateId>), FocusIFrame(PipelineId, BrowsingContextId, FocusSequenceNumber), FocusDocument(PipelineId, FocusSequenceNumber), Unfocus(PipelineId, FocusSequenceNumber), WebDriverScriptCommand(PipelineId, WebDriverScriptCommand), TickAllAnimations(Vec<WebViewId>), WebFontLoaded(PipelineId, bool), DispatchIFrameLoadEvent { target: BrowsingContextId, parent: PipelineId, child: PipelineId, }, DispatchStorageEvent(PipelineId, StorageType, ServoUrl, Option<String>, Option<String>, Option<String>), ReportCSSError(PipelineId, String, u32, u32, String), Reload(PipelineId), PaintMetric(PipelineId, ProgressiveWebMetricType, CrossProcessInstant, bool), MediaSessionAction(PipelineId, MediaSessionActionType), SetWebGPUPort(IpcReceiver<WebGPUMsg>), SetScrollStates(PipelineId, HashMap<ExternalScrollId, LayoutVector2D>), EvaluateJavaScript(PipelineId, JavaScriptEvaluationId, String), SendImageKeysBatch(PipelineId, Vec<ImageKey>), PreferencesUpdated(Vec<(String, PrefValue)>), NoLongerWaitingOnAsychronousImageUpdates(PipelineId),
}
Expand description

Messages sent to the ScriptThread event loop from the Constellation, Compositor, and (for now) Layout.

Variants§

§

StopDelayingLoadEventsMode(PipelineId)

Takes the associated window proxy out of “delaying-load-events-mode”, used if a scheduled navigated was refused by the embedder. https://html.spec.whatwg.org/multipage/#delaying-load-events-mode

§

AttachLayout(NewLayoutInfo)

Gives a channel and ID to a layout, as well as the ID of that layout’s parent

§

Resize(PipelineId, ViewportDetails, WindowSizeType)

Window resized. Sends a DOM event eventually, but first we combine events.

§

ThemeChange(PipelineId, Theme)

Theme changed.

§

ResizeInactive(PipelineId, ViewportDetails)

Notifies script that window has been resized but to not take immediate action.

§

ExitFullScreen(PipelineId)

Window switched from fullscreen mode.

§

UnloadDocument(PipelineId)

Notifies the script that the document associated with this pipeline should ‘unload’.

§

ExitPipeline(WebViewId, PipelineId, DiscardBrowsingContext)

Notifies the script that a pipeline should be closed.

§

ExitScriptThread

Notifies the script that the whole thread should be closed.

§

SendInputEvent(PipelineId, ConstellationInputEvent)

Sends a DOM event.

§

RefreshCursor(PipelineId)

Request that the given pipeline refresh the cursor by doing a hit test at the most recently hovered cursor position and resetting the cursor. This happens after a display list update is rendered.

§

Viewport(PipelineId, Rect<f32, UnknownUnit>)

Notifies script of the viewport.

§

GetTitle(PipelineId)

Requests that the script thread immediately send the constellation the title of a pipeline.

§

SetDocumentActivity(PipelineId, DocumentActivity)

Notifies script thread of a change to one of its document’s activity

§

SetThrottled(PipelineId, bool)

Set whether to use less resources by running timers at a heavily limited rate.

§

SetThrottledInContainingIframe(PipelineId, BrowsingContextId, bool)

Notify the containing iframe (in PipelineId) that the nested browsing context (BrowsingContextId) is throttled.

§

NavigateIframe(PipelineId, BrowsingContextId, LoadData, NavigationHistoryBehavior)

Notifies script thread that a url should be loaded in this iframe. PipelineId is for the parent, BrowsingContextId is for the nested browsing context

§

PostMessage

Post a message to a given window.

Fields

§target: PipelineId

The target of the message.

§source: PipelineId

The source of the message.

§source_browsing_context: WebViewId

The top level browsing context associated with the source pipeline.

§target_origin: Option<ImmutableOrigin>

The expected origin of the target.

§data: Box<StructuredSerializedData>

The data to be posted.

§

UpdatePipelineId(PipelineId, BrowsingContextId, WebViewId, PipelineId, UpdatePipelineIdReason)

Updates the current pipeline ID of a given iframe. First PipelineId is for the parent, second is the new PipelineId for the frame.

§

UpdateHistoryState(PipelineId, Option<HistoryStateId>, ServoUrl)

Updates the history state and url of a given pipeline.

§

RemoveHistoryStates(PipelineId, Vec<HistoryStateId>)

Removes inaccesible history states.

§

FocusIFrame(PipelineId, BrowsingContextId, FocusSequenceNumber)

Set an iframe to be focused. Used when an element in an iframe gains focus. PipelineId is for the parent, BrowsingContextId is for the nested browsing context

§

FocusDocument(PipelineId, FocusSequenceNumber)

Focus the document. Used when the container gains focus.

§

Unfocus(PipelineId, FocusSequenceNumber)

Notifies that the document’s container (e.g., an iframe) is not included in the top-level browsing context’s focus chain (not considering system focus) anymore.

Obviously, this message is invalid for a top-level document.

§

WebDriverScriptCommand(PipelineId, WebDriverScriptCommand)

Passes a webdriver command to the script thread for execution

§

TickAllAnimations(Vec<WebViewId>)

Notifies script thread that all animations are done

§

WebFontLoaded(PipelineId, bool)

Notifies the script thread that a new Web font has been loaded, and thus the page should be reflowed.

§

DispatchIFrameLoadEvent

Cause a load event to be dispatched at the appropriate iframe element.

Fields

§target: BrowsingContextId

The frame that has been marked as loaded.

§parent: PipelineId

The pipeline that contains a frame loading the target pipeline.

§child: PipelineId

The pipeline that has completed loading.

§

DispatchStorageEvent(PipelineId, StorageType, ServoUrl, Option<String>, Option<String>, Option<String>)

Cause a storage event to be dispatched at the appropriate window. The strings are key, old value and new value.

§

ReportCSSError(PipelineId, String, u32, u32, String)

Report an error from a CSS parser for the given pipeline

§

Reload(PipelineId)

Reload the given page.

§

PaintMetric(PipelineId, ProgressiveWebMetricType, CrossProcessInstant, bool)

Notifies the script thread about a new recorded paint metric.

§

MediaSessionAction(PipelineId, MediaSessionActionType)

Notifies the media session about a user requested media session action.

§

SetWebGPUPort(IpcReceiver<WebGPUMsg>)

Notifies script thread that WebGPU server has started

§

SetScrollStates(PipelineId, HashMap<ExternalScrollId, LayoutVector2D>)

The compositor scrolled and is updating the scroll states of the nodes in the given pipeline via the Constellation.

§

EvaluateJavaScript(PipelineId, JavaScriptEvaluationId, String)

Evaluate the given JavaScript and return a result via a corresponding message to the Constellation.

§

SendImageKeysBatch(PipelineId, Vec<ImageKey>)

A new batch of keys for the image cache for the specific pipeline.

§

PreferencesUpdated(Vec<(String, PrefValue)>)

Preferences were updated in the parent process.

§

NoLongerWaitingOnAsychronousImageUpdates(PipelineId)

Notify the ScriptThread that the Servo renderer is no longer waiting on asynchronous image uploads for the given Pipeline. These are mainly used by canvas to perform uploads while the display list is being built.

Trait Implementations§

Source§

impl Debug for ScriptThreadMessage

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ScriptThreadMessage

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<'_derivative_strum> From<&'_derivative_strum ScriptThreadMessage> for &'static str

Source§

fn from(x: &'_derivative_strum ScriptThreadMessage) -> &'static str

Converts to this type from the input type.
Source§

impl From<ScriptThreadMessage> for &'static str

Source§

fn from(x: ScriptThreadMessage) -> &'static str

Converts to this type from the input type.
Source§

impl Serialize for ScriptThreadMessage

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> WasmNotSend for T
where T: Send,