Add WKBundlePage SPI to temporarily force light or dark appearance on a page.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2019 01:11:57 +0000 (01:11 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2019 01:11:57 +0000 (01:11 +0000)
commit2217f758c690de40423b93aa411604628c65c64a
tree334f8c2d3b07481abcbb35f9cb399a11bbdf7da5
parent910e18461af11a72b038ce42252cdec32027fca2
Add WKBundlePage SPI to temporarily force light or dark appearance on a page.
https://bugs.webkit.org/show_bug.cgi?id=193327
rdar://problem/47093222

Reviewed by Tim Horton.

Source/WebKit:

Tests: WebKit.ForceLightAppearanceInBundle API Test

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetUseDarkAppearance): Added.
(WKBundlePageIsUsingDarkAppearance): Added.
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm: Added.
(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle_Bundle.mm: Added.
(TestWebKitAPI::ForceLightAppearanceInBundleTest::ForceLightAppearanceInBundleTest):
(TestWebKitAPI::ForceLightAppearanceInBundleTest::didCreatePage):
(TestWebKitAPI::ForceLightAppearanceInBundleTest::didReceiveMessage):
* TestWebKitAPI/Tests/WebKit/mac/dark-mode.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle_Bundle.mm [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit/mac/dark-mode.html [new file with mode: 0644]