[webkit-reviews] review granted: [Bug 129704] WKPage's pageExtendedBackgroundColor API exposed through WKView/WKWebView should support NSColor : [Attachment 225821] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 4 15:34:23 PST 2014


Beth Dakin <bdakin at apple.com> has granted Conrad Shultz
<conrad_shultz at apple.com>'s request for review:
Bug 129704: WKPage's pageExtendedBackgroundColor API exposed through
WKView/WKWebView should support NSColor
https://bugs.webkit.org/show_bug.cgi?id=129704

Attachment 225821: Patch
https://bugs.webkit.org/attachment.cgi?id=225821&action=review

------- Additional Comments from Beth Dakin <bdakin at apple.com>
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.


More information about the webkit-reviews mailing list