Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 745197a248b45467af0dc885581c3bc1bf0bdfb4
https://github.com/WebKit/WebKit/commit/745197a248b45467af0dc885581c3bc1bf0bdfb4
Author: Aditya Keerthi <[email protected]>
Date: 2025-06-16 (Mon, 16 Jun 2025)
Changed paths:
M Source/WebKit/Platform/cocoa/WKMaterialHostingSupport.swift
Log Message:
-----------
[Materials] Glass materials do not respect accessibility settings on macOS
https://bugs.webkit.org/show_bug.cgi?id=294563
rdar://152922163
Reviewed by Wenson Hsieh and Richard Robinson.
"Increase contrast" and "Reduce transparency" should affect the appearance of
glass materials. This is normally done automatically by SwiftUI by propagating
values from the Environment. However, since the layer tree on macOS is not
view-backed, the environment values never propagate to the SwiftUI `View`. This
is not a problem on iOS, where the layer tree is view-backed.
Fix by explicitly setting the `_accessibilityReduceTransparency` and
`_colorSchemeContrast` environment variables on the view on macOS.
* Source/WebKit/Platform/cocoa/WKMaterialHostingSupport.swift:
(MaterialHostingView.shouldIncreaseContrast):
(MaterialHostingView.shouldReduceTransparency):
(MaterialHostingView.updateAccessibilityState):
(MaterialHostingView.body):
Update the environment values whenever
`NSWorkspace.accessibilityDisplayOptionsDidChangeNotification`
is observed.
Note that the strange indentation of the added logic is applied by
`swift-format`.
Canonical link: https://commits.webkit.org/296283@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes