Bug 184426 - Add support for setting a background color on WKWebView and WKView
Summary: Add support for setting a background color on WKWebView and WKView
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Local Build
Hardware: Mac macOS 10.13
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-09 13:23 PDT by Timothy Hatcher
Modified: 2018-04-09 22:08 PDT (History)
9 users (show)

See Also:


Attachments
Patch (15.15 KB, patch)
2018-04-09 14:32 PDT, Timothy Hatcher
no flags Details | Formatted Diff | Diff
Add missing availability (2.47 KB, patch)
2018-04-09 20:58 PDT, Wenson Hsieh
timothy: review+
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-sierra (2.21 MB, application/zip)
2018-04-09 22:03 PDT, EWS Watchlist
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2018-04-09 13:23:10 PDT
WebView has long had support for setting a background color. WKWebView and WKView should support the same too.

<rdar://problem/39132633>
Comment 1 Timothy Hatcher 2018-04-09 14:32:23 PDT
Created attachment 337543 [details]
Patch
Comment 2 Megan Gardner 2018-04-09 14:55:37 PDT
Comment on attachment 337543 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=337543&action=review

R=Me, but you need a real review

> Tools/TestWebKitAPI/Tests/mac/BackgroundColor.mm:110
> +

How about a test that just sets the color to something specific, like Purple. I know the systemColor one basically does that, but it depends the on the control stuff being right.
Comment 3 Wenson Hsieh 2018-04-09 15:44:59 PDT
Comment on attachment 337543 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=337543&action=review

LGTM! You might need a WK2 owner to review, though.

> Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:263
> +@property (nonatomic, setter=_setBackgroundColor:) NSColor *_backgroundColor;

Nit - we usually make copyable non-POD properties copy.
Comment 4 Beth Dakin 2018-04-09 16:09:16 PDT
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 337543 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=337543&action=review
> 
> LGTM! You might need a WK2 owner to review, though.
> 

rs=me on top of Wenson's review for WK2 owner stamp.

> > Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:263
> > +@property (nonatomic, setter=_setBackgroundColor:) NSColor *_backgroundColor;
> 
> Nit - we usually make copyable non-POD properties copy.
Comment 5 WebKit Commit Bot 2018-04-09 18:36:35 PDT
Comment on attachment 337543 [details]
Patch

Clearing flags on attachment: 337543

Committed r230462: <https://trac.webkit.org/changeset/230462>
Comment 6 WebKit Commit Bot 2018-04-09 18:36:36 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 mitz 2018-04-09 20:08:06 PDT
Comment on attachment 337543 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=337543&action=review

>>> Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:263
>>> +@property (nonatomic, setter=_setBackgroundColor:) NSColor *_backgroundColor;
>> 
>> Nit - we usually make copyable non-POD properties copy.
> 
> 

This declaration is missing availability information.
Comment 8 Wenson Hsieh 2018-04-09 20:58:37 PDT
Reopening to attach new patch.
Comment 9 Wenson Hsieh 2018-04-09 20:58:37 PDT
Created attachment 337583 [details]
Add missing availability
Comment 10 Timothy Hatcher 2018-04-09 21:40:02 PDT
Comment on attachment 337583 [details]
Add missing availability

Thanks! You beat me to it.
Comment 11 EWS Watchlist 2018-04-09 22:03:50 PDT
Comment on attachment 337583 [details]
Add missing availability

Attachment 337583 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/7263363

New failing tests:
imported/w3c/web-platform-tests/workers/name-property.html
Comment 12 EWS Watchlist 2018-04-09 22:03:51 PDT
Created attachment 337588 [details]
Archive of layout-test-results from ews103 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 13 Wenson Hsieh 2018-04-09 22:08:19 PDT
(In reply to Build Bot from comment #11)
> Comment on attachment 337583 [details]
> Add missing availability
> 
> Attachment 337583 [details] did not pass mac-ews (mac):
> Output: http://webkit-queues.webkit.org/results/7263363
> 
> New failing tests:
> imported/w3c/web-platform-tests/workers/name-property.html

...pretty certain this is unrelated.

Landed directly on trunk in r230470.