Skip to content

Commit

Permalink
Attachment (wide-layout): Use semantic color for the save icon backgr…
Browse files Browse the repository at this point in the history
…ound on iOS

https://bugs.webkit.org/show_bug.cgi?id=255849
rdar://107157550

Reviewed by Aditya Keerthi.

Without a proper semantic color, the color doesn't get updated when switching between light and dark modes.
The "-apple-system-opaque-tertiary-fill" color is not semantic, instead "-apple-system-tertiary-fill" should be used (as was already done on macOS).

* LayoutTests/platform/ios-wk2/fast/attachment/cocoa/wide-attachment-rendering-expected.txt:
* Source/WebCore/css/CSSValueKeywords.in:
* Source/WebCore/css/parser/CSSParserIdioms.cpp:
(WebCore::isValueAllowedInMode):
* Source/WebCore/html/shadow/attachmentElementShadow.css:
(button#attachment-save-button):
* Source/WebCore/rendering/RenderThemeIOS.mm:
(WebCore::cssValueSystemColorInformationList):

Canonical link: https://commits.webkit.org/263340@main
  • Loading branch information
squelart committed Apr 24, 2023
1 parent 71c4047 commit 35779e4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
Expand Up @@ -49,7 +49,7 @@ layer at (0,0) size 800x600
RenderGrid {DIV} at (76,0) size 262x92
RenderGrid {DIV} at (6,26) size 230x40
RenderBlock {DIV} at (190,0) size 40x40
RenderButton {BUTTON} at (0,0) size 40x40 [bgcolor=#EEEEEF]
RenderButton {BUTTON} at (0,0) size 40x40 [bgcolor=#7676801F]
RenderBlock (anonymous) at (0,9) size 40x22
RenderBlock {DIV} at (9,0) size 22x22
layer at (128,131) size 230x17
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/css/CSSValueKeywords.in
Expand Up @@ -273,6 +273,7 @@ accentcolortext
-apple-system-label enable-if=WTF_PLATFORM_COCOA
-apple-system-secondary-label enable-if=WTF_PLATFORM_COCOA
-apple-system-tertiary-label enable-if=WTF_PLATFORM_COCOA
-apple-system-tertiary-fill enable-if=WTF_PLATFORM_COCOA
-apple-system-quaternary-label enable-if=WTF_PLATFORM_COCOA
-apple-system-grid enable-if=WTF_PLATFORM_COCOA
-apple-system-separator enable-if=WTF_PLATFORM_COCOA
Expand Down Expand Up @@ -305,7 +306,6 @@ accentcolortext
-apple-system-selected-text-background enable-if=WTF_PLATFORM_MAC
-apple-system-unemphasized-selected-text-background enable-if=WTF_PLATFORM_MAC
-apple-system-find-highlight-background enable-if=WTF_PLATFORM_MAC
-apple-system-tertiary-fill enable-if=WTF_PLATFORM_MAC
-apple-system-indigo enable-if=WTF_PLATFORM_IOS_FAMILY
-apple-system-teal enable-if=WTF_PLATFORM_IOS_FAMILY
-apple-system-opaque-fill enable-if=WTF_PLATFORM_IOS_FAMILY
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/css/parser/CSSParserIdioms.cpp
Expand Up @@ -39,7 +39,7 @@ bool isValueAllowedInMode(unsigned short id, CSSParserMode mode)
switch (id) {
case CSSValueWebkitFocusRingColor:
return isUASheetBehavior(mode) || isQuirksModeBehavior(mode);
#if PLATFORM(MAC)
#if PLATFORM(COCOA)
case CSSValueAppleSystemTertiaryFill:
#endif
#if PLATFORM(IOS_FAMILY)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/shadow/attachmentElementShadow.css
Expand Up @@ -182,7 +182,7 @@ button#attachment-save-button {
#if (defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)
width: 40px;
height: 40px;
background-color: -apple-system-opaque-tertiary-fill;
background-color: -apple-system-tertiary-fill;
border: 0;
#else
width: 28px;
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/rendering/RenderThemeIOS.mm
Expand Up @@ -1425,6 +1425,7 @@ static bool shouldUseConvexGradient(const Color& backgroundColor)
// FIXME: <rdar://problem/75538507> UIKit should expose this color so that we maintain parity with system buttons.
{ CSSValueAppleSystemOpaqueSecondaryFillDisabled, @selector(secondarySystemFillColor), true, 0.75f },
{ CSSValueAppleSystemOpaqueTertiaryFill, @selector(tertiarySystemFillColor), true },
{ CSSValueAppleSystemTertiaryFill, @selector(tertiarySystemFillColor) },
{ CSSValueAppleSystemQuaternaryFill, @selector(quaternarySystemFillColor) },
{ CSSValueAppleSystemGroupedBackground, @selector(systemGroupedBackgroundColor) },
{ CSSValueAppleSystemSecondaryGroupedBackground, @selector(secondarySystemGroupedBackgroundColor) },
Expand Down

0 comments on commit 35779e4

Please sign in to comment.