Skip to content

Commit abf9f11

Browse files
committed
[css-font-loading] Until Anne adds useful language for rejecting with a FooError, be more explicit.
1 parent 77bd28a commit abf9f11

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

css-font-loading/Overview.bs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,14 @@ The Constructor</h3>
175175
and the members of the <a argument for='FontFace/FontFace()'>descriptors</a> argument,
176176
according to the grammars of the corresponding descriptors of the CSS ''@font-face'' rule.
177177
If any of them fail to parse correctly,
178-
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a SyntaxError exception and abort these steps.
178+
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a DOMException named "SyntaxError" and abort these steps.
179179
Otherwise, set <var>font face's</var> corresponding attributes to the serialization of the parsed values.
180180

181181
<li>
182182
If the <a>source</a> argument was a <a>DOMString</a>,
183183
parse it according to the grammar of the 'src' descriptor of the CSS ''@font-face'' rule.
184184
If it fails to parse correctly,
185-
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a SyntaxError exception and abort these steps;
185+
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a DOMException named "SyntaxError" exception and abort these steps;
186186
otherwise, set <var>font face's</var> internal <a>[<!---->[Urls]]</a> slot to the string.
187187

188188
Note: Note that this means that passing a naked url as the source argument,
@@ -215,7 +215,7 @@ The Constructor</h3>
215215

216216
<li>
217217
Otherwise,
218-
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a SyntaxError
218+
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a DOMException named "SyntaxError"
219219
and set <var>font face's</var> <a for=FontFace>status</a> attribute to "error".
220220
</ol>
221221
</ol>
@@ -279,7 +279,8 @@ The <code>load()</code> method</h3>
279279
<ol>
280280
<li>
281281
If the attempt to load fails,
282-
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a NetworkError
282+
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with
283+
a DOMException whose name is "NetworkError"
283284
and set <var>font face's</var> <a for=FontFace>status</a> attribute to "error".
284285

285286
<li>

css-font-loading/Overview.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,14 @@ <h3 class="heading settled heading" data-level=2.1 id=font-face-constructor><spa
291291
and the members of the <a class=idl-code data-link-for=FontFace/FontFace() data-link-type=argument href=#dom-fontfacefontface-descriptors title=descriptors>descriptors</a> argument,
292292
according to the grammars of the corresponding descriptors of the CSS <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule.
293293
If any of them fail to parse correctly,
294-
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a SyntaxError exception and abort these steps.
294+
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a DOMException named "SyntaxError" and abort these steps.
295295
Otherwise, set <var>font face’s</var> corresponding attributes to the serialization of the parsed values.
296296

297297
<li>
298298
If the <a data-link-type=idl href=#dom-fontfacefontface-source title=source>source</a> argument was a <a data-link-type=idl title=domstring>DOMString</a>,
299299
parse it according to the grammar of the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#descdef-src title=src>src</a> descriptor of the CSS <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule.
300300
If it fails to parse correctly,
301-
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a SyntaxError exception and abort these steps;
301+
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a DOMException named "SyntaxError" exception and abort these steps;
302302
otherwise, set <var>font face’s</var> internal <a data-link-type=idl href=#dom-fontface-urls title=[[urls]]>[[Urls]]</a> slot to the string.
303303

304304
<p class=note>Note: Note that this means that passing a naked url as the source argument,
@@ -331,7 +331,7 @@ <h3 class="heading settled heading" data-level=2.1 id=font-face-constructor><spa
331331

332332
<li>
333333
Otherwise,
334-
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a SyntaxError
334+
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a DOMException named "SyntaxError"
335335
and set <var>font face’s</var> <a data-link-for=FontFace data-link-type=idl href=#dom-fontface-status title=status>status</a> attribute to "error".
336336
</ol>
337337
</ol>
@@ -387,7 +387,8 @@ <h3 class="heading settled heading" data-level=2.2 id=font-face-load><span class
387387
<ol>
388388
<li>
389389
If the attempt to load fails,
390-
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a NetworkError
390+
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with
391+
a DOMException whose name is "NetworkError"
391392
and set <var>font face’s</var> <a data-link-for=FontFace data-link-type=idl href=#dom-fontface-status title=status>status</a> attribute to "error".
392393

393394
<li>

0 commit comments

Comments
 (0)