pub enum JsTask {
Show 22 variants
SetDocumentUrl {
url: String,
},
SetOrigin {
origin: String,
},
SetPermissions {
permissions: Permissions,
},
SetViewport {
width: f32,
height: f32,
},
SetLanguage {
language: String,
},
SetLayoutMetrics {
metrics: HashMap<u64, JsLayoutMetrics>,
computed_styles: HashMap<u64, Vec<(String, String)>>,
},
RunScript {
source: String,
label: Option<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,
url: String,
},
RejectIframe {
dom_id: u64,
},
SetTracing {
enabled: bool,
},
ClearTrace,
EvaluateConsole {
id: u64,
source: String,
},
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.
SetPermissions
Install the effective capabilities of the top-level document, inherited by any child frame.
Fields
permissions: PermissionsSetViewport
Update CSS-pixel dimensions exposed through the Window API.
SetLanguage
Update the language preferences exposed through navigator.
SetLayoutMetrics
Replace DOM geometry and computed styles exposed by measurement APIs.
RunScript
Execute a classic (blocking or deferred) script.
Fields
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, recording the effective URL, then fire its load event.
RejectIframe
Mark an iframe load as failed so later contentDocument accesses do not
keep re-queuing a fetch.
SetTracing
Start or stop JavaScript execution tracing.
ClearTrace
Clear the buffered JavaScript execution trace.
EvaluateConsole
Evaluate a DevTools console expression in the page’s JavaScript runtime.
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> ⓘ
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