Respect explicit outline-color for focus rings in dark mode [chromium/src : main]

0 views
Skip to first unread message

Helmut Januschka (Gerrit)

unread,
Mar 5, 2026, 5:24:15 AM (6 days ago) Mar 5
to Helmut Januschka, Florin Malita, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Florin Malita

Helmut Januschka added 1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Helmut Januschka . resolved

hi @fma...@chromium.org thanks for review in advance.
offtopic, i love this avatar you have, thought my glassses had a bug!!

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 4
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Comment-Date: Thu, 05 Mar 2026 10:23:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Florin Malita (Gerrit)

unread,
Mar 5, 2026, 5:10:22 PM (6 days ago) Mar 5
to Helmut Januschka, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Helmut Januschka

Florin Malita added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Florin Malita . resolved

The change looks good, but the pixel diffs in `chrome/test/data/focus_rings/` seem problematic: we changed from white to a black outline, which is not visible against the black background.

Do you know what's causing that? Looks like the test is using dark mode, so I would expect the outline to be white:

https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/focus_ring_interactive_uitest.cc;drc=24a2b28fad818f399db985eb92b296a1cd0250c0;l=218

Open in Gerrit

Related details

Attention is currently required from:
  • Helmut Januschka
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 9
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
Gerrit-Comment-Date: Thu, 05 Mar 2026 22:10:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Helmut Januschka (Gerrit)

unread,
Mar 6, 2026, 4:55:20 AM (5 days ago) Mar 6
to Helmut Januschka, Florin Malita, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Florin Malita

Helmut Januschka added 2 comments

Patchset-level comments
Florin Malita . resolved

The change looks good, but the pixel diffs in `chrome/test/data/focus_rings/` seem problematic: we changed from white to a black outline, which is not visible against the black background.

Do you know what's causing that? Looks like the test is using dark mode, so I would expect the outline to be white:

https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/focus_ring_interactive_uitest.cc;drc=24a2b28fad818f399db985eb92b296a1cd0250c0;l=218

Helmut Januschka

