Skip to content

Commit

Permalink
[css-fonts-4] Clarify the behavior of the 'very small' block period, to
Browse files Browse the repository at this point in the history
resolve #4108.
  • Loading branch information
tabatkins committed Sep 25, 2019
1 parent c0ee29f commit 8c80283
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions css-fonts-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2668,8 +2668,7 @@ for example, forcing all fonts to have a ''0s'' <a>block period</a>.

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

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

<dt><dfn>optional</dfn>
<dd>
Gives the font face an extremely small <a>block period</a>
(''100ms'' or less is recommended in most cases)
and a ''0s'' <a>swap period</a>.

If the font is not retrieved before the two durations expire,
Gives the font a [=no-network=] [=block period=] and ''0s'' [=swap period=],
plus some additional caveats.

A <dfn export for="block period">no-network</dfn> [=block period=]
indicates that the user agent <em>should</em> block long enough
to determine if the font is locally installed
or cached from a previous network request
before falling back,
effectively giving the font a very small [=block period=],
but should not wait for a font to actually come from a "real" network request.
(If the user agent knows it's on a device
where waiting for an uncached local font
would likely cause a significant delay,
it can fall back immediately instead.)

Additionally, if the font is not retrieved before the two durations expire,
the user agent may choose to abort the font download,
or download it with a very low priority.
If the user agent believes it would be useful for the user,
it may avoid even starting the font download,
and proceed immediately to using a fallback font.

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

Expand Down

0 comments on commit 8c80283

Please sign in to comment.