New issue
Advanced search Search tips

Issue 770978 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 2
Type: Bug


Participants' hotlists:
Hotlist-1


Sign in to add a comment

font-display loads all font types and ignores format

Reported by raja....@gmail.com, Oct 2 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Steps to reproduce the problem:
1. Define font-face with font-diplay:optional
2. UYse the font in the page
3. Open the html and see how many fonts get downloaded
4. Or, Open this link http://output.jsbin.com/nuwedikena

What is the expected behavior?
Browse should load only the format which browse supports

What went wrong?
It loads all types of font and ignores format

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 61.0.3163.100   Channel: stable
OS Version: OS X 10.12.6
Flash Version: 

if we try without font-display, it works fine.
 
fontdisplaydemo.html
2.0 KB View Download
Screen Shot 2017-10-02 at 4.27.51 PM.png
101 KB View Download

Comment 1 by raja....@gmail.com, Oct 2 2017

This is not happening all the time. it happens at times and not sure the logic behind it. 
Labels: Needs-Triage-M61

Comment 3 by e...@chromium.org, Oct 3 2017

Components: -Blink>Fonts Blink>WebFonts Blink>Loader
Labels: -Needs-Triage-M61 M-61 OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Windows
Owner: ksakamoto@chromium.org
Status: Assigned (was: Unconfirmed)
Confirmed.
On what scenarios does this happen? And is there an approximate ETA for this?
This happens when a font face gets to the Font failure period [1], which is currently 100ms after the font is attempted to load.

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display

Consider this example:

    @font-face {
      font-family: Foo;
      src: url(foo.woff2), url(foo.woff);
    }
    body {
      font-family, Foo, Arial;
    }

If foo.woff2 couldn't be loaded within 100ms, the fallback font face (Arial) should be used. Instead, Chrome tries the next src (foo.woff) as a fallback. This is the bug.


For ETA, M63 branch point has just passed, so M64.

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 10 2017

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

commit 55d6544181be3ce8b5ed18ed62657fb002c910a8
Author: Kunihiko Sakamoto <ksakamoto@chromium.org>
Date: Fri Nov 10 05:35:52 2017

font-display: Font failure period should fallback to next family, not next src

This fixes a bug where @font-face with font-display: optional causes
unnecessary font downloads of subsequent sources when the first source
fails to download by the "short time limit" (100ms).

Bug:  770978 
Change-Id: I24ad7c803d04b9eb310b6b916c999660a23c61b5
Reviewed-on: https://chromium-review.googlesource.com/760137
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515453}
[add] https://crrev.com/55d6544181be3ce8b5ed18ed62657fb002c910a8/third_party/WebKit/LayoutTests/external/wpt/css/css-fonts/font-display/font-display-failure-fallback.html
[modify] https://crrev.com/55d6544181be3ce8b5ed18ed62657fb002c910a8/third_party/WebKit/Source/core/css/CSSFontFace.cpp
[modify] https://crrev.com/55d6544181be3ce8b5ed18ed62657fb002c910a8/third_party/WebKit/Source/core/css/CSSFontFaceSource.h
[modify] https://crrev.com/55d6544181be3ce8b5ed18ed62657fb002c910a8/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h

Status: Fixed (was: Assigned)
 Issue 806722  has been merged into this issue.

Sign in to add a comment