Skip to content

Commit 655726e

Browse files
committed
[css-font-loading] Remove FontFace#ready, fold its functionality into FontFace#load.
1 parent 6c8ba4d commit 655726e

2 files changed

Lines changed: 12 additions & 22 deletions

File tree

css-font-loading/Overview.bs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,7 @@ The <code>FontFace</code> Interface</h2>
7474

7575
readonly attribute FontFaceLoadStatus status;
7676

77-
// If the font face's source is url-based and its status isn't
78-
// "loading" or "loaded", this kicks off the load.
79-
void load();
80-
81-
// Returns a promise that fulfills or rejects when the font face
82-
// reached "loaded" or "error" status.
83-
Promise ready();
77+
Promise load();
8478
};
8579
</pre>
8680

@@ -192,7 +186,7 @@ The Constructor</h3>
192186

193187
Note: Note that constructing a <a idl>FontFace</a> object <strong>does not</strong> automatically add it to the document's <a>font source</a>.
194188
If it's desired that the newly-constructed <a idl>FontFace</a> object is usable from CSS/etc,
195-
it must be explicitly added to the <a>font source</a>.
189+
it must be explicitly added to a <a>font source</a>.
196190

197191
<h3 id='font-face-load'>
198192
The <code>load()</code> method</h3>
@@ -213,13 +207,14 @@ The <code>load()</code> method</h3>
213207
<li>
214208
If <var>font face's</var> <a>[Urls]</a> attribute is <code>null</code>,
215209
or its <a for=FontFace>status</a> attribute is anything other than <code>"unloaded"</code>,
216-
abort this algorithm immediately.
210+
return <var>font face's</var> <a>[FontStatusPromise]</a>
211+
and abort these steps.
217212

218213
<li>
219214
Otherwise,
220215
set <var>font face's</var> <a for=FontFace>status</a> attribute to "loading",
221-
return immediately,
222-
and follow these steps asynchronously:
216+
return <var>font face's</var> <a>[FontStatusPromise]</a>,
217+
and continue executing the rest of this algorithm asynchronously.
223218

224219
<li>
225220
Using the value of <var>font face's</a> <a>[Urls]</a> attribute,

css-font-loading/Overview.html

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,7 @@ <h2 class="heading settled heading" data-level=2 id=fontface-interface><span cla
171171

172172
readonly attribute <a data-link-type=idl href=#enumdef-fontfaceloadstatus title=fontfaceloadstatus>FontFaceLoadStatus</a> <a class=idl-code data-global-name="FontFace<interface>/status<attribute>" data-link-for=FontFace data-link-type=attribute href=#dom-fontface-status title=status>status</a>;
173173

174-
// If the font face’s source is url-based and its status isn’t
175-
// "loading" or "loaded", this kicks off the load.
176-
void <a class=idl-code data-global-name="FontFace<interface>/load()<method>" data-link-for=FontFace data-link-type=method href=#dom-fontface-load title=load()>load</a>();
177-
178-
// Returns a promise that fulfills or rejects when the font face
179-
// reached "loaded" or "error" status.
180-
<a data-link-type=idl href=#dom-promise title=promise>Promise</a> <a class=idl-code data-global-name="FontFace<interface>/ready()<method>" data-link-for=FontFace data-link-type=method href=#dom-fontface-ready title=ready()>ready</a>();
174+
<a data-link-type=idl href=#dom-promise title=promise>Promise</a> <a class=idl-code data-global-name="FontFace<interface>/load()<method>" data-link-for=FontFace data-link-type=method href=#dom-fontface-load title=load()>load</a>();
181175
};
182176
</pre>
183177
<dl data-dfn-for=FontFace data-dfn-type=attribute>
@@ -288,7 +282,7 @@ <h3 class="heading settled heading" data-level=2.1 id=font-face-constructor><spa
288282

289283
<p class=note> Note: Note that constructing a <a data-link-type=idl href=#dom-fontface title=fontface>FontFace</a> object <strong>does not</strong> automatically add it to the document’s <a data-link-type=dfn href=#font-source title="font source">font source</a>.
290284
If it’s desired that the newly-constructed <a data-link-type=idl href=#dom-fontface title=fontface>FontFace</a> object is usable from CSS/etc,
291-
it must be explicitly added to the <a data-link-type=dfn href=#font-source title="font source">font source</a>.
285+
it must be explicitly added to a <a data-link-type=dfn href=#font-source title="font source">font source</a>.
292286

293287
<h3 class="heading settled heading" data-level=2.2 id=font-face-load><span class=secno>2.2 </span><span class=content>
294288
The <code>load()</code> method</span><a class=self-link href=#font-face-load></a></h3>
@@ -309,13 +303,14 @@ <h3 class="heading settled heading" data-level=2.2 id=font-face-load><span class
309303
<li>
310304
If <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-urls title=[urls]>[Urls]</a> attribute is <code>null</code>,
311305
or its <a data-link-for=FontFace data-link-type=idl href=#dom-fontface-status title=status>status</a> attribute is anything other than <code>"unloaded"</code>,
312-
abort this algorithm immediately.
306+
return <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[fontstatuspromise]>[FontStatusPromise]</a>
307+
and abort these steps.
313308

314309
<li>
315310
Otherwise,
316311
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 "loading",
317-
return immediately,
318-
and follow these steps asynchronously:
312+
return <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[fontstatuspromise]>[FontStatusPromise]</a>,
313+
and continue executing the rest of this algorithm asynchronously.
319314

320315
<li>
321316
Using the value of <var>font face’s <a data-link-type=idl href=#dom-fontface-urls title=[urls]>[Urls]</a> attribute,

0 commit comments

Comments
 (0)