Re: [csswg-drafts] [css-mediaqueries] Inverted-colors media feature can cause problems on semi-transparent images. (#9674)

On [bugzilla, I posted](url), I posted some related info, and was requested to comment here also. The gist is that Firefox (in the current version) tries to uninvert photographs after the OS has inverted the whole screen (e.g. Windows 10's built in [color filters](https://support.microsoft.com/en-us/windows/use-color-filters-in-windows-43893e44-b8b3-2e27-1a29-b0c15ef0e5ce) feature). However, aside from some bugs in that implementation leaving photos inverted after the user turns off the OS inversion (that bug and siblings), such smart logic should not be applied to images that are meant to be not naturalistic photos, but UI elements or text.

Such is a broader category than semi-transparent images, but the particular place I'm seeing the issue is with formulae on Wikipedia, which will 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

```css
.mw-invert {
  filter: invert(0);
}
```
in in a new style sheet in the "Style Editor" tab of the devtools for the page (I add this as a [Stylus](https://addons.mozilla.org/en-US/firefox/addon/styl-us/) profile).

In my opinion, the browser shouldn't guess at which images are "naturalistic" and thus shouldn't be inverted--either it gives the developers information on whether the OS is inverted and lets them do their own `filter:invert` reactively, or (if this is deemed insecure or something), allow devs to specify some extra naturalistic-image property to tag images that should not invert (which would mean a change of standard, so also probably no-go). Since both are bad for their own reasons, I think the browser should just do the most straightforward, user-predictable thing and not second-guess the OS's inversion.


-- 
GitHub Notification of comment by tsbertalan
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9674#issuecomment-1847541779 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 8 December 2023 17:10:37 UTC