View Issue Details

IDProjectCategoryView StatusLast Update
0020897MMW 5Skinning frameworkpublic2024-05-02 10:23
Reporterzvezdan Assigned To 
PriorityurgentSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version5.1 
Target Version5.1 
Summary0020897: Media query with forced-colors is not working correctly with b3018
DescriptionThe main feature of my skin is to automatically change program colors based on the state of Windows Contrast themes. To detect if any Contrast theme is enabled, I am using this media query: @media (forced-colors: active) {}. This worked fine until b3018.

Actually, it works fine in b3018 on start of the program, when I already have set any contrast theme (1-st screenshot). It also works fine if I switch to non-contrast theme while the program is running (2). However, it doesn't work if I switch from non-contrast theme to any contrast theme (3).

It doesn't help if I choose Quick window reload using Refresh Skin Shortcut add-on, only restart of the program will make it fine.

As you could see from the screenshots, Inspect Element window has the same problem. However, Google Chrome 123 is working fine with the following html page.
Steps To Reproduce<html>
    <style>
        @media (forced-colors: none) {
            span {
                color: Highlight;
                background-color: HighlightText;
            }
            span:after {
                content: "None";
            }
        }
        @media (forced-colors: active) {
            span {
                color: HighlightText;
                background-color: Highlight;
            }
            span:after {
                content: "Active";
            }
        }
    </style>
    <body>
        <span>Forced colors: </span>
    </body>
</html>
TagsNo tags attached.
Attached Files
Fixed in build

Activities

michal

2024-05-02 06:43

developer   ~0075319

It is something with new Chromium, if I switch to Chromium 120, the same sources work, but in Chromium 123 it does not work. Assigned to Petr to look at it.

zvezdan

2024-05-02 10:21

updater   ~0075320

I though at first that it has something with Chromium, which is why I tested the code with Google Chrome 123. It doesn't matter how many times I toggle the contrast mode, the mentioned html page always works fine, and you could see its Developer tools panel is changing its colors accordingly, unlike Inspect Element window in MM. It works fine with Chrome 124 as well.

michal

2024-05-02 10:23

developer   ~0075321

Yes, it works in Chrome, but not with Chromium 123 used in MM5.