Create RFC to load Ahem as a webfont#22
Conversation
|
@frivoal may have helpful perspective on this. |
|
@LukeZielinski have you come across any tests that use Ahem not for its known glyph metrics, but to test a system font as opposed to a loaded font? If any such tests exist, I wonder if as an alternative to requiring Ahem to be installed could require some font to be installed as a system font, and have a way for the font family name to be provided to tests as a variable or through the wptserve template system? |
|
@drott do you have thoughts about this? |
|
Copying over @drott's comment from web-platform-tests/wpt#16951 (comment):
What triggered this proposal was @LukeZielinski running into trouble getting system fonts installed on Chromium CQ. Given your comments in web-platform-tests/wpt#13203 (comment), perhaps there is a way to do this after all? |
No additional thoughts other than the ones you quoted. I think it'd be beneficial if we have more robust WPT harness mechanisms to control what system fonts are installed on the system, or at least available to the rendering engine in a sideloaded way that is equivalent in behavior to system fonts. We have sideloading mechanisms in Chromium for Windows, Android and Linux that do not require a "real" installation on the system. |
|
@foolip I have not come across any tests that cares about a system font being installed. They all seemed to work fine when switching to a webfont. @drott The side-loading mechanism you're talking about is only for content shell, right? For the use case here we'd be interested in running WPT against full Chrome inside Chromium CI, which is why this conversation got started. |
|
This seems like a good idea. Certainly, going forward, I see no reason not to require usage of Ahem as a webfont, that's a lot more reliable. For past tests, although the change does seem safe in principle, I haven't been able to review the entire diff to check that it was true in all cases, and I doubt anybody will find it practical to do manually. If we could do a sanity check, verifying that the before/after state looks the same it all tests, that'd be great. Quite possibly there are a few tests in there that are manual, and might not be suitable for automated before/after verification, but if we could just check the before/after of all ref tests (and all refs), that would leave us with a much smaller set of things to review manually. To make sure we don't create more tests with Ahem not used as a webfont, we should also:
As a side note, since most CSS tests typically don't need a server side component, it's quite common while developing them to run the directly from the file system rather than from wpt serve, and the proposed approach is nice in that it doesn't break that. Ahem.css is loaded via an absolute url which will fail when using the file:// protocol, but since the font-family name is still Ahem, it will load it (as usual) from the system fonts for people who have it. |
|
As far as the mechanics of actually submitting this, I plan to break up the massive CL into two parts. The first will be the reviewable things like Ahem.css, docs change, lint rule, and a handful of representative test updates (there are 3 distinct flavours). For correctness, I've run this change through Chromium CQ and it passed (this link may time out since the CL is so big, ymmv). So there's at least some signal that this doesn't break anything new. For the PR, we're going to get failing checks due to already-failing tests that are being updated. I think I should be able to upload a run manually to wpt.fyi for a side-by-side comparison though. |
I guess we could, though probably with something even more naïve at first attempt (given |
|
AIUI this matches how gecko-internal reftests already work, so I don't think we have any issues with this going forward. I do think there needs to be a lint (even a relatively basic one) as part of the initial patch, to ensure we don't regress this straight away. It should probably also make |
|
@jgraham I expect in reality we want to be able to install fonts on a per-test basis, given I think this is closer to what |
|
Sure, but the actual code to install fonts doesn't change in that case (although the chance of it working on various platforms is greatly diminished). It just means we need to arrange for the fonts to be part of the environment in the same way that gecko prefs are currently. |
|
To summarize the state of this as I see it so far: There doesn't seem to be any opposition to this change in principal. The following specific tweaks were suggested, and I'm happy to make them:
I'll break this up into 2 PRs. The first will include the above changes with a handful of representative test updates. The second will include the ~2k remaining test updates. In addition there are some legitimate concerns about WPT's support for testing using specific system fonts. Those concerns are more general than this Ahem discussion and we should consider those as a separate feature request. Can I consider this approved then? |
|
I think the formal process may require waiting another couple of days, but at this point it seems like there's consensus, so I would suggest you proceed as if this is approved. |
jgraham
left a comment
There was a problem hiding this comment.
Actually I think the timeout is since the last substantive disagreement, and there haven't really been any, just some additional stipulations. So I"m going to claim this is OK now (opinions welcome on whether I ought to have insisted that the RFC was updated to reflect the plan or record to implement it).
|
So this was discussed before in www-style and it didn't seem to have consensus. This point by @MatsPalmgren is still legit, fwiw: https://lists.w3.org/Archives/Public/www-style/2017Jan/0053.html |
|
Though I guess it's ok per the rest of the thread... Oh well. I think I did prefer having ahem as a local font, but... |
|
If the tests use @font-face { font-family: 'Ahem'; src: local('Ahem') url('/fonts/Ahem.ttf'); } |
|
Also note that some systems, iOS most obviously, don't allow installing system fonts, and some browsers (notably Safari) don't allow websites to use anything except preinstalled fonts (to remove user-installed fonts as an additional fingerprinting metric). |
I don't like the idea of adding an implcit branch into the tests depending on the system configuration. |
|
@zcorpan Yeah, that seems like a good compromise to me. |
|
OK. But @jgraham doesn't like the idea. Can we make it an explicit branch somehow? I don't know how worthwhile it is to test locally installed Ahem in wpt. If what Safari does is something that other browsers will follow, then the test would be "make sure that a locally user-installed font does not work", which could be a single test. |
|
The reason I want to include I really don't see what harm including |
|
Is it important for those tests that the font is Ahem, or could it be tested using any system font? If any font would do, we could perhaps arrange a mechanism to reference some system font, but not have it be the same one cross-platform. |
|
(Note that we can't make |
The bugs I'm referring to were extreme edge cases that weren't covered by any existing tests. You can't plan ahead and write a test for unknown future bugs in edge cases like that. The only way to catch them is to maximize the test coverage for that particular code path. This is what including
Running WPTs on any system that doesn't have Ahem installed will simply use the |
|
If we're talking about incidental coverage by lots of tests that aren't trying to target that bug, then the default configuration can only cover either system fonts or webfonts. That is, unless we run a bunch of tests twice. What is the concrete thing that we should do to get better coverage of system fonts? |
|
I guess the concrete suggestion is #22 (comment). But even with that we have to either install Ahem or not by default, and not have coverage for the other option. Would anyone run the tests twice to cover both? |
|
We (i.e. gecko CI) could theoretically spread it over platforms in some way e.g. having something different between opt and debug or Linux and Windows. But I don't see a way that isn't degenerate with some other interesting difference. We could theoretically run both configurations on one platform e.g. on linux64, but that would at least require some justification for the extra CI load. |
|
I guess we change ahem.css when there's a concrete plan to install Ahem on some CI setups but not others. @MatsPalmgren is that something you'd like to pursue, or convince someone else to work on? |
That's a bad assumption. As @jgraham hinted, there's a whole spectrum of options for running these tests. For Gecko, the best option by far is to always use a system-installed Ahem. (There are plenty of other WPTs that covers testing the |
|
FWIW given the difficulty we've had with system fonts on Mac I'd be pretty keen to use the |
|
@LukeZielinski can you add @jgraham do you think we should keep installing fonts in our Taskcluster runs? |
|
I think if the feature is supposed to keep working, at least in some browsers, we should have some kind of CI coverage for it. I don't know what's better in terms of getting good results in wpy.fyi for master runs. |
|
Probably How about running infrastructure/ tests without Ahem installed to make sure that works, but run with it installed for the full runs? |
Having Ahem both uninstalled/installed in the same run sounds unnecessarily complicated to me. The @font-face {
font-family: TestThatAhemURLWorks;
src: url(/fonts/Ahem.ttf);
} |
|
Those are different jobs, so it's just a matter of removing the step to install fonts from one of them. |
web-platform-tests/rfcs#22 removed this requirement, and it's no longer documented as an assumption (web-platform-tests#18972).
According to [0], tests should use `/fonts/ahem.css` instead of assuming Ahem is available as a system font (which is not the case in Chromium's CI fleet). https://crrev.com/c/5941209 exposed latent flakiness [1] in this test because `headless_shell`, unlike `content_shell` [2], does not sideload Ahem with special test-only logic. The flakiness likely arises in slower hardware or build configurations if Ahem is not loaded before the test runs. This can be fixed by first waiting for `document.fonts.ready` to resolve. See https://crrev.com/c/5889804 for a similar fix. [0]: web-platform-tests/rfcs#22 [1]: https://ci.chromium.org/ui/p/chromium/builders/ci/Mac11%20Tests/32122/overview [2]: https://source.chromium.org/chromium/chromium/src/+/main:content/web_test/renderer/web_test_content_renderer_client.cc;l=109;drc=64faea4fd9465ba61a48a5a617f04e59464a6b52;bpv=0;bpt=0 Bug: 374675198, 374694820, 336886479 Cq-Include-Trybots: luci.chromium.try:mac11.0-blink-rel Cq-Include-Trybots: luci.chromium.try:mac11.0.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac12.0-blink-rel Cq-Include-Trybots: luci.chromium.try:mac12.0.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac13-blink-rel Cq-Include-Trybots: luci.chromium.try:mac13.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel Cq-Include-Trybots: luci.chromium.try:mac14.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac15-blink-rel Cq-Include-Trybots: luci.chromium.try:mac15.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:win11-arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Test: Add `?pipe=trickle(d3)` to `url()` in `ahem.css` Test: Tests still run as expected on a system without preinstalled Ahem Change-Id: I9f0d8ba6a3c4910f832bfc94d38a8ae605689e98
According to [0], tests should use `/fonts/ahem.css` instead of assuming Ahem is available as a system font (which is not the case in Chromium's CI fleet). https://crrev.com/c/5941209 exposed latent flakiness [1] in this test because `headless_shell`, unlike `content_shell` [2], does not sideload Ahem with special test-only logic. The flakiness likely arises in slower hardware or build configurations if Ahem is not loaded before the test runs. This can be fixed by first waiting for `document.fonts.ready` to resolve. See https://crrev.com/c/5889804 for a similar fix. [0]: web-platform-tests/rfcs#22 [1]: https://ci.chromium.org/ui/p/chromium/builders/ci/Mac11%20Tests/32122/overview [2]: https://source.chromium.org/chromium/chromium/src/+/main:content/web_test/renderer/web_test_content_renderer_client.cc;l=109;drc=64faea4fd9465ba61a48a5a617f04e59464a6b52;bpv=0;bpt=0 Bug: 374675198, 374694820, 336886479 Cq-Include-Trybots: luci.chromium.try:mac11.0-blink-rel Cq-Include-Trybots: luci.chromium.try:mac11.0.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac12.0-blink-rel Cq-Include-Trybots: luci.chromium.try:mac12.0.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac13-blink-rel Cq-Include-Trybots: luci.chromium.try:mac13.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel Cq-Include-Trybots: luci.chromium.try:mac14.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac15-blink-rel Cq-Include-Trybots: luci.chromium.try:mac15.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:win11-arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Test: Add `?pipe=trickle(d3)` to `url()` in `ahem.css` Test: Tests still run as expected on a system without preinstalled Ahem Change-Id: I9f0d8ba6a3c4910f832bfc94d38a8ae605689e98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5943572 Commit-Queue: Koji Ishii <[email protected]> Reviewed-by: Koji Ishii <[email protected]> Auto-Submit: Jonathan Lee <[email protected]> Cr-Commit-Position: refs/heads/main@{#1371831}
According to [0], tests should use `/fonts/ahem.css` instead of assuming Ahem is available as a system font (which is not the case in Chromium's CI fleet). https://crrev.com/c/5941209 exposed latent flakiness [1] in this test because `headless_shell`, unlike `content_shell` [2], does not sideload Ahem with special test-only logic. The flakiness likely arises in slower hardware or build configurations if Ahem is not loaded before the test runs. This can be fixed by first waiting for `document.fonts.ready` to resolve. See https://crrev.com/c/5889804 for a similar fix. [0]: web-platform-tests/rfcs#22 [1]: https://ci.chromium.org/ui/p/chromium/builders/ci/Mac11%20Tests/32122/overview [2]: https://source.chromium.org/chromium/chromium/src/+/main:content/web_test/renderer/web_test_content_renderer_client.cc;l=109;drc=64faea4fd9465ba61a48a5a617f04e59464a6b52;bpv=0;bpt=0 Bug: 374675198, 374694820, 336886479 Cq-Include-Trybots: luci.chromium.try:mac11.0-blink-rel Cq-Include-Trybots: luci.chromium.try:mac11.0.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac12.0-blink-rel Cq-Include-Trybots: luci.chromium.try:mac12.0.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac13-blink-rel Cq-Include-Trybots: luci.chromium.try:mac13.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel Cq-Include-Trybots: luci.chromium.try:mac14.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac15-blink-rel Cq-Include-Trybots: luci.chromium.try:mac15.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:win11-arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Test: Add `?pipe=trickle(d3)` to `url()` in `ahem.css` Test: Tests still run as expected on a system without preinstalled Ahem Change-Id: I9f0d8ba6a3c4910f832bfc94d38a8ae605689e98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5943572 Commit-Queue: Koji Ishii <[email protected]> Reviewed-by: Koji Ishii <[email protected]> Auto-Submit: Jonathan Lee <[email protected]> Cr-Commit-Position: refs/heads/main@{#1371831}
…keyword-sizes-on-*.html`, a=testonly Automatic update from web-platform-tests [wpt] Speculatively deflake `css-sizing/keyword-sizes-on-*.html` According to [0], tests should use `/fonts/ahem.css` instead of assuming Ahem is available as a system font (which is not the case in Chromium's CI fleet). https://crrev.com/c/5941209 exposed latent flakiness [1] in this test because `headless_shell`, unlike `content_shell` [2], does not sideload Ahem with special test-only logic. The flakiness likely arises in slower hardware or build configurations if Ahem is not loaded before the test runs. This can be fixed by first waiting for `document.fonts.ready` to resolve. See https://crrev.com/c/5889804 for a similar fix. [0]: web-platform-tests/rfcs#22 [1]: https://ci.chromium.org/ui/p/chromium/builders/ci/Mac11%20Tests/32122/overview [2]: https://source.chromium.org/chromium/chromium/src/+/main:content/web_test/renderer/web_test_content_renderer_client.cc;l=109;drc=64faea4fd9465ba61a48a5a617f04e59464a6b52;bpv=0;bpt=0 Bug: 374675198, 374694820, 336886479 Cq-Include-Trybots: luci.chromium.try:mac11.0-blink-rel Cq-Include-Trybots: luci.chromium.try:mac11.0.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac12.0-blink-rel Cq-Include-Trybots: luci.chromium.try:mac12.0.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac13-blink-rel Cq-Include-Trybots: luci.chromium.try:mac13.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel Cq-Include-Trybots: luci.chromium.try:mac14.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac15-blink-rel Cq-Include-Trybots: luci.chromium.try:mac15.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:win11-arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Test: Add `?pipe=trickle(d3)` to `url()` in `ahem.css` Test: Tests still run as expected on a system without preinstalled Ahem Change-Id: I9f0d8ba6a3c4910f832bfc94d38a8ae605689e98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5943572 Commit-Queue: Koji Ishii <[email protected]> Reviewed-by: Koji Ishii <[email protected]> Auto-Submit: Jonathan Lee <[email protected]> Cr-Commit-Position: refs/heads/main@{#1371831} -- wpt-commits: 5c7efce5c36c39b012d34ac94f0b5ed5ba6ae918 wpt-pr: 48746
…8712) web-platform-tests/rfcs#22 removed this requirement, and it's no longer documented as an assumption (#18972).
…hat Ahem is a system font, a=testonly Automatic update from web-platform-tests Remove obsolete `infrastructure/` test that Ahem is a system font (#48712) web-platform-tests/rfcs#22 removed this requirement, and it's no longer documented as an assumption (web-platform-tests/wpt#18972). -- wpt-commits: 8624366d459e5dbb9fd0fcbe1bfb43c30f657243 wpt-pr: 48712
…hat Ahem is a system font, a=testonly Automatic update from web-platform-tests Remove obsolete `infrastructure/` test that Ahem is a system font (#48712) web-platform-tests/rfcs#22 removed this requirement, and it's no longer documented as an assumption (web-platform-tests/wpt#18972). -- wpt-commits: 8624366d459e5dbb9fd0fcbe1bfb43c30f657243 wpt-pr: 48712
…keyword-sizes-on-*.html`, a=testonly Automatic update from web-platform-tests [wpt] Speculatively deflake `css-sizing/keyword-sizes-on-*.html` According to [0], tests should use `/fonts/ahem.css` instead of assuming Ahem is available as a system font (which is not the case in Chromium's CI fleet). https://crrev.com/c/5941209 exposed latent flakiness [1] in this test because `headless_shell`, unlike `content_shell` [2], does not sideload Ahem with special test-only logic. The flakiness likely arises in slower hardware or build configurations if Ahem is not loaded before the test runs. This can be fixed by first waiting for `document.fonts.ready` to resolve. See https://crrev.com/c/5889804 for a similar fix. [0]: web-platform-tests/rfcs#22 [1]: https://ci.chromium.org/ui/p/chromium/builders/ci/Mac11%20Tests/32122/overview [2]: https://source.chromium.org/chromium/chromium/src/+/main:content/web_test/renderer/web_test_content_renderer_client.cc;l=109;drc=64faea4fd9465ba61a48a5a617f04e59464a6b52;bpv=0;bpt=0 Bug: 374675198, 374694820, 336886479 Cq-Include-Trybots: luci.chromium.try:mac11.0-blink-rel Cq-Include-Trybots: luci.chromium.try:mac11.0.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac12.0-blink-rel Cq-Include-Trybots: luci.chromium.try:mac12.0.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac13-blink-rel Cq-Include-Trybots: luci.chromium.try:mac13.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel Cq-Include-Trybots: luci.chromium.try:mac14.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:mac15-blink-rel Cq-Include-Trybots: luci.chromium.try:mac15.arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:win11-arm64-blink-rel Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Test: Add `?pipe=trickle(d3)` to `url()` in `ahem.css` Test: Tests still run as expected on a system without preinstalled Ahem Change-Id: I9f0d8ba6a3c4910f832bfc94d38a8ae605689e98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5943572 Commit-Queue: Koji Ishii <[email protected]> Reviewed-by: Koji Ishii <[email protected]> Auto-Submit: Jonathan Lee <[email protected]> Cr-Commit-Position: refs/heads/main@{#1371831} -- wpt-commits: 5c7efce5c36c39b012d34ac94f0b5ed5ba6ae918 wpt-pr: 48746
…hat Ahem is a system font, a=testonly Automatic update from web-platform-tests Remove obsolete `infrastructure/` test that Ahem is a system font (#48712) web-platform-tests/rfcs#22 removed this requirement, and it's no longer documented as an assumption (web-platform-tests/wpt#18972). -- wpt-commits: 8624366d459e5dbb9fd0fcbe1bfb43c30f657243 wpt-pr: 48712
Rendered