[webkit-changes] [WebKit/WebKit] e0fe69: REGRESSION (285606 at main): [visionOS] "Sign in with...

Aditya Keerthi noreply at github.com
Wed Dec 11 13:44:28 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e0fe6971e0ffcdef26794cc3698b3b1570ec1d9e
      https://github.com/WebKit/WebKit/commit/e0fe6971e0ffcdef26794cc3698b3b1570ec1d9e
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-12-11 (Wed, 11 Dec 2024)

  Changed paths:
    M Source/WebCore/page/Page.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm

  Log Message:
  -----------
  REGRESSION (285606 at main): [visionOS] "Sign in with Google" pop-up is unexpectedly in dark mode
https://bugs.webkit.org/show_bug.cgi?id=284465
rdar://140862101

Reviewed by Richard Robinson and Abrar Rahman Protyasha.

Safari uses `-[WKWebpagePreferences _setColorSchemePreference:]` on visionOS to
ensure content is always displayed in light mode. 285606 at main broke this
functionality, as it modified logic to only allow a dark mode override, whereas
Safari uses a light mode override.

Fix by restoring the original logic.

* Source/WebCore/page/Page.cpp:
(WebCore::Page::useDarkAppearance const):

Undo the change made to this section of code in 285606 at main. An override via
`WKWebpagePreferences` must always be honored if the preference is not
`ColorSchemePreference::NoPreference`.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
((WebpagePreferences, UserExplicitlyPrefersColorSchemeLight)):

Update test to effectively protect against this regression. Previously, this
test would trivially pass as the web view was already using light mode. Now,
force the web view to use dark mode, so that a light mode override is actually
tested.

Canonical link: https://commits.webkit.org/287694@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list