New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 835583 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 1
Type: Bug



Sign in to add a comment

link-rel-preload breaks the timeout behavior of web fonts

Project Member Reported by malteubl@google.com, Apr 21 2018

Issue description

Chrome Version: Current canary and stable
OS: All

What steps will reproduce the problem?
(1) Set up page that preloads a font file.
(2) Declare the font as font-display: optional
(3) Load the page using a throttled connection

What is the expected result?

No FOIT and the font is never displayed.

What happens instead?

The default font-display behavior

Repro case: 
- https://www.zachleat.com/web-fonts/demos/font-display-optional-preload.html
- https://github.com/zachleat/web-font-loading-recipes/blob/master/font-display-optional-preload.html
 
Owner: ksakamoto@chromium.org
ksakamoto@: can you give this a quick look? How much work would it be to fix this?
Cc: toyoshim@chromium.org
Status: Started (was: Untriaged)
Looks like RemoteFontFaceSource::BeginLoadIfNeeded does not start the timers if the font resource is already started loading by preload.
Components: -Blink>Fonts Blink>WebFonts
Labels: -Pri-2 OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Mac OS-Windows Pri-1
Summary: link-rel-preload breaks the timeout behavior of web fonts (was: link-rel-preload breaks font-display-optional)
Actually, preload breaks webfont's timeout behavior regardless of the font-display value; font is never displayed until it loads.
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a838569157a09ebfadfd10cacc1755686b05ac40

commit a838569157a09ebfadfd10cacc1755686b05ac40
Author: Kunihiko Sakamoto <ksakamoto@chromium.org>
Date: Thu Apr 26 03:31:31 2018

Make web font timeouts work for preloaded fonts

This patch fixes a bug where font display timeouts (100ms and 3s)
didn't start if the font resource is already started loading by
<link rel=preload>.

Bug:  835583 
Change-Id: Ie464179ebcc56f2d18c99d234eadd4fc26bc1fcd
Reviewed-on: https://chromium-review.googlesource.com/1027331
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553896}
[add] https://crrev.com/a838569157a09ebfadfd10cacc1755686b05ac40/third_party/WebKit/LayoutTests/external/wpt/css/css-fonts/font-display/font-display-preload-ref.html
[add] https://crrev.com/a838569157a09ebfadfd10cacc1755686b05ac40/third_party/WebKit/LayoutTests/external/wpt/css/css-fonts/font-display/font-display-preload.html
[modify] https://crrev.com/a838569157a09ebfadfd10cacc1755686b05ac40/third_party/blink/renderer/core/css/remote_font_face_source.cc
[modify] https://crrev.com/a838569157a09ebfadfd10cacc1755686b05ac40/third_party/blink/renderer/core/loader/resource/font_resource.cc
[modify] https://crrev.com/a838569157a09ebfadfd10cacc1755686b05ac40/third_party/blink/renderer/core/loader/resource/font_resource.h

Status: Fixed (was: Started)
This should be fixed in the latest canary.

Sign in to add a comment