Expand description
The script crate contains all matters DOM.
Re-exports§
pub use script_runtime::JSEngineSetup;
Modules§
- animation_
timeline πA timeline module, used to specify anAnimationTimeline
which determines the time used for synchronizing animations in the script thread. - animations πThe set of animations for a document.
- body π
- canvas_
state π - devtools π
- Tracking of pending loads in a document.
- dom πThe implementation of the DOM.
- drag_
data_ πstore - image_
listener π - init π
- A safe wrapper for DOM nodes that prevents layout from mutating the DOM, from letting DOM nodes escape, and from generally doing anything that it isnβt supposed to. This is accomplished via a simple whitelist of allowed operations, along with some lifetime magic to prevent nodes from escaping.
- layout_
image πInfrastructure to initiate network requests for images needed by layout. The script thread needs to be responsible for them because thereβs no guarantee that the responsible nodes will still exist in the future if layout holds on to them during asynchronous operations. - links πDefines shared hyperlink behaviour for
<link>
,<a>
,<area>
and<form>
elements. - mem πRoutines for handling measuring the memory usage of arbitrary DOM nodes.
- microtask πImplementation of microtasks and microtask queues. It is up to implementations of event loops to store a queue and perform checkpoints at appropriate times, as well as enqueue microtasks as required.
- network_
listener π - realms π
- script_
module πThe script module mod contains common traits and structs related totype=module
for script thread or worker threads. - The script runtime contains common traits and structs commonly used by the script thread, the dom, and the worker threads.
- The script thread is the thread that owns the DOM in memory, runs JavaScript, and triggers layout. Itβs in charge of processing events for all same-origin pages in a frame tree, and manages the entire lifetime of pages in the frame tree from initial request to teardown.
- The service worker manager persists the descriptor of any registered service workers. It also stores an active workers map, which holds descriptors of running service workers. If an active service worker timeouts, then it removes the descriptor entry from its active_workers map
- stylesheet_
loader π - stylesheet_
set π - task πMachinery for tasks.
- task_
manager π - task_
queue πMachinery for task-queue. - task_
source π - Common handling of keyboard input and state management for text input controls
- timers π
- unminify π
- unpremultiplytable π
- webdriver_
handlers π - xpath π
Macros§
- Usage:
- Defines a macro
native_fn!
to create a JavaScript function from a Rust function pointer. - Defines a macro
native_raw_obj_fn!
to create a raw JavaScript function object. - Usage:
Structs§
- A struct to store a reference to the reflector of a DOM object.
Traits§
- A trait to allow tracing only DOM sub-objects.
- A trait to provide access to the
Reflector
for a DOM object. - A trait to allow tracing (only) DOM objects. Types that can be traced.
- A trait to initialize the
Reflector
for a DOM object.