Closed Bug 1715783 Opened 4 years ago Closed 4 years ago

Black on black printing occurs with custom colors set in preferences and "High Contrast Black" color scheme in Windows 7 or 10

Categories

(Core :: Layout, defect)

78 Branch
defect

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: d2ogilvi, Assigned: emilio)

References

Details

Attachments

(6 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0

Steps to reproduce:

  1. Set Windows 7 or Windows 10 color scheme to "High Contrast Black".
  2. Start Thunderbird.
  3. Go to Tools > Options
  4. In right pane, scroll down to "Colors..." button and click on it.
  5. Set Text Color to white.
  6. Set background colour to black.
  7. Set "unvisited link color" to green.
  8. Set "Visited link color" to yellow.
  9. Set "Override the colors specified by the content with my selections above" to either "Only with High Contrast Themes" or "Always"
  10. Open an email with text and links.
  11. Press ctrl+p to print the email.

Actual results:

Headers appear as black text on a black background.
Links appear very faint, was link color is supposed to be most visible on a black background, not on white paper.
Text in previous emails in the thread appear as black text on a black background.
If "Override the colors specified by the content with my selections above" is set to "Always" and a standard Windows oolor scheme is used, then the black-on-black text described above is white-on-white instead.

Expected results:

The printout should look the same as the email when viewed with a standard Windows color scheme.
The solution to the issue is to save the user's current setting for "Override the colors specified by the content with my selections above" then setting the "Override the colors specified by the content with my selections above" to "Never" before performing the printing pass Once the printing is finished, the original setting for "Override the colors specified by the content with my selections above" should be reinstated.

Component: Untriaged → Theme
Summary: Printing issue when in "High Contreast Black" color scheme in Windows 7 or 10 → Printing issue when in "High Contrast Black" color scheme in Windows 7 or 10

Confirming exactly as described on 78.11.0 (32-bit), Win10.

These color settings always confuse me, but I believe that black-on-black for printout should never happen, and as it happens only to a random portion of the message, this does look like a bug. Not sure about the link colors how they should print, but probably just always printing standard colors (whatever that is) would be good enough.

Richard?

Summary: Printing issue when in "High Contrast Black" color scheme in Windows 7 or 10 → Black on black printing occurs with custom colors set in preferences and "High Contrast Black" color scheme in Windows 7 or 10

This is a beast! The colours aren't really settable by CSS. Somehow the print preparation uses a on the fly generated about:PreferenceStyleSheet that uses some colours, the link colours, that are set in the prefs. In our CSS only the header background colours are defined. And this background colours are on High Contrast (it doesn't need to be HC, only setting to Always is enough) used also when Print backgrounds is disabled!! With normal colour mode this defined background colours are only used when Print backgrounds is set.

My patch only fixes the background colour issue. The link colours aren't settable through CSS.

Assignee: nobody → richard.marti
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9226547 - Flags: review?(alessandro)

Does this happen also with Firefox?
Maybe this is something that should be fixed in the toolkit if it affects Firefox as well.

Flags: needinfo?(d2ogilvi)

It does affect firefox as well. It may be something that's in the toolkit, common code to both TB and FF.

Flags: needinfo?(d2ogilvi)
Attachment #9226547 - Flags: review?(alessandro)

Pinging Emilio to see if he knows who we can redirect this bug to.

Flags: needinfo?(emilio)
Assignee: richard.marti → emilio
Component: Theme → Layout
Flags: needinfo?(emilio)
Product: Thunderbird → Core
Version: 78 → 78 Branch

When printing, we lighten backgrounds and darken colors, unless color-adjust:
exact is used. So with the current backplating logic we might end up using a dark
system color background for a backplate, but then darkening the test, ending up
in both more ink being used, and the text being unreadable.

We don't have a great test story for these but I can try...

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9cff2072c592 Do not backplate using a background-color that isn't drawn due to print settings. r=morgan
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch

I just realized that my fix isn't quite perfect, and that there's some more work to do for form controls...

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Blocks: 1717245

This is more correct as it takes care about falling back to white as needed in
printing mode.

This is still not perfect because themed frames still get black-on-black text.

I'm not super-sure what's the right way to fix that, will
file a follow-up for that. In particular, when you have a themed
button, we use the system colors (i.e., black) to paint
it, but nsLayoutUtils::DarkenColorIfNeeded doesn't know it
and darkens the text color anyways.

Easiest fix is just not use the system colors when
printing, but that feels not-amazing...

That might feel non-amzing, but to would likely be the easiest solution. Printing doesn't need to know about the Windows colour scheme... it should just assume standard colors and generate the print according to that scheme. Just a thought...

Yeah, that's what I ended up doing in bug 1717245. It's not super-duper-great, but it is indeed the simpler solution.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b4e4f16482fe Use nsCSSRendering::DetermineBackgroundColor in backplate color computation. r=morgan
Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7fbc470c2f9f Use nsCSSRendering::DetermineBackgroundColor in backplate color computation. r=morgan
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Attached image email screenshot 1.png

Thanks so much for getting the printing to work in FF and TB!

There's just one small item that isn't quite right yet when printing in TB, and it may or may not be something that can be fixed easily.

Note in attachment "email screenshot 1" an email where there are multiple levels of back-and-forth between sender and recipient. Note the vertical lines showing the thread levels, some of which are white and some blue. This is fine on the screen, but notice in the print preview that the white lines don't show up. Ideally, the white lines should be black since they are being printed on white paper.

I realize this may be a hornet's nest, but thought I'd bring it to your attention anyway.

Thanks again for the great job at getting the text to print properly! This has been an issue since Netscape days.

No worries, happy to help! I don't know how the thread levels are drawn and I'm on my phone now, but it's probably worth a separate bug, should be fixable some way or another.

The email link could also have some more contrast...

Do you want me to submit a new bug on this, and a seperate one for the email link?

Yeah please do, feel free to cc me / ni? me so I dont forget to poke at it (on vacation now)

Awesome! - Thanks much Emilio for fixing this, and thanks Alex for inviting Emilio ;-)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: