Summary: | Let clients override _WKThumbnailView's background color | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ricky Mondello <rmondello> | ||||||||
Component: | Platform | Assignee: | Ricky Mondello <rmondello> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | anshu, commit-queue, rmondello, sam, thorton, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Ricky Mondello
2018-07-18 15:31:04 PDT
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. 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. |