Let clients override _WKThumbnailView's background color
Created attachment 345305 [details] Attempt.
Comment on attachment 345305 [details] Attempt. View in context: https://bugs.webkit.org/attachment.cgi?id=345305&action=review > Source/WebKit/UIProcess/API/Cocoa/_WKThumbnailView.mm:159 > +- (void)setOverrideBackgroundColor:(NSColor *)overrideBackgroundColor > +{ > + if ([_overrideBackgroundColor isEqual:overrideBackgroundColor]) > + return; > + > + _overrideBackgroundColor = overrideBackgroundColor; > + [self updateLayer]; It seems strange to call -updateLayer directly. Could we instead -setNeedsDisplay on the layer so that -updateLayer gets called during the next display pass?
Comment on attachment 345305 [details] Attempt. View in context: https://bugs.webkit.org/attachment.cgi?id=345305&action=review > Source/WebKit/UIProcess/API/Cocoa/_WKThumbnailView.mm:159 > + [self updateLayer]; Don't you usually setNeedsDisplay, not updateLayer directly?
lol, yes, that
Created attachment 345308 [details] Attempt 2, using setNeedsDisplay
Comment on attachment 345308 [details] Attempt 2, using setNeedsDisplay View in context: https://bugs.webkit.org/attachment.cgi?id=345308&action=review > Source/WebKit/UIProcess/API/Cocoa/_WKThumbnailView.mm:159 > + [self.layer setNeedsDisplay]; setNeedsDisplay on the view, no? Isn't that how you get to updateLayer? This might work too, I'm not sure.
Created attachment 345310 [details] Attempt 3, calling -setNeedsDisplay: on the view itself
Comment on attachment 345310 [details] Attempt 3, calling -setNeedsDisplay: on the view itself Clearing flags on attachment: 345310 Committed r233945: <https://trac.webkit.org/changeset/233945>
All reviewed patches have been landed. Closing bug.
<rdar://problem/42361917>
Comment on attachment 345310 [details] Attempt 3, calling -setNeedsDisplay: on the view itself View in context: https://bugs.webkit.org/attachment.cgi?id=345310&action=review > Source/WebKit/UIProcess/API/Cocoa/_WKThumbnailView.h:51 > +@property (strong, nonatomic) NSColor *overrideBackgroundColor; I believe this should probably be nullable.