Good catch. Root cause was that renderer prefs set a custom focus ring color (#101010), and FocusRingColor() was honoring that in dark mode.

File-level comment, Patchset 10 (Latest):
Helmut Januschka . resolved

thank you from preventing me to break the world!

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 10
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Mar 2026 09:55:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Florin Malita <fma...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Florin Malita (Gerrit)

unread,
Mar 6, 2026, 10:34:33 AM (5 days ago) Mar 6
to Helmut Januschka, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Helmut Januschka

Florin Malita voted and added 1 comment

Votes added by Florin Malita

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 10 (Latest):
Florin Malita . resolved

Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Helmut Januschka
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 10
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
Gerrit-Comment-Date: Fri, 06 Mar 2026 15:34:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Helmut Januschka (Gerrit)

unread,
Mar 6, 2026, 10:39:35 AM (5 days ago) Mar 6
to Helmut Januschka, Florin Malita, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

Helmut Januschka voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 10
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-Comment-Date: Fri, 06 Mar 2026 15:39:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Chromium LUCI CQ (Gerrit)

unread,
Mar 6, 2026, 10:55:05 AM (5 days ago) Mar 6
to Helmut Januschka, Florin Malita, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

Chromium LUCI CQ submitted the change

Change information

Commit message:
Respect explicit outline-color for focus rings in dark mode

PaintFocusRing() unconditionally overrides the author-specified
outline-color to white when DarkColorScheme() is true on non-Mac
platforms. This means outline-color: red is silently ignored in
dark mode.


Bug: 480978106, 489304736
Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7633026
Reviewed-by: Florin Malita <fma...@chromium.org>
Commit-Queue: Helmut Januschka <hel...@januschka.com>
Cr-Commit-Position: refs/heads/main@{#1595419}
Files:
  • M third_party/blink/renderer/core/layout/layout_theme.cc
  • M third_party/blink/renderer/core/paint/outline_painter.cc
  • M third_party/blink/renderer/core/paint/outline_painter_test.cc
  • A third_party/blink/web_tests/flag-specific/enable-skia-graphite/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/date-suggestion-picker-appearance-expected.png
  • A third_party/blink/web_tests/flag-specific/enable-skia-graphite/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/datetimelocal-suggestion-picker-appearance-expected.png
  • A third_party/blink/web_tests/flag-specific/enable-skia-graphite/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/month-suggestion-picker-appearance-expected.png
  • A third_party/blink/web_tests/flag-specific/enable-skia-graphite/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/time-suggestion-picker-appearance-expected.png
  • A third_party/blink/web_tests/flag-specific/enable-skia-graphite/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/week-suggestion-picker-appearance-expected.png
  • M third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/date-suggestion-picker-appearance-expected.png
  • M third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/datetimelocal-suggestion-picker-appearance-expected.png
  • M third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/month-suggestion-picker-appearance-expected.png
  • M third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/time-suggestion-picker-appearance-expected.png
  • M third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/week-suggestion-picker-appearance-expected.png
  • M third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/date-suggestion-picker-appearance-expected.png
  • M third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/datetimelocal-suggestion-picker-appearance-expected.png
  • M third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/month-suggestion-picker-appearance-expected.png
  • M third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/time-suggestion-picker-appearance-expected.png
  • M third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/week-suggestion-picker-appearance-expected.png
  • D third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/date-suggestion-picker-appearance-expected.png
  • D third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/datetimelocal-suggestion-picker-appearance-expected.png
  • D third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/month-suggestion-picker-appearance-expected.png
  • D third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/time-suggestion-picker-appearance-expected.png
  • D third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/week-suggestion-picker-appearance-expected.png
  • A third_party/blink/web_tests/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/date-suggestion-picker-appearance-expected.png
  • A third_party/blink/web_tests/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/datetimelocal-suggestion-picker-appearance-expected.png
  • A third_party/blink/web_tests/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/month-suggestion-picker-appearance-expected.png
  • A third_party/blink/web_tests/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/time-suggestion-picker-appearance-expected.png
  • A third_party/blink/web_tests/virtual/dark-color-scheme/fast/forms/color-scheme/suggestion-picker/week-suggestion-picker-appearance-expected.png
Change size: M
Delta: 28 files changed, 62 insertions(+), 7 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Florin Malita
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 11
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
open
diffy
satisfied_requirement

Philip Rogers (Gerrit)

unread,
Mar 6, 2026, 4:10:36 PM (5 days ago) Mar 6
to Helmut Januschka, Chromium LUCI CQ, Florin Malita, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Helmut Januschka

Philip Rogers added 1 comment

File third_party/blink/renderer/core/layout/layout_theme.cc
Line 876, Patchset 11 (Latest):#if !BUILDFLAG(IS_MAC)
Philip Rogers . unresolved

Q1: will this patch change behavior of some new codepaths, such as `CanvasRenderingContext2D::DrawFocusRing` which uses this function but did not previously use PaintFocusRing?

Q2: Does this change behavior of reading the css style for `-webkit-focus-ring-color`? I think this can be done with `console.log((() => { const d = document.createElement('div'); d.style.color = '-webkit-focus-ring-color'; document.body.appendChild(d); const c = getComputedStyle(d).color; d.remove(); return c; })());`.

Q3: Why do we still have this platform difference at all?

Open in Gerrit

Related details

Attention is currently required from:
  • Helmut Januschka
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 11
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-CC: Philip Rogers <p...@chromium.org>
Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
Gerrit-Comment-Date: Fri, 06 Mar 2026 21:10:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
open
diffy

Helmut Januschka (Gerrit)

unread,
Mar 6, 2026, 5:18:25 PM (5 days ago) Mar 6
to Helmut Januschka, Chromium LUCI CQ, Philip Rogers, Florin Malita, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

Helmut Januschka added 1 comment

File third_party/blink/renderer/core/layout/layout_theme.cc
Line 876, Patchset 11 (Latest):#if !BUILDFLAG(IS_MAC)
Philip Rogers . resolved

Q1: will this patch change behavior of some new codepaths, such as `CanvasRenderingContext2D::DrawFocusRing` which uses this function but did not previously use PaintFocusRing?

Q2: Does this change behavior of reading the css style for `-webkit-focus-ring-color`? I think this can be done with `console.log((() => { const d = document.createElement('div'); d.style.color = '-webkit-focus-ring-color'; document.body.appendChild(d); const c = getComputedStyle(d).color; d.remove(); return c; })());`.

Q3: Why do we still have this platform difference at all?

Helmut Januschka

A1: Yes, this does affect other FocusRingColor() callers (like CanvasRenderingContext2D::DrawFocusRing) on non-Mac in dark mode.

That is intentional: previously only the outline:auto paint path forced white in dark mode, while other -webkit-focus-ring-color users kept the dark renderer-pref color (#101010), which led to inconsistent and sometimes invisible focus indicators.


A2: Yes, in dark color-scheme contexts this changes computed style for -webkit-focus-ring-color on non-Mac. Since that keyword resolves via LayoutTheme::FocusRingColor(), getComputedStyle(...).color now resolves to white instead of rgb(16, 16, 16) (light mode is unchanged).

A3: The platform split is pre-existing and preserved by this CL. Mac uses LayoutThemeMac::FocusRingColor() (native accent/focus behavior), while non-Mac uses the legacy renderer-pref path with dark-mode visibility handling. This CL only moves where the non-Mac dark override is applied; it does not attempt to unify Mac/non-Mac policy.
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 11
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-CC: Philip Rogers <p...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Mar 2026 22:18:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Philip Rogers <p...@chromium.org>
satisfied_requirement
open
diffy

Philip Rogers (Gerrit)

unread,
Mar 6, 2026, 5:41:22 PM (5 days ago) Mar 6
to Helmut Januschka, Chromium LUCI CQ, Florin Malita, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

Philip Rogers added 1 comment

File third_party/blink/renderer/core/layout/layout_theme.cc
Line 876, Patchset 11 (Latest):#if !BUILDFLAG(IS_MAC)
Philip Rogers . resolved

Q1: will this patch change behavior of some new codepaths, such as `CanvasRenderingContext2D::DrawFocusRing` which uses this function but did not previously use PaintFocusRing?

Q2: Does this change behavior of reading the css style for `-webkit-focus-ring-color`? I think this can be done with `console.log((() => { const d = document.createElement('div'); d.style.color = '-webkit-focus-ring-color'; document.body.appendChild(d); const c = getComputedStyle(d).color; d.remove(); return c; })());`.

Q3: Why do we still have this platform difference at all?

Helmut Januschka

A1: Yes, this does affect other FocusRingColor() callers (like CanvasRenderingContext2D::DrawFocusRing) on non-Mac in dark mode.

That is intentional: previously only the outline:auto paint path forced white in dark mode, while other -webkit-focus-ring-color users kept the dark renderer-pref color (#101010), which led to inconsistent and sometimes invisible focus indicators.


A2: Yes, in dark color-scheme contexts this changes computed style for -webkit-focus-ring-color on non-Mac. Since that keyword resolves via LayoutTheme::FocusRingColor(), getComputedStyle(...).color now resolves to white instead of rgb(16, 16, 16) (light mode is unchanged).

A3: The platform split is pre-existing and preserved by this CL. Mac uses LayoutThemeMac::FocusRingColor() (native accent/focus behavior), while non-Mac uses the legacy renderer-pref path with dark-mode visibility handling. This CL only moves where the non-Mac dark override is applied; it does not attempt to unify Mac/non-Mac policy.
Philip Rogers

Isn't this patch basically a regression for non-mac platforms for the other callers of FocusRingColor? In other words, you've fixed PaintFocusRing, but broken FocusRingColor. Or do I misunderstand?

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 11
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-CC: Philip Rogers <p...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Mar 2026 22:41:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Helmut Januschka <hel...@januschka.com>
Comment-In-Reply-To: Philip Rogers <p...@chromium.org>
satisfied_requirement
open
diffy

Helmut Januschka (Gerrit)

unread,
Mar 6, 2026, 5:59:49 PM (5 days ago) Mar 6
to Helmut Januschka, Chromium LUCI CQ, Philip Rogers, Florin Malita, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

Helmut Januschka added 1 comment

File third_party/blink/renderer/core/layout/layout_theme.cc
Line 876, Patchset 11 (Latest):#if !BUILDFLAG(IS_MAC)
Philip Rogers . resolved

Q1: will this patch change behavior of some new codepaths, such as `CanvasRenderingContext2D::DrawFocusRing` which uses this function but did not previously use PaintFocusRing?

Q2: Does this change behavior of reading the css style for `-webkit-focus-ring-color`? I think this can be done with `console.log((() => { const d = document.createElement('div'); d.style.color = '-webkit-focus-ring-color'; document.body.appendChild(d); const c = getComputedStyle(d).color; d.remove(); return c; })());`.

Q3: Why do we still have this platform difference at all?

Helmut Januschka

A1: Yes, this does affect other FocusRingColor() callers (like CanvasRenderingContext2D::DrawFocusRing) on non-Mac in dark mode.

That is intentional: previously only the outline:auto paint path forced white in dark mode, while other -webkit-focus-ring-color users kept the dark renderer-pref color (#101010), which led to inconsistent and sometimes invisible focus indicators.


A2: Yes, in dark color-scheme contexts this changes computed style for -webkit-focus-ring-color on non-Mac. Since that keyword resolves via LayoutTheme::FocusRingColor(), getComputedStyle(...).color now resolves to white instead of rgb(16, 16, 16) (light mode is unchanged).

A3: The platform split is pre-existing and preserved by this CL. Mac uses LayoutThemeMac::FocusRingColor() (native accent/focus behavior), while non-Mac uses the legacy renderer-pref path with dark-mode visibility handling. This CL only moves where the non-Mac dark override is applied; it does not attempt to unify Mac/non-Mac policy.
Philip Rogers

Isn't this patch basically a regression for non-mac platforms for the other callers of FocusRingColor? In other words, you've fixed PaintFocusRing, but broken FocusRingColor. Or do I misunderstand?

Helmut Januschka

You are right that it changes all non-Mac dark-mode FocusRingColor() callers, not just PaintFocusRing(), and that is intentional: previously only outline:auto forced white while other paths still used #101010, causing inconsistent and often invisible focus rings. This also intentionally addresses https://issues.chromium.org/issues/489304736, where -webkit-focus-ring-color with non-auto outlines in dark mode stayed at #101010 on non-Mac.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 11
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-CC: Philip Rogers <p...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Mar 2026 22:59:30 +0000
satisfied_requirement
open
diffy

Philip Rogers (Gerrit)

unread,
Mar 6, 2026, 8:51:07 PM (5 days ago) Mar 6
to Helmut Januschka, Chromium LUCI CQ, Florin Malita, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

Philip Rogers added 1 comment

File third_party/blink/renderer/core/layout/layout_theme.cc
Line 876, Patchset 11 (Latest):#if !BUILDFLAG(IS_MAC)
Philip Rogers . resolved

Q1: will this patch change behavior of some new codepaths, such as `CanvasRenderingContext2D::DrawFocusRing` which uses this function but did not previously use PaintFocusRing?

Q2: Does this change behavior of reading the css style for `-webkit-focus-ring-color`? I think this can be done with `console.log((() => { const d = document.createElement('div'); d.style.color = '-webkit-focus-ring-color'; document.body.appendChild(d); const c = getComputedStyle(d).color; d.remove(); return c; })());`.

Q3: Why do we still have this platform difference at all?

Helmut Januschka

A1: Yes, this does affect other FocusRingColor() callers (like CanvasRenderingContext2D::DrawFocusRing) on non-Mac in dark mode.

That is intentional: previously only the outline:auto paint path forced white in dark mode, while other -webkit-focus-ring-color users kept the dark renderer-pref color (#101010), which led to inconsistent and sometimes invisible focus indicators.


A2: Yes, in dark color-scheme contexts this changes computed style for -webkit-focus-ring-color on non-Mac. Since that keyword resolves via LayoutTheme::FocusRingColor(), getComputedStyle(...).color now resolves to white instead of rgb(16, 16, 16) (light mode is unchanged).

A3: The platform split is pre-existing and preserved by this CL. Mac uses LayoutThemeMac::FocusRingColor() (native accent/focus behavior), while non-Mac uses the legacy renderer-pref path with dark-mode visibility handling. This CL only moves where the non-Mac dark override is applied; it does not attempt to unify Mac/non-Mac policy.
Philip Rogers

Isn't this patch basically a regression for non-mac platforms for the other callers of FocusRingColor? In other words, you've fixed PaintFocusRing, but broken FocusRingColor. Or do I misunderstand?

Helmut Januschka

You are right that it changes all non-Mac dark-mode FocusRingColor() callers, not just PaintFocusRing(), and that is intentional: previously only outline:auto forced white while other paths still used #101010, causing inconsistent and often invisible focus rings. This also intentionally addresses https://issues.chromium.org/issues/489304736, where -webkit-focus-ring-color with non-auto outlines in dark mode stayed at #101010 on non-Mac.

Philip Rogers

This change will cause a regression where there are invisible focus rings for canvas in the following example:
```
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<title>Outline colour</title>
<style>
* {
outline-color: red;
}
div {
padding: 1rem;
margin: 1rem;
border: thin solid gold;
}
p {
color: red;
}
.dark {
color-scheme: dark;
}
.light {
color-scheme: light;
}
.system {
color-scheme: light dark;
}
</style>
</head>
<body>
<div class="dark">
<p>Dark colour scheme</p>
<button>Button</button>
<a href="#">Link</a>
<canvas id="darkc" width="100" height="100"><button id="darkcb">abc</button></canvas>
<script>
darkcb.focus();
var ctx = darkc.getContext('2d');
ctx.beginPath();
ctx.rect(10, 10, 50, 50);
ctx.drawFocusIfNeeded(darkcb);
</script>
</div>
  <div class="light">
<p>Light colour scheme</p>
<button>Button</button>
<a href="#">Link</a>
<canvas id="lightc" width="100" height="100"><button id="lightcb">abc</button></canvas>
<script>
lightcb.focus();
var ctx = lightc.getContext('2d');
ctx.beginPath();
ctx.rect(10, 10, 50, 50);
ctx.drawFocusIfNeeded(lightcb);
</script>
</div>
  <div class="system">
<p>System colour scheme</p>
<button>Button</button>
<a href="#">Link</a>
<canvas id="systemc" width="100" height="100"><button id="systemcb">abc</button></canvas>
<script>
systemcb.focus();
var ctx = systemc.getContext('2d');
ctx.beginPath();
ctx.rect(10, 10, 50, 50);
ctx.drawFocusIfNeeded(systemcb);
</script>
</div>

</body>

</html>

```

I think it would be best to revert these patches and think more about the changes.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 11
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-CC: Philip Rogers <p...@chromium.org>
Gerrit-Comment-Date: Sat, 07 Mar 2026 01:50:58 +0000
satisfied_requirement
open
diffy

Helmut Januschka (Gerrit)

unread,
Mar 7, 2026, 8:39:13 AM (4 days ago) Mar 7
to Helmut Januschka, Chromium LUCI CQ, Philip Rogers, Florin Malita, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

Helmut Januschka added 1 comment

File third_party/blink/renderer/core/layout/layout_theme.cc
Helmut Januschka

ohhh gosh, super sorry! and highly appreciate your feedback. instead of revert, would it be ok to land a fix on top? CL: https://chromium-review.googlesource.com/c/chromium/src/+/7646168
posted a screenshot of before/after on the bug.

that ultimatly unresolves issue: http://crbug.com/489304736 (but keeps the first one clean solved, and it might require some more targeted approach on css level itself.)


i am feeling confident that this should cleanly solve issue1, please let me know if you want me to revert (and reland basically the same thing) or proceed with the followup.


and again, sorry for breaking things, i will do better next time!

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie602528a2e235a5b1fbd5dd9c4eada41b2425799
Gerrit-Change-Number: 7633026
Gerrit-PatchSet: 11
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-CC: Philip Rogers <p...@chromium.org>
Gerrit-Comment-Date: Sat, 07 Mar 2026 13:38:57 +0000
satisfied_requirement
open
diffy

Helmut Januschka (Gerrit)

unread,
Mar 9, 2026, 4:27:13 PM (2 days ago) Mar 9
to Helmut Januschka, Chromium LUCI CQ, Philip Rogers, Florin Malita, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

Helmut Januschka has created a revert of this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: revert
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages