Crate script_traits
source ·Expand description
This module contains traits in script used generically in the rest of Servo. The traits are here instead of in script so that these modules won’t have to depend on script.
Modules
Defines data structures which are consumed by the Compositor.
This module contains implementations in script that are serializable,
as per https://html.spec.whatwg.org/multipage/#serializable-objects.
The implementations are here instead of in script
so that the other modules involved in the serialization don’t have
to depend on script.
This module contains implementations in script that are transferable.
The implementations are here instead of in script
so that the other modules involved in the transfer don’t have
to depend on script.
Structs
Specifies if rAF should be triggered and/or CSS Animations and Transitions.
Specifies the information required to load an auxiliary browsing context.
Message for communication between the constellation and a global managing broadcast channels.
The result of a hit test in the compositor.
Message that gets passed to service worker scope on postMessage
The result of executing paint code: the image together with any image URLs that need to be loaded.
Specifies the information required to load an iframe.
Specifies the information required to load a URL in an iframe.
An iframe sizing operation.
Data needed to construct a script thread.
https://w3c.github.io/ServiceWorker/#dfn-job
can be passed to
LoadUrl
to load a page with GET/POST
parameters or headersThe initial data required to create a new layout attached to an existing script thread.
A task on the https://html.spec.whatwg.org/multipage/#port-message-queue
Channels to allow service worker manager to communicate with constellation and resource thread
Entities required to spawn service workers
A Script to Constellation channel.
The scroll state of a stacking context.
A data-holder for serialized data and transferred objects.
https://html.spec.whatwg.org/multipage/#structuredserializewithtransfer
Notifies the script thread to fire due timers.
TimerSource
must be FromWindow
when dispatched to ScriptThread
and
must be FromWorker
when dispatched to a DedicatedGlobalWorkerScope
The id to be used for a
TimerEvent
is defined by the corresponding TimerEventRequest
.Requests a TimerEvent-Message be sent after the given duration.
The message used to send a request to the timer scheduler.
An opaque identifier for a touch point.
The address of a node. Layout sends these back. They must be validated via
from_untrusted_node_address
before they can be used, because we do not trust layout.A mechanism to communicate with the parent process’ WebRender instance.
The Wheel event deltas in every direction
Data about the window size.
Resources required by workerglobalscopes
Common entities representing a network load origin
Enums
For a given pipeline, whether any animations are currently running
and any animation callbacks are queued
Events from the compositor that the script thread needs to know about
Messages sent from the constellation or layout to the script thread.
When a pipeline is closed, should its browsing context be discarded too?
Is a document fully active, active or inactive?
A document is active if it is the current active document in its session history,
it is fuly active if it is active and all of its ancestors are active,
and it is inactive otherwise.
Used to determine if a script has any pending asynchronous activity.
Whether a DOM event was prevented by web content
https://html.spec.whatwg.org/multipage/#replacement-enabled
Whether the sandbox attribute is present for an iframe element
Serializable image updates that must be performed by WebRender.
The kind of error the job promise should be rejected with.
Messages sent from Job algorithms steps running in the SW manager,
in order to resolve or reject the job promise.
Jobs are resolved with the help of various values.
https://w3c.github.io/ServiceWorker/#dfn-job-type
The result of evaluating a javascript scheme url.
Messages sent to the layout thread from the constellation and/or compositor.
Messages from the layout to the constellation.
The origin where a given load was initiated.
Useful for origin checks, for example before evaluation a JS URL.
A log entry reported to the constellation
We don’t report all log entries, just serious ones.
We need a separate type for this because
LogLevel
isn’t serializable.The type of MediaSession action.
https://w3c.github.io/mediasession/#enumdef-mediasessionaction
Messages for communication between the constellation and a global managing ports.
Unit of measurement.
The mouse button involved in the event.
The types of mouse events
Unit of measurement.
Errors from executing a paint worklet
Type of recorded progressive web metric
Messages outgoing from the Service Worker Manager thread to constellation
Messages from the script to the constellation.
Serialized
ImageData
. It contains IPC byte channel receiver to prevent from loading bytes too
slow.Serialized
ImageUpdate
.Messages sent to Service Worker Manager thread
Describes the thread that requested the TimerEvent.
The type of input represented by a multi-touch event.
The reason why the pipeline id of an iframe is being updated.
Messages to the constellation originating from the WebDriver server.
The set of WebRender operations that can be initiated by the content process.
Mode to measure WheelDelta floats in
The type of window size change.
Traits
Execute paint code in the worklet thread pool.
This trait allows creating a
ScriptThread
without depending on the script
crate.This trait allows creating a
ServiceWorkerManager
without depending on the script
crate.Functions
Returns the duration since an unspecified epoch measured in ms.
Type Definitions
Amount of milliseconds.
Amount of nanoseconds.