-
Notifications
You must be signed in to change notification settings - Fork 668
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
[css-font-loading] document.fonts is too vagely defined #6126
Comments
I agree, it should only reflect Author (and User, presumably) faces. I'm curious what you're adding a User Agent @font-face for? If it's a generic font, that won't work correctly (it'll be recognized by the quoted variant of its name as well, which the generics must not do), and if it's not a generic font, then you're exposing a new font to all pages that's guaranteed to exist. |
Why would it make sense to reflect User faces here? (In view of Mats' reasons (2) and (3), it seems undesirable.) |
Oh yeah, don't know what I was thinking. User sheets aren't exposed in |
It's a font with a handful of glyphs for rendering the
It's not a generic font. The working name is |
…ets' to make it clear where document.fonts draws from. #6126
Luckily CSSOM already defines the precise term I need, so the spec should be well-defined now. |
…gin sheets from 'document.fonts'. r=jfkthame Per w3c/csswg-drafts#6126 these were never intended to be included in the first place so this is just fixing a bug. Note that I'm leaving them in the mRuleFaces array so that the font loading machinery works the same as before. I'm just excluding them when queried by document.fonts. Differential Revision: https://phabricator.services.mozilla.com/D111694
…gin sheets from 'document.fonts'. r=jfkthame Per w3c/csswg-drafts#6126 these were never intended to be included in the first place so this is just fixing a bug. Note that I'm leaving them in the mRuleFaces array so that the font loading machinery works the same as before. I'm just excluding them when queried by document.fonts. Differential Revision: https://phabricator.services.mozilla.com/D111694
…gin sheets from 'document.fonts'. r=jfkthame Per w3c/csswg-drafts#6126 these were never intended to be included in the first place so this is just fixing a bug. Note that I'm leaving them in the mRuleFaces array so that the font loading machinery works the same as before. I'm just excluding them when queried by document.fonts. Differential Revision: https://phabricator.services.mozilla.com/D111694
…gin sheets from 'document.fonts'. r=jfkthame Per w3c/csswg-drafts#6126 these were never intended to be included in the first place so this is just fixing a bug. Note that I'm leaving them in the mRuleFaces array so that the font loading machinery works the same as before. I'm just excluding them when queried by document.fonts. Differential Revision: https://phabricator.services.mozilla.com/D111694
I'm adding a
@font-face
rule for a built-in font to the UA sheet in Gecko. This caused a ton of WPT failures because our implementation ofdocument.fonts
included it in theFontFaceSet
it returns. The WPT framework itself makes the assumption (in /infrastructure/assumptions/document-fonts-ready.html) thatdocument.fonts
returns an empty set if the document itself hasn't added any font sources yet.The spec says:
https://drafts.csswg.org/css-font-loading/#font-face-source
and further:
https://drafts.csswg.org/css-font-loading/#document-font-face-set
It's unclear from the quoted spec text (and the spec in general) whether
document.fonts
should be initially empty, or if it should include User and UserAgent origin font sources too.We tend to think that it should be explicitly defined to start out empty, and thus that only Author origin font sources are exposed to the document. For a few reasons:
document.fonts
FontFaceSet.delete
(andclear
) on a User or UserAgent font is unclear; it doesn't seem like a document should have the authority to remove eitherPerhaps one should read from "in the document’s stylesheets, in document order" that only sheets linked, or embedded, from the document itself (and their
@import
s) should be included, but that's vague. A clear definition of "the document’s stylesheets" seems missing too.CC @jfkthame
The text was updated successfully, but these errors were encountered: