WKThumbnailView fallback background is blindingly bright in Dark Mode
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2018 23:40:52 +0000 (23:40 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2018 23:40:52 +0000 (23:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187017
<rdar://problem/41036209>

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView initWithFrame:]):
(-[_WKThumbnailView wantsUpdateLayer]):
(-[_WKThumbnailView updateLayer]):
Use a semantic color for the WKThumbnailView background color
instead of flat white.

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/_WKThumbnailView.mm

index ab486c6..3c07cd5 100644 (file)
@@ -1,3 +1,18 @@
+2018-06-25  Tim Horton  <timothy_horton@apple.com>
+
+        WKThumbnailView fallback background is blindingly bright in Dark Mode
+        https://bugs.webkit.org/show_bug.cgi?id=187017
+        <rdar://problem/41036209>
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
+        (-[_WKThumbnailView initWithFrame:]):
+        (-[_WKThumbnailView wantsUpdateLayer]):
+        (-[_WKThumbnailView updateLayer]):
+        Use a semantic color for the WKThumbnailView background color
+        instead of flat white.
+
 2018-06-25  John Wilander  <wilander@apple.com>
 
         Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
index 4ea1c58..f89218a 100644 (file)
@@ -70,7 +70,6 @@ using namespace WebKit;
         return nil;
 
     self.wantsLayer = YES;
-    self.layer.backgroundColor = [NSColor whiteColor].CGColor;
     _scale = 1;
     _lastSnapshotScale = NAN;
     
@@ -103,6 +102,18 @@ using namespace WebKit;
     return self;
 }
 
+- (BOOL)wantsUpdateLayer
+{
+    return YES;
+}
+
+- (void)updateLayer
+{
+    [super updateLayer];
+
+    self.layer.backgroundColor = [NSColor quaternaryLabelColor].CGColor;
+}
+
 - (void)requestSnapshot
 {
     if (_waitingForSnapshot) {