Bug 215121

Summary: monospace font inconsistently selected
Product: WebKit Reporter: Sam Sneddon [:gsnedders] <gsnedders>
Component: TextAssignee: Myles C. Maxfield <mmaxfield>
Status: ASSIGNED ---    
Severity: Normal CC: mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: macOS 10.14   
See Also: https://bugs.webkit.org/show_bug.cgi?id=214290

Description Sam Sneddon [:gsnedders] 2020-08-04 02:25:17 PDT
Since wpt.fyi first started trying to run Catalina(!) and STP 111, there’s a whole bunch of regressions that appear to be down inconsistent font selection (no in-depth analysis done on most, merely noted they visually appear to be the same issue).

An example is:

https://wpt.fyi/results/css/CSS2/bidi-text/bidi-011.xht?diff&filter=ADC&q=seq%28%28status%3Apass%7Cstatus%3Aok%29%20%28status%3A%21pass%26status%3A%21ok%26status%3A%21unknown%29%29&run_id=625120001&run_id=619180001

i.e.,
test: http://wpt.live/css/CSS2/bidi-text/bidi-011.xht
ref: http://wpt.live/css/CSS2/bidi-text/bidi-011-ref.xht

Both of these have `font: 2em monospace`. I _think_ the test is matching Menlo and the ref is matching Courier, but that is from a brief visual inspection.

From a brief glance, it appears some of the failures in bug 214290 are related.

<rdar://66400419> (which hopefully works to link this)
Comment 1 Radar WebKit Bug Importer 2020-08-04 02:33:17 PDT
<rdar://problem/66514901>
Comment 2 Alexey Proskuryakov 2020-08-04 13:34:33 PDT
<rdar://66400419>
Comment 3 Sam Sneddon [:gsnedders] 2022-01-06 06:22:36 PST
From discussion with Myles:

There was a desire to use the system's monospace font in at least some cases, as Menlo / Monaco have better typography than Courier, while still not being inconsistent with other browsers.

The decision previously was to try and thread the web compat needle by using Courier in the case when no lang was explicitly provided, and use the system default otherwise.

On the whole, my suggestion is to try and see if we can get away with using the lang=en system default for no-lang, rather than using Courier when no lang is provided, as this difference between lang=en and no-lang just introduces another web compat risk (as WPT has found).