Closed Bug 1858708 Opened 8 months ago Closed 7 months ago

Image colors are inverted after *disabling* windows accessibility filter.

Categories

(Core :: Layout, defect)

Firefox 118
defect

Tracking

()

RESOLVED DUPLICATE of bug 1825241

People

(Reporter: tom, Assigned: canadahonk)

References

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0

Steps to reproduce:

In the evening, I use the Windows 10 Ctrl+Win+C shortcut to enable color filters--specifically, color inversion. After working this way for a while, I put my computer to sleep, and then, in the morning after logging back in, do the shortcut again to de-invert.

Actual results:

Immediately when I use the shortcut, Firefox inverts everything in the usual way. However, at some point after browsing for a while, it tries to be helpful by inverting everything except images and videos on some future page loads. Then, when I de-invert in the morning, those "helpful" pages now have normal black-on-white UI with inverted images. Eventually, pages will get the message, but I can't predict when, and I'm forced to either live with inverted-color images on all pages, or quit firefox, restart, and history>reopen last session or whatever it's called.

Note that this includes both images on pages, and favicons, extension icons, etc in the UI.

I'm guessing this is some kind of bug in https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors -- CSS writers can detect when the user has inverted their screen (along with e.g. dark mode). I actually can't get that CSS feature to work, though the dark-mode detection works fine (see attachment).

Expected results:

Either images should either never invert or invert and stay inverted.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: WebRender' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core

To whoever will triage this, this sounds like it could maybe be a problem in layout rather than gfx.

Component: Graphics: WebRender → Layout

To check, do you have the layout.css.inverted-colors.enabled pref on? Otherwise this should never happen afaik (the media query should never become active otherwise currently).

Flags: needinfo?(omedhurst) → needinfo?(tom)

Actually I think we have it enabled in chrome-only which might be the cause? (But that shouldn't effect actual web content?)

It does. It's in a UA sheet, so it affects web content.

Flags: needinfo?(omedhurst)

(In reply to Oliver Medhurst [:canadahonk] from comment #4)

To check, do you have the layout.css.inverted-colors.enabled pref on? Otherwise this should never happen afaik (the media query should never become active otherwise currently).

layout.css.inverted-colors.enabled is at the default of false in all my profiles

Flags: needinfo?(tom)

We could just drop chrome-only support for this when pref is off which could fix for now while it is off by default, or investigate deeper why we aren't recieving the setting update from Windows. Not sure if this is a high enough priority to do a quick fix like the former (and even uplift it too if it is?)

I haven't tried reproducing locally yet fwiw.

Flags: needinfo?(omedhurst)

The severity field is not set for this bug.
:jfkthame, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jfkthame)

(In reply to Oliver Medhurst [:canadahonk] from comment #8)

We could just drop chrome-only support for this when pref is off which could fix for now while it is off by default, or investigate deeper why we aren't recieving the setting update from Windows. Not sure if this is a high enough priority to do a quick fix like the former (and even uplift it too if it is?)

Seems like if we can do a quick fix for this, it'd be worthwhile -- wrongly-inverted images would be pretty annoying. Can you find the cycles to do something here?

Severity: -- → S3
Flags: needinfo?(jfkthame) → needinfo?(omedhurst)

Quick fix for this bug, real issue is somewhere deeper (not getting
Windows pref updates properly?)

This reverts the functionality of inverting images/etc when the screen
is inverted, as it seems buggy from the report.

Submitted patch for quick fix. This does completely remove the (seemingly buggy?) functionality of stopping images/etc becoming inverted when displays are inverted, so that might have to be considered?

Flags: needinfo?(omedhurst)
Assignee: nobody → omedhurst
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Depends on: 1825241

Bug 1825241 fixes this properly.

Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Duplicate of bug: 1825241
Resolution: --- → DUPLICATE
Attachment #9361021 - Attachment is obsolete: true

Another consequence (I think) of this bug is that, some time after invoking Windows's inversion filter (via Ctrl+Win+c), all formulae on Wikipedia blend in with the page background (which is black to my eyes, but still captured as white by screenshots). It can be fixed temporarily by adding

.mw-invert {
  filter: invert(0);
}

or

.mwe-math-fallback-image-inline {
  filter: invert(0);
}

in in a new style sheet in the "Style Editor" tab of the devtools for the page (maybe I'll add this as a Stylus profile). I'm not sure if that mw-invert class is added dynamically when FF detects that the OS is inverting the screen. It's also present in Chrome with and without inversion; and for both browsers on just the formula elements, not actual figures.

Keeping photographs uninverted while everything else changes around them is nice in theory, but the little inline-images that Wikipedia uses for math are a case demonstrate why this can't work in practice: I want these to invert with the text. Really, I just want the browser to be dumb about this and let Windows invert everything at its compositor level or however that's done. This seems to be what Chrome does, AFAICT.

It's not a consequence of this bug, what you're describing is https://github.com/w3c/csswg-drafts/issues/9674. Commenting there would be great.

Depends on: 1875123
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: