wpt icon indicating copy to clipboard operation
wpt copied to clipboard

Fix the Ahem assumption test

Open gsnedders opened this issue 7 months ago • 3 comments

8624366d45 tried to change the test in line with the modern requirement that Ahem is not a system font.

However, in actuality it just ended up testing that:

<span style="font: 15px/1 Ahem">X</span>

!=

<span style="font-size: 15px; line-height: 1;">X</span>

This test fails in Safari, because unsurprisingly 15px / 15px serif is the same as 15px / 15px Ahem when Ahem is not installed. It seems like it is actually testing that Ahem is installed, or at least is not a no-op.

Instead, simply test that Ahem's X is the same as serif's X, as this should be true without the font installed.

gsnedders avatar Apr 14 '25 23:04 gsnedders

Though under our currently documented assumptions, we probably can't actually guarantee Ahem isn't installed, which implies we can't have any test here at all?

gsnedders avatar Apr 14 '25 23:04 gsnedders

Though under our currently documented assumptions, we probably can't actually guarantee Ahem isn't installed, which implies we can't have any test here at all?

Right, I think that's what the Firefox infrastructure/ failure indicates, so this PR's new test is too restrictive as-is. TC installs Ahem as a system font via wpt run --install-fonts.

It seems like it is actually testing that Ahem is installed, or at least is not a no-op.

I suspect the original -notref.html mismatch reftest was intended to check that serif is some human-readable font and not Ahem, which seemed reasonable (e.g., for https://wpt.live users). (Hence why https://github.com/web-platform-tests/wpt/commit/8624366d459e5dbb9fd0fcbe1bfb43c30f657243 keeps the test.) If we still want to check this property, the old ahem.html can be fixed by loading Ahem as a webfont.

However, this is technically not a documented assumption, so as you noted it might be better to not have a test at all.

jonathan-j-lee avatar Apr 16 '25 00:04 jonathan-j-lee

I suspect the original -notref.html mismatch reftest was intended to check that serif is some human-readable font and not Ahem, which seemed reasonable (e.g., for https://wpt.live users). (Hence why 8624366 keeps the test.) If we still want to check this property, the old ahem.html can be fixed by loading Ahem as a webfont.

I guess that's true. It does have some problem about different versions of Ahem — which implies we probably would want to check a single character (like the classic "X").

However, this is technically not a documented assumption, so as you noted it might be better to not have a test at all.

This seems very much a technicality, and I don't think is even worthy of an RFC.

gsnedders avatar May 14 '25 22:05 gsnedders