Bug 229976 - [WinCairo] Support prefers-color-scheme media query
Summary: [WinCairo] Support prefers-color-scheme media query
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks: 230032 230077
  Show dependency treegraph
 
Reported: 2021-09-06 17:12 PDT by Fujii Hironori
Modified: 2021-09-08 20:20 PDT (History)
8 users (show)

See Also:


Attachments
Patch (3.55 KB, patch)
2021-09-06 19:23 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2021-09-06 17:12:16 PDT
[WinCairo] Support prefers-color-scheme media query

See also:

  Bug 190499 – Add support for prefers-color-scheme media query
  Bug 196685 – [GTK] Support prefers-color-scheme media query
Comment 1 Fujii Hironori 2021-09-06 17:16:11 PDT
https://kuro.netlify.app/ doesn't have a background image in WinCairo.
It doesn't support browsers not supporting prefers-color-scheme.

> @media (prefers-color-scheme: light) {
>     body{
>         background: url("img/bglight.svg") no-repeat;
>     }
> }
> 
> @media (prefers-color-scheme: dark) {
>     body{
>         background: url("img/bgdark.svg") no-repeat;
>     }
> }
Comment 2 Fujii Hironori 2021-09-06 18:49:40 PDT
The dark mode win32 API is still undocumented.

Discussion: Dark mode for applications · Issue #41 · microsoft/WindowsAppSDK
https://github.com/microsoft/WindowsAppSDK/issues/41

windows - Win10 dark theme - how to use in WINAPI? - Stack Overflow
https://stackoverflow.com/q/53501268
Comment 3 Fujii Hironori 2021-09-06 19:23:45 PDT
Created attachment 437445 [details]
Patch
Comment 4 Don Olmstead 2021-09-07 18:21:19 PDT
Comment on attachment 437445 [details]
Patch

r=me

Can you open a bug for an actual implementation of dark mode on Windows?
Comment 5 Fujii Hironori 2021-09-07 19:02:49 PDT
Comment on attachment 437445 [details]
Patch

Clearing flags on attachment: 437445

Committed r282123 (241420@main): <https://commits.webkit.org/241420@main>
Comment 6 Fujii Hironori 2021-09-07 19:02:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2021-09-07 19:03:16 PDT
<rdar://problem/82850531>
Comment 8 Fujii Hironori 2021-09-07 19:07:03 PDT
Filed: Bug 230032 – [WinCairo] Add dark mode support
Comment 9 Fujii Hironori 2021-09-08 20:20:52 PDT
(In reply to Fujii Hironori from comment #5)
> Committed r282123 (241420@main): <https://commits.webkit.org/241420@main>

This change causes new test failures for WinCairo.
Filed: Bug 230077 – [Win] REGRESSION(r282123): some layout tests are failing because the bgcolor of text input forms are unexpectedly black