Bug 129704

Summary: WKPage's pageExtendedBackgroundColor API exposed through WKView/WKWebView should support NSColor
Product: WebKit Reporter: Conrad Shultz <conrad_shultz>
Component: WebKit APIAssignee: Conrad Shultz <conrad_shultz>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: Unspecified   
Bug Depends on: 129120    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Conrad Shultz 2014-03-04 14:20:20 PST
WKPage's pageExtendedBackgroundColor API exposed through WKView/WKWebView should support NSColor
Comment 1 Conrad Shultz 2014-03-04 14:31:20 PST
Created attachment 225816 [details]
Patch
Comment 2 Conrad Shultz 2014-03-04 15:08:49 PST
Comment on attachment 225816 [details]
Patch

Copy/paste error; will repost.
Comment 3 Conrad Shultz 2014-03-04 15:15:33 PST
Created attachment 225821 [details]
Patch
Comment 4 Beth Dakin 2014-03-04 15:31:27 PST
Comment on attachment 225821 [details]
Patch

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

r=me, but you should simplify those return statements with nsColor().

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:852
> +    return [NSColor colorWithDeviceRed:(color.red() / 255.0) green:(color.green() / 255.0) blue:(color.blue() / 255.0) alpha:(color.alpha() / 255.0)];

You can actually use the convenient nsColor() here, just like in the underlayColor method in the same class.

return nsColor(color);

> Source/WebKit2/UIProcess/API/mac/WKView.mm:3269
> +    return [NSColor colorWithDeviceRed:(color.red() / 255.0) green:(color.green() / 255.0) blue:(color.blue() / 255.0) alpha:(color.alpha() / 255.0)];

Similarly, you can use nsColor() here I think.
Comment 5 Conrad Shultz 2014-03-04 15:48:36 PST
Created attachment 225826 [details]
Patch
Comment 6 WebKit Commit Bot 2014-03-04 16:21:14 PST
Comment on attachment 225826 [details]
Patch

Clearing flags on attachment: 225826

Committed r165083: <http://trac.webkit.org/changeset/165083>
Comment 7 WebKit Commit Bot 2014-03-04 16:21:16 PST
All reviewed patches have been landed.  Closing bug.