Add support for setting a background color on WKWebView and WKView
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2018 01:36:29 +0000 (01:36 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2018 01:36:29 +0000 (01:36 +0000)
commitfe50678011d63a332d99a7f151804b88e4f00ed7
tree1124b7f1ef278fba740761e6191652ffa4bc1f7c
parent65d7031b0bfd89de3d1de427a130bca7eddd5b29
Add support for setting a background color on WKWebView and WKView
https://bugs.webkit.org/show_bug.cgi?id=184426

Reviewed by Wenson Hsieh.

Source/WebKit:

* UIProcess/API/Cocoa/WKViewPrivate.h: Added _backgroundColor property.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _backgroundColor]): Added. Call through to WebViewImpl.
(-[WKWebView _setBackgroundColor:]): Added. Call through to WebViewImpl.
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _backgroundColor property.
* UIProcess/API/mac/WKView.mm:
(-[WKView _backgroundColor]): Added. Call through to WebViewImpl.
(-[WKView _setBackgroundColor:]): Added. Call through to WebViewImpl.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::setBackgroundColor): Added.
(WebKit::WebViewImpl::backgroundColor const): Added.
(WebKit::WebViewImpl::updateLayer): Use m_backgroundColor when set.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/BackgroundColor.mm: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit/UIProcess/API/mac/WKView.mm
Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/mac/BackgroundColor.mm [new file with mode: 0644]