8000 [css-font-loading] Add a FontFace#loaded attribute that exposes the [… · w3c/csswg-drafts@7c18b3e · GitHub
Skip to content

Commit 7c18b3e

Browse files
committed
[css-font-loading] Add a FontFace#loaded attribute that exposes the [FontStatusPromise] directly, so you can listen to it without triggering a load.
--HG-- extra : rebase_source : 3650dddc8c7d2246c07486b4ce0262698ee285fe
1 parent a8942fb commit 7c18b3e

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

css-font-loading/Overview.bs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ The <code>FontFace</code> Interface</h2>
7575
readonly attribute FontFaceLoadStatus status;
7676

7777
Promise load();
78+
attribute Promise loaded;
7879
};
7980
</pre>
8081

@@ -115,6 +116,10 @@ The <code>FontFace</code> Interface</h2>
115116
such as through the <a method for=FontFace>load()</a> method on <a interface>FontFace</a>,
116117
or implicitly by the user agent,
117118
due to it detecting that the font face is needed to draw some text on the screen.
119+
120+
<dt><dfn>loaded</dfn>, of type <a interface>Promise</a>
121+
<dd>
122+
This attribute reflects the <a idl>[FontStatusPromise]</a> of the font face.
118123
</dl>
119124

120125
All <a interface>FontFace</a> objects contain an internal <dfn attribute for=FontFace>[FontStatusPromise]</dfn> attribute,

css-font-loading/Overview.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</p>
1414
<h1 class="p-name no-ref" id=title>CSS Font Loading Module Level 3</h1>
1515
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>W3C First Public Working Draft,
16-
<span class=dt-updated><span class=value-title title=20140325>25 March 2014</span></span></span></h2>
17-
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://www.w3.org/TR/2014/WD-css-font-loading-3-20140325/>http://www.w3.org/TR/2014/WD-css-font-loading-3-20140325/</a><dt>Latest version:<dd><a href=http://w3.org/TR/css-font-loading/>http://w3.org/TR/css-font-loading/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-font-loading/>http://dev.w3.org/csswg/css-font-loading/</a>
16+
<span class=dt-updated><span class=value-title title=20140328>28 March 2014</span></span></span></h2>
17+
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://www.w3.org/TR/2014/WD-css-font-loading-3-20140328/>http://www.w3.org/TR/2014/WD-css-font-loading-3-20140328/</a><dt>Latest version:<dd><a href=http://w3.org/TR/css-font-loading/>http://w3.org/TR/css-font-loading/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-font-loading/>http://dev.w3.org/csswg/css-font-loading/</a>
1818
<dt>Feedback:</dt>
1919
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-font-loading%5D%20feedback">www-style@w3.org</a>
2020
with subject line
@@ -171,6 +171,7 @@ <h2 class="heading settled heading" data-level=2 id=fontface-interface><span cla
171171
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>;
172172

173173
<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>();
174+
attribute <a data-link-type=idl href=#dom-promise title=promise>Promise</a> <a class=idl-code data-global-name="FontFace<interface>/loaded<attribute>" data-link-for=FontFace data-link-type=attribute href=#dom-fontface-loaded title=loaded>loaded</a>;
174175
};
175176
</pre>
176177
<dl data-dfn-for=FontFace data-dfn-type=attribute>
@@ -210,6 +211,10 @@ <h2 class="heading settled heading" data-level=2 id=fontface-interface><span cla
210211
such as through the <a class=idl-code data-link-for=FontFace data-link-type=method href=#dom-fontface-load title=load()>load()</a> method on <a class=idl-code data-link-type=interface href=#dom-fontface title=fontface>FontFace</a>,
211212
or implicitly by the user agent,
212213
due to it detecting that the font face is needed to draw some text on the screen.
214+
215+
<dt><dfn class=idl-code data-dfn-for=FontFace data-dfn-type=attribute data-export="" id=dom-fontface-loaded>loaded<a class=self-link href=#dom-fontface-loaded></a></dfn>, of type <a class=idl-code data-link-type=interface href=#dom-promise title=promise>Promise</a>
216+
<dd>
217+
This attribute reflects the <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[fontstatuspromise]>[FontStatusPromise]</a> of the font face.
213218
</dl>
214219

215220
<p> All <a class=idl-code data-link-type=interface href=#dom-fontface title=fontface>FontFace</a> objects contain an internal <dfn class=idl-code data-dfn-for=FontFace data-dfn-type=attribute data-export="" id=dom-fontface-fontstatuspromise>[FontStatusPromise]<a class=self-link href=#dom-fontface-fontstatuspromise></a></dfn> attribute,
@@ -1118,7 +1123,8 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
11181123
<li>[FontStatusPromise], <a href=#dom-fontface-fontstatuspromise title="section 2">2</a>
11191124
<li>load()<ul><li>method for FontFace, <a href=#dom-fontface-load title="section 2.2">2.2</a>
11201125
<li>method for FontFaceSet, <a href=#dom-fontfaceset-load title="section 3.3">3.3</a>
1121-
</ul><li>[LoadedFonts], <a href=#dom-fontfaceset-loadedfonts title="section 3">3</a>
1126+
</ul><li>loaded, <a href=#dom-fontface-loaded title="section 2">2</a>
1127+
<li>[LoadedFonts], <a href=#dom-fontfaceset-loadedfonts title="section 3">3</a>
11221128
<li>loading, <a href=#dom-fontfaceset-loading title="section 3.2">3.2</a>
11231129
<li>loadingdone, <a href=#dom-fontfaceset-loadingdone title="section 3.2">3.2</a>
11241130
<li>loadingerror, <a href=#dom-fontfaceset-loadingerror title="section 3.2">3.2</a>

0 commit comments

Comments
 (0)