Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grey background color/text highlight in high contrast mode #13230

Closed
sawanm9000 opened this issue Apr 13, 2021 · 4 comments · Fixed by #14715
Closed

Grey background color/text highlight in high contrast mode #13230

sawanm9000 opened this issue Apr 13, 2021 · 4 comments · Fixed by #14715

Comments

@sawanm9000
Copy link

sawanm9000 commented Apr 13, 2021

Link to PDF file:
https://mozilla.github.io/pdf.js/web/viewer.html

Configuration:

  • Web browser and its version: Firefox Developer Edition 88.0b9
  • Operating system and its version: Windows 10 19042.870
  • PDF.js version: Latest version
  • Is a browser extension: No

Steps to reproduce the problem:

  1. Switch to high contrast mode.
  2. Open a PDF file.

What is the expected behavior

  • Text and background colors are as defined in the file:
    Screenshot 2021-04-13 112321

What went wrong?

  • Text has a a highlight/grey background in high contrast mode:
    Screenshot 2021-04-13 112354

Possible solution:

  • Add the following code after line 32 in pdf_viewer.css
.pdfViewer > .page > .textLayer {
    forced-color-adjust: none;
}

forced-color-adjust, however, is not supported in Firefox.

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Apr 13, 2021

forced-color-adjust, however, is not supported in Firefox.

For reference, that's being tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1591210


Add the following code after line 32 in pdf_viewer.css

FYI: CSS rules for the textLayer belongs in https://github.com/mozilla/pdf.js/blob/master/web/text_layer_builder.css

@marco-c
Copy link
Contributor

marco-c commented Mar 27, 2022

I've reopened the issue since it's still reproducible in Firefox.

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Feb 18, 2023

I've reopened the issue since it's still reproducible in Firefox.

https://bugzilla.mozilla.org/show_bug.cgi?id=1591210 has been fixed, so hopefully this should work now.

Edit: @marco-c Can you please re-check if this is fixed now?

@Snuffleupagus
Copy link
Collaborator

WFM, when testing various high-contrast themes in Windows 11 and Firefox Nightly 115.0a1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants