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.
  • script_msg 🔒
  • 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

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.
  • The set of WebRender operations that can be initiated by the content process.
  • 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.
  • 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