link-rel-preload breaks the timeout behavior of web fonts |
|||||
Issue descriptionChrome 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
,
Apr 23 2018
Looks like RemoteFontFaceSource::BeginLoadIfNeeded does not start the timers if the font resource is already started loading by preload.
,
Apr 23 2018
,
Apr 25 2018
Actually, preload breaks webfont's timeout behavior regardless of the font-display value; font is never displayed until it loads.
,
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
,
Apr 27 2018
This should be fixed in the latest canary. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by kenjibaheux@chromium.org
, Apr 23 2018