WebKit Bugzilla
Attachment 342698 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-20180613152435.patch (text/plain), 11.10 KB, created by
Timothy Hatcher
on 2018-06-13 15:24:35 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Timothy Hatcher
Created:
2018-06-13 15:24:35 PDT
Size:
11.10 KB
patch
obsolete
>Subversion Revision: 232807 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a57ca2ae845d6b679ba394380143611ad79a7cf6..ed12d6b878683cb01f9d8d79ba83954c66ec50d9 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 NOBODY (OOPS!). >+ >+ 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/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..b6dede0e3fc7d70a9d97cce4d59cccbf722c2212 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -574,6 +574,44 @@ 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: >+ return @selector(findHighlightColor); > case CSSValueAppleSystemLabel: > return @selector(labelColor); > case CSSValueAppleSystemSecondaryLabel: >@@ -584,6 +622,8 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O > return @selector(quaternaryLabelColor); > case CSSValueAppleSystemGrid: > return @selector(gridColor); >+ case CSSValueAppleSystemSeparator: >+ return @selector(separatorColor); > case CSSValueAppleWirelessPlaybackTargetActive: > return @selector(systemBlueColor); > case CSSValueAppleSystemBlue: >@@ -618,19 +658,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..c91106d30a20def4f55d50de8a365e403777e83c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/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 NOBODY (OOPS!). >+ >+ * fast/css/apple-system-control-colors.html: Updated for new colors. >+ > 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.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