Closed Bug 2083002 Opened 1 month ago Closed 1 month ago

[Nova] Wrong contrast ratio of 4.35 for selected items in PDF menu while using the Night Sky high contrast theme

Categories

(Firefox :: PDF Viewer, defect, P1)

Desktop
Windows
defect

Tracking

()

RESOLVED FIXED
161 Branch
Accessibility Severity s3
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- unaffected
firefox158 --- wontfix
firefox159 --- wontfix
firefox160 --- wontfix
firefox161 --- fixed

People

(Reporter: bmaris, Assigned: calixte)

References

Details

(Keywords: access)

Attachments

(1 external file)

Follow-up of bug 2071599.

Found in

  • Latest Nightly 160.0a1

Affected versions

  • Nightly 160.0a1
  • Beta 159.0b2
  • Release 158.0

Tested platforms

  • Affected platforms: Windows 11 and 10
  • Unaffected platforms: MacOS 13 and Ubuntu 24.04

Preconditions

  • Windows 11 - enable Night Sky contrast theme from windows settings.
  • Windows 10 - enable High Contrast #1, High Contrast #2 from Windows settings or the default Light theme inside Firefox
  • Enable Inspect Accessibility Properties in the context menu by opening the Web console and clicking on the Accessibility tab.

Steps to reproduce

  1. Open a pdf sample (eg. https://samplepdf.org/files/sample.pdf)
  2. Click on the Tools button '>>'
  3. Right click on any selected item (eg. No Spreads)
  4. Select Inspect Accessibility Properties
  5. Click the Inspect button (The one from the far left) and hover over the selected item inside the PDF Tools panel

Expected result

  • A correct contrast is displayed.

Actual result

  • The wrong contrast number is recorded for the following:
  1. Windows 11 - Night Sky - 4.35!
  2. Windows 10 - High Contrast #1 - 3.26!, High Contrast #2 - 3.26!, Firefox Light theme - 2.93!

Regression range

  • Not sure if this is a regression, I can search for one if needed but it seems that with the enabling of Nova, might have also caused these.

The forced-colors :root block in viewer.css puts the checked-state text --toggled-btn-text-color: HighlightText on --toggled-btn-bg-color: LinkText, which are not a system color pair: Night Sky's #2B2B2B on #8080FF is exactly 4.35:1, and white on #8080FF in Windows 10 High Contrast #1/#2 is 3.26:1. The block comes after the Nova overrides, so it also applies with Nova off, and it styles every .toolbarButton.toggled (#7764) and checked findbar .toggleButton (#7506).

Fix: In upstream pdf.js web/viewer.css, switch the checked pair to SelectedItem/SelectedItemText, the same pair as --button-background-color-selected in tokens-shared.css, and keep the ButtonBorder hover outline at #7773 as the hover cue. Then vendor the change, because a local edit to this file is overwritten by the next PDF.js update. The Windows 10 Light theme figure of 2.93 matches the value from before bug 2071599 was fixed, so please re-measure it on a build that includes that fix.

Suggested severity: S3. Checked items in the PDF Tools menu and findbar are hard to read for Windows high-contrast users, but the menu still works and the problem is limited to forced-colors mode.


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-{wrong-file, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.

Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.

The Bugbug bot thinks this bug is an accessibility bug, but please revert this change in case of error.

Keywords: access

Marking access-s3 because, while we should get this calculation correct, high contrast modes are not subject to WCAG contrast requirements

Accessibility Severity: --- → s3
Severity: -- → S3
Priority: -- → P3
Assignee: nobody → cdenizet
Status: NEW → ASSIGNED
Priority: P3 → P1
Depends on: 2085270
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Depends on: 2085437
No longer depends on: 2085270
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch
QA Whiteboard: [qa-found-in-c160] [S3] → [qa-found-in-c160] [S3] [qa-triage-done-c162/b161] [qa-ver-needed-c162/b161]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: