You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
otherwise, set <var>font face’s</var> internal <codeclass=idl><adata-link-type=idlhref=#dom-fontface-urlstitle=[[Urls]]>[[Urls]]</a></code> slot to the string.</p>
330
331
331
-
<pclass=note>Note: Note that this means that passing a naked url as the source argument,
332
+
<pclass=noterole=note>Note: Note that this means that passing a naked url as the source argument,
332
333
like <code>"http://example.com/myFont.woff"</code>,
333
334
won’t work - it needs to be at least wrapped in a <spanclass=css>url()</span> function,
334
335
like <code>"url(http://example.com/myFont.woff)"</code>.
reject <var>font face’s</var><codeclass=idl><adata-link-type=idlhref=#dom-fontface-fontstatuspromisetitle=[[FontStatusPromise]]>[[FontStatusPromise]]</a></code> with a DOMException named "SyntaxError"
364
365
and set <var>font face’s</var><codeclass=idl><adata-link-for=FontFacedata-link-type=idlhref=#dom-fontface-statustitle=status>status</a></code> attribute to "error".</p>
365
366
</ol></ol>
366
-
<pclass=note>Note: Newly constructed FontFace objects are not automatically added
367
+
<pclass=noterole=note>Note: Newly constructed FontFace objects are not automatically added
367
368
to the FontFaceSet associated with a document
368
369
or a context for a worker thread.
369
370
This means that while newly constructed fonts can be preloaded,
they must act as if they had called the corresponding <codeclass=idl><adata-link-type=idlhref=#dom-fontfacetitle=FontFace>FontFace</a></code>’s <codeclass=idl><adata-link-for=FontFacedata-link-type=idlhref=#dom-fontface-loadtitle=load()>load()</a></code> method described here.</p>
432
433
433
-
<pclass=note>Note: Some UAs utilize a "font cache"
434
+
<pclass=noterole=note>Note: Some UAs utilize a "font cache"
434
435
which avoids having to download the same font multiple times
435
436
on a page or on multiple pages within the same origin.
436
437
Multiple <codeclass=idl><adata-link-type=idlhref=#dom-fontfacetitle=FontFace>FontFace</a></code> objects can be mapped to the same entry in the font cache,
which provides a way for authors to avoid having to keep track of which fonts have or haven’t been loaded
854
855
before examining content which may be affected by loading fonts.</p>
855
856
856
-
<pclass=note>Note: Authors should note that a given <var>ready promise</var> is only fulfilled once,
857
+
<pclass=noterole=note>Note: Authors should note that a given <var>ready promise</var> is only fulfilled once,
857
858
but further fonts may be loaded after it fulfills.
858
859
This is similar to listening for a <codeclass=idl><adata-link-type=idlhref=#dom-fontfaceset-loadingdonetitle=loadingdone>loadingdone</a></code> event to fire,
859
860
but the callbacks passed to the <codeclass=idl><adata-link-for=FontFaceSetdata-link-type=idlhref=#dom-fontfaceset-readytitle=ready>ready</a></code> promise will <strong>always</strong> get called,
860
861
even when no font loads occur because the fonts in question are already loaded.
861
862
It’s a simple, easy way to synchronize code to font loads
862
863
without the need to keep track of what fonts are needed and precisely when they load.</p>
863
864
864
-
<pclass=note>Note: Note that the user agent may need to iterate over multiple font loads before the <var>ready promise</var> is fulfilled.
865
+
<pclass=noterole=note>Note: Note that the user agent may need to iterate over multiple font loads before the <var>ready promise</var> is fulfilled.
865
866
This can occur with font fallback situations,
866
867
where one font in the fontlist is loaded
867
868
but doesn’t contain a particular glyph
868
869
and other fonts in the fontlist need to be loaded.
869
870
The <var>ready promise</var> is only fulfilled after layout operations complete
870
871
and no additional font loads are necessary.</p>
871
872
872
-
<pclass=note>Note: Note that the Promise returned by this <codeclass=idl><adata-link-for=FontFaceSetdata-link-type=idlhref=#dom-fontfaceset-readytitle=ready>ready</a></code> attribute is only ever fulfilled,
873
+
<pclass=noterole=note>Note: Note that the Promise returned by this <codeclass=idl><adata-link-for=FontFaceSetdata-link-type=idlhref=#dom-fontfaceset-readytitle=ready>ready</a></code> attribute is only ever fulfilled,
873
874
never rejected,
874
875
unlike the Promise returned by the <codeclass=idl><adata-link-type=idlhref=#dom-fontfacetitle=FontFace>FontFace</a></code><codeclass=idl><adata-link-for=FontFacedata-link-type=idlhref=#dom-fontface-loadtitle=load()>load()</a></code> method.</p>
875
876
@@ -965,7 +966,7 @@ <h3 class="heading settled" data-level=4.1 id=fontfacesource-workers><span class
965
966
966
967
<p>Within a Worker document, the <adata-link-type=dfnhref=#font-sourcetitle="font source">font source</a> is initially empty.</p>
967
968
968
-
<pclass=note>Note: <codeclass=idl><adata-link-type=idlhref=#dom-fontfacetitle=FontFace>FontFace</a></code> objects can be constructed and added to it as normal,
969
+
<pclass=noterole=note>Note: <codeclass=idl><adata-link-type=idlhref=#dom-fontfacetitle=FontFace>FontFace</a></code> objects can be constructed and added to it as normal,
969
970
which affects CSS font-matching within the worker
970
971
(such as, for example, drawing text into a <codeclass=idl><adata-link-type=idlhref=https://html.spec.whatwg.org/#canvasproxytitle=CanvasProxy>CanvasProxy</a></code>).</p>
971
972
@@ -982,13 +983,13 @@ <h3 class="heading settled" data-level=4.2 id=document-font-face-set><span class
982
983
must be added or removed from the document’s <adata-link-type=dfnhref=#font-sourcetitle="font source">font source</a>,
983
984
and maintain this ordering.</p>
984
985
985
-
<pclass=note>Note: Authors can still maintain references to a removed <codeclass=idl><adata-link-type=idlhref=#dom-fontfacetitle=FontFace>FontFace</a></code>,
986
+
<pclass=noterole=note>Note: Authors can still maintain references to a removed <codeclass=idl><adata-link-type=idlhref=#dom-fontfacetitle=FontFace>FontFace</a></code>,
986
987
even if it’s been automatically removed from a <adata-link-type=dfnhref=#font-sourcetitle="font source">font source</a>.
987
988
As specified in <adata-section="" href=#font-face-css-connection>§2.3
988
989
Interaction with CSS’s @font-face Rule</a>, though,
989
990
the <codeclass=idl><adata-link-type=idlhref=#dom-fontfacetitle=FontFace>FontFace</a></code> is no longer <adata-link-type=dfnhref=#css-connectedtitle=CSS-connected>CSS-connected</a> at that point.</p>
990
991
991
-
<pclass=note>Note: It is expected that a future version of this specification
992
+
<pclass=noterole=note>Note: It is expected that a future version of this specification
992
993
will define ways of interacting with and querying local fonts as well.</p>
0 commit comments