Skip to content

[css-values] ch units shouldn’t cause font downloads #3135

@litherum

Description

@litherum

Migrated from #3129

Right now, Values and Units 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, @emilio says that Firefox does something similar.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Wednesday

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions