Intent to Implement and Ship: 'font-display: optional' without relayout

74 views
Skip to first unread message

Xiaocheng Hu

unread,
Feb 7, 2020, 5:19:54 PM2/7/20
to blink-dev
xiaoc...@chromium.org https://bit.ly/2FELF7e Specification: https://drafts.csswg.org/css-fonts-4/#valdef-font-face-font-display-optional https://bit.ly/36E8UKB Not needed, as this is a minor change to an already launched feature. Slightly tweak web font loading, so that: - Web fonts with 'font-display: optional' never cause relayout - Web font preloading is allowed to slightly block rendering (for all font-display values), so that if the font loads fast enough, we don't need to render with fallback Therefore, when 'font-display: optional' and preloading are used together, we'll never see layout shifting due to font swapping, and still have a good chance to use the font if it loads fast enough (e.g., from disk cache). Relayout after font loading is an issue, as it leads to unstable layout, and increases the latency for the font to show up. Now that CSSWG has reached a resolution to avoid that, our implementation should catch up.
Not expected, as this is a minor change to an already launched feature. Firefox: No public signals (https://github.com/w3c/csswg-drafts/issues/4108#issuecomment-578222439) No objection at the CSSWG meeting. Edge: No public signals (https://github.com/w3c/csswg-drafts/issues/4108#issuecomment-578222439) No objection at the CSSWG meeting. Safari: No public signals (https://github.com/w3c/csswg-drafts/issues/4108#issuecomment-578222439) No objection at the CSSWG meeting. Web developers: No signals It is expected to be used together with <link rel="preload"> or the imperiative Font Loading API to achieve good performance.
Yes Yes https://wpt.fyi/results/css/css-fonts/font-display https://crbug.com/1040632 https://chromestatus.com/feature/6386634616471552
This intent message was generated by Chrome Platform Status.

Xiaocheng Hu

unread,
Feb 7, 2020, 5:34:29 PM2/7/20
to blink-dev, Chris Harrelson
Additional clarification: for fonts which are *not* font-display: optional, there is also a greater chance that the first render will use the web font, if it loads quickly enough.

sligh...@chromium.org

unread,
Feb 13, 2020, 3:11:54 PM2/13/20
to blink-dev, chri...@chromium.org
LGTM1

Daniel Bratell

unread,
Feb 13, 2020, 3:14:38 PM2/13/20
to blink-dev, chri...@chromium.org
LGTM2

/Daniel

Yoav Weiss

unread,
Feb 13, 2020, 3:15:24 PM2/13/20
to Daniel Bratell, blink-dev, Chris Harrelson
LGTM3

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/7434f359-82ee-4263-804f-8139b6ae1d65%40chromium.org.
Reply all
Reply to author
Forward
0 new messages