Skip to content

Commit 15c3326

Browse files
committed
[css-font-loading] Added some more detail to the loadingdone example.
1 parent 01bc464 commit 15c3326

2 files changed

Lines changed: 31 additions & 15 deletions

File tree

css-font-loading/Overview.bs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -763,27 +763,35 @@ API Examples</h2>
763763
<strong>and</strong> text has been laid out without causing additional font loads:
764764

765765
<pre>
766+
&lt;style>
766767
@font-face {
767768
font-family: latin-serif;
768769
src: url(latinserif.woff) format("woff"); /* contains no kanji/kana */
769770
}
770-
771771
@font-face {
772772
font-family: jpn-mincho;
773773
src: url(mincho.woff) format("woff");
774774
}
775+
@font-face {
776+
font-family: unused;
777+
src: url(unused.woff);
778+
}
775779

776780
body { font-family: latin-serif, jpn-mincho; }
777-
781+
&lt;/style>
778782
&lt;p>納豆はいかがでしょうか
779783
</pre>
780784

781785
In this situation, the user agent first downloads “latinserif.woff”
782-
and then tries to use this to draw the Japanese text. But because no
783-
Japanese glyphs are present in that font, fallback occurs and the font
784-
“mincho.woff” is downloaded. Only after the second font is downloaded
785-
and the Japanese text laid out does the <a event>loadingdone</a>
786-
event fire.
786+
and then tries to use this to draw the Japanese text.
787+
But because no Japanese glyphs are present in that font,
788+
fallback occurs and the font “mincho.woff” is downloaded.
789+
Only after the second font is downloaded and the Japanese text laid out does the <a event>loadingdone</a> event fire.
790+
791+
The "unused" font isn't loaded,
792+
but no text is using it,
793+
so the UA isn't even <em>trying</em> to load it.
794+
It doesn't interfere witht he <a event>loadingdone</a> event.
787795
</div>
788796

789797

css-font-loading/Overview.html

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -847,26 +847,34 @@ <h2 class="heading settled heading" data-level=5 id=font-load-event-examples><sp
847847
The <a class=idl-code data-link-type=event href=#dom-fontfaceset-loadingdone title=loadingdone>loadingdone</a> event only fires after all font related loads have completed
848848
<strong>and</strong> text has been laid out without causing additional font loads:
849849

850-
<pre> @font-face {
850+
<pre> &lt;style&gt;
851+
@font-face {
851852
font-family: latin-serif;
852853
src: url(latinserif.woff) format("woff"); /* contains no kanji/kana */
853854
}
854-
855855
@font-face {
856856
font-family: jpn-mincho;
857857
src: url(mincho.woff) format("woff");
858858
}
859+
@font-face {
860+
font-family: unused;
861+
src: url(unused.woff);
862+
}
859863

860864
body { font-family: latin-serif, jpn-mincho; }
861-
865+
&lt;/style&gt;
862866
&lt;p&gt;納豆はいかがでしょうか
863867
</pre>
864868
<p> In this situation, the user agent first downloads “latinserif.woff”
865-
and then tries to use this to draw the Japanese text. But because no
866-
Japanese glyphs are present in that font, fallback occurs and the font
867-
“mincho.woff” is downloaded. Only after the second font is downloaded
868-
and the Japanese text laid out does the <a class=idl-code data-link-type=event href=#dom-fontfaceset-loadingdone title=loadingdone>loadingdone</a>
869-
event fire.
869+
and then tries to use this to draw the Japanese text.
870+
But because no Japanese glyphs are present in that font,
871+
fallback occurs and the font “mincho.woff” is downloaded.
872+
Only after the second font is downloaded and the Japanese text laid out does the <a class=idl-code data-link-type=event href=#dom-fontfaceset-loadingdone title=loadingdone>loadingdone</a> event fire.
873+
874+
<p> The "unused" font isn’t loaded,
875+
but no text is using it,
876+
so the UA isn’t even <em>trying</em> to load it.
877+
It doesn’t interfere witht he <a class=idl-code data-link-type=event href=#dom-fontfaceset-loadingdone title=loadingdone>loadingdone</a> event.
870878
</div>
871879

872880

0 commit comments

Comments
 (0)