Expose -apple-system-container-border color to internal web views.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Sep 2018 22:16:35 +0000 (22:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Sep 2018 22:16:35 +0000 (22:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189178.

Patch by James Savage <james.savage@apple.com> on 2018-09-10
Reviewed by Timothy Hatcher.

Source/WebCore:

Tests: LayoutTests/fast/css/apple-system-colors.html

* css/CSSValueKeywords.in: Add new semantic color name.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const): Use system color on supported
systems, and fall back to approximation for older systems.

Source/WebCore/PAL:

* pal/spi/cocoa/NSColorSPI.h: Declare SPI.

LayoutTests:

* fast/css/apple-system-control-colors-expected.txt:
* fast/css/apple-system-control-colors.html:
* platform/mac-highsierra/fast/css/apple-system-control-colors-expected.txt:
* platform/mac-sierra/fast/css/apple-system-control-colors-expected.txt:
* platform/mac/fast/css/apple-system-control-colors-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235866 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/css/apple-system-control-colors-expected.txt
LayoutTests/fast/css/apple-system-control-colors.html
LayoutTests/platform/mac-highsierra/fast/css/apple-system-control-colors-expected.txt
LayoutTests/platform/mac-sierra/fast/css/apple-system-control-colors-expected.txt
LayoutTests/platform/mac/fast/css/apple-system-control-colors-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cocoa/NSColorSPI.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/rendering/RenderThemeMac.mm

index f6970f7..d9fe2b4 100644 (file)
@@ -1,3 +1,16 @@
+2018-09-10  James Savage  <james.savage@apple.com>
+
+        Expose -apple-system-container-border color to internal web views.
+        https://bugs.webkit.org/show_bug.cgi?id=189178.
+
+        Reviewed by Timothy Hatcher.
+
+        * fast/css/apple-system-control-colors-expected.txt:
+        * fast/css/apple-system-control-colors.html:
+        * platform/mac-highsierra/fast/css/apple-system-control-colors-expected.txt:
+        * platform/mac-sierra/fast/css/apple-system-control-colors-expected.txt:
+        * platform/mac/fast/css/apple-system-control-colors-expected.txt:
+
 2018-09-07  Ryosuke Niwa  <rniwa@webkit.org>
 
         mouseenter and mouseleave events don't get dispatched even when there is a capturing event listener for a slot ancestor
index 427a7a8..025c02e 100644 (file)
@@ -19,4 +19,5 @@
 -apple-system-quaternary-label : rgba(0, 0, 0, 0.0980392)
 -apple-system-grid : rgb(204, 204, 204)
 -apple-system-separator : rgb(204, 204, 204)
+-apple-system-container-border : rgb(197, 197, 197)
 current-color with inherited -apple-system-label : rgba(0, 0, 0, 0.85098)
index 8427965..f87d073 100644 (file)
@@ -42,4 +42,5 @@
 <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><span class="swatch" style="background-color: -apple-system-container-border"></span>-apple-system-container-border</div>
 <div style="color: -apple-system-label"><span class="swatch" style="background-color: currentcolor;"></span>current-color with inherited -apple-system-label</div>
index 8c144e3..8d65ee0 100644 (file)
@@ -19,4 +19,5 @@
 -apple-system-quaternary-label : rgba(0, 0, 0, 0.0980392)
 -apple-system-grid : rgb(204, 204, 204)
 -apple-system-separator : rgb(204, 204, 204)
+-apple-system-container-border : rgb(197, 197, 197)
 current-color with inherited -apple-system-label : rgba(0, 0, 0, 0.85098)
index 8c144e3..8d65ee0 100644 (file)
@@ -19,4 +19,5 @@
 -apple-system-quaternary-label : rgba(0, 0, 0, 0.0980392)
 -apple-system-grid : rgb(204, 204, 204)
 -apple-system-separator : rgb(204, 204, 204)
+-apple-system-container-border : rgb(197, 197, 197)
 current-color with inherited -apple-system-label : rgba(0, 0, 0, 0.85098)
index f913ab6..087c740 100644 (file)
@@ -19,4 +19,5 @@
 -apple-system-quaternary-label : rgba(0, 0, 0, 0.0980392)
 -apple-system-grid : rgb(204, 204, 204)
 -apple-system-separator : rgba(0, 0, 0, 0.0980392)
+-apple-system-container-border : rgba(0, 0, 0, 0.247059)
 current-color with inherited -apple-system-label : rgba(0, 0, 0, 0.847059)
index 1fa3b5f..faffda5 100644 (file)
@@ -1,3 +1,17 @@
+2018-09-10  James Savage  <james.savage@apple.com>
+
+        Expose -apple-system-container-border color to internal web views.
+        https://bugs.webkit.org/show_bug.cgi?id=189178.
+
+        Reviewed by Timothy Hatcher.
+
+        Tests: LayoutTests/fast/css/apple-system-colors.html
+
+        * css/CSSValueKeywords.in: Add new semantic color name.
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::systemColor const): Use system color on supported
+        systems, and fall back to approximation for older systems.
+
 2018-09-07  Ryosuke Niwa  <rniwa@webkit.org>
 
         mouseenter and mouseleave events don't get dispatched even when there is a capturing event listener for a slot ancestor
index 092db30..aa388ca 100644 (file)
@@ -1,3 +1,12 @@
+2018-09-10  James Savage  <james.savage@apple.com>
+
+        Expose -apple-system-container-border color to internal web views.
+        https://bugs.webkit.org/show_bug.cgi?id=189178.
+
+        Reviewed by Timothy Hatcher.
+
+        * pal/spi/cocoa/NSColorSPI.h: Declare SPI.
+
 2018-09-06  Megan Gardner  <megan_gardner@apple.com>
 
         Add Support for Conic Gradients
index 8161652..44f7ebd 100644 (file)
@@ -48,6 +48,7 @@
 + (NSColor *)linkColor;
 + (NSColor *)findHighlightColor;
 + (NSColor *)placeholderTextColor;
++ (NSColor *)containerBorderColor;
 @end
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
index c71c74f..73e72c9 100644 (file)
@@ -244,6 +244,7 @@ windowtext
 -apple-system-quaternary-label
 -apple-system-grid
 -apple-system-separator
+-apple-system-container-border
 #endif
 -apple-wireless-playback-target-active
 -apple-system-blue
index c7375fa..4fea87d 100644 (file)
@@ -768,6 +768,13 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
                 // Handled below.
                 return nullptr;
 #endif
+            case CSSValueAppleSystemContainerBorder:
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+                return @selector(containerBorderColor);
+#else
+                // Handled below.
+                return nullptr;
+#endif
             case CSSValueAppleSystemLabel:
                 return @selector(labelColor);
             case CSSValueAppleSystemSecondaryLabel:
@@ -860,6 +867,9 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
 #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
         case CSSValueAppleSystemFindHighlightBackground:
             return platformActiveTextSearchHighlightColor(options);
+
+        case CSSValueAppleSystemContainerBorder:
+            return 0xFFC5C5C5;
 #endif
 
         case CSSValueAppleSystemEvenAlternatingContentBackground: {