pub enum JsTask {
Show 18 variants
SetDocumentUrl {
url: String,
},
SetOrigin {
origin: String,
},
SetViewport {
width: f32,
height: f32,
},
SetLanguage {
language: String,
},
SetLayoutMetrics {
metrics: HashMap<u64, JsLayoutMetrics>,
},
RunScript {
source: String,
},
DispatchDomContentLoaded,
DispatchWindowLoad,
RunTimers,
Click {
dom_id: u64,
},
Scroll {
dom_id: u64,
},
DispatchElementEvent {
dom_id: u64,
event_type: String,
},
ResolveFetch {
id: u64,
response: JsFetchResponse,
},
RejectFetch {
id: u64,
reason: String,
},
ResolveDevTools {
id: u64,
result: String,
},
ResolveIframe {
dom_id: u64,
html: String,
},
RejectIframe {
dom_id: u64,
},
UpdateDom {
snapshot: DomSnapshot,
},
}Expand description
What the background JS thread should do next.
Variants§
SetDocumentUrl
Set the URL exposed through document and related browser APIs.
SetOrigin
Set the serialized origin exposed through window/location/document.
SetViewport
Update CSS-pixel dimensions exposed through the Window API.
SetLanguage
Update the language preferences exposed through navigator.
SetLayoutMetrics
Replace DOM geometry exposed by measurement APIs.
Fields
metrics: HashMap<u64, JsLayoutMetrics>RunScript
Execute a classic (blocking or deferred) script.
DispatchDomContentLoaded
Dispatch DOMContentLoaded to document listeners.
DispatchWindowLoad
Dispatch the window load event (fires window.onload).
RunTimers
Run timer callbacks whose deadlines have elapsed (coalescable).
Click
Dispatch a click on the element with the given JS-facing dom id.
Scroll
Dispatch a scroll event on the element with the given JS-facing dom id.
DispatchElementEvent
Dispatch an event on the element with the given JS-facing dom id.
ResolveFetch
Resolve a pending JavaScript fetch() with a network response.
RejectFetch
Reject a pending JavaScript fetch() after a network failure.
ResolveDevTools
Settle a pending DevTools inspection request with its JSON envelope.
ResolveIframe
Parse fetched iframe HTML and install it as the host element’s
contentDocument, then fire its load event.
RejectIframe
Mark an iframe load as failed so later contentDocument accesses do not
keep re-queuing a fetch.
UpdateDom
Replace the JS thread’s mirror DOM with the UI’s tree (write-backs).
Fields
snapshot: DomSnapshotTrait Implementations§
Auto Trait Implementations§
impl Freeze for JsTask
impl RefUnwindSafe for JsTask
impl Send for JsTask
impl Sync for JsTask
impl Unpin for JsTask
impl UnsafeUnpin for JsTask
impl UnwindSafe for JsTask
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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