AnimationWorkletGlobalScope Class
The global object of an animation worklet (https://drafts.css-houdini.org/css-animation-worklet-1/#animationworkletglobalscope): the scripts added to CSS.animationWorklet register the animators of the WorkletAnimation objects.
public sealed class AnimationWorkletGlobalScope : WorkletGlobalScope- Inheritance
WorkletGlobalScopeAnimationWorkletGlobalScope
Methods
| Name | Description |
|---|---|
| RegisterAnimator(string, WorkletClassConstructor) | Registers a class whose instances drive the effects of the worklet animations of the name (https://drafts.css-houdini.org/css-animation-worklet-1/#dom-animationworkletglobalscope-registeranimator). |
RegisterAnimator(string, WorkletClassConstructor)
AnimationWorklet.csRegisters a class whose instances drive the effects of the worklet animations of the name (https://drafts.css-houdini.org/css-animation-worklet-1/#dom-animationworkletglobalscope-registeranimator).
public void RegisterAnimator(string name, WorkletClassConstructor animatorCtor)Parameters
namestring- The name of the animator: an identifier.
animatorCtorWorkletClassConstructor- The class: its prototype has the
animatecallback, and astatefunction when the animator is stateful.
Exceptions
TypeErrorException- The name is not an identifier, the value is not a constructor, or its prototype has no
animatefunction. DomException- A
NotSupportedErrorwhen the name is already registered in the global scope.