Issue 480978106: dark-mode focus outline color ignored

#480978106 Filed 2026-02-02 P3 / S3 Affected before fix: Linux, Windows

Platform Status

By platform

Reason: override code is under #if !BUILDFLAG(IS_MAC) in PaintFocusRing().

Canvas Regression (drawFocusIfNeeded)

What broke

When white override moved from PaintFocusRing() to FocusRingColor(), canvas also got white rings in dark mode. On white canvas, the ring disappears.

Before fix

Dark canvas: white focus ring invisible on white background
Dark canvas: white ring on white

After fix

All three color schemes: focus ring visible
Ring visible

Fix

Keep FocusRingColor() renderer-driven (for canvas). Apply white override only in PaintFocusRing() and only for keyword-based default rings. Explicit author colors stay untouched.

Original Bug

Root Cause

On non-Mac in dark mode, PaintFocusRing() forced the inner ring to white.

Result: explicit outline-color (for example red) was ignored.

Outline Before / After

Before

Before fix: dark mode outline is white
Dark mode outline white

After

After fix: dark mode outline is red
Dark mode outline red

Live Reproducer

Tab to the buttons. In dark mode, the outline should be red.

Light mode

red outline shown

Dark mode (before fix)

red ignored, white shown

Related CLs

CL 7555272 -- Use specified outline color for focus rings (abandoned)

CL 2644337 -- Use the system accent color for dark mode focus ring on Mac (merged)

Test

TEST_F(OutlinePainterTest, FocusRingRespectsExplicitOutlineColorInDarkMode)
// explicit outline-color must not be overridden in dark mode.