[csswg-drafts] [css-values] ch units shouldn’t cause font downloads

litherum has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values] ch units shouldn’t cause font downloads ==
Migrated from https://github.com/w3c/csswg-drafts/pull/3129

Right now, [Values and Units](https://drafts.csswg.org/css-values-4/#ch) says:

> Equal to the used advance measure of the “0” (ZERO, U+0030) glyph in the font used to render it.

It’s pretty unfortunate that ch units can cause fonts to download.

WebKit doesn’t do this; it just uses the primary font, and if the primary font doesn’t support “0” then it uses that font’s .notdef glyph. No downloads necessary.

https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/Font.cpp#L123

https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/css/CSSPrimitiveValue.cpp#L661

In [this comment](https://github.com/w3c/csswg-drafts/pull/3129#issuecomment-423294483), @emilio says that Firefox does something similar.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3135 using your GitHub account

Received on Friday, 21 September 2018 21:14:49 UTC