Flash of Invisible Text (FOIT) in Material WebUI |
||||
Issue descriptionVersion: * OS: ? What steps will reproduce the problem? (0) Have the Roboto Normal font installed. (1) Don't have the Roboto Medium or Roboto Bold fonts installed. (You probably don't.) (2) Visit a Material WebUI page, e.g. chrome://downloads Expected: All text displays at the same time. Actual: Normal Roboto text displays first. Text with other weights (e.g. bold, 500) is briefly invisible before appearing, thus FOIT. The browser has to "download" chrome://resources/roboto/roboto-medium.woff2 and chrome://resources/roboto/roboto-bold.woff2. Before images, these are the last resources downloaded. Until the download completes, any Roboto text for those weights (500 and 700) is invisible. The result is that any non-normal-weight Roboto text is invisible on the first paint and appears on a subsequent paint. Screenshots in the Timeline show rendering of chrome://downloads in this order: * the grey background * the top toolbar, with Downloads label and search icon * the "Open Downloads Folder" button in the toolbar and the "Nothing to see here..." text * the files image I think this is up to Chrome, but it's suggested by the standard: https://www.w3.org/TR/css-fonts-3/#font-face-loading The result is a noticeable flicker, especially on lighter-weight pages.
,
Aug 15 2016
Can we set it such that they are displayed initially, but just in a fallback font? Then they should be updated when the fonts are loaded.
,
Aug 16 2016
> Can we set it such that they are displayed initially, but just in a fallback font? Then they should be updated when the fonts are loaded. font-display:swap; works exactly that way, but as michaelpg@ pointed out this feature is disabled by default. In the meantime, you'll need some scripting to avoid FOIT. For example, see the "Optimizing font rendering with the Font Loading API" section of this article: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization#optimizing-loading-and-rendering
,
Dec 10 2016
,
Mar 17 2017
@dbeam fixed this |
||||
►
Sign in to add a comment |
||||
Comment 1 by michae...@chromium.org
, Aug 15 2016