Worklet interface is a lightweight version of
Worklets are restricted to specific use cases; they cannot be used for arbitrary computations like Web Workers. The
Worklet interface abstracts properties and methods common to all kind of worklets, and cannot be created directly. Instead, you can use one of the following classes:
||for defining how custom CSS properties are being rendered, accessible through
||Chrome: Main thread
Gecko: Paint thread
|CSS Painting API|
||for audio processing with custom AudioNodes||Web Audio render thread||Web Audio API|
||for creating scroll-linked and other high performance procedural animations||Compositor thread||CSS Animation Worklet API|
||for defining the positioning and dimensions of custom elements||CSS Layout API|
For 3D rendering with WebGL, you don't use Worklets. Instead, you write Vertex Shaders and Fragment Shaders using GLSL code, and those shaders will then run on the graphics card.
The Worklet interface does not define any properties.
- Adds the script module at the given URL to the current worklet.
|Worklets Level 1
The definition of 'Worklet' in that specification.