Image colors are inverted after *disabling* windows accessibility filter.
Categories
(Core :: Layout, defect)
Tracking
()
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.
Comment 1•8 months ago
|
||
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.
Comment 2•8 months ago
|
||
To whoever will triage this, this sounds like it could maybe be a problem in layout rather than gfx.
Updated•8 months ago
|
Assignee | ||
Comment 4•8 months ago
|
||
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).
Assignee | ||
Comment 5•8 months ago
|
||
Actually I think we have it enabled in chrome-only which might be the cause? (But that shouldn't effect actual web content?)
Comment 6•8 months ago
|
||
It does. It's in a UA sheet, so it affects web content.
(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
Assignee | ||
Comment 8•8 months ago
•
|
||
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.
Comment 9•7 months ago
|
||
The severity field is not set for this bug.
:jfkthame, could you have a look please?
For more information, please visit BugBot documentation.
Comment 10•7 months ago
|
||
(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?
Assignee | ||
Comment 11•7 months ago
|
||
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.
Assignee | ||
Comment 12•7 months ago
|
||
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?
Assignee | ||
Updated•7 months ago
|
Assignee | ||
Updated•7 months ago
|
Comment 13•7 months ago
|
||
Bug 1825241 fixes this properly.
Updated•7 months ago
|
Reporter | ||
Comment 14•6 months ago
|
||
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.
Comment 15•6 months ago
|
||
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.
Description
•