Skip to content

Commit 8c80283

Browse files
committed
[css-fonts-4] Clarify the behavior of the 'very small' block period, to resolve w3c#4108.
1 parent c0ee29f commit 8c80283

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

css-fonts-4/Overview.bs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,8 +2668,7 @@ for example, forcing all fonts to have a ''0s'' <a>block period</a>.
26682668

26692669
<dt><dfn>fallback</dfn>
26702670
<dd>
2671-
Gives the font face an extremely small <a>block period</a>
2672-
(''100ms'' or less is recommended in most cases)
2671+
Gives the font face a [=no-network=] <a>block period</a>
26732672
and a short <a>swap period</a>
26742673
(''3s'' is recommended in most cases).
26752674

@@ -2696,19 +2695,32 @@ for example, forcing all fonts to have a ''0s'' <a>block period</a>.
26962695

26972696
<dt><dfn>optional</dfn>
26982697
<dd>
2699-
Gives the font face an extremely small <a>block period</a>
2700-
(''100ms'' or less is recommended in most cases)
2701-
and a ''0s'' <a>swap period</a>.
2702-
2703-
If the font is not retrieved before the two durations expire,
2698+
Gives the font a [=no-network=] [=block period=] and ''0s'' [=swap period=],
2699+
plus some additional caveats.
2700+
2701+
A <dfn export for="block period">no-network</dfn> [=block period=]
2702+
indicates that the user agent <em>should</em> block long enough
2703+
to determine if the font is locally installed
2704+
or cached from a previous network request
2705+
before falling back,
2706+
effectively giving the font a very small [=block period=],
2707+
but should not wait for a font to actually come from a "real" network request.
2708+
(If the user agent knows it's on a device
2709+
where waiting for an uncached local font
2710+
would likely cause a significant delay,
2711+
it can fall back immediately instead.)
2712+
2713+
Additionally, if the font is not retrieved before the two durations expire,
27042714
the user agent may choose to abort the font download,
27052715
or download it with a very low priority.
27062716
If the user agent believes it would be useful for the user,
27072717
it may avoid even starting the font download,
27082718
and proceed immediately to using a fallback font.
27092719

2710-
Note: In other words, the font is used if it's already downloaded and available,
2711-
but otherwise a fallback is used for the rest of the page's lifetime instead.
2720+
Note: In other words, 'optional' is meant to allow usage of local or already-downloaded-and-cached fonts
2721+
without noticeably delaying rendering for the user,
2722+
but otherwise fall back immediately;
2723+
in either case, the text will render quickly and never re-render in a different font as a result of fonts loading.
27122724
The font might download in the background and be available to future page loads,
27132725
but if the user-agent detects that the user has very limited bandwidth,
27142726
it might choose to simply never download and use the font.
@@ -2726,7 +2738,8 @@ for example, forcing all fonts to have a ''0s'' <a>block period</a>.
27262738
than they do about the finer points of its display,
27272739
and ''optional'' provides a good behavior for them.
27282740
If they return later,
2729-
the desired font faces might have finished downloading,
2741+
and the page has correctly used caching semantics for its font downloads,
2742+
the desired font faces might be available in the user agent's cache,
27302743
giving them the "intended" experience without slowing down
27312744
either their first or subsequent visits.
27322745

0 commit comments

Comments
 (0)