LayoutWorkletGlobalScope Class

The global object of a layout worklet (https://drafts.css-houdini.org/css-layout-api-1/#layoutworkletglobalscope): the scripts added to CSS.layoutWorklet register the classes that lay out the display: layout() boxes.

public sealed class LayoutWorkletGlobalScope : WorkletGlobalScope
Inheritance
WorkletGlobalScope LayoutWorkletGlobalScope

Methods

NameDescription
RegisterLayout(string, WorkletClassConstructor)Registers a class that lays out the display: layout() boxes (https://drafts.css-houdini.org/css-layout-api-1/#dom-layoutworkletglobalscope-registerlayout).

RegisterLayout(string, WorkletClassConstructor)

LayoutWorklet.cs

Registers a class that lays out the display: layout() boxes (https://drafts.css-houdini.org/css-layout-api-1/#dom-layoutworkletglobalscope-registerlayout).

public void RegisterLayout(string name, WorkletClassConstructor layoutCtor)

Parameters

name string
The name of the layout.
layoutCtor WorkletClassConstructor
The class: its static inputProperties, childInputProperties and layoutOptions properties are read once, and its prototype has the intrinsicSizes and layout callbacks.

Exceptions

TypeErrorException
The name is empty, the options are invalid, the prototype of the class is not an object, or it has no intrinsicSizes or layout function.
DomException
An InvalidModificationError when the name is already registered in the global scope.

See also