Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 4f0c0eb24e9b1b2d4d6e69d6f2b6b60a8420a0e8 https://github.com/WebKit/WebKit/commit/4f0c0eb24e9b1b2d4d6e69d6f2b6b60a8420a0e8 Author: Lily Spiniolas <lily_spinio...@apple.com> Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths: A LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-checkbox-radio-do-not-disappear-dark-mode-expected-mismatch.html A LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-checkbox-radio-do-not-disappear-dark-mode.html A LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-checkbox-radio-do-not-disappear-light-mode-expected-mismatch.html A LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-checkbox-radio-do-not-disappear-light-mode.html A LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-does-not-affect-inactive-window-dark-mode-expected.html A LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-does-not-affect-inactive-window-dark-mode.html A LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-does-not-affect-inactive-window-light-mode-expected.html A LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-does-not-affect-inactive-window-light-mode.html A LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-submit-does-not-disappear-expected-mismatch.html A LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-submit-does-not-disappear.html M Source/WebCore/rendering/RenderTheme.h M Source/WebCore/rendering/TextPaintStyle.cpp M Source/WebCore/rendering/cocoa/RenderThemeCocoa.h M Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm M Source/WebCore/rendering/style/RenderStyle.cpp M Source/WebCore/rendering/style/RenderStyle.h M Source/WebCore/rendering/style/RenderStyleInlines.h M Source/WebCore/rendering/style/RenderStyleSetters.h M Source/WebCore/rendering/style/StyleRareInheritedData.cpp M Source/WebCore/rendering/style/StyleRareInheritedData.h Log Message: ----------- [Form Control Refresh] `accent-color` should preserve control legibility https://bugs.webkit.org/show_bug.cgi?id=244233 rdar://99018889 Reviewed by Aditya Keerthi. When form control refresh is enabled, controls with tint color now preserve legibility regardless of any set `accent-color`. To ensure that all controls can display the same accent-colors, while also taking into account the fact that some controls may not be able to use certain accent-colors without extensive changes to other parts of the contol, the visual accent-color is bounded based on whether light mode or dark mode is being used. In light mode, accent-colors with a luminance greater than 0.5 will have their luminance lowered to 0.5. In dark mode, accent-colors with a luminance less than or equal to 0.5 will have their luminance increased to 0.5. For both operations, the color's hue is preserved. Additionally, checkboxes and radio buttons will now use a dark indicator in cases where the accent-color luminance is greater than 0.5. The threshold of 0.5 luminance was chosen to match AppKit's threshold for switching indicator colors for checkboxes and radio buttons. `setInsideDisabledSubmitButton` is now `setInsideSubmitButton` and is applied to all submit buttons, regardless of enabled/disabled state in order to properly set the text color based on enablement, the window active state, and the controls tint color in order to preserve contrast. Affected controls: * <input type=range> (sliders) * <input type=checkbox> * <input type=radio> * <input type=text list=somedatalist> (list buttons) * <input type="submit"> * <progress> * LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-checkbox-radio-do-not-disappear-dark-mode-expected-mismatch.html: Added. * LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-checkbox-radio-do-not-disappear-dark-mode.html: Added. * LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-checkbox-radio-do-not-disappear-light-mode-expected-mismatch.html: Added. * LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-checkbox-radio-do-not-disappear-light-mode.html: Added. * LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-does-not-affect-inactive-window-dark-mode-expected.html: Added. * LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-does-not-affect-inactive-window-dark-mode.html: Added. * LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-does-not-affect-inactive-window-light-mode-expected.html: Added. * LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-does-not-affect-inactive-window-light-mode.html: Added. * LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-submit-does-not-disappear-expected-mismatch.html: Added. * LayoutTests/fast/forms/form-control-refresh/accent-color-contrast-submit-does-not-disappear.html: Added. * Source/WebCore/rendering/RenderTheme.h: (WebCore::RenderTheme::submitButtonTextColor const): (WebCore::RenderTheme::disabledSubmitButtonTextColor const): Deleted. * Source/WebCore/rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): * Source/WebCore/rendering/cocoa/RenderThemeCocoa.h: * Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm: (WebCore::foregroundColorForBackgroundColor): (WebCore::colorWithTargetLuminance): (WebCore::checkboxRadioIndicatorColorForVectorBasedControls): (WebCore::adjustCheckboxRadioBackgroundColorDisabledState): (WebCore::RenderThemeCocoa::checkboxRadioBackgroundColorForVectorBasedControls const): (WebCore::RenderThemeCocoa::paintCheckboxForVectorBasedControls): (WebCore::RenderThemeCocoa::paintRadioForVectorBasedControls): (WebCore::RenderThemeCocoa::paintButtonForVectorBasedControls): (WebCore::RenderThemeCocoa::adjustButtonStyleForVectorBasedControls const): (WebCore::RenderThemeCocoa::controlTintColorWithContrast const): (WebCore::RenderThemeCocoa::paintListButtonForVectorBasedControls): (WebCore::RenderThemeCocoa::paintProgressBarForVectorBasedControls): (WebCore::paintSliderTicksForVectorBasedControls): (WebCore::RenderThemeCocoa::paintSliderTrackForVectorBasedControls): (WebCore::RenderThemeCocoa::submitButtonTextColor const): (WebCore::RenderThemeCocoa::disabledSubmitButtonTextColor const): Deleted. * Source/WebCore/rendering/style/RenderStyle.cpp: (WebCore::rareInheritedDataChangeRequiresRepaint): * Source/WebCore/rendering/style/RenderStyle.h: * Source/WebCore/rendering/style/RenderStyleInlines.h: (WebCore::RenderStyle::insideSubmitButton const): (WebCore::RenderStyle::insideDisabledSubmitButton const): Deleted. * Source/WebCore/rendering/style/RenderStyleSetters.h: (WebCore::RenderStyle::setInsideSubmitButton): (WebCore::RenderStyle::setInsideDisabledSubmitButton): Deleted. * Source/WebCore/rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): (WebCore::StyleRareInheritedData::dumpDifferences const): * Source/WebCore/rendering/style/StyleRareInheritedData.h: Canonical link: https://commits.webkit.org/298318@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes