Closed Bug 1863191 Opened 2 years ago Closed 2 years ago

On Japanese macOS, font-family:monospace is ignored if Enhanced Tracking Protection is strict (because Osaka-Mono is unavailable)

Categories

(Core :: Layout: Text and Fonts, defect)

Firefox 119
Desktop
macOS
defect

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: ucm8888, Assigned: jfkthame)

Details

Attachments

(5 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/119.0

Steps to reproduce:

Firefox 119.0/macOS Ventura 13.6.1
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/119.0

  1. Run the following in Terminal:
    /Applications/Firefox.app/Contents/MacOS/firefox-bin -p

  2. Make new profile, and start Firefox.

  3. open https://unkoh.github.io/mono.html
    The textarea "monospace"(font-family:monospace) is displayed in a monospace font.

  4. Open Settings, and set "Enhanced Tracking Protection" to "strict", and reload all tabs.

Actual results:

The font of textarea in step 3 has changed to a non-monospaced.

Expected results:

The font of textarea in step 3 remains monospaced.

OS: Unspecified → macOS
Hardware: Unspecified → Desktop

Firefox 118.0.2 doesn't reproduce.
(The font of textarea in step 3 remains monospaced.)

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core

I'm not able to reproduce this (on macOS 14 here) .... I see the same monospace font (Menlo) regardless of the tracking protection setting.

Could you please attach a screenshot of how it displays for you? If you use the Inspector to examine the textarea, what font does it report is used in each case (with and without Strict tracking protection)?

Flags: needinfo?(ucm8888)

I tried setting macOS to English, the problem could not be reproduced on either en-US or ja-JP of Firefox 119.0.

On Japanese macOS, I reproduced the problem with Firefox 119.0 en-US and ja-JP.

As shown in the attached screenshot, when set to Strict tracking protection, a warning such as "Request for font "Osaka-Mono" blocked at visibility level 2 (requires 3)" was displayed on the console.

Flags: needinfo?(ucm8888)

Oh, I see.... it's related to the macOS locale being Japanese, which is affecting the default font prefs used (and the document doesn't have a lang="en" or similar attribute that would cause the Western prefs to be used).

I was a bit surprised to see that Osaka (and Osaka-Mono) wasn't included in the standard set of macOS fonts, but according to https://developer.apple.com/fonts/system-fonts/?q=osaka it's provided as a downloadable (optional) font these days. So that's why it isn't in our list of standard fonts that are available under Strict tracking protection.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: font-family:monospace is ignored if Enhanced Tracking Protection is strict → On Japanese macOS, font-family:monospace is ignored if Enhanced Tracking Protection is strict (because Osaka-Mono is unavailable)

Probably the simplest "quick fix" here is for us to insert Menlo into the Japanese monospace pref list, so that if Osaka-Mono isn't available (for whatever reason -- whether strict tracking protection or not-downloaded or whatever) we still get monospaced Latin characters.

@UCM, if you go to about:config and find the pref font.name-list.monospace.ja, and edit the value to add Menlo after the existing mention of Osaka-Mono (but before the other fonts in the list), so the value becomes Osaka-Mono, Menlo, Hiragino Kaku Gothic ProN, Hiragino Sans, does that fix the issue for you on Japanese macOS? I would expect that to help.

Flags: needinfo?(ucm8888)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9e5c856c0c71 Insert Menlo into the Japanese monospace font list on macOS, as fallback for Latin characters when Osaka-Mono is unavailable. r=layout-reviewers,emilio

(In reply to Jonathan Kew [:jfkthame] from comment #9)

@UCM, if you go to about:config and find the pref font.name-list.monospace.ja, and edit the value to add Menlo after the existing mention of Osaka-Mono (but before the other fonts in the list), so the value becomes Osaka-Mono, Menlo, Hiragino Kaku Gothic ProN, Hiragino Sans, does that fix the issue for you on Japanese macOS? I would expect that to help.

ASCII characters were displayed in Menlo, but non-ASCII characters were displayed in Hiragino Sans, which is not monospaced. So, I doubt whether this is the correct behavior for "font-family:monospace".


Is it really important to avoid using downloaded Osaka-Mono for Strict tracking protection?
(And does that mean there was a bug before 119.0 which was no avoidance?)

I am ignorant about tracking users using fonts, but it seems that there is no problem using Osaka-Mono even in Strict tracking protection. At least if Osaka-Mono is already downloaded.

(I think the fundamental problem is that the macOS Japanese environment does not include monospaced Japanese fonts by default...)

Flags: needinfo?(ucm8888)

(In reply to UCM from comment #12)

(In reply to Jonathan Kew [:jfkthame] from comment #9)

@UCM, if you go to about:config and find the pref font.name-list.monospace.ja, and edit the value to add Menlo after the existing mention of Osaka-Mono (but before the other fonts in the list), so the value becomes Osaka-Mono, Menlo, Hiragino Kaku Gothic ProN, Hiragino Sans, does that fix the issue for you on Japanese macOS? I would expect that to help.

ASCII characters were displayed in Menlo, but non-ASCII characters were displayed in Hiragino Sans, which is not monospaced. So, I doubt whether this is the correct behavior for "font-family:monospace".

OK, that's what I would expect -- it's not ideal, but in general there's no guarantee that 'monospace' will truly result in monospaced text across any arbitrary mixture of scripts. (Even if there's a font that provides monospaced Kanji and Latin, for instance, what happens when a Greek or Arabic or Hindi character is found? No individual font supports every possible character, so mixtures will inevitably occur.)


Is it really important to avoid using downloaded Osaka-Mono for Strict tracking protection?
(And does that mean there was a bug before 119.0 which was no avoidance?)

I am ignorant about tracking users using fonts, but it seems that there is no problem using Osaka-Mono even in Strict tracking protection. At least if Osaka-Mono is already downloaded.

(I think the fundamental problem is that the macOS Japanese environment does not include monospaced Japanese fonts by default...)

Yes, that's the more fundamental problem; adding Menlo to the list is just a partial workaround to help with Latin characters, but as you noted, it doesn't do anything for Japanese characters.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: