Skip to content

Commit 6614844

Browse files
committed
[css-paint-api] Change a bunch of errors in registerPaint to better versions.
1 parent 656c8eb commit 6614844

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

css-paint-api/Overview.bs

+6-6
Original file line numberDiff line numberDiff line change
@@ -128,24 +128,24 @@ used, or the user agent needs to reclaim memory.
128128

129129
When the <dfn method for=PaintWorkletGlobalScope>registerPaint(|name|, |paintCtor|)</dfn> method is
130130
called, the user agent <em>must</em> run the following steps:
131-
1. If the |name| is not a valid <<ident>>, <a>throw</a> a <a>NotSupportedError</a> and abort all
132-
these steps.
131+
1. If the |name| is not a valid <<ident>>, <a>throw</a> a <a>TypeError</a> and abort all these
132+
steps.
133133

134134
2. If the |name| exists as a key in the <a>paint name to constructor map</a>, <a>throw</a> a
135135
<a>NotSupportedError</a> and abort all these steps.
136136

137137
3. If the result of <a>IsConstructor</a>(argument=|paintCtor|) is false, <a>throw</a> a
138-
<a>NotSupportedError</a> and abort all these steps.
138+
<a>TypeError</a> and abort all these steps.
139139

140140
4. Let |prototype| be the result of <a>Get</a>(O=|paintCtor|, P="prototype").
141141

142142
5. If the result of <a>IsCallable</a>(argument=<a>Get</a>(O=|prototype|, P="paint")) is false,
143-
<a>throw</a> a <a>NotSupportedError</a> and abort all these steps.
143+
<a>throw</a> a <a>TypeError</a> and abort all these steps.
144144

145145
6. Let |inputProperties| be the result of <a>Get</a>(O=|paintCtor|, P="inputProperties").
146146

147-
7. If the result of <a>IsArray</a>(argument=|inputProperties|) is false, <a>throw</a> a
148-
<a>NotSupportedError</a> and abort all these steps.
147+
7. If |inputProperties| is not undefined, and the result of <a>IsArray</a>(argument=
148+
|inputProperties|) is false, <a>throw</a> a <a>TypeError</a> and abort all these steps.
149149

150150
8. Add the key-value pair (|name| - |inputProperties|) to the <a>paint name to input properties
151151
map</a> of the associated <a>document</a>.

0 commit comments

Comments
 (0)