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/WOFF2: Consider providing fonts in FontToInstall/ via @font-face rules #8440
Comments
I think they are used as local fonts to rule-out any web font loading issues. |
cc'ing @jfkthame for advice on how it is done in mozilla-central. I think one can assume that at least basic WOFF1 support is available and working before implementing WOFF2. So if WOFF1 fonts fail to load, it seems likely that the same issue will happen for the WOFF2 fonts used in the tests, right? Would there be any concerns to add a WOFF1 fallback in addition to the local fonts (e.g. slowing down test executions)? At worst, I guess we can install test fonts in WebKit, but it's just extra work and not done the same way for all WebKit ports. Is it how it is done in mozilla-central too? |
What web font loading issues are you referring to? The domcontentloaded event isn't fired until web fonts have been downloaded. |
I don't think that's necessarily true, is it? Webfont loading may not even be triggered until reflow happens (at which point styles are resolved and the font-matching algorithm determines what fonts are needed for the actual character content of the elements). |
In mozilla-central, tests that depend on specific fonts generally load them using For testing things like WOFF2 support, we'd typically start with a basic test that the format is supported, by checking that a testcase using a WOFF2 font renders differently from a reference that doesn't use it; if that were to fail (because the webfont doesn't load, and we fall back to the default font) then any further tests involving the format would be understood to be invalid, even if they happen to "pass" trivially because fallback renderings match. |
I've created a branch with my proposal in https://github.com/w3c/web-platform-tests/tree/woff2-fonts-to-install-as-web-fonts. It looks like available-001.xht is not strictly speaking a reftest and should be adjusted a bit if we want to automate the execution.
So do you mean it make senses to add @font-face rules directly to the test files, as I do in the woff2-fonts-to-install-as-web-fonts? reftest-wait is also supported in WPT ( http://web-platform-tests.org/writing-tests/reftests.html ) but again if it's needed we should probably do that for the WOFF2 fonts too.
Such a test should probably be in WPT too. |
We should use
AFAICT, every browser has the behaviour such that the |
@gsnedders is exactly correct. |
For the record, I opened #8482 |
@fred-wang I suggest you open a PR for your |
@gsnedders OK, I opened #8494 and I've done a more extreme change by removing all the "install local fonts" stuff. Tests seem to work as expected when I run them on WebKitGTK. |
They were done that way when we did the WOFF 1.0 test suite, because webfont loading was a lot less interoperable then. As you know, the WOFF 2.0 tests were derived from the WOFF 1.0 tests (for the record @khaledhosny did most of that conversion work) but meanwhile the state of webfont loading has improved a lot and we no longer need to worry that some browser doesn't load any webfonts at all. Also, it that does happen (and it will, in the case of some CSS to PDF formatters for example which lag behind browsers) the tests will not display the PASS or FAIL glyphs; they will display the usual glyphs for the characters |
See also #8482 (comment) |
OK, it's fine by me if we wait that WOFF2 is moved to Proposed Recommendation. |
The tests in http://www.w3c-test.org/css/WOFF2/ fail if one does not install the support fonts in https://github.com/w3c/web-platform-tests/tree/master/css/WOFF2/support/FontsToInstall ; Would it make sense to serve them via @font-face rules like what is done for acid/acid3/test.html ? Maybe as woff1 fonts for better interoperability ? (Maybe move them to https://github.com/w3c/web-platform-tests/tree/master/fonts/ ?)
cc @khaledhosny @youennf
The text was updated successfully, but these errors were encountered: