PDF Viewer should not set the background of PDF documents to browser.display.background_color
Categories
(Firefox :: PDF Viewer, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox-esr102 | --- | fixed |
firefox102 | --- | wontfix |
firefox103 | --- | wontfix |
firefox104 | --- | fixed |
People
(Reporter: vincent-moz, Assigned: calixte)
References
(Regression)
Details
(Keywords: regression)
Attachments
(3 files, 1 obsolete file)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0
Steps to reproduce:
- Set browser.display.background_color to #FFFF00
- Open a PDF file that has a usual background (i.e. white, as generated by pdflatex, but I don't know the internals; just in case, I have attached a small PDF file to reproduce the issue).
Actual results:
The background of the PDF document is what is specified by browser.display.background_color, e.g. yellow (#FFFF00) with the above test.
Expected results:
The background of the PDF document should be white.
Note: this is a recent regression (appearing with FF 102?).
Reporter | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
It has been done on purpose: we want to improve pdf readability for people with visual disabilities:
https://github.com/mozilla/pdf.js/pull/14874
Changing the value of browser.display.background_color
modifies the value of the css name Canvas
which is a system color:
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#system_colors
used in forced color
mode:
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors
and usually forced colors mode
is chosen for accessibility reasons (for example in setting HCM mode on Windows).
It's possible to reset to the default colors in setting:
pdfjs.pageColorsBackground
to#FFFFFF
;pdfjs.pageColorsForeground
to#000000
.
Reporter | ||
Comment 2•2 years ago
|
||
This kind of information should have been announced. In particular, I've noticed that this change also makes all colors disappear from PDF files, while colors improve readability and/or convey information.
BTW, I'm also wondering what is the point of changing the rendering of PDF documents for people with visual disabilities, while nothing is "improved" on the HTML side (i.e. the change of text and background colors are still honored in HTML pages, contrary to PDF).
Assignee | ||
Comment 3•2 years ago
|
||
It has been announced in nightly release notes:
https://www.mozilla.org/en-US/firefox/102.0a1/releasenotes/
Colors improve readability for people who are able to see them correctly.
And finally I just switched to Dusk theme through a11y in Windows settings and the colors in Bugzilla are the ones from the Dusk theme, so if you see something wrong on the HTML side with forced colors, please file a bug.
Reporter | ||
Comment 4•2 years ago
|
||
(In reply to Calixte Denizet (:calixte) from comment #3)
It has been announced in nightly release notes:
https://www.mozilla.org/en-US/firefox/102.0a1/releasenotes/
Well, there are just a few unhelpful words: "Improved PDF reading in high contrast mode". I suppose that most users (like me) don't know the concept of "high contrast mode" (I just changed the background color, and that was about 20 years ago).
And finally I just switched to Dusk theme through a11y in Windows settings and the colors in Bugzilla are the ones from the Dusk theme, so if you see something wrong on the HTML side with forced colors, please file a bug.
Assignee | ||
Comment 5•2 years ago
|
||
In pdf.js we only rely on Canvas
and CanvasText
values:
https://drafts.csswg.org/css-color/#css-system-colors
which are set whatever the values of Use system color
or Overrides...
in colors settings are.
So we should take them into account.
Assignee | ||
Updated•2 years ago
|
Comment 7•2 years ago
|
||
Comment 8•2 years ago
|
||
Set release status flags based on info from the regressing bug 1768821
Assignee | ||
Comment 9•2 years ago
|
||
This way it'll help to know when the user-defined colors have to be used
when rendering a pdf.
Updated•2 years ago
|
Assignee | ||
Comment 10•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Comment 13•2 years ago
•
|
||
Backed out for causing mochitest failures in browser_pdfjs_hcm.js
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | toolkit/components/pdfjs/test/browser_pdfjs_hcm.js | [63,63,63,255] deepEqual [0,0,0,255] - JS frame :: chrome://mochitests/content/browser/toolkit/components/pdfjs/test/browser_pdfjs_hcm.js :: test/< :: line 75
Updated•2 years ago
|
Comment 14•2 years ago
|
||
Set release status flags based on info from the regressing bug 1768821
Assignee | ||
Comment 15•2 years ago
|
||
The failure is very likely due to a difference with the screen resolution between linux and windows machines. So I just increased the zoom level (and set it correctly thanks to a #
) to 800 in order to be sure that we have a correct color at the first pixel.
I triggered a try:
https://treeherder.mozilla.org/jobs?repo=try&revision=038b1c268b2d92104b07a1f89eea7b1c7c39aecd&selectedTaskRun=UVDHDRurS1S-G7YGBefNzA.0
Comment 16•2 years ago
|
||
Comment 18•2 years ago
|
||
bugherder |
Description
•