WebKit Bugzilla
Attachment 342743 Details for
Bug 186609
: Expose more semantic system colors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186609-20180614105208.patch (text/plain), 14.12 KB, created by
Timothy Hatcher
on 2018-06-14 10:52:09 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Timothy Hatcher
Created:
2018-06-14 10:52:09 PDT
Size:
14.12 KB
patch
obsolete
>Subversion Revision: 232807 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a57ca2ae845d6b679ba394380143611ad79a7cf6..071348dfbb98cf3ecbc809d07736065bd7a6593d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,30 @@ >+2018-06-13 Timothy Hatcher <timothy@apple.com> >+ >+ Expose more semantic system colors. >+ >+ https://bugs.webkit.org/show_bug.cgi?id=186609 >+ rdar://problem/39287277 >+ >+ Reviewed by Tim Horton. >+ >+ Add the following semantic colors: >+ -apple-system-control-accent >+ -apple-system-even-alternating-content-background >+ -apple-system-odd-alternating-content-background >+ -apple-system-selected-content-background >+ -apple-system-unemphasized-selected-content-background >+ -apple-system-selected-text >+ -apple-system-unemphasized-selected-text >+ -apple-system-selected-text-background >+ -apple-system-unemphasized-selected-text-background >+ -apple-system-placeholder-text >+ -apple-system-find-highlight-background >+ -apple-system-separator >+ >+ * css/CSSValueKeywords.in: >+ * rendering/RenderThemeMac.mm: >+ (WebCore::RenderThemeMac::systemColor const): >+ > 2018-06-13 Timothy Hatcher <timothy@apple.com> > > Input form controls have a white background in dark mode, when they should not. >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 362ad5c2887190818f7277cf1da1ce812d5b04e7..caec58eacb7bd0bc05c7157a449882b54505bf8c 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,14 @@ >+2018-06-13 Timothy Hatcher <timothy@apple.com> >+ >+ Expose more semantic system colors. >+ >+ https://bugs.webkit.org/show_bug.cgi?id=186609 >+ rdar://problem/39287277 >+ >+ Reviewed by Tim Horton. >+ >+ * pal/spi/cocoa/NSColorSPI.h: Added findHighlightColor and placeholderTextColor. >+ > 2018-06-09 Dan Bernstein <mitz@apple.com> > > [Xcode] Clean up and modernize some build setting definitions >diff --git a/Source/WebCore/PAL/pal/spi/cocoa/NSColorSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/NSColorSPI.h >index c9719a858aa05be8883e0bd7a100f23a3ff9378c..b43a018339e29baefdad9828905ab8aa2ab9b85b 100644 >--- a/Source/WebCore/PAL/pal/spi/cocoa/NSColorSPI.h >+++ b/Source/WebCore/PAL/pal/spi/cocoa/NSColorSPI.h >@@ -42,6 +42,8 @@ > + (NSColor *)systemPurpleColor; > + (NSColor *)systemGrayColor; > + (NSColor *)linkColor; >++ (NSColor *)findHighlightColor; >++ (NSColor *)placeholderTextColor; > @end > > #endif >diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in >index 69359fccd4be71c14e441376e20953fa299fa006..0ae57ffe113263c503aa93e3a3f4301032df8831 100644 >--- a/Source/WebCore/css/CSSValueKeywords.in >+++ b/Source/WebCore/css/CSSValueKeywords.in >@@ -226,11 +226,23 @@ windowtext > -apple-system-text-background > -apple-system-control-background > -apple-system-alternate-selected-text >+-apple-system-control-accent >+-apple-system-even-alternating-content-background >+-apple-system-odd-alternating-content-background >+-apple-system-selected-content-background >+-apple-system-unemphasized-selected-content-background >+-apple-system-selected-text >+-apple-system-unemphasized-selected-text >+-apple-system-selected-text-background >+-apple-system-unemphasized-selected-text-background >+-apple-system-placeholder-text >+-apple-system-find-highlight-background > -apple-system-label > -apple-system-secondary-label > -apple-system-tertiary-label > -apple-system-quaternary-label > -apple-system-grid >+-apple-system-separator > -apple-wireless-playback-target-active > -apple-system-blue > -apple-system-brown >diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm >index 8295887cea310ab99937c76eac55295d4483a3a5..a58d733f9b7dc1bb21d8b1cce3bd8add437d0164 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -574,6 +574,48 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O > return @selector(controlBackgroundColor); > case CSSValueAppleSystemAlternateSelectedText: > return @selector(alternateSelectedControlTextColor); >+ case CSSValueAppleSystemControlAccent: >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ return @selector(controlAccentColor); >+#else >+ return @selector(alternateSelectedControlColor); >+#endif >+ case CSSValueAppleSystemSelectedContentBackground: >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ return @selector(selectedContentBackgroundColor); >+#else >+ return @selector(alternateSelectedControlColor); >+#endif >+ case CSSValueAppleSystemUnemphasizedSelectedContentBackground: >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ return @selector(unemphasizedSelectedContentBackgroundColor); >+#else >+ return @selector(secondarySelectedControlColor); >+#endif >+ case CSSValueAppleSystemSelectedText: >+ return @selector(selectedTextColor); >+ case CSSValueAppleSystemUnemphasizedSelectedText: >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ return @selector(unemphasizedSelectedTextColor); >+#else >+ return @selector(textColor); >+#endif >+ case CSSValueAppleSystemSelectedTextBackground: >+ return @selector(selectedTextBackgroundColor); >+ case CSSValueAppleSystemUnemphasizedSelectedTextBackground: >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ return @selector(unemphasizedSelectedTextBackgroundColor); >+#else >+ return @selector(secondarySelectedControlColor); >+#endif >+ case CSSValueAppleSystemPlaceholderText: >+ return @selector(placeholderTextColor); >+ case CSSValueAppleSystemFindHighlightBackground: >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 >+ return @selector(findHighlightColor); >+#else >+ return @selector(systemYellowColor); >+#endif > case CSSValueAppleSystemLabel: > return @selector(labelColor); > case CSSValueAppleSystemSecondaryLabel: >@@ -584,6 +626,12 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O > return @selector(quaternaryLabelColor); > case CSSValueAppleSystemGrid: > return @selector(gridColor); >+ case CSSValueAppleSystemSeparator: >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ return @selector(separatorColor); >+#else >+ return @selector(gridColor); >+#endif > case CSSValueAppleWirelessPlaybackTargetActive: > return @selector(systemBlueColor); > case CSSValueAppleSystemBlue: >@@ -618,19 +666,44 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O > case CSSValueActivebuttontext: > // No corresponding NSColor for this so we use a hard coded value. > return Color::white; >+ > case CSSValueButtonface: > case CSSValueThreedface: > // We selected this value instead of [NSColor controlColor] to avoid website incompatibilities. > // We may want to consider changing to [NSColor controlColor] some day. > return 0xFFC0C0C0; >+ > case CSSValueInfobackground: > // No corresponding NSColor for this so we use a hard coded value. > return 0xFFFBFCC5; >+ > case CSSValueMenu: > return menuBackgroundColor(); >+ >+ case CSSValueAppleSystemEvenAlternatingContentBackground: { >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ NSArray<NSColor *> *alternateColors = [NSColor alternatingContentBackgroundColors]; >+#else >+ NSArray<NSColor *> *alternateColors = [NSColor controlAlternatingRowBackgroundColors]; >+#endif >+ ASSERT(alternateColors.count >= 2); >+ return colorFromNSColor(alternateColors[0]); >+ } >+ >+ case CSSValueAppleSystemOddAlternatingContentBackground: { >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ NSArray<NSColor *> *alternateColors = [NSColor alternatingContentBackgroundColors]; >+#else >+ NSArray<NSColor *> *alternateColors = [NSColor controlAlternatingRowBackgroundColors]; >+#endif >+ ASSERT(alternateColors.count >= 2); >+ return colorFromNSColor(alternateColors[1]); >+ } >+ > case CSSValueBackground: > // Use platform-independent value returned by base class. > FALLTHROUGH; >+ > default: > return RenderTheme::systemColor(cssValueID, options); > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index c04c60a3ad60c69b29e599a38d805db6748cb775..59eb29f5fb3ccf559b89171288c7539cb561aeea 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-06-13 Timothy Hatcher <timothy@apple.com> >+ >+ Expose more semantic system colors. >+ >+ https://bugs.webkit.org/show_bug.cgi?id=186609 >+ rdar://problem/39287277 >+ >+ Reviewed by Tim Horton. >+ >+ * fast/css/apple-system-control-colors.html: Updated for new colors. >+ * fast/css/apple-system-control-colors-expected.txt: Ditto. >+ > 2018-06-13 Timothy Hatcher <timothy@apple.com> > > Input form controls have a white background in dark mode, when they should not. >diff --git a/LayoutTests/fast/css/apple-system-control-colors-expected.txt b/LayoutTests/fast/css/apple-system-control-colors-expected.txt >index 6ebee22ebc8bb6a581c30b54a74c93cff89299da..3bfcca2a7ddf7991517f4a0edc16d241d3e5ed30 100644 >--- a/LayoutTests/fast/css/apple-system-control-colors-expected.txt >+++ b/LayoutTests/fast/css/apple-system-control-colors-expected.txt >@@ -2,9 +2,21 @@ > -apple-system-text-background : rgb(255, 255, 255) > -apple-system-control-background : rgb(255, 255, 255) > -apple-system-alternate-selected-text : rgb(255, 255, 255) >+-apple-system-control-accent : rgb(0, 105, 217) >+-apple-system-even-alternating-content-background : rgb(255, 255, 255) >+-apple-system-odd-alternating-content-background : rgb(245, 245, 245) >+-apple-system-selected-content-background : rgb(0, 105, 217) >+-apple-system-unemphasized-selected-content-background : rgb(212, 212, 212) >+-apple-system-selected-text : rgb(0, 0, 0) >+-apple-system-unemphasized-selected-text : rgb(0, 0, 0) >+-apple-system-selected-text-background : rgb(181, 213, 255) >+-apple-system-unemphasized-selected-text-background : rgb(212, 212, 212) >+-apple-system-placeholder-text : rgba(0, 0, 0, 0.247059) >+-apple-system-find-highlight-background : rgb(255, 204, 0) > -apple-system-label : rgba(0, 0, 0, 0.85098) > -apple-system-secondary-label : rgba(0, 0, 0, 0.498039) > -apple-system-tertiary-label : rgba(0, 0, 0, 0.247059) > -apple-system-quaternary-label : rgba(0, 0, 0, 0.0980392) > -apple-system-grid : rgb(204, 204, 204) >+-apple-system-separator : rgb(204, 204, 204) > current-color with inherited -apple-system-label : rgba(0, 0, 0, 0.85098) >diff --git a/LayoutTests/fast/css/apple-system-control-colors.html b/LayoutTests/fast/css/apple-system-control-colors.html >index 1a06fbefd12fa416f0a5c82efcfcda0114270b12..842796577cabf9e98070fdd79b5652f43f9dd95e 100644 >--- a/LayoutTests/fast/css/apple-system-control-colors.html >+++ b/LayoutTests/fast/css/apple-system-control-colors.html >@@ -25,9 +25,21 @@ > <div><span class="swatch" style="background-color: -apple-system-text-background"></span>-apple-system-text-background</div> > <div><span class="swatch" style="background-color: -apple-system-control-background"></span>-apple-system-control-background</div> > <div><span class="swatch" style="background-color: -apple-system-alternate-selected-text"></span>-apple-system-alternate-selected-text</div> >+<div><span class="swatch" style="background-color: -apple-system-control-accent"></span>-apple-system-control-accent</div> >+<div><span class="swatch" style="background-color: -apple-system-even-alternating-content-background"></span>-apple-system-even-alternating-content-background</div> >+<div><span class="swatch" style="background-color: -apple-system-odd-alternating-content-background"></span>-apple-system-odd-alternating-content-background</div> >+<div><span class="swatch" style="background-color: -apple-system-selected-content-background"></span>-apple-system-selected-content-background</div> >+<div><span class="swatch" style="background-color: -apple-system-unemphasized-selected-content-background"></span>-apple-system-unemphasized-selected-content-background</div> >+<div><span class="swatch" style="background-color: -apple-system-selected-text"></span>-apple-system-selected-text</div> >+<div><span class="swatch" style="background-color: -apple-system-unemphasized-selected-text"></span>-apple-system-unemphasized-selected-text</div> >+<div><span class="swatch" style="background-color: -apple-system-selected-text-background"></span>-apple-system-selected-text-background</div> >+<div><span class="swatch" style="background-color: -apple-system-unemphasized-selected-text-background"></span>-apple-system-unemphasized-selected-text-background</div> >+<div><span class="swatch" style="background-color: -apple-system-placeholder-text"></span>-apple-system-placeholder-text</div> >+<div><span class="swatch" style="background-color: -apple-system-find-highlight-background"></span>-apple-system-find-highlight-background</div> > <div><span class="swatch" style="background-color: -apple-system-label"></span>-apple-system-label</div> > <div><span class="swatch" style="background-color: -apple-system-secondary-label"></span>-apple-system-secondary-label</div> > <div><span class="swatch" style="background-color: -apple-system-tertiary-label"></span>-apple-system-tertiary-label</div> > <div><span class="swatch" style="background-color: -apple-system-quaternary-label"></span>-apple-system-quaternary-label</div> > <div><span class="swatch" style="background-color: -apple-system-grid"></span>-apple-system-grid</div> >+<div><span class="swatch" style="background-color: -apple-system-separator"></span>-apple-system-separator</div> > <div style="color: -apple-system-label"><span class="swatch" style="background-color: currentcolor;"></span>current-color with inherited -apple-system-label</div>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186609
:
342698
|
342700
|
342709
|
342710
|
342712
|
342735
|
342740
| 342743