dsanders11

#55970: fix: reflect system contrast preference in prefers-contrast media query

Merged
Created: Nov 19, 2026, 4:57:42 PM
Merged: Nov 20, 2026, 11:06:15 AM
4 comments
Target: main

Description of Change

Electron never set preferred_contrast in its web preferences, unlike Chrome (which added it in https://chromium-review.googlesource.com/c/chromium/src/+/2412972), so prefers-contrast always matched no-preference even when nativeTheme.shouldUseHighContrastColors was true. This sets it from the native theme, mirroring Chrome's GetPreferredContrast, and includes it in the color-related needs-update check so a runtime change refreshes open pages; the new spec forces high contrast with --force-high-contrast.

Fixes #55917

Checklist

Release Notes

Notes: Fixed prefers-contrast media query ignoring the system's contrast setting.

Backports

44-x-y
Merged
PR Number
#55987
Merged At
Nov 20, 2026, 12:31:38 PM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#55986
Merged At
Nov 20, 2026, 12:31:45 PM
Released In
Not yet
Release Date
Not yet
46-x-y
Merged
PR Number
#55985
Merged At
Nov 20, 2026, 12:05:12 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron