Closed Bug 1773795 Opened 2 years ago Closed 2 years ago

Firefox uses a different 'windowtext' color differs from Chrome (making e.g. MS OneDrive Word docs appear darker/easier-to-read in Chrome)

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: dholbert, Assigned: emilio)

References

Details

Attachments

(2 files)

STR:

  1. Load attached testcase.
  2. Click the text and see what the alert says.

ACTUAL RESULTS:
Firefox reports rgb(61, 61, 61) i.e. a grayish color.

EXPECTED RESULTS:
Chrome reports rgb(0, 0, 0) i.e. black.

I suspect that strictly speaking this is a UA-defined color and we use whatever color we deem appropriate (or maybe we get it from the OS? Though I'd expect that Firefox and Chrome would get the same color in that case...)

This causes Firefox to look noticeably "fainter" than Chromium-based browsers on OneDrive's Word Document Editor (which seems to use color: windowtext by default).

Screenshot with Firefox on the left, Chrome on the right:
https://bugzilla.mozilla.org/attachment.cgi?id=9280762

(I originally posted this on bug 1773699 but then realized that I was seeing a different issue than the reporter; hence, I'm spinning this bug here off for the issue that I'm seeing.)

I'm using Ubuntu 22.04, FWIW.

Attached file testcase 1
See Also: → 1773699

FWIW in Firefox on Windows 10 (which I just tested via BrowserStack), it looks like we do indeed use rgb(0,0,0) -- i.e. I get "expected results" there.

But in Firefox Nightly on MacOS, I get rgba(0, 0, 0, 0.847) -- i.e. partially-transparent black. I imagine this color (much like the opaque gray color that I'm getting on Ubuntu) is harder-to-see than regular black on MS Word documents viewed in OneDrive...

emilio, do you know offhand where this windowtext system-color value comes from?

Flags: needinfo?(emilio)

I am the one who reported the original bug. Your test case reports windowtext as rgb(46, 52, 54). I'm in Fedora linux 36 KDE

WindowText comes from the OS theme here.

Flags: needinfo?(emilio)

They are using the window / windowtext color correctly at least. We could make them match the Windows colors, but I'm not sure it's worth it.

Blocks: 1774016
No longer blocks: 1774016
Depends on: 1774016
Assignee: nobody → emilio
Status: NEW → ASSIGNED

So I'm not sure comment 6 is a great idea, but it should help for this specific case.

could we do a specific page fix? Spoof window color only in Microsoft Office?

We could, but adding site-specific hacks is not a great use of time IMO. We could try to ping Microsoft folks to see if they can fix their page.

Also, I guess the spec says that Window/WindowText should be just Canvas/CanvasText, which this patch would achieve: https://drafts.csswg.org/css-color-4/#window

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/26d5615493b5
Spoof window/windowtext colors in content. r=dholbert
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
Regressions: 1776162
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: