Skip to content

Commit 3da7993

Browse files
committed
[css-paint-api] Convert alphaValue variable, instead of manually performing checks.
1 parent f0187f1 commit 3da7993

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

css-paint-api/Overview.bs

+13-13
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ urlPrefix: https://heycam.github.io/webidl/; type: dfn;
2424
text: exception
2525
text: throw
2626
url: throw; text: thrown
27+
urlPrefix: #idl-;
28+
text: boolean
2729
url: es-invoking-callback-functions; text: Invoke
2830
url: es-type-mapping; text: converting
2931
urlPrefix: https://html.spec.whatwg.org/multipage/scripting.html; type: dfn;
@@ -178,30 +180,28 @@ called, the user agent <em>must</em> run the following steps:
178180

179181
6. Let |alphaValue| be the result of <a>Get</a>(|paintCtor|, "alpha").
180182

181-
7. If |alphaValue| is not undefined and the result of <a>Type</a>(|alpha|) is not Boolean,
182-
<a>throw</a> a <a>TypeError</a> and abort all these steps.
183-
184-
8. Let |alpha| be <code>true</code> if |alphaValue| is undefined, otherwise let it be the value
185-
of |alphaValue|.
183+
7. Let |alpha| be <code>true</code> if |alphaValue| is undefined, otherwise let it be the result
184+
of <a>converting</a> |alphaValue| to a <a>boolean</a>. If an exception is thrown, rethrow
185+
the exception and abort all these steps.
186186

187187
Note: Setting <code>alpha</code> is <code>false</code> allows user agents to anti-alias text
188188
an addition to performing "visibility" optimizations, e.g. not painting an image behind
189189
the paint image as the paint image is opaque.
190190

191-
9. If the result of <a>IsConstructor</a>(|paintCtor|) is false, <a>throw</a> a <a>TypeError</a>
191+
8. If the result of <a>IsConstructor</a>(|paintCtor|) is false, <a>throw</a> a <a>TypeError</a>
192192
and abort all these steps.
193193

194-
10. Let |prototype| be the result of <a>Get</a>(|paintCtor|, "prototype").
194+
9. Let |prototype| be the result of <a>Get</a>(|paintCtor|, "prototype").
195195

196-
11. If the result of <a>Type</a>(|prototype|) is not Object, <a>throw</a> a <a>TypeError</a> and
196+
10. If the result of <a>Type</a>(|prototype|) is not Object, <a>throw</a> a <a>TypeError</a> and
197197
abort all these steps.
198198

199-
12. Let |paint| be the result of <a>Get</a>(|prototype|, "paint").
199+
11. Let |paint| be the result of <a>Get</a>(|prototype|, "paint").
200200

201-
13. If the result of <a>IsCallable</a>(|paint|) is false, <a>throw</a> a <a>TypeError</a> and
201+
12. If the result of <a>IsCallable</a>(|paint|) is false, <a>throw</a> a <a>TypeError</a> and
202202
abort all these steps.
203203

204-
14. Let |definition| be a new <a>paint image definition</a> with:
204+
13. Let |definition| be a new <a>paint image definition</a> with:
205205

206206
- <a>paint image name</a> being |name|
207207

@@ -213,10 +213,10 @@ called, the user agent <em>must</em> run the following steps:
213213

214214
- <a>paint context alpha flag</a> being |alpha|.
215215

216-
15. Add the key-value pair (|name| - |inputProperties|) to the <a>paint name to input properties
216+
14. Add the key-value pair (|name| - |inputProperties|) to the <a>paint name to input properties
217217
map</a> of the associated <a>document</a>.
218218

219-
16. Add the key-value pair (|name| - |definition|) to the <a>paint name to paint image
219+
15. Add the key-value pair (|name| - |definition|) to the <a>paint name to paint image
220220
definition map</a> of the associated <a>document</a>.
221221

222222

0 commit comments

Comments
 (0)