You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The {{RenderWorkletGlobalScope}} has a map of <b>name to paint instance map</b>. Initially this map is empty; it is populated when {{registerPaint(name, paintCtor)}} is called.
The {{PaintWorkletGlobalScope}} has a map of <b>name to paint instance map</b>. Initially this map is empty; it is populated when {{registerPaint(name, paintCtor)}} is called.
79
93
80
94
<div class='note'>
81
95
Note: This is how the class should look.
@@ -87,7 +101,7 @@ The {{RenderWorkletGlobalScope}} has a map of <b>name to paint instance map</b>.
87
101
</pre>
88
102
</div>
89
103
90
-
When the <dfn method for=RenderWorkletGlobalScope>registerPaint(<var>name</var>, <var>paintCtor</var>)</dfn> method is called, the user agent <em>must</em> run the following steps:
104
+
When the <dfn method for=PaintWorkletGlobalScope>registerPaint(<var>name</var>, <var>paintCtor</var>)</dfn> method is called, the user agent <em>must</em> run the following steps:
91
105
1. If the |name| is not a valid <<ident>>, <a>throw</a> a <a>NotSupportedError</a> and abort all these steps.
92
106
2. If the |name| exists as a key in the <b>name to paint instance map</b>, <a>throw</a> a <a>NotSupportedError</a> and abort all these steps.
93
107
3. If the result of <a>IsConstructor</a>(argument=|paintCtor|) is false, <a>throw</a> a <a>NotSupportedError</a> and abort all these steps.
@@ -97,7 +111,7 @@ When the <dfn method for=RenderWorkletGlobalScope>registerPaint(<var>name</var>,
97
111
7. If the result of <a>IsArray</a>(argument=|inputProperties|) is false, <a>throw</a> a <a>NotSupportedError</a> and abort all these steps.
98
112
8. Add the key-value pair (|name| - |inputProperties|) to the <b>paint name to input properties map</b> of the associated <a>document</a>.
99
113
9. Let <var>paintInstance</var> be the result of <a>Construct</a>(|paintCtor|).
100
-
10. Add the key-value pair (|name| - |paintInstance|) to the <b>name to paint instance map</b> of the {{RenderWorkletGlobalScope}}.
114
+
10. Add the key-value pair (|name| - |paintInstance|) to the <b>name to paint instance map</b> of the {{PaintWorkletGlobalScope}}.
101
115
102
116
Note: The list of CSS properties provided by the input properties getter can either be custom or native CSS properties.
103
117
@@ -212,7 +226,7 @@ When the user agent wants to <dfn>draw an image</dfn> of a <<paint()>> for a <va
212
226
8. To produce the image output, <a>invoke a method on a class inside a Worklet</a> given "paint" as the <em>methodPropertyKey</em> and [|renderingContext|, |geometry|, |styleMap|] as the <em>arguments</em> with the following options:
213
227
- To <a>create a worklet global scope</a> the user agent will:
214
228
215
-
Return a new {{RenderWorkletGlobalScope}}.
229
+
Return a new {{PaintWorkletGlobalScope}}.
216
230
- To <a>lookup a class instance on a worklet global scope</a> given a |workletGlobalScope|, the user agent will:
217
231
218
232
Return the result of looking up |name| on the |workletGlobalScope|'s <b>name to paint instance map</b>.
@@ -247,7 +261,7 @@ Example 1: A colored circle. {#example-1}
247
261
-----------------------------------------
248
262
249
263
<pre class='lang-javascript'>
250
-
// Inside RenderWorkletGlobalScope.
264
+
// Inside PaintWorkletGlobalScope.
251
265
registerPaint('circle', class {
252
266
static get inputProperties() { return ['--circle-color']; }
0 commit comments