-
Notifications
You must be signed in to change notification settings - Fork 715
[css-fonts-4] Stop claiming that 'ch' uses the first available font, since it doesn't #3129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…since it doesn't.
Your "it doesn't" link leads to the following text:
This text could use with some clarification, too. It took me a moment to realize that "it" referred back to the "0", and not the element as a whole. And since there might not be a "0" in the element's text content, maybe a better wording would be (borrowing from the definition of "first available font"):
(and similar wording for the |
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 |
I'm not the most familiar with Gecko's font metrics code, but it seems that we use the first valid font as well: And fall back to @jfkthame can probably correct if anything above is wrong. |
Can they? It seems to me the definition of "first available font" is slightly unclear:
But this doesn't say what it means for a font to be "available". If the font-family list includes AFAICT, the spec usually uses "available" to refer to a font resource that has been downloaded and is ready for use, so I've assumed that was the intent here as well; but in §4.1 it seems to regard any font defined by a
without regard for whether the relevant resources have actually been fetched. [1] https://drafts.csswg.org/css-fonts-4/#first-available-font |
Once we have agreement, the same change can be listed as an erratum on Fonts 3. |
Hmm that would also call into question this test currently passed by Gecko, Edge, Blink and even Trident. |
So this is a PR to make a referencing spec agree with the spec that normatively defines the relevant behavior. If folks disagree with the behavior, I think it would be good to open an issue against the latter spec (css-values). |
Also, I don't think https://test.csswg.org/harness/test/css-fonts-4_dev/first-available-font-002/ really distinguishes the case, since it's a font that has neither a space nor a zero (it has only a lowercase a). It would be more relevant to the question of how to define |
I agree that V&U defines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, brings fonts-4 into alignment with V&U.
Right now, Values and Units says:
Seems fairly unambiguous to me. |
css-fonts-4 claims that the 'ch' unit uses the "first available font", but it doesn't. This revises the spec to stop making this claim.
Note that the same claim is made in css-fonts-3. Given its status, I'm not sure whether to suggest the same edit there...