Skip to content

Commit 408a81a

Browse files
committed
[css-font-loading] Scratch that, it was stupid. Just move descriptor parsing into the sync section.
1 parent ba0a889 commit 408a81a

2 files changed

Lines changed: 19 additions & 25 deletions

File tree

css-font-loading/Overview.bs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,24 +189,21 @@ The Constructor</h3>
189189
<li>
190190
Let <var>font face</var> be a fresh <a>FontFace</a> object.
191191
Set <var>font face's</var> <a for=FontFace>status</a> argument to <code>"unloaded"</code>,
192-
its <a idl>family</a> attribute to the empty string,
193-
and all of its attributes corresponding to the <a idl>FontFaceDescriptors</a> dictionary's members
194-
set to the initial value of the corresponding member.
192+
Set its internal <a>[<!---->[FontStatusPromise]]</a> slot to a fresh pending <a idl>Promise</a> object.
195193

196-
Set its internal <a>[<!---->[FontStatusPromise]]</a> slot to a newly-created <a idl>Promise</a> object.
197-
198-
Return <var>font face</var>,
199-
and complete the rest of these steps asynchronously.
200-
201-
<li>
202194
Parse the <a argument>family</a> argument,
203195
and the members of the <a argument for='FontFace/FontFace()'>descriptors</a> argument,
204196
according to the grammars of the corresponding descriptors of the CSS ''@font-face'' rule.
205197
If any of them fail to parse correctly,
206198
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a DOMException named "SyntaxError",
207-
queue a task to set <var>font face’s</var> <a idl for=FontFace>status</a> attribute to "error",
208-
and abort these steps.
209-
Otherwise, queue a task to set <var>font face's</var> corresponding attributes to the serialization of the parsed values.
199+
and set <var>font face’s</var> <a idl for=FontFace>status</a> attribute to "error".
200+
Otherwise, set <var>font face's</var> corresponding attributes to the serialization of the parsed values.
201+
202+
Return <var>font face</var>.
203+
If <var>font face’s</a> <a idl for=FontFace>status</a> is "error",
204+
terminate this algorithm;
205+
otherwise,
206+
complete the rest of these steps asynchronously.
210207

211208
<li>
212209
If the <a>source</a> argument was a <a>DOMString</a>,

css-font-loading/Overview.html

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -316,24 +316,21 @@ <h3 class="heading settled heading" data-level=2.1 id=font-face-constructor><spa
316316
<li>
317317
Let <var>font face</var> be a fresh <a data-link-type=idl href=#dom-fontface title=fontface>FontFace</a> object.
318318
Set <var>font face’s</var> <a data-link-for=FontFace data-link-type=idl href=#dom-fontface-status title=status>status</a> argument to <code>"unloaded"</code>,
319-
its <a data-link-type=idl href=#dom-fontface-family title=family>family</a> attribute to the empty string,
320-
and all of its attributes corresponding to the <a data-link-type=idl href=#dictdef-fontfacedescriptors title=fontfacedescriptors>FontFaceDescriptors</a> dictionary’s members
321-
set to the initial value of the corresponding member.
319+
Set its internal <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> slot to a fresh pending <a data-link-type=idl href=#dom-promise title=promise>Promise</a> object.
322320

323-
<p>Set its internal <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> slot to a newly-created <a data-link-type=idl href=#dom-promise title=promise>Promise</a> object.</p>
324-
325-
<p>Return <var>font face</var>,
326-
and complete the rest of these steps asynchronously.</p>
327-
328-
<li>
329-
Parse the <a class=idl-code data-link-type=argument href=#dom-fontfacefontface-family title=family>family</a> argument,
321+
<p>Parse the <a class=idl-code data-link-type=argument href=#dom-fontfacefontface-family title=family>family</a> argument,
330322
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,
331323
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.
332324
If any of them fail to parse correctly,
333325
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a DOMException named "SyntaxError",
334-
queue a task to 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",
335-
and abort these steps.
336-
Otherwise, queue a task to set <var>font face’s</var> corresponding attributes to the serialization of the parsed values.
326+
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".
327+
Otherwise, set <var>font face’s</var> corresponding attributes to the serialization of the parsed values.</p>
328+
329+
<p>Return <var>font face</var>.
330+
If <var>font face’s <a data-link-for=FontFace data-link-type=idl href=#dom-fontface-status title=status>status</a> is "error",
331+
terminate this algorithm;
332+
otherwise,
333+
complete the rest of these steps asynchronously.</var></p>
337334

338335
<li>
339336
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>,

0 commit comments

Comments
 (0)