Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fc83508a96785c6aa4b5028331afc32d41b06f05
https://github.com/WebKit/WebKit/commit/fc83508a96785c6aa4b5028331afc32d41b06f05
Author: Michael Catanzaro <[email protected]>
Date: 2026-07-07 (Tue, 07 Jul 2026)
Changed paths:
M Source/WebCore/css/query/MediaQueryFeatures.cpp
M Source/WebCore/inspector/agents/InspectorPageAgent.cpp
M Source/WebCore/platform/Theme.h
M Source/WebCore/platform/adwaita/ThemeAdwaita.cpp
M Source/WebCore/platform/adwaita/ThemeAdwaita.h
M Source/WebCore/platform/glib/SystemSettings.cpp
M Source/WebCore/platform/glib/SystemSettings.h
M Source/WebCore/platform/ios/ThemeIOS.h
M Source/WebCore/platform/ios/ThemeIOS.mm
M Source/WebCore/platform/mac/ThemeMac.h
M Source/WebCore/platform/mac/ThemeMac.mm
M Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm
M Source/WebKit/Shared/glib/SystemSettings.serialization.in
M Source/WebKit/UIProcess/glib/SystemSettingsManagerProxy.cpp
M Source/WebKit/UIProcess/glib/SystemSettingsManagerProxy.h
M Source/WebKit/UIProcess/gtk/SystemSettingsManagerProxyGtk.cpp
M Source/WebKit/UIProcess/wpe/SystemSettingsManagerProxyWPE.cpp
M Source/WebKit/WPEPlatform/wpe/WPESettings.cpp
M Source/WebKit/WPEPlatform/wpe/WPESettings.h
Log Message:
-----------
[WPE][GTK] Improvements to platform media queries (prefers reduced motion,
high contrast, and dark theme)
https://bugs.webkit.org/show_bug.cgi?id=317488
Reviewed by Carlos Garcia Campos.
GNOME 50 has a new reduced motion setting, separate from GTK's disable
animations setting. We currently have the disable animations setting
hooked up to the prefers-reduced-motion CSS media query. Let's stop
using that, and use the new reduced motion setting instead. For good
measure, I've also created a new WPE API setting matching the new name,
and removed the older one (because the WPEPlatform API is not stable
yet).
I had been planning to stop there, but then I noticed that we have the
prefers-contrast media query implemented only for GTK 3. I have
implemented it for GTK 4 as well. This required some effort, because
WebKit has it implemented as a boolean value, but GNOME and CSS both use
a tri-state, so I had to change a bunch of places to expose it as a
tri-state. I've also created a new WPE setting for this as well. I
considered updating Internals so that I could expose the tri-state to
layout tests as well, but it currently uses ForcedAccessibilityValue
which is a boolean, and I decided not to try changing this.
Finally, I've improved the implementation of the prefers-color-scheme
media query for GTK 4. This is an especially significant change because
it previously did not respect the user's dark mode preference at all.
Now a bunch of websites will become dark.
* Source/WebCore/css/query/MediaQueryFeatures.cpp:
(WebCore::MQ::Features::prefersContrastFeatureSchema):
* Source/WebCore/inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::defaultUserPreferencesDidChange):
* Source/WebCore/platform/Theme.h:
(WebCore::Theme::userPreferredContrast const):
(WebCore::Theme::userPrefersContrast const): Deleted.
* Source/WebCore/platform/adwaita/ThemeAdwaita.cpp:
(WebCore::ThemeAdwaita::ThemeAdwaita):
(WebCore::ThemeAdwaita::refreshSettings):
(WebCore::ThemeAdwaita::userPreferredContrast const):
(WebCore::ThemeAdwaita::userPrefersContrast const): Deleted.
* Source/WebCore/platform/adwaita/ThemeAdwaita.h:
* Source/WebCore/platform/glib/SystemSettings.cpp:
(WebCore::SystemSettings::updateSettings):
* Source/WebCore/platform/glib/SystemSettings.h:
(WebCore::SystemSettings::reducedMotion const):
(WebCore::SystemSettings::interfaceContrast const):
(WebCore::SystemSettings::enableAnimations const): Deleted.
* Source/WebCore/platform/ios/ThemeIOS.h:
* Source/WebCore/platform/ios/ThemeIOS.mm:
(WebCore::ThemeIOS::userPreferredContrast const):
(WebCore::ThemeIOS::userPrefersContrast const): Deleted.
* Source/WebCore/platform/mac/ThemeMac.h:
* Source/WebCore/platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::userPreferredContrast const):
(WebCore::ThemeMac::userPrefersContrast const): Deleted.
* Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm:
(WebCore::switchTrackColor):
(WebCore::paintSwitchTrackOnOffLabels):
(WebCore::paintLiquidGlassSwitchTrackOnOffLabels):
(WebCore::renderThemePaintLiquidGlassSwitchThumb):
(WebCore::renderThemePaintLiquidGlassSwitchTrack):
(WebCore::RenderThemeCocoa::paintCheckboxForVectorBasedControls):
(WebCore::RenderThemeCocoa::paintRadioForVectorBasedControls):
(WebCore::RenderThemeCocoa::paintButtonForVectorBasedControls):
(WebCore::RenderThemeCocoa::paintColorWellForVectorBasedControls):
(WebCore::RenderThemeCocoa::paintInnerSpinButtonForVectorBasedControls):
(WebCore::paintTextAreaOrTextField):
(WebCore::RenderThemeCocoa::paintMeterForVectorBasedControls):
(WebCore::RenderThemeCocoa::paintListButtonForVectorBasedControls):
(WebCore::RenderThemeCocoa::paintSliderThumbForVectorBasedControls):
(WebCore::RenderThemeCocoa::paintSearchFieldForVectorBasedControls):
(WebCore::RenderThemeCocoa::paintSearchFieldCancelButtonForVectorBasedControls):
(WebCore::RenderThemeCocoa::paintSearchFieldDecorationPartForVectorBasedControls):
(WebCore::RenderThemeCocoa::paintPlatformResizerForVectorBasedControls):
* Source/WebKit/Shared/glib/SystemSettings.serialization.in:
* Source/WebKit/UIProcess/glib/SystemSettingsManagerProxy.cpp:
(WebKit::SystemSettingsManagerProxy::reducedMotion const):
(WebKit::SystemSettingsManagerProxy::interfaceContrast const):
(WebKit::SystemSettingsManagerProxy::settingsDidChange):
(WebKit::SystemSettingsManagerProxy::enableAnimations const): Deleted.
* Source/WebKit/UIProcess/glib/SystemSettingsManagerProxy.h:
* Source/WebKit/UIProcess/gtk/SystemSettingsManagerProxyGtk.cpp:
(WebKit::SystemSettingsManagerProxy::darkMode const):
(WebKit::SystemSettingsManagerProxy::reducedMotion const):
(WebKit::SystemSettingsManagerProxy::interfaceContrast const):
(WebKit::SystemSettingsManagerProxy::enableAnimations const): Deleted.
* Source/WebKit/UIProcess/wpe/SystemSettingsManagerProxyWPE.cpp:
(WebKit::SystemSettingsManagerProxy::reducedMotion const):
(WebKit::SystemSettingsManagerProxy::interfaceContrast const):
(WebKit::SystemSettingsManagerProxy::enableAnimations const): Deleted.
* Source/WebKit/WPEPlatform/wpe/WPESettings.cpp:
(_WPESettingsPrivate::_WPESettingsPrivate):
* Source/WebKit/WPEPlatform/wpe/WPESettings.h:
Canonical link: https://commits.webkit.org/316627@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications