Skip to content

Commit ad75373

Browse files
committed
[css-paint-api] Move to RenderWorkletGlobalScope
1 parent 4f45879 commit ad75373

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

css-paint-api/Overview.bs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ Registering Custom Paint {#registering-custom-paint}
7070
<pre class='idl'>
7171
callback VoidFunction = void ();
7272

73-
interface PaintWorkletGlobalScope : WorkletGlobalScope {
73+
partial interface RenderWorkletGlobalScope {
7474
void registerPaint(DOMString name, VoidFunction paintCtor);
7575
void unregisterPaint(DOMString name);
7676
};
7777
</pre>
7878

79-
A {{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+
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.
8080

8181
<div class='note'>
8282
Note: This is how the class should look.
@@ -89,7 +89,7 @@ A {{PaintWorkletGlobalScope}} has a map of <b>name to paint instance map</b>. In
8989
</pre>
9090
</div>
9191

92-
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:
92+
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:
9393
1. If the |name| is not a valid <<ident>>, <a>throw</a> a <a>NotSupportedError</a> and abort all these steps.
9494
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.
9595
3. If the result of <a>IsConstructor</a>(argument=|paintCtor|) is false, <a>throw</a> a <a>NotSupportedError</a> and abort all these steps.
@@ -100,7 +100,7 @@ When the <dfn method for=PaintWorkletGlobalScope>registerPaint(<var>name</var>,
100100
8. If the result of <a>IsArray</a>(argument=|inputProperties|) is false, <a>throw</a> a <a>NotSupportedError</a> and abort all these steps.
101101
9. Add the key-value pair (|name| - |inputProperties|) to the <b>paint name to input properties map</b> of the associated <a>document</a>.
102102
10. Let <var>paintInstance</var> be the result of <a>Construct</a>(|paintCtor|).
103-
11. Add the key-value pair (|name| - |paintInstance|) to the <b>name to paint instance map</b> of the {{PaintWorkletGlobalScope}}.
103+
11. Add the key-value pair (|name| - |paintInstance|) to the <b>name to paint instance map</b> of the {{RenderWorkletGlobalScope}}.
104104

105105
Note: The list of CSS properties provided by the input properties getter can either be custom or native CSS properties.
106106

@@ -112,9 +112,9 @@ Note: In a future version of the spec, the author may be able to set an option t
112112

113113
Issue(w3c/css-houdini-drafts#31): Allow author to specify the intrinsic size.
114114

115-
When the <dfn method for=PaintWorkletGlobalScope>unregisterPaint(<var>name</var>)</dfn> method is called, the user agent <em>must</em> run the following steps:
115+
When the <dfn method for=RenderWorkletGlobalScope>unregisterPaint(<var>name</var>)</dfn> method is called, the user agent <em>must</em> run the following steps:
116116
1. Remove the key-value pair associated with the |name| key in the <b>paint name to input properties map</b> of the associated <a>document</a>.
117-
2. Remove the key-value pair associated with the |name| key in the <b>name to paint instance map</b> of the {{PaintWorkletGlobalScope}}.
117+
2. Remove the key-value pair associated with the |name| key in the <b>name to paint instance map</b> of the {{RenderWorkletGlobalScope}}.
118118

119119
Paint Notation {#paint-notation}
120120
================================
@@ -219,7 +219,7 @@ When the user agent wants to <dfn>draw an image</dfn> of a <<paint()>> for a <va
219219
6. Let <var>overflow</var> be the result <a>invoke a method on a class inside a Worklet</a> given "overflow" as the <em>methodPropertyKey</em> and [|styleMap|] as the <em>arguments</em> with the following options:
220220
- To <a>create a worklet global scope</a> the user agent will:
221221

222-
Return a new {{PaintWorkletGlobalScope}}.
222+
Return a new {{RenderWorkletGlobalScope}}.
223223
- To <a>lookup a class instance on a worklet global scope</a> given a |workletGlobalScope|, the user agent will:
224224

225225
Return the result of looking up |name| on the |workletGlobalScope|'s <b>name to paint instance map</b>.
@@ -244,7 +244,7 @@ When the user agent wants to <dfn>draw an image</dfn> of a <<paint()>> for a <va
244244
9. 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:
245245
- To <a>create a worklet global scope</a> the user agent will:
246246

247-
Return a new {{PaintWorkletGlobalScope}}.
247+
Return a new {{RenderWorkletGlobalScope}}.
248248
- To <a>lookup a class instance on a worklet global scope</a> given a |workletGlobalScope|, the user agent will:
249249

250250
Return the result of looking up |name| on the |workletGlobalScope|'s <b>name to paint instance map</b>.
@@ -279,7 +279,7 @@ Example 1: A colored circle. {#example-1}
279279
-----------------------------------------
280280

281281
<pre class='lang-javascript'>
282-
// Inside PaintWorkletGlobalScope.
282+
// Inside RenderWorkletGlobalScope.
283283
registerPaint('circle', class {
284284
static get inputProperties() { return ['--circle-color']; }
285285
paint(ctx, geom, properties) {

0 commit comments

Comments
 (0)