Page MenuHomePhabricator

Focus not visible on Button in Windows High Contrast Mode (WHCM)
Closed, ResolvedPublicBUG REPORT

Description

Background

Windows features an operating system display mode called High Contrast Mode (WHCM). Unlike other display modes (for example setting dark mode flag), WHCM completely overrides authored colors with user-set colors in supporting browsers. IE/Edge but also Firefox/Win.
Here, when WHCM is active it relies on putting a certain color from its reduced palette on outline property disregarding transparent and only overrides the color value of the shorthand property. If we were to set outline: none it would fail to put a visible outline on the element.

Steps to Reproduce:

  • Go to any page with a OOUI button
  • Turn on high contrast mode
  • Navigate to the button using keyboard

Actual Results:

  • No focus is visible on the button

Expected Results:

  • There should be a visual indication that the current button is in focus

Goal

Set a compliant rule to support our visible custom focus outlines while also supporting the WHCM overrides.

Further reading

Event Timeline

My open questions in T253598#6193715 remain, the approach of preferring proprietary high contrast mode over any other mode and environment isn't sufficient for our scope and reach. If we can't address high contrast mode focus differently (and without a lot of extra code), taking away custom focus behavior will not be merged at current understanding.

Change 607640 had a related patch set uploaded (by Bkudiess-msft; owner: Bkudiess-msft):
[oojs/ui@master] Adds button focus in high contrast mode

https://gerrit.wikimedia.org/r/607640

Status quo:

image.png (138×324 px, 7 KB)

With patch:
image.png (132×320 px, 7 KB)

Notice the far bigger radius.

Change 607640 merged by jenkins-bot:
[oojs/ui@master] WikimediaUI theme: Add button focus for Windows high contrast mode

https://gerrit.wikimedia.org/r/607640

Change 611174 had a related patch set uploaded (by VolkerE; owner: VolkerE):
[mediawiki/core@master] Update OOUI to v0.39.3

https://gerrit.wikimedia.org/r/611174

Change 611174 merged by jenkins-bot:
[mediawiki/core@master] Update OOUI to v0.39.3

https://gerrit.wikimedia.org/r/611174

Volker_E edited projects, added OOUI (OOUI-0.38.0); removed OOUI.
Volker_E moved this task from OOUI-0.38.0 to OOUI-0.39.3 on the OOUI board.
Volker_E edited projects, added OOUI (OOUI-0.39.3); removed OOUI (OOUI-0.38.0).
Volker_E renamed this task from Focus not visible on Button on high contrast mode to Focus not visible on Button in Windows High Contrast Mode (WHCM).Jan 15 2025, 9:49 PM
Volker_E updated the task description. (Show Details)

Extended by more detailed explanation on why the outline: 1px solid transparent workaround is needed. Also tagged by Codex as it inherited this solution from OOUI for future reference.