2020-04-30 Russell Epstein Apply patch. rdar://problem/62623152 2020-04-30 Alex Christensen Revert most of r260370 and all of r260795 r260370 not only fixed client certificate authentication when using non-persistent WKWebsiteDataStores, but it also removed a strong reference to the WebsiteDataStores, which changed their lifetime and caused their destructor to be called more often in SafariViewController, which caused hangs because of a deadlock in the destruction code I tried to fix in r260795, which introduced suspension hangs. This keeps only the part of r260370 that is necessary to fix client certificate authentication (as verified by the Challenge.ClientCertificateNonPersistentDataStore unit test from r260370 that continues to pass) but reverts the part of that change that changed the lifetime of the WebsiteDataStore, restoring behavior to how the safari-609-branch was without hangs in SafariViewController or in suspension, but with client certificate authentication working in non-persistent WKWebsiteDataStores. This patch applies to the safari-609.2.9.0-branch. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::didDestroyNetworkSession): (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore): (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): (WebKit::sharedStatisticsQueue): Deleted. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didClose): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::~NetworkSession): (WebKit::NetworkSession::destroyResourceLoadStatistics): (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): (WebKit::NetworkSession::recreateResourceLoadStatisticStore): * NetworkProcess/NetworkSession.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): (WebKit::NetworkProcessProxy::addSession): (WebKit::NetworkProcessProxy::removeSession): * UIProcess/Network/NetworkProcessProxy.h: 2020-04-27 Russell Epstein Apply patch. rdar://problem/62377357 2020-04-27 Alex Christensen Stop waiting for a BinarySemaphore on the main thread in the NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=211080 Reviewed by Darin Adler and Chris Dumez. There was an out-of-date comment suggesting we needed to use a semaphore, but we've since added these in the destructor: RELEASE_ASSERT(!m_statisticsStore); RELEASE_ASSERT(!m_persistentStorage); This indicates that flushAndDestroyPersistentStore is called before the destructor, at which time it is safe to add a reference to keep it alive. WebResourceLoadStatisticsStore is also marked as WTF::DestructionThread::Main so this should do everything we need. We also flush these databases to disk before closing like we did cookies. In order to keep tests working as they are, I needed to make recreateResourceLoadStatisticStore have a CompletionHandler and have all WebResourceLoadStatisticsStores share the same queue to serialize background tasks between WebResourceLoadStatisticsStores with and without database stores sequentially to avoid opening a SQLiteDatabase before the previous WebResourceLoadStatisticsStore had closed it. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::sharedStatisticsQueue): (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::didDestroyNetworkSession): (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore): (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): Deleted. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didClose): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::~NetworkSession): (WebKit::NetworkSession::destroyResourceLoadStatistics): (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): (WebKit::NetworkSession::recreateResourceLoadStatisticStore): * NetworkProcess/NetworkSession.h: 2020-04-23 Russell Epstein Apply patch. rdar://problem/62272256 2020-04-23 Per Arne Vollan Only hearing audio with black screen when playing video [contentsScale = 0] PUBLIC SEED ☂: Only hearing audio with black screen when playing video Reviewed by Brent Fulgham. Add mach-lookup access to MobileGestalt service. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-04-22 Russell Epstein Cherry-pick r260474. rdar://problem/62083321. 2020-04-21 Jer Noble PiP buttons shows up in element fullscreen when PiP is disabled in WKWebViewConfiguration https://bugs.webkit.org/show_bug.cgi?id=210813 Not currently testable; entering fullscreen never completes in the iOS TestWebKitAPI app because that process is not a UI Application. * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: (-[WKFullScreenViewController videoControlsManagerDidChange]): 2020-04-21 Alan Coon Apply patch. rdar://problem/62083319 2020-04-21 Alex Christensen NetworkSessionCocoa should request client certificate only once per host/port https://bugs.webkit.org/show_bug.cgi?id=210626 Reviewed by Geoffrey Garen. NSURLSession creates more than one TCP connection to a server when using HTTP 1.1. Each TCP connection with TLS generates a didReceiveChallenge to do the server trust evaluation of the certificate chain. If the server requests a client certificate in the TLS handshake, it also generates a didReceiveChallenge to request client certificates as well. This is an implementation detail of our networking. We should not actually ask the WKNavigationDelegate for client certificates more than once per host/port. We should remember the credential and give it to NSURLSession immediately if we have used this credential in the past for a task that has received bytes (either a response or a redirect). If the TLS handshake fails, we should not reuse that same certificate automatically. * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): (WebKit::NetworkSessionCocoa::clientCertificateSuggestedForHost): (WebKit::NetworkSessionCocoa::taskReceivedBytes): (WebKit::NetworkSessionCocoa::taskFailed): (WebKit::NetworkSessionCocoa::successfulClientCertificateForHost const): 2020-04-20 Alan Coon Apply patch. rdar://problem/61950472 2020-04-20 Brady Eidson Pass sandbox extensions for back/forward list navigations after the policy is decided at process-swap time. and https://bugs.webkit.org/show_bug.cgi?id=210623 Reviewed by Geoff Garen. Covered by almost all existing tests, and a new API test. Instead of granting a sandbox extension when updating the back/forward cursor for a pending back/forward list traversal, do so after the client decides the policy. (Which is also along with a process swap in interesting cases) * Shared/PolicyDecision.h: (WebKit::PolicyDecision::encode const): (WebKit::PolicyDecision::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/APINavigation.cpp: (API::Navigation::Navigation): * UIProcess/API/APINavigation.h: (API::Navigation::create): (API::Navigation::reloadItem const): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::backForwardGoToItem): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebNavigationState.cpp: (WebKit::WebNavigationState::createReloadNavigation): * UIProcess/WebNavigationState.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::launchProcessForReload): (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::receivedPolicyDecision): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::receivedPolicyDecision): * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::goToItem): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad): 2020-04-17 Alan Coon Cherry-pick r260278. rdar://problem/61950220 Bring Fullscreen API + alert() behavior from iOS to macOS https://bugs.webkit.org/show_bug.cgi?id=210662 Reviewed by Eric Carlson. Source/WebKit: When a page is showing an alert(), all non-synchronous messages will be blocked until the sync XPC for alert() ends. And when exiting fullscreen, we block completing the fullscreen exit animation until a repaint XPC completes. So a page that is showing an alert() will never fully exit element fullscreen mode. On iOS, we fixed this behavior by exiting fullscreen mode whenever the page shows an alert() or prompt(). We should bring this behavior to macOS as well. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKitCocoa/FullscreenAlert.mm: Added. (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260278 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-04-17 Jer Noble Bring Fullscreen API + alert() behavior from iOS to macOS https://bugs.webkit.org/show_bug.cgi?id=210662 Reviewed by Eric Carlson. When a page is showing an alert(), all non-synchronous messages will be blocked until the sync XPC for alert() ends. And when exiting fullscreen, we block completing the fullscreen exit animation until a repaint XPC completes. So a page that is showing an alert() will never fully exit element fullscreen mode. On iOS, we fixed this behavior by exiting fullscreen mode whenever the page shows an alert() or prompt(). We should bring this behavior to macOS as well. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): 2020-04-16 Alan Coon Cherry-pick r259814. rdar://problem/61888315 WTF::Persistence::Coder and WTF::Persistence::Decoder should use WARN_UNUSED_RETURN Reviewed by Darin Adler. Source/WebKit: * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::decodeStorageRecord): - Add missing return value check for decode.decode(). Source/WTF: * wtf/persistence/PersistentCoders.cpp: (WTF::Persistence::decodeStringText): - Add WARN_UNUSED_RETURN. * wtf/persistence/PersistentCoders.h: (WTF::Persistence::Coder>::decode): (WTF::Persistence::Coder::decode): (WTF::Persistence::Coder::decode): - Add WARN_UNUSED_RETURN. - Add missing return value check for decode.decodeFixedLengthData(). * wtf/persistence/PersistentDecoder.h: (WTF::Persistence::Decoder::decode): (WTF::Persistence::Decoder::decodeEnum): (WTF::Persistence::Decoder::bufferIsLargeEnoughToContain const): - Add WARN_UNUSED_RETURN. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259814 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-04-09 David Kilzer WTF::Persistence::Coder and WTF::Persistence::Decoder should use WARN_UNUSED_RETURN Reviewed by Darin Adler. * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::decodeStorageRecord): - Add missing return value check for decode.decode(). 2020-04-15 Russell Epstein Cherry-pick r260101. rdar://problem/61853298 createArchiveList() in WebCoreArgumentCodersMac.mm should do more validity checks Reviewed by Darin Adler. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::createArchiveList): Add more validity checks. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260101 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-04-14 David Kilzer createArchiveList() in WebCoreArgumentCodersMac.mm should do more validity checks Reviewed by Darin Adler. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::createArchiveList): Add more validity checks. 2020-04-12 Alan Coon Cherry-pick r259316. rdar://problem/61269751 IndexedDB: destroy WebIDBServer when session is removed in network process https://bugs.webkit.org/show_bug.cgi?id=209606 Reviewed by Geoffrey Garen. Source/WebCore: Rename immediateCloseForUserDelete to immediateClose as we now use it in destructor of IDBServer to make sure everything in database finishes correctly. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::~IDBServer): (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince): (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::immediateClose): (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete): Deleted. * Modules/indexeddb/server/UniqueIDBDatabase.h: Source/WebKit: Tested manually to verify WebIDBServer is removed and its thread ends when session is removed. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::~WebIDBServer): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::close): * NetworkProcess/IndexedDB/WebIDBServer.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::connectionToWebProcessClosed): Source/WTF: Add function to kill CrossThreadTaskHandler and make thread finish. Also add a callback to be called before thread finishes. * wtf/CrossThreadTaskHandler.cpp: (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler): (WTF::CrossThreadTaskHandler::setCompletionCallback): (WTF::CrossThreadTaskHandler::kill): * wtf/CrossThreadTaskHandler.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259316 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-03-31 Sihui Liu IndexedDB: destroy WebIDBServer when session is removed in network process https://bugs.webkit.org/show_bug.cgi?id=209606 Reviewed by Geoffrey Garen. Tested manually to verify WebIDBServer is removed and its thread ends when session is removed. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::~WebIDBServer): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::close): * NetworkProcess/IndexedDB/WebIDBServer.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::connectionToWebProcessClosed): 2020-04-10 Alan Coon Cherry-pick r259802. rdar://problem/61477495 Source/WebKit: [MacOS] REGRESSION (r253275): Stopping a cloned audio capture track should not stop the original audio track https://bugs.webkit.org/show_bug.cgi?id=210259 Reviewed by Eric Carlson. We changed video track cloning so that each cloned track would get its own source. The source is getting video sample from the real capture source. The real capture source will get stopped if all its client sources are stopped. For audio, we are still using the same audio source for each track. We should thus not close the source until all its tracks are stopped. To do so, we reuse RealtimeMediaSource::requestToEnd instead of directly sending the order to stop observing the remote audio source. Test: fast/mediastream/mediastreamtrack-audio-clone.html * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::requestToEnd): (WebKit::UserMediaCaptureManager::Source::stopBeingObserved): Deleted. LayoutTests: [MacOS] Stopping a cloned audio capture track should not stop the original audio track https://bugs.webkit.org/show_bug.cgi?id=210259 Reviewed by Eric Carlson. * fast/mediastream/mediastreamtrack-audio-clone-expected.txt: Added. * fast/mediastream/mediastreamtrack-audio-clone.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259802 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-04-09 Youenn Fablet [MacOS] REGRESSION (r253275): Stopping a cloned audio capture track should not stop the original audio track https://bugs.webkit.org/show_bug.cgi?id=210259 Reviewed by Eric Carlson. We changed video track cloning so that each cloned track would get its own source. The source is getting video sample from the real capture source. The real capture source will get stopped if all its client sources are stopped. For audio, we are still using the same audio source for each track. We should thus not close the source until all its tracks are stopped. To do so, we reuse RealtimeMediaSource::requestToEnd instead of directly sending the order to stop observing the remote audio source. Test: fast/mediastream/mediastreamtrack-audio-clone.html * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::requestToEnd): (WebKit::UserMediaCaptureManager::Source::stopBeingObserved): Deleted. 2020-04-09 Alan Coon Revert r259689. rdar://problem/61269751 2020-04-07 Russell Epstein Cherry-pick r259338. rdar://problem/61269727 Support resolution of IPv6 STUN/TURN addresses https://bugs.webkit.org/show_bug.cgi?id=209808 Reviewed by Eric Carlson. Source/WebCore: Add family access to IPAddress to support both IPv4 and IPv6. Store IPAddress internal value as IPv6 and cast them to IPv4 on demand. * platform/network/DNS.h: * platform/network/soup/DNSResolveQueueSoup.cpp: (WebCore::resolvedWithObserverCallback): Source/WebKit: Update code to support IPv6 addresses when doing DNS resolution of TURN/STUN servers. Refactor code to share more code between Cocoa ports and non Cocoa ports. Manually tested with external IPv6 TURN servers. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createResolver): * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp: (WebKit::resolvedName): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259338 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-04-01 youenn fablet Support resolution of IPv6 STUN/TURN addresses https://bugs.webkit.org/show_bug.cgi?id=209808 Reviewed by Eric Carlson. Update code to support IPv6 addresses when doing DNS resolution of TURN/STUN servers. Refactor code to share more code between Cocoa ports and non Cocoa ports. Manually tested with external IPv6 TURN servers. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createResolver): * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp: (WebKit::resolvedName): 2020-04-07 Russell Epstein Cherry-pick r259316. rdar://problem/61269751 IndexedDB: destroy WebIDBServer when session is removed in network process https://bugs.webkit.org/show_bug.cgi?id=209606 Reviewed by Geoffrey Garen. Source/WebCore: Rename immediateCloseForUserDelete to immediateClose as we now use it in destructor of IDBServer to make sure everything in database finishes correctly. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::~IDBServer): (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince): (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::immediateClose): (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete): Deleted. * Modules/indexeddb/server/UniqueIDBDatabase.h: Source/WebKit: Tested manually to verify WebIDBServer is removed and its thread ends when session is removed. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::~WebIDBServer): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::close): * NetworkProcess/IndexedDB/WebIDBServer.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::connectionToWebProcessClosed): Source/WTF: Add function to kill CrossThreadTaskHandler and make thread finish. Also add a callback to be called before thread finishes. * wtf/CrossThreadTaskHandler.cpp: (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler): (WTF::CrossThreadTaskHandler::setCompletionCallback): (WTF::CrossThreadTaskHandler::kill): * wtf/CrossThreadTaskHandler.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259316 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-03-31 Sihui Liu IndexedDB: destroy WebIDBServer when session is removed in network process https://bugs.webkit.org/show_bug.cgi?id=209606 Reviewed by Geoffrey Garen. Tested manually to verify WebIDBServer is removed and its thread ends when session is removed. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::~WebIDBServer): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::close): * NetworkProcess/IndexedDB/WebIDBServer.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::connectionToWebProcessClosed): 2020-04-07 Russell Epstein Cherry-pick r257222. rdar://problem/61414891 Protect WebProcessPool from null weak pointers in m_serviceWorkerProcesses map https://bugs.webkit.org/show_bug.cgi?id=208143 rdar://problem/58285589 Reviewed by Alex Christensen. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::updateServiceWorkerUserAgent): (WebKit::WebProcessPool::updateProcessAssertions): When iterating through the map, make sure it does not have a null entry. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257222 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-24 Youenn Fablet Protect WebProcessPool from null weak pointers in m_serviceWorkerProcesses map https://bugs.webkit.org/show_bug.cgi?id=208143 rdar://problem/58285589 Reviewed by Alex Christensen. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::updateServiceWorkerUserAgent): (WebKit::WebProcessPool::updateProcessAssertions): When iterating through the map, make sure it does not have a null entry. 2020-04-06 Alan Coon Cherry-pick r259580. rdar://problem/61352477 CrashTracer: MobileSafari at WebKit: WebKit::SystemPreviewController::updateProgress https://bugs.webkit.org/show_bug.cgi?id=210040 rdar://51410841 Reviewed by Darin Adler. It appears that the SystemPreviewController on WebPageProxy can become null causing a call to an in-progress download to crash as it tries to talk to the QuickLook delegate. Guard against this by checking the SystemPreviewController each time. * UIProcess/Cocoa/DownloadClient.mm: (WebKit::systemPreviewController): (WebKit::DownloadClient::didReceiveResponse): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::processDidCrash): (WebKit::DownloadClient::didFinish): (WebKit::DownloadClient::didFail): (WebKit::DownloadClient::didCancel): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259580 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-04-06 Dean Jackson CrashTracer: MobileSafari at WebKit: WebKit::SystemPreviewController::updateProgress https://bugs.webkit.org/show_bug.cgi?id=210040 rdar://51410841 Reviewed by Darin Adler. It appears that the SystemPreviewController on WebPageProxy can become null causing a call to an in-progress download to crash as it tries to talk to the QuickLook delegate. Guard against this by checking the SystemPreviewController each time. * UIProcess/Cocoa/DownloadClient.mm: (WebKit::systemPreviewController): (WebKit::DownloadClient::didReceiveResponse): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::processDidCrash): (WebKit::DownloadClient::didFinish): (WebKit::DownloadClient::didFail): (WebKit::DownloadClient::didCancel): 2020-04-06 Alan Coon Cherry-pick r259315. rdar://problem/61352448 Regression(r253357) DeviceMotionEvent acceleration and rotationRate are null https://bugs.webkit.org/show_bug.cgi?id=209831 Reviewed by Darin Adler. Source/WebCore: The issue was that DeviceMotionClientIOS::motionChanged() would only initialize the acceleration and rotationRate if [m_motionManager gyroAvailable] returned YES. After r253357, m_motionManager is nil because we get motion data from the UIProcess so [m_motionManager gyroAvailable] would always resolve to NO. To address the issue, I made the rotationRate parameters to motionChanged() optional and we rely on them being set to know if gyro data is available. Note that I did not make the acceleration optional because according to [1], all devices have an accelerometer. [1] https://developer.apple.com/documentation/coremotion/cmmotionmanager/1616094-devicemotionavailable?language=objc * platform/ios/DeviceMotionClientIOS.h: * platform/ios/DeviceMotionClientIOS.mm: (WebCore::DeviceMotionClientIOS::motionChanged): * platform/ios/DeviceOrientationUpdateProvider.h: * platform/ios/MotionManagerClient.h: (WebCore::MotionManagerClient::motionChanged): * platform/ios/WebCoreMotionManager.mm: (-[WebCoreMotionManager sendAccelerometerData:]): Source/WebKit: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.mm: (WebKit::WebDeviceOrientationUpdateProviderProxy::motionChanged): * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp: (WebKit::WebDeviceOrientationUpdateProvider::deviceMotionChanged): * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h: * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.messages.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259315 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-03-31 Chris Dumez Regression(r253357) DeviceMotionEvent acceleration and rotationRate are null https://bugs.webkit.org/show_bug.cgi?id=209831 Reviewed by Darin Adler. * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.mm: (WebKit::WebDeviceOrientationUpdateProviderProxy::motionChanged): * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp: (WebKit::WebDeviceOrientationUpdateProvider::deviceMotionChanged): * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h: * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.messages.in: 2020-04-03 Alan Coon Cherry-pick r257209. rdar://problem/61269710 Protect from null session in NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded https://bugs.webkit.org/show_bug.cgi?id=208127 rdar://problem/57937917 Reviewed by Chris Dumez. In case of a data task whose session is destroyed, do not follow redirection early on. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257209 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-24 Youenn Fablet Protect from null session in NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded https://bugs.webkit.org/show_bug.cgi?id=208127 rdar://problem/57937917 Reviewed by Chris Dumez. In case of a data task whose session is destroyed, do not follow redirection early on. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): 2020-04-03 Alan Coon Cherry-pick r256900. rdar://problem/61269733 SWServer::claim should check for the service worker to be active https://bugs.webkit.org/show_bug.cgi?id=207739 Reviewed by Alex Christensen. Source/WebCore: claim is only working for service workers that are active. But there might be a time when a service worker is active in its web process but redundant in networking process. Thus, we need to move the check from WebProcess to NetworkProcess. * workers/service/ServiceWorkerClients.cpp: (WebCore::ServiceWorkerClients::claim): * workers/service/context/SWContextManager.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::claim): * workers/service/server/SWServer.h: * workers/service/server/SWServerToContextConnection.cpp: (WebCore::SWServerToContextConnection::claim): * workers/service/server/SWServerToContextConnection.h: * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::claim): Deleted. * workers/service/server/SWServerWorker.h: (WebCore::SWServerWorker::isActive const): Source/WebKit: Use Async Reply to remove the need for a map and passing integers around. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::claimCompleted): Deleted. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::claim): (WebKit::WebSWContextManagerConnection::claimCompleted): Deleted. * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256900 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-18 Youenn Fablet SWServer::claim should check for the service worker to be active https://bugs.webkit.org/show_bug.cgi?id=207739 Reviewed by Alex Christensen. Use Async Reply to remove the need for a map and passing integers around. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::claimCompleted): Deleted. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::claim): (WebKit::WebSWContextManagerConnection::claimCompleted): Deleted. * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2020-03-30 Alan Coon Cherry-pick r259056. rdar://problem/61064876 Force Touch preview on file:/// URL works while clicking on the URL is blocked https://bugs.webkit.org/show_bug.cgi?id=209589 Reviewed by Antoine Quint. The immediate action for links should never trigger on file: URLs. * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _defaultAnimationController]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259056 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-03-26 Dean Jackson Force Touch preview on file:/// URL works while clicking on the URL is blocked https://bugs.webkit.org/show_bug.cgi?id=209589 Reviewed by Antoine Quint. The immediate action for links should never trigger on file: URLs. * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _defaultAnimationController]): 2020-03-30 Alan Coon Cherry-pick r258902. rdar://problem/61064808 IPC::Decoder::decodeFixedLengthData() should be marked WARN_UNUSED_RETURN Reviewed by Chris Dumez. * Platform/IPC/ArgumentCoders.h: (struct VectorArgumentCoder::decode): - Check the return value of Decoder::decodeFixedLengthData(). * Platform/IPC/Decoder.h: (IPC::Decoder::decodeFixedLengthData): Add WARN_UNUSED_RETURN. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258902 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-03-23 David Kilzer IPC::Decoder::decodeFixedLengthData() should be marked WARN_UNUSED_RETURN Reviewed by Chris Dumez. * Platform/IPC/ArgumentCoders.h: (struct VectorArgumentCoder::decode): - Check the return value of Decoder::decodeFixedLengthData(). * Platform/IPC/Decoder.h: (IPC::Decoder::decodeFixedLengthData): Add WARN_UNUSED_RETURN. b'2020-03-24 Russell Epstein \n\n Cherry-pick r258814. rdar://problem/60827019\n\n decodeSharedBuffer() in WebCoreArgumentCoders.cpp should validate `bufferSize`\n \n \n \n Reviewed by Darin Adler.\n \n * Shared/WebCoreArgumentCoders.cpp:\n (IPC::decodeSharedBuffer):\n - Return early if `bufferSize` is too big.\n \n \n git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258814 268f45cc-cd09-0410-ab3c-d52691b4dbfc\n\n 2020-03-21 David Kilzer \n\n decodeSharedBuffer() in WebCoreArgumentCoders.cpp should validate `bufferSize`\n \n \n\n Reviewed by Darin Adler.\n\n * Shared/WebCoreArgumentCoders.cpp:\n (IPC::decodeSharedBuffer):\n - Return early if `bufferSize` is too big.\n\n b\'2020-03-24 Russell Epstein \\n\\n Cherry-pick r258180. rdar://problem/60827009\\n\\n [iOS] Replace "unexpectedly resumed" observer with RunningBoard suspendible assertions\\n https://bugs.webkit.org/show_bug.cgi?id=205687\\n \\n \\n Reviewed by Tim Horton.\\n \\n Adopt new RunningBoard process assertion to indicate that WebContent processes depend on their\\n UIProcess (and therefore, the UIProcess must be running if the WebContent process is). This\\n replaces our "Unexpectedly resumed" assertion which was causing unexpected terminations in some\\n cases.\\n \\n * Configurations/WebKit.xcconfig:\\n * Platform/spi/ios/RunningBoardServicesSPI.h: Added.\\n * Scripts/process-entitlements.sh:\\n * Shared/DependencyProcessAssertion.cpp: Added.\\n (WebKit::DependencyProcessAssertion::DependencyProcessAssertion):\\n (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion):\\n * Shared/DependencyProcessAssertion.h: Added.\\n * Shared/ios/DependencyProcessAssertionIOS.mm: Added.\\n (WebKit::DependencyProcessAssertion::DependencyProcessAssertion):\\n (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion):\\n * Sources.txt:\\n * SourcesCocoa.txt:\\n * UIProcess/Cocoa/WebProcessProxyCocoa.mm:\\n * UIProcess/WebProcessProxy.h:\\n * UIProcess/WebProcessProxy.messages.in:\\n * WebKit.xcodeproj/project.pbxproj:\\n * WebProcess/WebProcess.cpp:\\n (WebKit::WebProcess::initializeConnection):\\n * WebProcess/WebProcess.h:\\n * WebProcess/cocoa/WebProcessCocoa.mm:\\n \\n git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258180 268f45cc-cd09-0410-ab3c-d52691b4dbfc\\n\\n 2020-03-09 Chris Dumez \\n\\n [iOS] Replace "unexpectedly resumed" observer with RunningBoard suspendible assertions\\n https://bugs.webkit.org/show_bug.cgi?id=205687\\n \\n\\n Reviewed by Tim Horton.\\n\\n Adopt new RunningBoard process assertion to indicate that WebContent processes depend on their\\n UIProcess (and therefore, the UIProcess must be running if the WebContent process is). This\\n replaces our "Unexpectedly resumed" assertion which was causing unexpected terminations in some\\n cases.\\n\\n * Configurations/WebKit.xcconfig:\\n * Platform/spi/ios/RunningBoardServicesSPI.h: Added.\\n * Scripts/process-entitlements.sh:\\n * Shared/DependencyProcessAssertion.cpp: Added.\\n (WebKit::DependencyProcessAssertion::DependencyProcessAssertion):\\n (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion):\\n * Shared/DependencyProcessAssertion.h: Added.\\n * Shared/ios/DependencyProcessAssertionIOS.mm: Added.\\n (WebKit::DependencyProcessAssertion::DependencyProcessAssertion):\\n (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion):\\n * Sources.txt:\\n * SourcesCocoa.txt:\\n * UIProcess/Cocoa/WebProcessProxyCocoa.mm:\\n * UIProcess/WebProcessProxy.h:\\n * UIProcess/WebProcessProxy.messages.in:\\n * WebKit.xcodeproj/project.pbxproj:\\n * WebProcess/WebProcess.cpp:\\n (WebKit::WebProcess::initializeConnection):\\n * WebProcess/WebProcess.h:\\n * WebProcess/cocoa/WebProcessCocoa.mm:\\n\\n b\\\'2020-03-23 Russell Epstein \\\\n\\\\n Cherry-pick r258741. rdar://problem/60756641\\\\n\\\\n Sanitize suggested download filename received from web process\\\\n https://bugs.webkit.org/show_bug.cgi?id=209300\\\\n \\\\n \\\\n Patch by Alex Christensen on 2020-03-19\\\\n Reviewed by Chris Dumez.\\\\n \\\\n Source/WebKit:\\\\n \\\\n * UIProcess/Downloads/DownloadProxy.cpp:\\\\n (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):\\\\n \\\\n LayoutTests:\\\\n \\\\n * fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash-expected.txt:\\\\n * fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html:\\\\n \\\\n git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258741 268f45cc-cd09-0410-ab3c-d52691b4dbfc\\\\n\\\\n 2020-03-19 Alex Christensen \\\\n\\\\n Sanitize suggested download filename received from web process\\\\n https://bugs.webkit.org/show_bug.cgi?id=209300\\\\n \\\\n\\\\n Reviewed by Chris Dumez.\\\\n\\\\n * UIProcess/Downloads/DownloadProxy.cpp:\\\\n (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):\\\\n\\\\n\\\'2020-03-23 Russell Epstein \\n\\n Apply patch. rdar://problem/60756683\\n 2020-03-23 John Wilander \\n Cherry-pick r258599. rdar://problem/60089022\\n 2020-03-17 John Wilander \\n Add quirk for cookie blocking latch mode ymail.com redirecting to yahoo.com under yahoo.com\\n https://bugs.webkit.org/show_bug.cgi?id=209193\\n \\n\\n Reviewed by Brent Fulgham.\\n\\n No new tests. Site-specific quirk tested manually on the site in question.\\n * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:\\n * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:\\n (WebKit::NetworkDataTaskCocoa::unblockCookies):\\n (WebKit::NetworkDataTaskCocoa::needsFirstPartyCookieBlockingLatchModeQuirk const):\\n (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):\\n\\n Apply patch. rdar://problem/60363244\\n\\n Crash in com.apple.WebKit.WebContent at WebKit::WebSWClientConnection::scheduleJobInServer \\n\\n Patch by Youenn Fablet on 2020-03-13\\n Reviewed by David Kilzer.\\n\\n * WebProcess/Storage/WebSWClientConnection.cpp:\\n (WebKit::WebSWClientConnection::scheduleJobInServer):\\n - Revert branch commit r256687. This RELEASE_ASSERT() was\\n removed on trunk as part of r256578 (which was merged to this\\n branch in r256680, then added back in r256687).\\n\\n 2020-03-13 Youenn Fablet \\n\\n Crash in com.apple.WebKit.WebContent at WebKit::WebSWClientConnection::scheduleJobInServer\\n \\n\\n Reviewed by David Kilzer.\\n\\n * WebProcess/Storage/WebSWClientConnection.cpp:\\n (WebKit::WebSWClientConnection::scheduleJobInServer):\\n - Revert branch commit r256687. This RELEASE_ASSERT() was\\n removed on trunk as part of r256578 (which was merged to this\\n branch in r256680, then added back in r256687).\\n\\n\'2020-03-17 Kocsen Chung \n\n Apply patch. rdar://problem/60500511\n\n 2020-03-17 David Kilzer \n\n Cherry-pick r258507. rdar://problem/60500511\n\n 2020-03-16 David Kilzer \n\n WebPage::GetDataSelectionForPasteboard should validate its `size` variable\n \n \n\n Reviewed by Brent Fulgham.\n\n * Platform/IPC/Connection.h:\n (MESSAGE_CHECK_WITH_RETURN_VALUE_BASE): Add.\n - Variant of MESSAGE_CHECK_BASE() that takes a return value.\n * UIProcess/mac/WebPageProxyMac.mm:\n (MESSAGE_CHECK_WITH_RETURN_VALUE): Add.\n (WebKit::WebPageProxy::dataSelectionForPasteboard):\n - Use new MESSAGE_CHECK_WITH_RETURN_VALUE() macro to update\n check for handle.isNull() and to add check for `size`\n variable.\n - Add static_cast() to `size` variable to denote type\n change.\n\n'2020-03-17 Alan Coon Apply patch. rdar://problem/60433244 2020-03-17 David Kilzer Cherry-pick r258401. rdar://problem/60433244 2020-03-13 David Kilzer WebPageProxy::SetPromisedDataForImage should validate its `imageSize` and `archiveSize` parameters Reviewed by Youenn Fablet. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setPromisedDataForImage): - Validate `imageSize` and `archiveSize` using MESSAGE_CHECK(). - Add static_cast() to `imageSize` and `archiveSize` parameters to denote type change. - Add nullptr check for SharedMemory::map() result with `archiveHandle`. 2020-03-17 Alan Coon Apply patch. rdar://problem/60436975 2020-03-17 David Kilzer Cherry-pick r254724. rdar://problem/60436975 2020-01-16 Chris Dumez IPC hardening for WebPageProxy::SetPromisedDataForImage message https://bugs.webkit.org/show_bug.cgi?id=206380 Reviewed by Geoffrey Garen. IPC hardening for WebPageProxy::SetPromisedDataForImage message. Make sure the shared memory handle sent over IPC is not null and null check the SharedMemory object after calling SharedMemory::map(). * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setPromisedDataForImage): 2020-03-17 Kocsen Chung Apply patch. rdar://problem/60396281 2020-03-17 David Kilzer Cherry-pick r258374. rdar://problem/60396281 2020-03-12 David Kilzer WebPageProxy::SaveImageToLibrary should validate its `imageSize` parameter Reviewed by Chris Dumez. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::saveImageToLibrary): - Validate upper bound of `imageSize` parameter. - Add static_cast() to `imageSize` parameter to denote type change. 2020-03-17 Alan Coon Apply patch. rdar://problem/60396294 2020-03-17 David Kilzer Cherry-pick r258334. rdar://problem/60396294 2020-03-12 David Kilzer WebPasteboardProxy::SetPasteboardBufferForType should validate its `size` parameter Reviewed by Chris Dumez. * Platform/IPC/Connection.h: (MESSAGE_CHECK_BASE): - Define in terms of MESSAGE_CHECK_COMPLETION_BASE() with a no-op completion handler. (MESSAGE_CHECK_COMPLETION_BASE): - Rename from MESSAGE_CHECK_BASE() and add completion handler parameter. * Platform/SharedMemory.h: (WebKit::SharedMemory::Handle::size const): Add. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (MESSAGE_CHECK): - Define macro to use in WebPasteboardProxy::setPasteboardBufferForType(). - Undefine macro at end of source file due to unified sources. (WebKit::WebPasteboardProxy::setPasteboardBufferForType): - Add IPC::Connection& parameter after change to WebPasteboardProxy.messages.in. Use with MESSAGE_CHECK(). - Validate `size` parameter using MESSAGE_CHECK(). Because SharedMemory::Handle::size() returns a size_t value, we do not need to check `size <= std::numeric_limits::max()`. - Add static_cast() to size parameter to denote type change. * UIProcess/WebPasteboardProxy.h: (WebKit::WebPasteboardProxy::setPasteboardBufferForType): - Add IPC::Connection& parameter after change to WebPasteboardProxy.messages.in. * UIProcess/WebPasteboardProxy.messages.in: (SetPasteboardBufferForType): - Add 'WantsConnection' attribute to add IPC::Connection& parameter to WebPasteboardProxy::setPasteboardBufferForType(). 2020-03-17 Alan Coon Apply patch. rdar://problem/60430195 2020-03-17 David Kilzer Cherry-pick r258053. rdar://problem/60430195 2020-03-06 David Kilzer IPC hardening for WebPageProxy::SaveImageToLibrary message Reviewed by Chris Dumez. * UIProcess/ios/WebPageProxyIOS.mm: (MESSAGE_CHECK): Define macro only for methods in this source file. (WebKit::WebPageProxy::saveImageToLibrary): - Make sure the shared memory handle sent over IPC is not null. - Make sure the image size sent over IPC is not zero. - Null check the SharedMemory object after calling SharedMemory::map(). 2020-03-09 Alan Coon Cherry-pick r257659. rdar://problem/60183766 macCatalyst: 'Open' context menu item doesn't work https://bugs.webkit.org/show_bug.cgi?id=208388 Reviewed by Wenson Hsieh. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _webTouchEventsRecognized:]): (-[WKContentView _doubleTapRecognizedForDoubleClick:]): (-[WKContentView _singleTapRecognized:]): (-[WKContentView _attemptClickAtLocation:modifierFlags:]): (-[WKContentView _mouseGestureRecognizerChanged:]): In r178980, a mechanism was introduced to ensure that synthetic clicks are only dispatched to the page that the user originally touched. macCatalyst's WKMouseGestureRecognizer unintentionally entirely bypassed this mechanism, never setting _layerTreeTransactionIdAtLastTouchStart, because the touch event gesture recognizer is disabled. This was generally fine because in this case, we don't need to send synthetic clicks, instead sending proper mouse events. However, the "Open" context menu item works by sending a synthetic click at the original interaction location. Since we did not set _layerTreeTransactionIdAtLastTouchStart, the Web Content process will ignore the click, and perform no action. Fix this by also setting _layerTreeTransactionIdAtLastTouchStart on mouseDown. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257659 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-28 Tim Horton macCatalyst: 'Open' context menu item doesn't work https://bugs.webkit.org/show_bug.cgi?id=208388 Reviewed by Wenson Hsieh. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _webTouchEventsRecognized:]): (-[WKContentView _doubleTapRecognizedForDoubleClick:]): (-[WKContentView _singleTapRecognized:]): (-[WKContentView _attemptClickAtLocation:modifierFlags:]): (-[WKContentView _mouseGestureRecognizerChanged:]): In r178980, a mechanism was introduced to ensure that synthetic clicks are only dispatched to the page that the user originally touched. macCatalyst's WKMouseGestureRecognizer unintentionally entirely bypassed this mechanism, never setting _layerTreeTransactionIdAtLastTouchStart, because the touch event gesture recognizer is disabled. This was generally fine because in this case, we don't need to send synthetic clicks, instead sending proper mouse events. However, the "Open" context menu item works by sending a synthetic click at the original interaction location. Since we did not set _layerTreeTransactionIdAtLastTouchStart, the Web Content process will ignore the click, and perform no action. Fix this by also setting _layerTreeTransactionIdAtLastTouchStart on mouseDown. 2020-03-09 Alan Coon Cherry-pick r256789. rdar://problem/60183772 macCatalyst: I-beam is still too aggressive in non-editable content, shows up beyond the end of text https://bugs.webkit.org/show_bug.cgi?id=207867 Reviewed by Wenson Hsieh. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::populateCaretContext): Only expand the I-beam region to the end of the line in editable text. This better matches the macOS behavior. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256789 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-17 Tim Horton macCatalyst: I-beam is still too aggressive in non-editable content, shows up beyond the end of text https://bugs.webkit.org/show_bug.cgi?id=207867 Reviewed by Wenson Hsieh. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::populateCaretContext): Only expand the I-beam region to the end of the line in editable text. This better matches the macOS behavior. 2020-02-21 Russell Epstein Apply patch. rdar://problem/59680475 2020-02-21 Chris Dumez REGRESSION (r255533) Null Deref of _sessionWrapper under [WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:] https://bugs.webkit.org/show_bug.cgi?id=208029 Reviewed by Tim Horton. r255533 started dereferencing _sessionWrapper without null check in didReceiveChallenge. All other delegates in this file null check _sessionWrapper before using it because it is a weak pointer. Add a null check to avoid crashing. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): 2020-02-21 Russell Epstein Cherry-pick r257106. rdar://problem/59676866 Add fidelity.com to the desktop class quirks list https://bugs.webkit.org/show_bug.cgi?id=208037 Reviewed by Brent Fulgham. No new tests. This patch just adds a domain name to a quirks function. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::desktopClassBrowsingRecommendedForRequest): fidelity.com and its subdomains now return false. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257106 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-20 John Wilander Add fidelity.com to the desktop class quirks list https://bugs.webkit.org/show_bug.cgi?id=208037 Reviewed by Brent Fulgham. No new tests. This patch just adds a domain name to a quirks function. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::desktopClassBrowsingRecommendedForRequest): fidelity.com and its subdomains now return false. 2020-02-21 Russell Epstein Cherry-pick r257103. rdar://problem/59676889 WebIDBServer resume should return early if suspend does not happen https://bugs.webkit.org/show_bug.cgi?id=208027 Reviewed by Geoffrey Garen. We should not try releasing a lock that is not held. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::resume): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257103 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-20 Sihui Liu WebIDBServer resume should return early if suspend does not happen https://bugs.webkit.org/show_bug.cgi?id=208027 Reviewed by Geoffrey Garen. We should not try releasing a lock that is not held. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::resume): 2020-02-21 Russell Epstein Cherry-pick r257089. rdar://problem/59676923 NetworkCache should use 4KB threshold for mmap-ed files instead of 16KB https://bugs.webkit.org/show_bug.cgi?id=207882 Reviewed by Alex Christensen. Source/WebKit: We found that a lot of Vectors in Membuster is holding resource content. This is because we have 16KB threshold for mmap-ed files. If a file is smaller than 16KB, it is copied to Vector instead. But this is costly in terms of memory. If we use mmap-ed files, it becomes named-pages instead of anonymous-pages. File-backed non-dirty named-pages have a lot of benefit. 1. The application is offering a hint that pages are file-backed. This means that OS can purge them at any time since the content can be recovered from the disk. This is cheaper than swapping / compressing anonymous pages since just discarding works. 2. The application is offering a hint that pages have spatial locality. Purging pages in one named-pages region is better compared to purging the same # of anonymous pages randomly. Anonymous pages are split by malloc implementation and access pattern of pages in one VA is random. On the other hand, named-pages are accessed together because it is file, and file typically has sequential locality. And recovery of named pages are also cheap compared to anonymous pages since OS can prefetch pages once access happens because of sequential locality of files. This tendency makes OS like purging named pages instead of anonymous pages. In WebKit use case, this works perfectly. CachedResource typically has decoded content. So typically WebProcess does not access SharedBuffer after the content is decoded. This patch reduces the threshold from 16KB to page size (4KB in macOS, 16KB in iOS). This is pre-2015 behavior. This offers 2.56% progression with 98% probability in Membuster. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::maximumInlineBodySize): (WebKit::NetworkCache::estimateRecordsSize): (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob): LayoutTests: The test is assuming that 12KB file is served via non-mmap-file. This assumption is flaky and broken by this change. For now, we pick smaller file to meet this assumption. * http/tests/inspector/network/resource-sizes-disk-cache-expected.txt: * http/tests/inspector/network/resource-sizes-disk-cache.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257089 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-20 Yusuke Suzuki NetworkCache should use 4KB threshold for mmap-ed files instead of 16KB https://bugs.webkit.org/show_bug.cgi?id=207882 Reviewed by Alex Christensen. We found that a lot of Vectors in Membuster is holding resource content. This is because we have 16KB threshold for mmap-ed files. If a file is smaller than 16KB, it is copied to Vector instead. But this is costly in terms of memory. If we use mmap-ed files, it becomes named-pages instead of anonymous-pages. File-backed non-dirty named-pages have a lot of benefit. 1. The application is offering a hint that pages are file-backed. This means that OS can purge them at any time since the content can be recovered from the disk. This is cheaper than swapping / compressing anonymous pages since just discarding works. 2. The application is offering a hint that pages have spatial locality. Purging pages in one named-pages region is better compared to purging the same # of anonymous pages randomly. Anonymous pages are split by malloc implementation and access pattern of pages in one VA is random. On the other hand, named-pages are accessed together because it is file, and file typically has sequential locality. And recovery of named pages are also cheap compared to anonymous pages since OS can prefetch pages once access happens because of sequential locality of files. This tendency makes OS like purging named pages instead of anonymous pages. In WebKit use case, this works perfectly. CachedResource typically has decoded content. So typically WebProcess does not access SharedBuffer after the content is decoded. This patch reduces the threshold from 16KB to page size (4KB in macOS, 16KB in iOS). This is pre-2015 behavior. This offers 2.56% progression with 98% probability in Membuster. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::maximumInlineBodySize): (WebKit::NetworkCache::estimateRecordsSize): (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob): 2020-02-21 Russell Epstein Cherry-pick r257077. rdar://problem/59676879 REGRESSION (r255677): Reloading tab with beforeunload prompt closes tab when asking to stay on page https://bugs.webkit.org/show_bug.cgi?id=208015 Reviewed by Geoffrey Garen. Source/WebKit: Make sure we only restart the tryClose timer after the beforeunload prompt if the timer was actually active before the prompt (i.e. tryClose was actually called). On Reload, tryClose is not called but beforeunload prompt may still happen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Tools: Add API test coverage. * TestWebKitAPI/Tests/WebKitCocoa/ModalAlerts.mm: (TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257077 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-20 Chris Dumez REGRESSION (r255677): Reloading tab with beforeunload prompt closes tab when asking to stay on page https://bugs.webkit.org/show_bug.cgi?id=208015 Reviewed by Geoffrey Garen. Make sure we only restart the tryClose timer after the beforeunload prompt if the timer was actually active before the prompt (i.e. tryClose was actually called). On Reload, tryClose is not called but beforeunload prompt may still happen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): 2020-02-21 Russell Epstein Cherry-pick r256967. rdar://problem/59654609 Regression(r247567) HTTP Disk cache capacity is no longer set https://bugs.webkit.org/show_bug.cgi?id=207959 Reviewed by Alex Christensen. NetworkProcess::initializeNetworkProcess() was setting the cache model, which would iterate over all network sessions to update their network cache capacity. The issue was that network sessions were not constructed yet at this point. When the network session(s) would get created later on, they would construct their NetworkCache and it would use the default capacity (i.e. std::numeric_limits::max()). To make this safer, I have moved the capacity computation to the Cache::open() method and now pass the capacity when constructing the network cache storage. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::setCacheModelSynchronouslyForTesting): (WebKit::NetworkProcess::setCacheModel): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::cacheModel const): * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::computeCapacity): (WebKit::NetworkCache::Cache::open): (WebKit::NetworkCache::Cache::capacity const): (WebKit::NetworkCache::Cache::updateCapacity): (WebKit::NetworkCache::Cache::setCapacity): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::open): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cache/NetworkCacheStorage.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setCacheModel): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256967 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-19 Chris Dumez Regression(r247567) HTTP Disk cache capacity is no longer set https://bugs.webkit.org/show_bug.cgi?id=207959 Reviewed by Alex Christensen. NetworkProcess::initializeNetworkProcess() was setting the cache model, which would iterate over all network sessions to update their network cache capacity. The issue was that network sessions were not constructed yet at this point. When the network session(s) would get created later on, they would construct their NetworkCache and it would use the default capacity (i.e. std::numeric_limits::max()). To make this safer, I have moved the capacity computation to the Cache::open() method and now pass the capacity when constructing the network cache storage. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::setCacheModelSynchronouslyForTesting): (WebKit::NetworkProcess::setCacheModel): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::cacheModel const): * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::computeCapacity): (WebKit::NetworkCache::Cache::open): (WebKit::NetworkCache::Cache::capacity const): (WebKit::NetworkCache::Cache::updateCapacity): (WebKit::NetworkCache::Cache::setCapacity): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::open): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cache/NetworkCacheStorage.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setCacheModel): 2020-02-21 Russell Epstein Cherry-pick r256881. rdar://problem/59654577 Drop getSandboxExtensionsForBlobFiles() as it is dead code https://bugs.webkit.org/show_bug.cgi?id=207909 Reviewed by Per Arne Vollan. * NetworkProcess/NetworkProcess.cpp: * NetworkProcess/NetworkProcess.h: * UIProcess/Network/NetworkProcessProxy.cpp: * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256881 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-18 Chris Dumez Drop getSandboxExtensionsForBlobFiles() as it is dead code https://bugs.webkit.org/show_bug.cgi?id=207909 Reviewed by Per Arne Vollan. * NetworkProcess/NetworkProcess.cpp: * NetworkProcess/NetworkProcess.h: * UIProcess/Network/NetworkProcessProxy.cpp: * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: 2020-02-21 Russell Epstein Cherry-pick r256857. rdar://problem/59654279 NetworkDataTask should not expect its session wrapper to be always live https://bugs.webkit.org/show_bug.cgi?id=207903 rdar://problem/59291486 Reviewed by Alex Christensen. NetworkDataTaskCocoa should take a weak pointer to its session wrapper. If the session wrapper is still valid, then we can remove the task from the session wrapper map. We cannot guarantee session wrapper is valid since NetworkDataTask is ref counted. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256857 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-18 Youenn Fablet NetworkDataTask should not expect its session wrapper to be always live https://bugs.webkit.org/show_bug.cgi?id=207903 rdar://problem/59291486 Reviewed by Alex Christensen. NetworkDataTaskCocoa should take a weak pointer to its session wrapper. If the session wrapper is still valid, then we can remove the task from the session wrapper map. We cannot guarantee session wrapper is valid since NetworkDataTask is ref counted. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): 2020-02-20 Alan Coon Cherry-pick r256933. rdar://problem/59618836 [iOS] Safari sometimes crashes under ViewGestureController::beginSwipeGesture https://bugs.webkit.org/show_bug.cgi?id=207929 Reviewed by Tim Horton. Make ViewGestureController::beginSwipeGesture robust in the case where the target back/forward item no longer exists. This means that a back/forward target item existed when UIKit called into us in canSwipeInDirection, but this item was removed by the time beginSwipeGesture is called. A couple of conditions could make this possible, such as handling incoming synchronous IPC in the UI process that could change the back/forward list before sending outgoing IPC to the web process; alternately, an SPI client could be overriding -_webViewDidBeginNavigationGesture: to run some logic that removes the would-be target back/forward item. To protect against these scenarios, null-check targetItem before attempting to dereference it; if it is null, then reset some state that might've been set as a result of beginning the swipe (that is, m_activeGestureType and m_currentGestureID) and then immediately bail before attempting to install the snapshot view and proceed with the swipe. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256933 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-18 Wenson Hsieh [iOS] Safari sometimes crashes under ViewGestureController::beginSwipeGesture https://bugs.webkit.org/show_bug.cgi?id=207929 Reviewed by Tim Horton. Make ViewGestureController::beginSwipeGesture robust in the case where the target back/forward item no longer exists. This means that a back/forward target item existed when UIKit called into us in canSwipeInDirection, but this item was removed by the time beginSwipeGesture is called. A couple of conditions could make this possible, such as handling incoming synchronous IPC in the UI process that could change the back/forward list before sending outgoing IPC to the web process; alternately, an SPI client could be overriding -_webViewDidBeginNavigationGesture: to run some logic that removes the would-be target back/forward item. To protect against these scenarios, null-check targetItem before attempting to dereference it; if it is null, then reset some state that might've been set as a result of beginning the swipe (that is, m_activeGestureType and m_currentGestureID) and then immediately bail before attempting to install the snapshot view and proceed with the swipe. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): 2020-02-20 Alan Coon Cherry-pick r256932. rdar://problem/59618845 Disable the process cache when process-per-tab is disabled in the debug menu https://bugs.webkit.org/show_bug.cgi?id=207949 Reviewed by Geoffrey Garen. Disable the process cache when process-per-tab is disabled in the debug menu. The process cache is a process-swap-on-navigation optimization and process-swap-on-navigation is already disabled when process-per-tab is disabled. The process cache is not useful with such configuration and actually leads to crashes too. * UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::updateCapacity): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256932 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-19 Chris Dumez Disable the process cache when process-per-tab is disabled in the debug menu https://bugs.webkit.org/show_bug.cgi?id=207949 Reviewed by Geoffrey Garen. Disable the process cache when process-per-tab is disabled in the debug menu. The process cache is a process-swap-on-navigation optimization and process-swap-on-navigation is already disabled when process-per-tab is disabled. The process cache is not useful with such configuration and actually leads to crashes too. * UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::updateCapacity): 2020-02-20 Russell Epstein Cherry-pick r256806. rdar://problem/59576023 Add and adopt HAVE(LOOKUP_GESTURE_RECOGNIZER) https://bugs.webkit.org/show_bug.cgi?id=207876 Reviewed by Wenson Hsieh. * wtf/Platform.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): For symmetry's sake, introduce a HAVE for this gesture. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256806 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-17 Tim Horton Add and adopt HAVE(LOOKUP_GESTURE_RECOGNIZER) https://bugs.webkit.org/show_bug.cgi?id=207876 Reviewed by Wenson Hsieh. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): For symmetry's sake, introduce a HAVE for this gesture. 2020-02-19 Russell Epstein Cherry-pick r257013. rdar://problem/59614282 Crash in WebPageProxy::didStartProvisionalLoadForFrameShared https://bugs.webkit.org/show_bug.cgi?id=207973 Reviewed by Chris Dumez. Use RefPtr to store Frame*. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257013 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-19 Ryosuke Niwa Crash in WebPageProxy::didStartProvisionalLoadForFrameShared https://bugs.webkit.org/show_bug.cgi?id=207973 Reviewed by Chris Dumez. Use RefPtr to store Frame*. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): 2020-02-19 Russell Epstein Cherry-pick r256859. rdar://problem/59576018 [macOS] Web process may crash under ServicesOverlayController::buildPotentialHighlightsIfNeeded https://bugs.webkit.org/show_bug.cgi?id=207899 Reviewed by Tim Horton and Simon Fraser. Source/WebCore: Mitigates a null pointer crash in ServicesOverlayController::buildPotentialHighlightsIfNeeded(), wherein the focused frame may not have a FrameView when the ServicesOverlayController's selection invalidation timer fires. This is possible if, while being focused, the newly focused subframe is unparented and reparented, which causes it to momentarily have a null view. During this time, if a selection change had occurred earlier in the runloop, it will schedule the page overlay controller invalidation timer, which will fire and discover that the currently focused frame no longer has a FrameView. Test: editing/selection/selection-change-in-disconnected-frame-crash.html * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::buildSelectionHighlight): Source/WebKit: Add another missing null check on iOS, for the case where FrameView is null. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState const): Tools: Make it possible to run tests on macOS with services controls enabled, via a new TestOptions flag. * WebKitTestRunner/TestController.cpp: (WTR::updateTestOptionsFromTestHeader): * WebKitTestRunner/TestOptions.h: (WTR::TestOptions::hasSameInitializationOptions const): * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::TestController::platformCreateWebView): LayoutTests: Add a new layout test to verify that we don't crash under this circumstance. * editing/selection/selection-change-in-disconnected-frame-crash-expected.txt: Added. * editing/selection/selection-change-in-disconnected-frame-crash.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256859 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-18 Wenson Hsieh [macOS] Web process may crash under ServicesOverlayController::buildPotentialHighlightsIfNeeded https://bugs.webkit.org/show_bug.cgi?id=207899 Reviewed by Tim Horton and Simon Fraser. Add another missing null check on iOS, for the case where FrameView is null. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState const): 2020-02-19 Russell Epstein Cherry-pick r256790. rdar://problem/59576023 Data detectors do not trigger on macCatalyst https://bugs.webkit.org/show_bug.cgi?id=207860 Reviewed by Tim Horton. The lookup gesture which run data detection needs touch information to function. Allow touches to be sent to the gesture. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256790 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-17 Megan Gardner Data detectors do not trigger on macCatalyst https://bugs.webkit.org/show_bug.cgi?id=207860 Reviewed by Tim Horton. The lookup gesture which run data detection needs touch information to function. Allow touches to be sent to the gesture. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): 2020-02-18 Alan Coon Cherry-pick r256191. rdar://problem/59447003 Disallow setting base URL to a data or JavaScript URL https://bugs.webkit.org/show_bug.cgi?id=207136 Source/WebCore: Reviewed by Brent Fulgham. Inspired by . Block setting the base URL to a data URL or JavaScript URL as such usage is questionable. This makes WebKit match the behavior of Chrome and Firefox and is in the spirit of the discussion in . On Mac and iOS, this restriction is applied only to apps linked against a future SDK to avoid breaking shipped apps. For all other ports, this restriction is enabled by default. Tests: fast/url/relative2.html fast/url/segments-from-data-url2.html http/tests/security/allowed-base-url-data-url-via-setting.html http/tests/security/denied-base-url-data-url.html http/tests/security/denied-base-url-javascript-url.html * dom/Document.cpp: (WebCore::Document::processBaseElement): Condition updating the parsed base URL on whether is has an allowed scheme, if restrictions are enabled. Otherwise, do what we do now. If the scheme is disallowed then log a message to the console to explain this to web developers. * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::scan): Pass whether to apply restrictons to the base URL to updatePredictedBaseURL(). This depends on whether the setting is enabled or not. (WebCore::TokenPreloadScanner::updatePredictedBaseURL): Modifed to take a boolean as to whether to apply restrictions. If restrictions are not to be applied do what we do now. Otherwise, only do what we do now if the scheme for the predicated base URL is allowed. * html/parser/HTMLPreloadScanner.h: * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::isBaseURLSchemeAllowed): Added. * page/SecurityPolicy.h: * page/Settings.yaml: Add a setting to toggle restrictions on the base URL scheme. Source/WebKit: Reviewed by Brent Fulgham. Apply base URL restrictions to apps linked to a future WebKit to avoid breaking existing apps. * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKWebView.mm: (shouldRestrictBaseURLSchemes): Added. (-[WKWebView _setupPageConfiguration:]): Update settings. * UIProcess/Cocoa/VersionChecks.h: Source/WebKitLegacy/mac: Reviewed by Brent Fulgham. Apply base URL restrictions to apps linked to a future WebKit to avoid breaking existing apps. * Misc/WebKitVersionChecks.h: * WebView/WebView.mm: (shouldRestrictBaseURLSchemes): Added. (-[WebView _commonInitializationWithFrameName:groupName:]): Update settings. Source/WTF: Reviewed by Brent Fulgham. Add some more macro definitions. * wtf/spi/darwin/dyldSPI.h: LayoutTests: RReviewed by Brent Fulgham. Add some tests. Update others to toggle the setting to apply or unapply the new behavior. The test denied-base-url-javascript-url.html is derived from the test base-url-javascript.html, included in . * fast/url/relative-expected.txt: * fast/url/relative.html: * fast/url/relative2-expected.txt: Copied from LayoutTests/fast/url/relative-expected.txt. * fast/url/relative2.html: Copied from LayoutTests/fast/url/relative.html. * fast/url/resources/utilities.js: (setShouldEllipsizeFileURLPaths): Added. Toggles ellipsizing the path portion of a file URL to simplify matching. Otherwise, file URLs could be machine-specific. (canonicalizedPathname): Added. (segments): Modified to optionally call canonicalizedPathname. (canonicalize): Ditto. * fast/url/segments-from-data-url-expected.txt: * fast/url/segments-from-data-url.html: * fast/url/segments-from-data-url2-expected.txt: Copied from LayoutTests/fast/url/segments-from-data-url-expected.txt. * fast/url/segments-from-data-url2.html: Copied from LayoutTests/fast/url/segments-from-data-url.html. * fetch/fetch-url-serialization-expected.txt: * http/tests/plugins/navigation-during-load-embed.html: * http/tests/plugins/navigation-during-load.html: * http/tests/security/allowed-base-url-data-url-via-setting-expected.txt: Added. * http/tests/security/allowed-base-url-data-url-via-setting.html: Added. * http/tests/security/denied-base-url-data-url-expected.txt: Added. * http/tests/security/denied-base-url-data-url.html: Added. * http/tests/security/denied-base-url-javascript-url-expected.txt: Added. * http/tests/security/denied-base-url-javascript-url.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256191 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-10 Daniel Bates Disallow setting base URL to a data or JavaScript URL https://bugs.webkit.org/show_bug.cgi?id=207136 Reviewed by Brent Fulgham. Apply base URL restrictions to apps linked to a future WebKit to avoid breaking existing apps. * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKWebView.mm: (shouldRestrictBaseURLSchemes): Added. (-[WKWebView _setupPageConfiguration:]): Update settings. * UIProcess/Cocoa/VersionChecks.h: 2020-02-17 Alan Coon Cherry-pick r255881. rdar://problem/59447271 Adopt MTOverrideShouldPlayHDRVideo() https://bugs.webkit.org/show_bug.cgi?id=207275 Reviewed by Eric Carlson. Source/WebCore: * platform/PlatformScreen.h: * platform/mac/PlatformScreenMac.mm: (WebCore::setShouldOverrideScreenSupportsHighDynamicRange): Source/WebCore/PAL: * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: Source/WebKit: The WebProcess sandbox can block access to the services necessary for MediaToolbox to determine whether the current display is capable of displaying HDR. Rather than opening up the sandbox, provide the information gathered by the UIProcess by way of MTOverrideShouldPlayHDRVideo(). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::windowScreenDidChange): (WebKit::WebPage::displayID const): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setScreenProperties): Deleted. * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::setScreenProperties): (WebKit::WebProcess::updatePageScreenProperties): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255881 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-05 Jer Noble Adopt MTOverrideShouldPlayHDRVideo() https://bugs.webkit.org/show_bug.cgi?id=207275 Reviewed by Eric Carlson. The WebProcess sandbox can block access to the services necessary for MediaToolbox to determine whether the current display is capable of displaying HDR. Rather than opening up the sandbox, provide the information gathered by the UIProcess by way of MTOverrideShouldPlayHDRVideo(). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::windowScreenDidChange): (WebKit::WebPage::displayID const): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setScreenProperties): Deleted. * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::setScreenProperties): (WebKit::WebProcess::updatePageScreenProperties): 2020-02-17 Alan Coon Cherry-pick r256632. rdar://problem/59478906 NetworkLoadMetrics should be shared by multiple ResourceResponse instances https://bugs.webkit.org/show_bug.cgi?id=207747 Reviewed by Keith Miller. Source/WebCore: ResourceResponse is value data, and it is copied multiple times in various places, (1) to create a new ResourceResponse which has slightly different fields, or (1) to hold ResourceResponse even after loading finishes. For example, DocumentLoader has Vector to replay response dispatching in the case of loading from BackForwardCache. The problem is that ResourceResponse is very large: 440 bytes. While we sometimes copy ResourceResponse to modify some part of it, NetworkLoadMetrics is immutable. It is set when response is created, and is never changed. And NetworkLoadMetrics is large: sizeof(NetworkLoadMetrics) is 184 bytes. Given that we have multiple copies of ResourceResponse in WebCore, we should share NetworkLoadMetrics by them. This patch puts Box in ResourceResponse to share it with all copied ResourceResponses. We do not make NetworkLoadMetrics RefCounted<> for now since some legit data structures embed NetworkLoadMetrics. This patch adds ArgumentCoder for Box so that we can encode / decode Box in ResourceResponse in IPC. To ensure NetworkLoadMetrics in ResourceResponse immutable, we add ResourceResponse::setDeprecatedNetworkLoadMetrics instead of modifying NetworkLoadMetrics already created in ResourceResponse. We also attempt to compact ResourceResponse more by using bit-fields. And removing m_isValid field in ParsedContentRange since this can be represented by the different field. These changes make sizeof(ResourceResponse) from 440 to 248. No behavior change. * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForTiming): (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): * inspector/agents/InspectorNetworkAgent.h: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didFinishLoading): * page/PerformanceTiming.cpp: (WebCore::PerformanceTiming::domainLookupStart const): (WebCore::PerformanceTiming::domainLookupEnd const): (WebCore::PerformanceTiming::connectStart const): (WebCore::PerformanceTiming::connectEnd const): (WebCore::PerformanceTiming::secureConnectionStart const): (WebCore::PerformanceTiming::requestStart const): (WebCore::PerformanceTiming::responseStart const): * platform/network/NetworkLoadMetrics.h: * platform/network/ParsedContentRange.cpp: (WebCore::areContentRangeValuesValid): (WebCore::parseContentRange): (WebCore::ParsedContentRange::ParsedContentRange): (WebCore::ParsedContentRange::headerValue const): * platform/network/ParsedContentRange.h: (WebCore::ParsedContentRange::isValid const): (WebCore::ParsedContentRange::invalidValue): (WebCore::ParsedContentRange::MarkableTraits::isEmptyValue): (WebCore::ParsedContentRange::MarkableTraits::emptyValue): (WebCore::ParsedContentRange::ParsedContentRange): Deleted. * platform/network/ResourceHandle.h: * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::ResourceResponseBase): (WebCore::ResourceResponseBase::crossThreadData const): (WebCore::ResourceResponseBase::fromCrossThreadData): (WebCore::ResourceResponseBase::compare): * platform/network/ResourceResponseBase.h: (WebCore::ResourceResponseBase::deprecatedNetworkLoadMetricsOrNull const): (WebCore::ResourceResponseBase::setDeprecatedNetworkLoadMetrics): (WebCore::ResourceResponseBase::encode const): (WebCore::ResourceResponseBase::decode): (WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics const): Deleted. * platform/network/cf/ResourceResponse.h: (WebCore::ResourceResponse::ResourceResponse): * platform/network/cocoa/NetworkLoadMetrics.mm: (WebCore::copyTimingData): * platform/network/curl/CurlResourceHandleDelegate.cpp: (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse): * platform/network/curl/ResourceResponse.h: * platform/network/curl/ResourceResponseCurl.cpp: (WebCore::ResourceResponse::setDeprecatedNetworkLoadMetrics): Deleted. * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::getConnectionTimingData): * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): Source/WebKit: Add ArgumentCoder support for Box. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder>::encode): (IPC::ArgumentCoder>::decode): Tools: * TestWebKitAPI/Tests/WebCore/ParsedContentRange.cpp: (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256632 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-14 Yusuke Suzuki NetworkLoadMetrics should be shared by multiple ResourceResponse instances https://bugs.webkit.org/show_bug.cgi?id=207747 Reviewed by Keith Miller. Add ArgumentCoder support for Box. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder>::encode): (IPC::ArgumentCoder>::decode): 2020-02-17 Alan Coon Cherry-pick r256432. rdar://problem/59446974 WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should https://bugs.webkit.org/show_bug.cgi?id=207537 Reviewed by Chris Dumez. Source/WebKit: Covered by added API test. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): Fix use after move so that we can get the context connection and send the IPC message to UIProcess as expected. Tools: * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256432 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-12 Youenn Fablet WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should https://bugs.webkit.org/show_bug.cgi?id=207537 Reviewed by Chris Dumez. Covered by added API test. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): Fix use after move so that we can get the context connection and send the IPC message to UIProcess as expected. 2020-02-17 Alan Coon Cherry-pick r256383. rdar://problem/59446974 Unreviewed, rolling out r256314. https://bugs.webkit.org/show_bug.cgi?id=207594 It is breaking an API test (Requested by youenn on #webkit). Reverted changeset: "WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should" https://bugs.webkit.org/show_bug.cgi?id=207537 https://trac.webkit.org/changeset/256314 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256383 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-11 Commit Queue Unreviewed, rolling out r256314. https://bugs.webkit.org/show_bug.cgi?id=207594 It is breaking an API test (Requested by youenn on #webkit). Reverted changeset: "WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should" https://bugs.webkit.org/show_bug.cgi?id=207537 https://trac.webkit.org/changeset/256314 2020-02-17 Alan Coon Cherry-pick r255037. rdar://problem/59446986 Fixed elements no longer stay fixed with elastic overscroll https://bugs.webkit.org/show_bug.cgi?id=206227 rdar://problem/58707084 Reviewed by Antti Koivisto. Source/WebCore: Intended behavior on iOS and macOS is for position:fixed and sticky elements to maintain their position relative to the view bounds when rubber-banding ("overscrolling"). This broke some time back. This change restores the correct behavior with the call to layoutViewportRespectingRubberBanding() in ScrollingTreeFixedNode::applyLayerPositions() and ScrollingTreeStickyNode::computeLayerPosition(). layoutViewportRespectingRubberBanding() computes a layout viewport without clamping. The rest of the changes are to support testing. internals.unconstrainedScrollTo() didn't work for main frame scrolling because of scroll position clamping in various places, so propagate ScrollClamping in more places (and replace the redundant ScrollPositionClamp with ScrollClamping). "requested scroll position" updates now carry along both clamping and "is programmatic" data, wrapped in a struct which is passed around the scrolling tree. This allows us to not clamp the scroll position (for testing) in more places. Internals::unconstrainedScrollTo() needs one weird hack to trigger a layout (and thus a scrolling tree commit), because the layout is normally triggered by a layout viewport change, but when rubber-banding we clamp the layoutViewport used for layout, so those layouts are never triggered. Tests: tiled-drawing/scrolling/fixed/fixed-during-rubberband.html tiled-drawing/scrolling/sticky/sticky-during-rubberband.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Element.cpp: (WebCore::Element::scrollTo): * page/DOMWindow.cpp: (WebCore::DOMWindow::scrollTo const): * page/FrameView.cpp: (WebCore::FrameView::setScrollPosition): (WebCore::FrameView::requestScrollPositionUpdate): * page/FrameView.h: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.cpp: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::requestScrollPositionUpdate): * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): (WebCore::ScrollingStateScrollingNode::setRequestedScrollData): (WebCore::ScrollingStateScrollingNode::dumpProperties const): (WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition): Deleted. * page/scrolling/ScrollingStateScrollingNode.h: (WebCore::RequestedScrollData::operator== const): (WebCore::ScrollingStateScrollingNode::requestedScrollData const): (WebCore::ScrollingStateScrollingNode::requestedScrollPosition const): Deleted. (WebCore::ScrollingStateScrollingNode::requestedScrollPositionRepresentsProgrammaticScroll const): Deleted. * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::scrollingTreeNodeRequestsScroll): * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const): (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportRespectingRubberBanding const): * page/scrolling/ScrollingTreeFrameScrollingNode.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren): (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const): (WebCore::ScrollingTreeScrollingNode::scrollBy): (WebCore::ScrollingTreeScrollingNode::scrollTo): (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: (WebCore::ScrollingTreeFixedNode::applyLayerPositions): * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: (WebCore::ScrollingTreeStickyNode::computeLayerPosition const): * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren): (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren): (WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints): * platform/ScrollTypes.cpp: Added. (WebCore::operator<<): * platform/ScrollTypes.h: * platform/ScrollView.cpp: (WebCore::ScrollView::setContentsScrollPosition): (WebCore::ScrollView::setScrollPosition): * platform/ScrollView.h: * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::setScrollOffsetFromAnimation): * platform/ScrollableArea.h: (WebCore::ScrollableArea::requestScrollPositionUpdate): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollToOffset): * testing/Internals.cpp: (WebCore::Internals::unconstrainedScrollTo): Source/WebKit: Intended behavior on iOS and macOS is for position:fixed and sticky elements to maintain their position relative to the view bounds when rubber-banding ("overscrolling"). This broke some time back. This change restores the correct behavior with the call to layoutViewportRespectingRubberBanding() in ScrollingTreeFixedNode::applyLayerPositions() and ScrollingTreeStickyNode::computeLayerPosition(). layoutViewportRespectingRubberBanding() computes a layout viewport without clamping. The rest of the changes are to support testing. internals.unconstrainedScrollTo() didn't work for main frame scrolling because of scroll position clamping in various places, so propagate ScrollClamping in more places (and replace the redundant ScrollPositionClamp with ScrollClamping). "requested scroll position" updates now carry along both clamping and "is programmatic" data, wrapped in a struct which is passed around the scrolling tree. This allows us to not clamp the scroll position (for testing) in more places. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): (ArgumentCoder::encode): (ArgumentCoder::decode): (WebKit::dump): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll): * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): LayoutTests: * tiled-drawing/scrolling/fixed/fixed-during-rubberband-expected.html: Added. * tiled-drawing/scrolling/fixed/fixed-during-rubberband.html: Added. * tiled-drawing/scrolling/sticky/sticky-during-rubberband-expected.html: Added. * tiled-drawing/scrolling/sticky/sticky-during-rubberband.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255037 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-17 Alan Coon Cherry-pick r256225. rdar://problem/59446983 [watchOS] Notification listener is never unregistered https://bugs.webkit.org/show_bug.cgi?id=207459 Source/WebKit: Reviewed by Maciej Stachowiak. On watchOS, the backlight changed notification is registered in WebProcessPool::registerNotificationObservers(), but not unregistered in WebProcessPool::unregisterNotificationObservers(). API test: WebKit.BacklightLevelNotificationCrash * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::unregisterNotificationObservers): Tools: Reviewed by Maciej Stachowiak. Add a test which tests that posting a backlight level change notification will not cause a crash. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKit/BacklightLevelNotification.mm: Added. (TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256225 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-10 Per Arne Vollan [watchOS] Notification listener is never unregistered https://bugs.webkit.org/show_bug.cgi?id=207459 Reviewed by Maciej Stachowiak. On watchOS, the backlight changed notification is registered in WebProcessPool::registerNotificationObservers(), but not unregistered in WebProcessPool::unregisterNotificationObservers(). API test: WebKit.BacklightLevelNotificationCrash * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::unregisterNotificationObservers): 2020-02-17 Alan Coon Cherry-pick r256426. rdar://problem/59447008 [ Mac Debug wk2 ] ASSERTION FAILED: m_wasConstructedOnMainThread == isMainThread() https://bugs.webkit.org/show_bug.cgi?id=207509 Reviewed by Chris Dumez. Covered by existing tests. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): Make sure completion handler is always called on the main thread. Minor refactoring to make things more efficient. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256426 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-11 Youenn Fablet [ Mac Debug wk2 ] ASSERTION FAILED: m_wasConstructedOnMainThread == isMainThread() https://bugs.webkit.org/show_bug.cgi?id=207509 Reviewed by Chris Dumez. Covered by existing tests. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): Make sure completion handler is always called on the main thread. Minor refactoring to make things more efficient. 2020-02-17 Alan Coon Cherry-pick r256314. rdar://problem/59446974 WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should https://bugs.webkit.org/show_bug.cgi?id=207537 Reviewed by Chris Dumez. Source/WebKit: Covered by added API test. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): Fix use after move so that we can get the context connection and send the IPC message to UIProcess as expected. Tools: * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256314 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-11 Youenn Fablet WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should https://bugs.webkit.org/show_bug.cgi?id=207537 Reviewed by Chris Dumez. Covered by added API test. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): Fix use after move so that we can get the context connection and send the IPC message to UIProcess as expected. 2020-02-14 Russell Epstein Cherry-pick r252849. rdar://problem/59446998 Crash in WebCore::ServiceWorkerRegistrationKey::hash() const https://bugs.webkit.org/show_bug.cgi?id=204497 Reviewed by Alex Christensen. Source/WebCore: Update ServiceWorkerContainer::jobResolvedWithRegistration to handle the case of a ServiceWorkerContainer that might have a job whose promise is not related to the same context. In that case, the ServiceWorkerContainer might get stopped, thus its m_ongoingSettledRegistrations be cleared. But the promise may get settled shortly after since its context is not stopped and will then retrieve an empty registration data key. This is difficult to test given we do not control when the resolvedWithRegistration task is posted to the client. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): * workers/service/ServiceWorkerRegistrationKey.h: (WebCore::ServiceWorkerRegistrationKey::encode const): Add release asserts to make sure we do not store/transfer empty registration keys. Source/WebKit: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::scheduleJobInServer): Add a release assert to be able to further debug the crash. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252849 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-11-25 Youenn Fablet Crash in WebCore::ServiceWorkerRegistrationKey::hash() const https://bugs.webkit.org/show_bug.cgi?id=204497 Reviewed by Alex Christensen. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::scheduleJobInServer): Add a release assert to be able to further debug the crash. 2020-02-14 Russell Epstein Cherry-pick r256578. rdar://problem/59447009 Protect WebSWServerConnection::scheduleJobInServer from bad scopeURL https://bugs.webkit.org/show_bug.cgi?id=207722 Reviewed by Chris Dumez. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::scheduleJobInServer): In case of bad scope, fail the job early on. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::scheduleJobInServer): Remove the RELEASE_ASSERT from now since we defend in Network process. We will add it back in ServiceWorkerRegistration::getOrCreate as a follow-up. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256578 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-13 Youenn Fablet Protect WebSWServerConnection::scheduleJobInServer from bad scopeURL https://bugs.webkit.org/show_bug.cgi?id=207722 Reviewed by Chris Dumez. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::scheduleJobInServer): In case of bad scope, fail the job early on. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::scheduleJobInServer): Remove the RELEASE_ASSERT from now since we defend in Network process. We will add it back in ServiceWorkerRegistration::getOrCreate as a follow-up. 2020-02-14 Russell Epstein Cherry-pick r256452. rdar://problem/59446979 Pages that trigger a redirect will sometimes be left blank https://bugs.webkit.org/show_bug.cgi?id=207614 rdar://problem/59077740 Reviewed by Tim Horton. TiledCoreAnimationDrawingArea::setRootCompositingGraphicsLayer() can be called when the layer tree is frozen, in which case we stash away the layer in m_pendingRootLayer to be parented later at flush time. However, this sequence of calls had a bug: setRootCompositingGraphicsLayer() when frozen -> stash in m_pendingRootLayer setRootCompositingGraphicsLayer() when not frozen -> set the root layer flushLayers() -> set the root layer to the (old) m_pendingRootLayer So we need to clear m_pendingRootLayer at step 2. Very timing dependent, hard to test. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256452 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-12 Simon Fraser Pages that trigger a redirect will sometimes be left blank https://bugs.webkit.org/show_bug.cgi?id=207614 rdar://problem/59077740 Reviewed by Tim Horton. TiledCoreAnimationDrawingArea::setRootCompositingGraphicsLayer() can be called when the layer tree is frozen, in which case we stash away the layer in m_pendingRootLayer to be parented later at flush time. However, this sequence of calls had a bug: setRootCompositingGraphicsLayer() when frozen -> stash in m_pendingRootLayer setRootCompositingGraphicsLayer() when not frozen -> set the root layer flushLayers() -> set the root layer to the (old) m_pendingRootLayer So we need to clear m_pendingRootLayer at step 2. Very timing dependent, hard to test. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer): 2020-02-14 Russell Epstein Cherry-pick r256401. rdar://problem/59447020 WebPage::getFocusedElementInformation should be robust when the focused element changes during layout https://bugs.webkit.org/show_bug.cgi?id=207582 Reviewed by Tim Horton. 2020-01-22 Simon Fraser Fixed elements no longer stay fixed with elastic overscroll https://bugs.webkit.org/show_bug.cgi?id=206227 rdar://problem/58707084 Reviewed by Antti Koivisto. Intended behavior on iOS and macOS is for position:fixed and sticky elements to maintain their position relative to the view bounds when rubber-banding ("overscrolling"). This broke some time back. This change restores the correct behavior with the call to layoutViewportRespectingRubberBanding() in ScrollingTreeFixedNode::applyLayerPositions() and ScrollingTreeStickyNode::computeLayerPosition(). layoutViewportRespectingRubberBanding() computes a layout viewport without clamping. The rest of the changes are to support testing. internals.unconstrainedScrollTo() didn't work for main frame scrolling because of scroll position clamping in various places, so propagate ScrollClamping in more places (and replace the redundant ScrollPositionClamp with ScrollClamping). "requested scroll position" updates now carry along both clamping and "is programmatic" data, wrapped in a struct which is passed around the scrolling tree. This allows us to not clamp the scroll position (for testing) in more places. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): (ArgumentCoder::encode): (ArgumentCoder::decode): (WebKit::dump): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll): * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): This is a speculative fix for , wherein the initial layout update in WebPage:: getFocusedElementInformation may cause the currently focused element to disappear (or change). In the case where m_focusedElement becomes nil, we end up crashing with a null pointer deref, since the rest of the method assumes that m_focusedElement exists. To patch this crash, bail early (after the first layout update) if m_focusedElement changed during the layout pass. Since the rest of the function my trigger even more layout updates that could nuke m_focusedElement, I also changed the rest of the function to use the locally stored `focusedElement` variable instead of m_focusedElement, on WebPage. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getFocusedElementInformation): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256401 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-11 Wenson Hsieh WebPage::getFocusedElementInformation should be robust when the focused element changes during layout https://bugs.webkit.org/show_bug.cgi?id=207582 Reviewed by Tim Horton. This is a speculative fix for , wherein the initial layout update in WebPage:: getFocusedElementInformation may cause the currently focused element to disappear (or change). In the case where m_focusedElement becomes nil, we end up crashing with a null pointer deref, since the rest of the method assumes that m_focusedElement exists. To patch this crash, bail early (after the first layout update) if m_focusedElement changed during the layout pass. Since the rest of the function my trigger even more layout updates that could nuke m_focusedElement, I also changed the rest of the function to use the locally stored `focusedElement` variable instead of m_focusedElement, on WebPage. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getFocusedElementInformation): 2020-02-14 Russell Epstein Cherry-pick r256346. rdar://problem/59446984 video.currentTime is not being updated in iOS 13.4 Beta https://bugs.webkit.org/show_bug.cgi?id=207489 Reviewed by Youenn Fablet. Source/WebKit: Allow the Web process and the GPU process to communicate with 'com.apple.coremedia.audiodeviceclock.xpc' because it is necessary to use a CMTimeBase, which is used by MediaPlayerPrivateMediaStreamAVFObjC for currentTime. Test: fast/mediastream/media-element-current-time.html * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: LayoutTests: * fast/mediastream/media-element-current-time.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256346 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-11 Eric Carlson video.currentTime is not being updated in iOS 13.4 Beta https://bugs.webkit.org/show_bug.cgi?id=207489 Reviewed by Youenn Fablet. Allow the Web process and the GPU process to communicate with 'com.apple.coremedia.audiodeviceclock.xpc' because it is necessary to use a CMTimeBase, which is used by MediaPlayerPrivateMediaStreamAVFObjC for currentTime. Test: fast/mediastream/media-element-current-time.html * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-02-14 Russell Epstein Cherry-pick r256233. rdar://problem/59447027 WebKit::WebProcessPool::initializeClassesForParameterCoding() should keep a copy of CString Reviewed by Brent Fulgham. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::initializeClassesForParameterCoding): - Change `className` to keep a copy of the CString object. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256233 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-10 David Kilzer WebKit::WebProcessPool::initializeClassesForParameterCoding() should keep a copy of CString Reviewed by Brent Fulgham. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::initializeClassesForParameterCoding): - Change `className` to keep a copy of the CString object. 2020-02-14 Russell Epstein Cherry-pick r256187. rdar://problem/59446994 Crash under WebProcessProxy::shouldSendPendingMessage() https://bugs.webkit.org/show_bug.cgi?id=207464 Reviewed by Alex Christensen. I suspect the WebProcessProxy object is getting destroyed as we are iterating over the pending messages in AuxiliaryProcessProxy::didFinishLaunching(), thus crashing when calling WebProcessProxy::shouldSendPendingMessage() inside the loop. As a speculative fix, protect |this| at the beginning of WebProcessProxy::didFinishLaunching(). * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256187 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-10 Chris Dumez Crash under WebProcessProxy::shouldSendPendingMessage() https://bugs.webkit.org/show_bug.cgi?id=207464 Reviewed by Alex Christensen. I suspect the WebProcessProxy object is getting destroyed as we are iterating over the pending messages in AuxiliaryProcessProxy::didFinishLaunching(), thus crashing when calling WebProcessProxy::shouldSendPendingMessage() inside the loop. As a speculative fix, protect |this| at the beginning of WebProcessProxy::didFinishLaunching(). * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): 2020-02-13 Russell Epstein Revert r256407. rdar://problem/59299143 2020-02-13 Russell Epstein Cherry-pick r256520. rdar://problem/59430255 [iOS] -updateSelectionWithExtentPoint:completionHandler: should work without requiring floating cursor https://bugs.webkit.org/show_bug.cgi?id=207680 Reviewed by Tim Horton. Source/WebKit: Currently, WebPage::updateSelectionWithExtentPoint consults the value of m_selectionAnchor to determine whether it should attempt to modify the current selection using the hit-tested visible position. m_selectionAnchor is only set under WebPage::beginSelectionInDirection, which is only invoked when the user begins a floating cursor gesture. When attempting to perform an out-of-band selection update (i.e. without calling beginSelectionInDirection beforehand), we will end up consulting an arbitrary value for m_selectionAnchor (::Start by default; otherwise, the last value set by beginSelectionInDirection if it was previously called). This means that the selection can often only be extended in one direction (typically forwards) when an API client attempts to use -updateSelectionWithExtentPoint:completionHandler: to extend the current selection. To fix this, make it so that we only respect the selection anchor (m_selectionAnchor) in the case where the user is currently using the floating cursor; otherwise, allow the SPI to expand the selection, such that it contains the visible position for the given location. Test: UIWKInteractionViewProtocol.UpdateSelectionWithExtentPoint * Platform/spi/ios/UIKitSPI.h: * Scripts/webkit/messages.py: * Shared/ios/GestureTypes.h: Add a new flag to tell the web process whether it should limit selection extent updates to the current selection anchor. Also, remove an existing enum type, SelectionHandlePosition, that is unused (since we no longer support block text selection). * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[UITextInteractionAssistant _wk_hasFloatingCursor]): Add a helper method to determine (using the text interaction assistant) whether there's an active floating cursor gesture. In the case where floating cursor is active, the text interaction assistant will be in an active gesture but its UITextInteraction will not, since the gesture recognizer belongs to the keyboard or input view rather than the first responder (in this case, WKContentView). (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]): Only respect the selection anchor if we're in floating cursor mode; otherwise, allow selection updates with an extent point to extend the current selection to include the new position. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::updateSelectionWithExtentPoint): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Plumb the RespectsSelectionAnchor flag over to the web process. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateSelectionWithExtentPoint): Tools: Add a new API test to verify that calling -updateSelectionWithExtentPoint:completionHandler: with a point behind the current selection works. * TestWebKitAPI/Tests/ios/UIWKInteractionViewProtocol.mm: (-[TestWKWebView updateSelectionWithExtentPoint:]): * TestWebKitAPI/ios/UIKitSPI.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256520 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-13 Wenson Hsieh [iOS] -updateSelectionWithExtentPoint:completionHandler: should work without requiring floating cursor https://bugs.webkit.org/show_bug.cgi?id=207680 Reviewed by Tim Horton. Currently, WebPage::updateSelectionWithExtentPoint consults the value of m_selectionAnchor to determine whether it should attempt to modify the current selection using the hit-tested visible position. m_selectionAnchor is only set under WebPage::beginSelectionInDirection, which is only invoked when the user begins a floating cursor gesture. When attempting to perform an out-of-band selection update (i.e. without calling beginSelectionInDirection beforehand), we will end up consulting an arbitrary value for m_selectionAnchor (::Start by default; otherwise, the last value set by beginSelectionInDirection if it was previously called). This means that the selection can often only be extended in one direction (typically forwards) when an API client attempts to use -updateSelectionWithExtentPoint:completionHandler: to extend the current selection. To fix this, make it so that we only respect the selection anchor (m_selectionAnchor) in the case where the user is currently using the floating cursor; otherwise, allow the SPI to expand the selection, such that it contains the visible position for the given location. Test: UIWKInteractionViewProtocol.UpdateSelectionWithExtentPoint * Platform/spi/ios/UIKitSPI.h: * Scripts/webkit/messages.py: * Shared/ios/GestureTypes.h: Add a new flag to tell the web process whether it should limit selection extent updates to the current selection anchor. Also, remove an existing enum type, SelectionHandlePosition, that is unused (since we no longer support block text selection). * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[UITextInteractionAssistant _wk_hasFloatingCursor]): Add a helper method to determine (using the text interaction assistant) whether there's an active floating cursor gesture. In the case where floating cursor is active, the text interaction assistant will be in an active gesture but its UITextInteraction will not, since the gesture recognizer belongs to the keyboard or input view rather than the first responder (in this case, WKContentView). (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]): Only respect the selection anchor if we're in floating cursor mode; otherwise, allow selection updates with an extent point to extend the current selection to include the new position. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::updateSelectionWithExtentPoint): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Plumb the RespectsSelectionAnchor flag over to the web process. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateSelectionWithExtentPoint): 2020-02-13 Russell Epstein Cherry-pick r256485. rdar://problem/59430261 Composition highlight rects should be rounded and inset https://bugs.webkit.org/show_bug.cgi?id=207655 Reviewed by Tim Horton. Source/WebCore: Apply a couple of minor adjustments to the appearance of composition highlight rects that appear behind marked text, in the case where the client specifies attributed marked text with background colors. Test: editing/input/composition-highlights.html * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintMarkedTextBackground): (WebCore::InlineTextBox::paintCompositionBackground): In the case where custom composition rects are specified, add a half-pixel inset to all sides of the background rect, and add a slight corner radius around each background rect. * rendering/InlineTextBox.h: Source/WebKit: Stitch adjacent highlight rects together if they have the same highlight color; this minimizes the number of composition highlight rects we hand to the web process when changing the marked text. * UIProcess/ios/WKContentViewInteraction.mm: (compositionHighlights): LayoutTests: Make this existing layout test work with the new composition highlight appearance by covering up the edges of the composition highlight rect with a black border. Due to subpixel insets around the composition highlight rect, the reference image would be offset by a half pixel without this change (even when changing the spans to have a `border-radius`). * editing/input/composition-highlights-expected.html: * editing/input/composition-highlights.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256485 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-12 Wenson Hsieh Composition highlight rects should be rounded and inset https://bugs.webkit.org/show_bug.cgi?id=207655 Reviewed by Tim Horton. Stitch adjacent highlight rects together if they have the same highlight color; this minimizes the number of composition highlight rects we hand to the web process when changing the marked text. * UIProcess/ios/WKContentViewInteraction.mm: (compositionHighlights): 2020-02-13 Russell Epstein Cherry-pick r256433. rdar://problem/59412971 macCatalyst: Unable to grab scrollbar on editable text field https://bugs.webkit.org/show_bug.cgi?id=207615 Reviewed by Tim Horton. In macCatalyst, hovering over the scrollbar (an instance of the internal UIKit class `_UIScrollViewScrollIndicator`) is required in order for a click and drag with the mouse to actually move the scrollbar. This is because UIKit depends on the cursor interaction added to this view to recognize and call its delegate methods. However, we override hit-testing in WebKit to skip over all children of scroll views, and instead force hit- testing to find the scroll view instead. This means that UIKit can never hit-test to the scroll indicator views embedded directly beneath each WKChildScrollView, so the cursor interactions described earlier will not recognize. To work around this, special case these scroll indicator views, such that we will allow -hitTest:withEvent: to find these views. * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: (WebKit::scrollViewScrollIndicatorClass): (-[UIView _web_findDescendantViewAtPoint:withEvent:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256433 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-12 Wenson Hsieh macCatalyst: Unable to grab scrollbar on editable text field https://bugs.webkit.org/show_bug.cgi?id=207615 Reviewed by Tim Horton. In macCatalyst, hovering over the scrollbar (an instance of the internal UIKit class `_UIScrollViewScrollIndicator`) is required in order for a click and drag with the mouse to actually move the scrollbar. This is because UIKit depends on the cursor interaction added to this view to recognize and call its delegate methods. However, we override hit-testing in WebKit to skip over all children of scroll views, and instead force hit- testing to find the scroll view instead. This means that UIKit can never hit-test to the scroll indicator views embedded directly beneath each WKChildScrollView, so the cursor interactions described earlier will not recognize. To work around this, special case these scroll indicator views, such that we will allow -hitTest:withEvent: to find these views. * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: (WebKit::scrollViewScrollIndicatorClass): (-[UIView _web_findDescendantViewAtPoint:withEvent:]): 2020-02-12 Alan Coon Cherry-pick r254859. rdar://problem/59298172 Minor improvements to StorageAreaMap https://bugs.webkit.org/show_bug.cgi?id=206433 Reviewed by Darin Adler. Source/WebCore: Use inline initialization for some of StorageMap's data member. Also specify uint8_t as underlying type of StorageType enum class for better packing. * inspector/InspectorInstrumentation.h: * storage/StorageArea.h: * storage/StorageMap.cpp: (WebCore::StorageMap::StorageMap): * storage/StorageMap.h: * storage/StorageType.h: Source/WebKit: Minor improvements to StorageAreaMap: 1. The class does not need to be RefCounted, as it is solely owned by StorageNamespaceImpl. Having it RefCounted was actually dangerous because StorageAreaMap had a raw pointer data member to its owner: m_storageNamespace. This raw pointer could become stale if you extend the lifetime of the StorageAreaMap object to outlive its StorageNamespaceImpl. 2. Make StorageAreaMap::connect() private as it is never called from outside the class 3. Reorder data members for better packing 4. Use modern loops in the implementation 5. Rename loadValuesIfNeeded() to ensureStorageMap() and have it return the StorageMap object. This makes calls site more concise and it makes it clearer when this method needs to be called. 6. Mark class as final 7. Replace LOG_ERROR() with RELEASE_LOG_ERROR() so that we can see error logging in sysdiagnoses 8. Use more references instead of raw pointers to make it clear when null checks are not needed * WebProcess/WebStorage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::create): (WebKit::StorageAreaImpl::StorageAreaImpl): * WebProcess/WebStorage/StorageAreaImpl.h: * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::StorageAreaMap): (WebKit::StorageAreaMap::length): (WebKit::StorageAreaMap::key): (WebKit::StorageAreaMap::item): (WebKit::StorageAreaMap::setItem): (WebKit::StorageAreaMap::removeItem): (WebKit::StorageAreaMap::clear): (WebKit::StorageAreaMap::contains): (WebKit::StorageAreaMap::resetValues): (WebKit::StorageAreaMap::ensureStorageMap): (WebKit::StorageAreaMap::applyChange): (WebKit::StorageAreaMap::dispatchSessionStorageEvent): (WebKit::StorageAreaMap::dispatchLocalStorageEvent): (WebKit::StorageAreaMap::connect): (WebKit::StorageAreaMap::disconnect): * WebProcess/WebStorage/StorageAreaMap.h: * WebProcess/WebStorage/StorageAreaMap.messages.in: * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::storageArea): * WebProcess/WebStorage/StorageNamespaceImpl.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254859 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-21 Chris Dumez Minor improvements to StorageAreaMap https://bugs.webkit.org/show_bug.cgi?id=206433 Reviewed by Darin Adler. Minor improvements to StorageAreaMap: 1. The class does not need to be RefCounted, as it is solely owned by StorageNamespaceImpl. Having it RefCounted was actually dangerous because StorageAreaMap had a raw pointer data member to its owner: m_storageNamespace. This raw pointer could become stale if you extend the lifetime of the StorageAreaMap object to outlive its StorageNamespaceImpl. 2. Make StorageAreaMap::connect() private as it is never called from outside the class 3. Reorder data members for better packing 4. Use modern loops in the implementation 5. Rename loadValuesIfNeeded() to ensureStorageMap() and have it return the StorageMap object. This makes calls site more concise and it makes it clearer when this method needs to be called. 6. Mark class as final 7. Replace LOG_ERROR() with RELEASE_LOG_ERROR() so that we can see error logging in sysdiagnoses 8. Use more references instead of raw pointers to make it clear when null checks are not needed * WebProcess/WebStorage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::create): (WebKit::StorageAreaImpl::StorageAreaImpl): * WebProcess/WebStorage/StorageAreaImpl.h: * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::StorageAreaMap): (WebKit::StorageAreaMap::length): (WebKit::StorageAreaMap::key): (WebKit::StorageAreaMap::item): (WebKit::StorageAreaMap::setItem): (WebKit::StorageAreaMap::removeItem): (WebKit::StorageAreaMap::clear): (WebKit::StorageAreaMap::contains): (WebKit::StorageAreaMap::resetValues): (WebKit::StorageAreaMap::ensureStorageMap): (WebKit::StorageAreaMap::applyChange): (WebKit::StorageAreaMap::dispatchSessionStorageEvent): (WebKit::StorageAreaMap::dispatchLocalStorageEvent): (WebKit::StorageAreaMap::connect): (WebKit::StorageAreaMap::disconnect): * WebProcess/WebStorage/StorageAreaMap.h: * WebProcess/WebStorage/StorageAreaMap.messages.in: * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::storageArea): * WebProcess/WebStorage/StorageNamespaceImpl.h: 2020-02-11 Alan Coon Cherry-pick r256073. rdar://problem/59299148 Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content https://bugs.webkit.org/show_bug.cgi?id=207409 rdar://problem/59275641 Patch by Alex Christensen on 2020-02-07 Reviewed by Chris Dumez. Source/WebCore: Covered by an API test. * history/CachedFrame.cpp: (WebCore::CachedFrame::setHasInsecureContent): * history/CachedFrame.h: (WebCore::CachedFrame::usedLegacyTLS const): * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::receivedFirstData): (WebCore::FrameLoader::commitProvisionalLoad): (WebCore::FrameLoader::dispatchDidCommitLoad): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: Source/WebKit: * Scripts/webkit/messages.py: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::hasInsecureContent): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Source/WebKitLegacy/mac: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidCommitLoad): Source/WebKitLegacy/win: * WebCoreSupport/WebFrameLoaderClient.cpp: (WebFrameLoaderClient::dispatchDidCommitLoad): * WebCoreSupport/WebFrameLoaderClient.h: Tools: * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm: (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256073 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-07 Alex Christensen Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content https://bugs.webkit.org/show_bug.cgi?id=207409 rdar://problem/59275641 Reviewed by Chris Dumez. * Scripts/webkit/messages.py: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::hasInsecureContent): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2020-02-11 Alan Coon Cherry-pick r255992. rdar://problem/59298165 [WK2][iOS] Add WKWebviewConfiguration SPI to run client navigations at foreground priority, even if the view is background https://bugs.webkit.org/show_bug.cgi?id=207341 Reviewed by Geoff Garen. Add WKWebviewConfiguration SPI to run client navigations at foreground priority, even if the view is background, as long as the application itself is foreground. The new SPI is: WKWebViewConfiguration._clientNavigationsRunAtForegroundPriority The use case is that the client may choose to load something in an offscreen view and only show the view once the load is complete (to avoid flashing for e.g.). In such cases, it makes sense to use foreground priority for the load since it needs to complete as fast as possible, even though the view is technically background. * UIProcess/API/APINavigation.h: (API::Navigation::setForegroundActivity): * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy const): * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::clientNavigationsRunAtForegroundPriority const): (API::PageConfiguration::setClientNavigationsRunAtForegroundPriority): (API::PageConfiguration::alwaysRunsAtForegroundPriority const): (API::PageConfiguration::alwaysRunsAtForegroundPriority): Deleted. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _clientNavigationsRunAtForegroundPriority]): (-[WKWebViewConfiguration _setClientNavigationsRunAtForegroundPriority:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadRequest): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): (WebKit::WebPageProxy::didFinishLoadForFrame): (WebKit::WebPageProxy::didFailLoadForFrame): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isApplicationVisible): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::shouldUseForegroundPriorityForClientNavigation const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255992 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-06 Chris Dumez [WK2][iOS] Add WKWebviewConfiguration SPI to run client navigations at foreground priority, even if the view is background https://bugs.webkit.org/show_bug.cgi?id=207341 Reviewed by Geoff Garen. Add WKWebviewConfiguration SPI to run client navigations at foreground priority, even if the view is background, as long as the application itself is foreground. The new SPI is: WKWebViewConfiguration._clientNavigationsRunAtForegroundPriority The use case is that the client may choose to load something in an offscreen view and only show the view once the load is complete (to avoid flashing for e.g.). In such cases, it makes sense to use foreground priority for the load since it needs to complete as fast as possible, even though the view is technically background. * UIProcess/API/APINavigation.h: (API::Navigation::setForegroundActivity): * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy const): * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::clientNavigationsRunAtForegroundPriority const): (API::PageConfiguration::setClientNavigationsRunAtForegroundPriority): (API::PageConfiguration::alwaysRunsAtForegroundPriority const): (API::PageConfiguration::alwaysRunsAtForegroundPriority): Deleted. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _clientNavigationsRunAtForegroundPriority]): (-[WKWebViewConfiguration _setClientNavigationsRunAtForegroundPriority:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadRequest): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): (WebKit::WebPageProxy::didFinishLoadForFrame): (WebKit::WebPageProxy::didFailLoadForFrame): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isApplicationVisible): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::shouldUseForegroundPriorityForClientNavigation const): 2020-02-11 Alan Coon Cherry-pick r255881. rdar://problem/59299143 Adopt MTOverrideShouldPlayHDRVideo() https://bugs.webkit.org/show_bug.cgi?id=207275 Reviewed by Eric Carlson. Source/WebCore: * platform/PlatformScreen.h: * platform/mac/PlatformScreenMac.mm: (WebCore::setShouldOverrideScreenSupportsHighDynamicRange): Source/WebCore/PAL: * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: Source/WebKit: The WebProcess sandbox can block access to the services necessary for MediaToolbox to determine whether the current display is capable of displaying HDR. Rather than opening up the sandbox, provide the information gathered by the UIProcess by way of MTOverrideShouldPlayHDRVideo(). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::windowScreenDidChange): (WebKit::WebPage::displayID const): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setScreenProperties): Deleted. * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::setScreenProperties): (WebKit::WebProcess::updatePageScreenProperties): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255881 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-05 Jer Noble Adopt MTOverrideShouldPlayHDRVideo() https://bugs.webkit.org/show_bug.cgi?id=207275 Reviewed by Eric Carlson. The WebProcess sandbox can block access to the services necessary for MediaToolbox to determine whether the current display is capable of displaying HDR. Rather than opening up the sandbox, provide the information gathered by the UIProcess by way of MTOverrideShouldPlayHDRVideo(). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::windowScreenDidChange): (WebKit::WebPage::displayID const): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setScreenProperties): Deleted. * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::setScreenProperties): (WebKit::WebProcess::updatePageScreenProperties): 2020-02-11 Alan Coon Cherry-pick r255846. rdar://problem/59299151 Make WKWebView._negotiatedLegacyTLS accurate when loading main resouorce from network or cache https://bugs.webkit.org/show_bug.cgi?id=207207 Reviewed by Chris Dumez. Source/WebCore: * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::includeCertificateInfo const): * platform/network/ResourceResponseBase.h: (WebCore::ResourceResponseBase::usedLegacyTLS const): (WebCore::ResourceResponseBase::encode const): (WebCore::ResourceResponseBase::decode): Source/WebKit: In PageLoadState::didCommitLoad, I was resetting the value of _negotiatedLegacyTLS to false. That created a race condition when loading the main resource because the NetworkProcess would message the UIProcess setting _negotiatedLegacyTLS to false, while the NetworkProcess would message the WebProcess which would message the UIProcess to call PageLoadState::didCommitLoad which would reset it to false. Now it resets it to the correct value, whatever it is. Updating the ResourceResponseBase serialization code has the desirable side effect that the disk cache will remember whether legacy TLS was used to fetch each resource. This will make it so _negotiatedLegacyTLS is true if we read content from the disk cache that was originally fetched using legacy TLS. In order to not increase the memory footprint of ResourceResponse, I changed m_httpStatusCode from an int to a short. It just needs to be able to cover the values 0-600 or so, which really only needs 10 bits. Covered by new API tests. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveResponse): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): (WebKit::NetworkDataTask::negotiatedLegacyTLS const): Deleted. * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const): Deleted. * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveResponse): (WebKit::NetworkLoad::notifyDidReceiveResponse): (WebKit::NetworkLoad::throttleDelayCompleted): (WebKit::NetworkLoad::negotiatedLegacyTLS const): Deleted. * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveResponse): * NetworkProcess/PingLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::didReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * NetworkProcess/curl/NetworkDataTaskCurl.cpp: (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::didCommitLoad): * UIProcess/PageLoadState.h: * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::didCommitLoadForFrame): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::commitProvisionalPage): (WebKit::WebPageProxy::didCommitLoadForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): Source/WTF: * wtf/persistence/PersistentDecoder.cpp: (WTF::Persistence::Decoder::decode): * wtf/persistence/PersistentDecoder.h: * wtf/persistence/PersistentEncoder.cpp: (WTF::Persistence::Encoder::encode): * wtf/persistence/PersistentEncoder.h: Tools: HTTPServer now supports HTTPS. Tell your friends! * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm: (testCertificate): (testIdentity): (credentialWithIdentity): * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm: (TestWebKitAPI::webViewWithNavigationDelegate): (TestWebKitAPI::TEST): * TestWebKitAPI/cocoa/HTTPServer.h: * TestWebKitAPI/cocoa/HTTPServer.mm: (TestWebKitAPI::HTTPServer::HTTPServer): (TestWebKitAPI::HTTPServer::request const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255846 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-05 Alex Christensen Make WKWebView._negotiatedLegacyTLS accurate when loading main resouorce from network or cache https://bugs.webkit.org/show_bug.cgi?id=207207 Reviewed by Chris Dumez. In PageLoadState::didCommitLoad, I was resetting the value of _negotiatedLegacyTLS to false. That created a race condition when loading the main resource because the NetworkProcess would message the UIProcess setting _negotiatedLegacyTLS to false, while the NetworkProcess would message the WebProcess which would message the UIProcess to call PageLoadState::didCommitLoad which would reset it to false. Now it resets it to the correct value, whatever it is. Updating the ResourceResponseBase serialization code has the desirable side effect that the disk cache will remember whether legacy TLS was used to fetch each resource. This will make it so _negotiatedLegacyTLS is true if we read content from the disk cache that was originally fetched using legacy TLS. In order to not increase the memory footprint of ResourceResponse, I changed m_httpStatusCode from an int to a short. It just needs to be able to cover the values 0-600 or so, which really only needs 10 bits. Covered by new API tests. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveResponse): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): (WebKit::NetworkDataTask::negotiatedLegacyTLS const): Deleted. * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const): Deleted. * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveResponse): (WebKit::NetworkLoad::notifyDidReceiveResponse): (WebKit::NetworkLoad::throttleDelayCompleted): (WebKit::NetworkLoad::negotiatedLegacyTLS const): Deleted. * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveResponse): * NetworkProcess/PingLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::didReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * NetworkProcess/curl/NetworkDataTaskCurl.cpp: (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::didCommitLoad): * UIProcess/PageLoadState.h: * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::didCommitLoadForFrame): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::commitProvisionalPage): (WebKit::WebPageProxy::didCommitLoadForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): 2020-02-11 Alan Coon Cherry-pick r255845. rdar://problem/59298143 _WKDownload should expose the originating FrameInfo. and https://bugs.webkit.org/show_bug.cgi?id=207185 Patch by Brady Eidson on 2020-02-05 Reviewed by Geoff Garen. Source/WebKit: Covered by new API test. For the cases where a navigation is converted into a download, include the relevant WKFrameInfo on the _WKDownload object. * UIProcess/API/APIFrameInfo.h: * UIProcess/API/Cocoa/_WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.mm: (-[_WKDownload originatingFrameInfo]): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::generateDownloadID): (WebKit::DownloadProxy::DownloadProxy): (WebKit::DownloadProxy::create): Deleted. (WebKit::DownloadProxy::setOriginatingPage): Deleted. * UIProcess/Downloads/DownloadProxy.h: (WebKit::DownloadProxy::create): (WebKit::DownloadProxy::frameInfo): * UIProcess/Downloads/DownloadProxyMap.cpp: (WebKit::DownloadProxyMap::createDownloadProxy): * UIProcess/Downloads/DownloadProxyMap.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::createDownloadProxy): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::download): (WebKit::WebProcessPool::resumeDownload): (WebKit::WebProcessPool::createDownloadProxy): * UIProcess/WebProcessPool.h: Tools: * TestWebKitAPI/Tests/WebKitCocoa/Download.mm: (-[DownloadTestSchemeDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): (-[DownloadSecurityOriginDelegate _downloadDidStart:]): (loaded): * TestWebKitAPI/cocoa/HTTPServer.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255845 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-05 Brady Eidson _WKDownload should expose the originating FrameInfo. and https://bugs.webkit.org/show_bug.cgi?id=207185 Reviewed by Geoff Garen. Covered by new API test. For the cases where a navigation is converted into a download, include the relevant WKFrameInfo on the _WKDownload object. * UIProcess/API/APIFrameInfo.h: * UIProcess/API/Cocoa/_WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.mm: (-[_WKDownload originatingFrameInfo]): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::generateDownloadID): (WebKit::DownloadProxy::DownloadProxy): (WebKit::DownloadProxy::create): Deleted. (WebKit::DownloadProxy::setOriginatingPage): Deleted. * UIProcess/Downloads/DownloadProxy.h: (WebKit::DownloadProxy::create): (WebKit::DownloadProxy::frameInfo): * UIProcess/Downloads/DownloadProxyMap.cpp: (WebKit::DownloadProxyMap::createDownloadProxy): * UIProcess/Downloads/DownloadProxyMap.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::createDownloadProxy): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::download): (WebKit::WebProcessPool::resumeDownload): (WebKit::WebProcessPool::createDownloadProxy): * UIProcess/WebProcessPool.h: 2020-02-11 Alan Coon Cherry-pick r255595. rdar://problem/59298183 Regression(r253224) WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView https://bugs.webkit.org/show_bug.cgi?id=207121 Reviewed by Alex Christensen. Source/WebKit: WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView, in case we time out while waiting for an answer from the WebProcess but the WebProcess eventually responds. Change is covered by new API test. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::tryClose): Tools: Add API test coverage. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKit/beforeunload-slow.html: Added. * TestWebKitAPI/Tests/WebKitCocoa/ModalAlerts.mm: (-[SlowBeforeUnloadHandlerUIDelegate _webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:]): (-[SlowBeforeUnloadHandlerUIDelegate webViewDidClose:]): (TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255595 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-03 Chris Dumez Regression(r253224) WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView https://bugs.webkit.org/show_bug.cgi?id=207121 Reviewed by Alex Christensen. WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView, in case we time out while waiting for an answer from the WebProcess but the WebProcess eventually responds. Change is covered by new API test. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::tryClose): 2020-02-11 Alan Coon Cherry-pick r255519. rdar://problem/59298166 Unreviewed macOS build fix after r255518 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleGestureEvent): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255519 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-31 Chris Dumez Unreviewed macOS build fix after r255518 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleGestureEvent): 2020-02-11 Alan Coon Cherry-pick r255518. rdar://problem/59298166 [ iOS ] imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker.html is flaky failing. https://bugs.webkit.org/show_bug.cgi?id=206934 Source/WebKit: Reviewed by Brady Eidson. Flakiness would happen when the service worker would take too long to launch and the responsiveness timer would fire and report the process as unresponsive while still launching or very shortly after. When a service worker is reported as unresponsive, we would kill it. To address the issue, several changes were made: - Responsiveness checks are now disabled for slow builds (Debug, ASAN, GuardMalloc) - We only start the ResponsivenessTimer after the process has finished launching since the responsiveness check relies on IPC to the process and we cannot send the IPC until after the process has launched. * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::goToBackForwardItem): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::launchProcessForReload): (WebKit::WebPageProxy::launchProcessWithItem): (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadDataWithNavigationShared): (WebKit::WebPageProxy::loadAlternateHTML): (WebKit::WebPageProxy::loadWebArchiveData): (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPageProxy::stopLoading): (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::processNextQueuedMouseEvent): (WebKit::WebPageProxy::handleKeyboardEvent): (WebKit::WebPageProxy::handleGestureEvent): (WebKit::WebPageProxy::handlePreventableTouchEvent): (WebKit::WebPageProxy::handleTouchEvent): (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): (WebKit::WebPageProxy::runOpenPanel): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::mayBecomeUnresponsive): (WebKit::WebProcessProxy::didFinishLaunching): (WebKit::WebProcessProxy::startResponsivenessTimer): (WebKit::WebProcessProxy::isResponsive): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::responsivenessTimer): LayoutTests: Unskip test which should no longer be flaky. * platform/ios-wk2/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255518 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-31 Chris Dumez [ iOS ] imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker.html is flaky failing. https://bugs.webkit.org/show_bug.cgi?id=206934 Reviewed by Brady Eidson. Flakiness would happen when the service worker would take too long to launch and the responsiveness timer would fire and report the process as unresponsive while still launching or very shortly after. When a service worker is reported as unresponsive, we would kill it. To address the issue, several changes were made: - Responsiveness checks are now disabled for slow builds (Debug, ASAN, GuardMalloc) - We only start the ResponsivenessTimer after the process has finished launching since the responsiveness check relies on IPC to the process and we cannot send the IPC until after the process has launched. * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::goToBackForwardItem): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::launchProcessForReload): (WebKit::WebPageProxy::launchProcessWithItem): (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadDataWithNavigationShared): (WebKit::WebPageProxy::loadAlternateHTML): (WebKit::WebPageProxy::loadWebArchiveData): (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPageProxy::stopLoading): (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::processNextQueuedMouseEvent): (WebKit::WebPageProxy::handleKeyboardEvent): (WebKit::WebPageProxy::handleGestureEvent): (WebKit::WebPageProxy::handlePreventableTouchEvent): (WebKit::WebPageProxy::handleTouchEvent): (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): (WebKit::WebPageProxy::runOpenPanel): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::mayBecomeUnresponsive): (WebKit::WebProcessProxy::didFinishLaunching): (WebKit::WebProcessProxy::startResponsivenessTimer): (WebKit::WebProcessProxy::isResponsive): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::responsivenessTimer): 2020-02-11 Alan Coon Cherry-pick r255158. rdar://problem/59298137 Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler https://bugs.webkit.org/show_bug.cgi?id=204713 Patch by Said Abou-Hallawa on 2020-01-27 Reviewed by Simon Fraser. Source/WebCore: Test: fast/animation/request-animation-frame-throttling-outside-viewport.html requestAnimationFrame is throttled by a timer although its callback are serviced by the page RenderingUpdate. This led to excessive rAF firing which makes it more than the preferred frame per seconds. The solution is to have two throttling types: 1) Page throttling (or full throttling) which slows down all the steps of RenderingUpdate for the main document and all the sub-documents. 2) Document throttling (or partial throttling) which only slows down the rAF of a certain document. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::animationInterval const): (WebCore::DocumentTimeline::updateThrottlingState): Deleted. * animation/DocumentTimeline.h: There is no need to have DocumentTimeline throttling. It is already throttled when the page RenderingUpdate is throttled. * dom/Document.cpp: (WebCore::Document::requestAnimationFrame): (WebCore::Document::updateLastHandledUserGestureTimestamp): LowPowerMode throttling is now handled by the page. So remove its handling in the Document side. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::ScriptedAnimationController): (WebCore::ScriptedAnimationController::page const): (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const): (WebCore::ScriptedAnimationController::interval const): (WebCore::ScriptedAnimationController::isThrottled const): (WebCore::ScriptedAnimationController::isThrottledRelativeToPage const): (WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const): (WebCore::ScriptedAnimationController::registerCallback): (WebCore::ScriptedAnimationController::cancelCallback): (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): (WebCore::ScriptedAnimationController::scheduleAnimation): (WebCore::throttlingReasonToString): Deleted. (WebCore::throttlingReasonsToString): Deleted. (WebCore::ScriptedAnimationController::addThrottlingReason): Deleted. (WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted. (WebCore::ScriptedAnimationController::animationTimerFired): Deleted. * dom/ScriptedAnimationController.h: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): Get rid of the rAF throttling timer. Service the rAF callback only when the period from the current time stamp till the last service time stamp is greater than the preferred rAF interval . * page/FrameView.cpp: (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState): ThrottlingReason is now defined outside ScriptedAnimationController. * page/Page.cpp: (WebCore::Page::renderingUpdateThrottlingEnabled const): (WebCore::Page::renderingUpdateThrottlingEnabledChanged): (WebCore::Page::isRenderingUpdateThrottled const): (WebCore::Page::preferredRenderingUpdateInterval const): Calculate the preferred RenderingUpdate interval from the throttling reasons. (WebCore::Page::setIsVisuallyIdleInternal): (WebCore::Page::handleLowModePowerChange): Call adjustRenderingUpdateFrequency() when isLowPowerModeEnabled or IsVisuallyIdle is toggled. (WebCore::updateScriptedAnimationsThrottlingReason): Deleted. * page/Page.h: * page/RenderingUpdateScheduler.cpp: (WebCore::RenderingUpdateScheduler::adjustFramesPerSecond): (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency): Change the preferredFramesPerSecond of the DisplayRefreshMonitor if the throttling is not aggressive e.g. 10_s. Otherwise use the timer. (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate): Call adjustFramesPerSecond() when DisplayRefreshMonitor is created. (WebCore::RenderingUpdateScheduler::startTimer): * page/RenderingUpdateScheduler.h: * page/Settings.yaml: * page/SettingsBase.cpp: (WebCore::SettingsBase::renderingUpdateThrottlingEnabledChanged): * page/SettingsBase.h: Add a setting to enable/disable RenderingUpdateThrottling. * platform/graphics/AnimationFrameRate.h: Added. (WebCore::preferredFrameInterval): (WebCore::preferredFramesPerSecond): * platform/graphics/DisplayRefreshMonitor.h: (WebCore::DisplayRefreshMonitor::setPreferredFramesPerSecond): * platform/graphics/DisplayRefreshMonitorManager.cpp: (WebCore::DisplayRefreshMonitorManager::monitorForClient): Rename createMonitorForClient() to monitorForClient() since it may return a cached DisplayRefreshMonitor. (WebCore::DisplayRefreshMonitorManager::setPreferredFramesPerSecond): (WebCore::DisplayRefreshMonitorManager::scheduleAnimation): (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange): No need to call registerClient(). This function was just ensuring the DisplayRefreshMonitor is created. scheduleAnimation() does the same thing. (WebCore::DisplayRefreshMonitorManager::createMonitorForClient): Deleted. (WebCore::DisplayRefreshMonitorManager::registerClient): Deleted. * platform/graphics/DisplayRefreshMonitorManager.h: (WebCore::DisplayRefreshMonitorManager::DisplayRefreshMonitorManager): Deleted. * platform/graphics/GraphicsLayerUpdater.cpp: (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater): * platform/graphics/ios/DisplayRefreshMonitorIOS.mm: (-[WebDisplayLinkHandler setPreferredFramesPerSecond:]): Set the preferredFramesPerSecond of the CADisplayLink. Source/WebKit: Create an IPC message on the DrawingArea to send a message from the WebProcess to the UIProcess to setPreferredFramesPerSecond of the DisplayRefreshMonitor. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetRenderingUpdateThrottlingEnabled): (WKPreferencesGetRenderingUpdateThrottlingEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: Add a WKPreference key for RenderingUpdateThrottlingEnabled. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]): (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond): Set the preferredFramesPerSecond of the CADisplayLink. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond): Delegate the call to RemoteLayerTreeDrawingArea. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond): Send the IPC message from the WebProcess to the UIProcess. Source/WebKitLegacy/mac: Add a WKPreference key for RenderingUpdateThrottling. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences renderingUpdateThrottlingEnabled]): (-[WebPreferences setRenderingUpdateThrottlingEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Source/WebKitLegacy/win: Add a WKPreference key for RenderingUpdateThrottling. * Interfaces/IWebPreferencesPrivate.idl: * WebPreferenceKeysPrivate.h: * WebPreferences.cpp: (WebPreferences::initializeDefaultSettings): (WebPreferences::renderingUpdateThrottlingEnabled): (WebPreferences::setRenderingUpdateThrottlingEnabled): * WebPreferences.h: * WebView.cpp: (WebView::notifyPreferencesChanged): Tools: RenderingUpdateThrottling is enabled by default. Turn it off for DRT and WTR. In some cases, the page may not get visually active while it's waiting for rAF. Throttling tests will have to explicitly turn it on. * DumpRenderTree/mac/DumpRenderTree.mm: (resetWebPreferencesToConsistentValues): * DumpRenderTree/win/DumpRenderTree.cpp: (resetWebPreferencesToConsistentValues): * WebKitTestRunner/TestController.cpp: (WTR::TestController::resetPreferencesToConsistentValues): LayoutTests: * fast/animation/css-animation-throttling-lowPowerMode.html: * fast/animation/request-animation-frame-throttle-subframe.html: * fast/animation/request-animation-frame-throttling-detached-iframe.html: Enable RenderingUpdateThrottling for these tests. * fast/animation/request-animation-frame-throttling-lowPowerMode-expected.txt: * fast/animation/request-animation-frame-throttling-lowPowerMode.html: Ensure the actual rAF interval is > 30ms for lowPowerMode. * fast/animation/request-animation-frame-throttling-outside-viewport-expected.txt: Added. * fast/animation/request-animation-frame-throttling-outside-viewport.html: Added. * fast/animation/resources/frame-with-animation-2.html: Added. Test the OutsideViewport throttling case. * http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html: Enable RenderingUpdateThrottling for this test. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255158 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-27 Said Abou-Hallawa Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler https://bugs.webkit.org/show_bug.cgi?id=204713 Reviewed by Simon Fraser. Create an IPC message on the DrawingArea to send a message from the WebProcess to the UIProcess to setPreferredFramesPerSecond of the DisplayRefreshMonitor. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetRenderingUpdateThrottlingEnabled): (WKPreferencesGetRenderingUpdateThrottlingEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: Add a WKPreference key for RenderingUpdateThrottlingEnabled. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]): (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond): Set the preferredFramesPerSecond of the CADisplayLink. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond): Delegate the call to RemoteLayerTreeDrawingArea. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond): Send the IPC message from the WebProcess to the UIProcess. 2020-02-11 Brent Fulgham Cherry-pick r254989. rdar://problem/59354409 [iOS] Camera is lost during WebRTC demo https://bugs.webkit.org/show_bug.cgi?id=206613 Reviewed by Brent Fulgham. Fix observed sandbox violations in the Networking process. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2020-02-10 Kocsen Chung Cherry-pick r256105. rdar://problem/59302221 Fix the watchOS build after https://bugs.webkit.org/show_bug.cgi?id=207443 Reviewed by Maciej Stachowiak. Use the version of the SPI that's guaranteed to be available across all platforms. * UIProcess/ios/WKContentViewInteraction.mm: (gestureRecognizerModifierFlags): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256105 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-09 Wenson Hsieh Fix the watchOS build after https://bugs.webkit.org/show_bug.cgi?id=207443 Reviewed by Maciej Stachowiak. Use the version of the SPI that's guaranteed to be available across all platforms. * UIProcess/ios/WKContentViewInteraction.mm: (gestureRecognizerModifierFlags): 2020-02-10 Kocsen Chung Cherry-pick r256090. rdar://problem/59298156 Resource Load Statistics: Hold off non-cookie website data deletion until an hour after user interaction https://bugs.webkit.org/show_bug.cgi?id=207418 Reviewed by Chris Dumez. This change makes sure there is at least a one-hour or older timestamp for user interaction for some website before activating deletion of non-cookie website data for sites the user has not interacted with. This ensures that a fresh start such as after a reset or on a new device doesn't interpret the lack of data as lack of user interaction. No new tests. Existing tests make sure we don't regress the functionality. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor): * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256090 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-08 John Wilander Resource Load Statistics: Hold off non-cookie website data deletion until an hour after user interaction https://bugs.webkit.org/show_bug.cgi?id=207418 Reviewed by Chris Dumez. This change makes sure there is at least a one-hour or older timestamp for user interaction for some website before activating deletion of non-cookie website data for sites the user has not interacted with. This ensures that a fresh start such as after a reset or on a new device doesn't interpret the lack of data as lack of user interaction. No new tests. Existing tests make sure we don't regress the functionality. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor): * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor): 2020-02-10 Kocsen Chung Cherry-pick r256075. rdar://problem/59298173 [Hardening] Validate Geolocation access permission on UIProcess side https://bugs.webkit.org/show_bug.cgi?id=207393 Reviewed by Brent Fulgham. Source/WebCore: Validate Geolocation access permission on UIProcess side, instead of only relying solely on the WebProcess for this. The workflow is as follows: - The Geolocation objects request for permission to access location data - The UIProcess shows a prompt - If the user accepts, the UIProcess sends an authorization token (a UUID string) to the Geolocation object. - When the Geolocation object later asks for location updates from the UIProcess, the UIProcess validates that this is a valid authorization token (one that it previously issued for this page) - When the Geolocation objects gets destroyed (or resets its permission), the authorization token gets revoked so that it is no longer valid. No new tests, no Web-facing behavior change, merely hardening. * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::~Geolocation): (WebCore::Geolocation::resumeTimerFired): (WebCore::Geolocation::resetAllGeolocationPermission): (WebCore::Geolocation::stop): (WebCore::Geolocation::setIsAllowed): (WebCore::Geolocation::revokeAuthorizationTokenIfNecessary): (WebCore::Geolocation::resetIsAllowed): * Modules/geolocation/Geolocation.h: * Modules/geolocation/GeolocationClient.h: (WebCore::GeolocationClient::revokeAuthorizationToken): * Modules/geolocation/GeolocationController.cpp: (WebCore::GeolocationController::addObserver): (WebCore::GeolocationController::revokeAuthorizationToken): (WebCore::GeolocationController::activityStateDidChange): * Modules/geolocation/GeolocationController.h: * platform/mock/GeolocationClientMock.cpp: (WebCore::GeolocationClientMock::permissionTimerFired): (WebCore::GeolocationClientMock::startUpdating): * platform/mock/GeolocationClientMock.h: Source/WebKit: * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision): (WebKit::GeolocationPermissionRequestManagerProxy::isValidAuthorizationToken const): (WebKit::GeolocationPermissionRequestManagerProxy::revokeAuthorizationToken): * UIProcess/GeolocationPermissionRequestManagerProxy.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::startUpdating): * UIProcess/WebGeolocationManagerProxy.h: * UIProcess/WebGeolocationManagerProxy.messages.in: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::geolocationPermissionRequestManager): * UIProcess/WebPageProxy.messages.in: * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation): (WebKit::GeolocationPermissionRequestManager::revokeAuthorizationToken): (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision): * WebProcess/Geolocation/GeolocationPermissionRequestManager.h: * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::registerWebPage): * WebProcess/Geolocation/WebGeolocationManager.h: * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: (WebKit::WebGeolocationClient::startUpdating): (WebKit::WebGeolocationClient::revokeAuthorizationToken): * WebProcess/WebCoreSupport/WebGeolocationClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceiveGeolocationPermissionDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Source/WebKitLegacy/mac: * WebCoreSupport/WebGeolocationClient.h: * WebCoreSupport/WebGeolocationClient.mm: (WebGeolocationClient::startUpdating): (WebGeolocationClient::requestPermission): (-[WebGeolocationPolicyListener allow]): (-[WebGeolocationPolicyListener deny]): Source/WebKitLegacy/win: * WebCoreSupport/WebGeolocationClient.cpp: (WebGeolocationClient::startUpdating): * WebCoreSupport/WebGeolocationClient.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256075 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-07 Chris Dumez [Hardening] Validate Geolocation access permission on UIProcess side https://bugs.webkit.org/show_bug.cgi?id=207393 Reviewed by Brent Fulgham. * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision): (WebKit::GeolocationPermissionRequestManagerProxy::isValidAuthorizationToken const): (WebKit::GeolocationPermissionRequestManagerProxy::revokeAuthorizationToken): * UIProcess/GeolocationPermissionRequestManagerProxy.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::startUpdating): * UIProcess/WebGeolocationManagerProxy.h: * UIProcess/WebGeolocationManagerProxy.messages.in: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::geolocationPermissionRequestManager): * UIProcess/WebPageProxy.messages.in: * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation): (WebKit::GeolocationPermissionRequestManager::revokeAuthorizationToken): (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision): * WebProcess/Geolocation/GeolocationPermissionRequestManager.h: * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::registerWebPage): * WebProcess/Geolocation/WebGeolocationManager.h: * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: (WebKit::WebGeolocationClient::startUpdating): (WebKit::WebGeolocationClient::revokeAuthorizationToken): * WebProcess/WebCoreSupport/WebGeolocationClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceiveGeolocationPermissionDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2020-02-10 Kocsen Chung Cherry-pick r256022. rdar://problem/59298187 Address post-landing review comments from Darin on r255989. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::terminateServiceWorkerProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256022 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-07 Chris Dumez Address post-landing review comments from Darin on r255989. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::terminateServiceWorkerProcess): 2020-02-10 Kocsen Chung Cherry-pick r256016. rdar://problem/59298146 Mandate UUID version 4 for mDNS ICE candidates https://bugs.webkit.org/show_bug.cgi?id=207329 Reviewed by Alex Christensen. Source/WebCore: Ignore ICE candidates if they are mDNS but not UUID version 4. Covered by existing tests relying on mDNS to do the connection. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::shouldIgnoreCandidate): (WebCore::PeerConnectionBackend::addIceCandidate): Source/WebKit: * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: (WebKit::NetworkMDNSRegister::registerMDNSName): Remove the count at the end of the mDNS name to make it a fully version 4 UUID. Source/WTF: Add a routine to validate version 4 UUID. * wtf/UUID.cpp: (WTF::isHexadecimalCharacter): (WTF::isVersion4UUID): * wtf/UUID.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256016 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-07 youenn fablet Mandate UUID version 4 for mDNS ICE candidates https://bugs.webkit.org/show_bug.cgi?id=207329 Reviewed by Alex Christensen. * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: (WebKit::NetworkMDNSRegister::registerMDNSName): Remove the count at the end of the mDNS name to make it a fully version 4 UUID. 2020-02-10 Kocsen Chung Cherry-pick r256005. rdar://problem/59299335 macCatalyst: Unnecessary I-beam over images in editable areas https://bugs.webkit.org/show_bug.cgi?id=207370 Reviewed by Wenson Hsieh. Source/WebCore: * dom/Position.h: Source/WebKit: * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::populateCaretContext): Add a bit indicating whether the forced I-beam for editable contexts should be used or not, based on whether it is adjacent to (or immediately over) a replaced element. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256005 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-06 Tim Horton macCatalyst: Unnecessary I-beam over images in editable areas https://bugs.webkit.org/show_bug.cgi?id=207370 Reviewed by Wenson Hsieh. * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::populateCaretContext): Add a bit indicating whether the forced I-beam for editable contexts should be used or not, based on whether it is adjacent to (or immediately over) a replaced element. 2020-02-10 Kocsen Chung Cherry-pick r256000. rdar://problem/59299326 WebPage::rangeForGranularityAtPoint always returns null in the case of CharacterGranularity https://bugs.webkit.org/show_bug.cgi?id=207350 Reviewed by Tim Horton. Source/WebKit: Handle the character granularity case in `WebPage::rangeForGranularityAtPoint` by just returning a collapsed Range. Certain internal clients will have a need to place and update the text selection using character granularity; see radar for more details. Test: UIWKInteractionViewProtocol.SelectTextWithCharacterGranularity * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView supportsTextSelectionWithCharacterGranularity]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForGranularityAtPoint): Tools: Add a test to exercise the corner case in the SPI. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/ios/UIWKInteractionViewProtocol.mm: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256000 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-06 Wenson Hsieh WebPage::rangeForGranularityAtPoint always returns null in the case of CharacterGranularity https://bugs.webkit.org/show_bug.cgi?id=207350 Reviewed by Tim Horton. Handle the character granularity case in `WebPage::rangeForGranularityAtPoint` by just returning a collapsed Range. Certain internal clients will have a need to place and update the text selection using character granularity; see radar for more details. Test: UIWKInteractionViewProtocol.SelectTextWithCharacterGranularity * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView supportsTextSelectionWithCharacterGranularity]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForGranularityAtPoint): 2020-02-10 Kocsen Chung Cherry-pick r255989. rdar://problem/59298187 REGRESSION (r254706): Crash under WebProcessPool::terminateServiceWorkerProcess() https://bugs.webkit.org/show_bug.cgi?id=207354 Reviewed by Geoffrey Garen. No new tests, not easily testable AFAIK since this happens on failure to send sync IPC to the service worker when terminating it. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::terminateServiceWorkerProcess): 'auto' resolved to 'WeakPtr' in this method and the call to disableServiceWorkers() could cause the process to get destroyed. We would then do a null dereference on the next line. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255989 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-06 Chris Dumez REGRESSION (r254706): Crash under WebProcessPool::terminateServiceWorkerProcess() https://bugs.webkit.org/show_bug.cgi?id=207354 Reviewed by Geoffrey Garen. No new tests, not easily testable AFAIK since this happens on failure to send sync IPC to the service worker when terminating it. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::terminateServiceWorkerProcess): 'auto' resolved to 'WeakPtr' in this method and the call to disableServiceWorkers() could cause the process to get destroyed. We would then do a null dereference on the next line. 2020-02-10 Kocsen Chung Cherry-pick r255879. rdar://problem/59299329 [macCatalyst] Incorrect IBeam cursor when selecting text on Wikipedia https://bugs.webkit.org/show_bug.cgi?id=207299 Reviewed by Tim Horton. After r255827, if EventHandler selects an IBeam cursor at the position information request location, we will always attempt to show a caret at that location, whose height is the height of the editing caret for that visible position. However, this means that: - It's possible for the caret to be incorrectly sized if the caret is before a large replaced element, such as a table. Since the request location is also outside of any line rect, it doesn't make sense to use the caret height for the height of the cursor. Instead, fall back to computed line height. This fixes an issue on en.wikipedia.org where the line rect would sometimes update to an enormous size when selecting text, since the caret would temporarily hover over an editing position that is before a large table. - This fallback path completely negates certain cursor behaviors; partially restore this behavior by making it so that in the case where the cursor is in editable content and the line caret first line from the top of the hit-tested node already contains the request point, don't bother trying to recenter the line rect to be right over the request point. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::populateCaretContext): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255879 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-05 Wenson Hsieh [macCatalyst] Incorrect IBeam cursor when selecting text on Wikipedia https://bugs.webkit.org/show_bug.cgi?id=207299 Reviewed by Tim Horton. After r255827, if EventHandler selects an IBeam cursor at the position information request location, we will always attempt to show a caret at that location, whose height is the height of the editing caret for that visible position. However, this means that: - It's possible for the caret to be incorrectly sized if the caret is before a large replaced element, such as a table. Since the request location is also outside of any line rect, it doesn't make sense to use the caret height for the height of the cursor. Instead, fall back to computed line height. This fixes an issue on en.wikipedia.org where the line rect would sometimes update to an enormous size when selecting text, since the caret would temporarily hover over an editing position that is before a large table. - This fallback path completely negates certain cursor behaviors; partially restore this behavior by making it so that in the case where the cursor is in editable content and the line caret first line from the top of the hit-tested node already contains the request point, don't bother trying to recenter the line rect to be right over the request point. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::populateCaretContext): 2020-02-10 Kocsen Chung Cherry-pick r255874. rdar://problem/59298178 [iOS] Do not create sandbox reports when the UI process cannot issue extensions to diagnostics service https://bugs.webkit.org/show_bug.cgi?id=207279 Source/WebKit: Reviewed by Brent Fulgham. Do not create sandbox reports when the UI process cannot issue mach extensions to the diagnostics service. The majority of clients are capable of doing this. No new tests, since it is not trivial to test if no sandbox reports are generated for a violation. * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtensionImpl::create): (WebKit::SandboxExtensionImpl::sandboxExtensionForType): (WebKit::SandboxExtensionImpl::SandboxExtensionImpl): (WebKit::SandboxExtension::createHandleForMachLookup): * Shared/SandboxExtension.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): Source/WTF: Reviewed by Brent Fulgham. Add flag which avoids generating sandbox reports. * wtf/spi/darwin/SandboxSPI.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255874 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-05 Per Arne Vollan [iOS] Do not create sandbox reports when the UI process cannot issue extensions to diagnostics service https://bugs.webkit.org/show_bug.cgi?id=207279 Reviewed by Brent Fulgham. Do not create sandbox reports when the UI process cannot issue mach extensions to the diagnostics service. The majority of clients are capable of doing this. No new tests, since it is not trivial to test if no sandbox reports are generated for a violation. * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtensionImpl::create): (WebKit::SandboxExtensionImpl::sandboxExtensionForType): (WebKit::SandboxExtensionImpl::SandboxExtensionImpl): (WebKit::SandboxExtension::createHandleForMachLookup): * Shared/SandboxExtension.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): 2020-02-10 Kocsen Chung Cherry-pick r255848. rdar://problem/59298190 [IPC Hardening] Protect against bad RegistrableDomain under WebProcessProxy::didCollectPrewarmInformation() https://bugs.webkit.org/show_bug.cgi?id=207281 Reviewed by Geoffrey Garen. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didCollectPrewarmInformation): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255848 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-05 Chris Dumez [IPC Hardening] Protect against bad RegistrableDomain under WebProcessProxy::didCollectPrewarmInformation() https://bugs.webkit.org/show_bug.cgi?id=207281 Reviewed by Geoffrey Garen. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didCollectPrewarmInformation): 2020-02-10 Kocsen Chung Cherry-pick r255827. rdar://problem/59299345 [macCatalyst] IBeam cursor doesn't show up when hovering over text form controls prior to editing https://bugs.webkit.org/show_bug.cgi?id=207268 Reviewed by Tim Horton. On macCatalyst, when hovering over textareas and input fields that have not been edited yet, the cursor fails to change to an IBeam and instead falls back to the default style. Even though `EventHandler::selectCursor()` returns `IBeam`, we end up not actually using an IBeam because the position information's `lineCaretExtent` is an empty rect, which means the caret height is 0 and, more importantly, the line rect will not contain the request point. The line rect is empty in text fields that have not been edited yet because the form control's inner plaintext contenteditable div (embedded in the shadow root) does not contain any child renderers with a non-zero height. Even if it did, however, the element may still be much taller than the combined height of the inner div's children, so the line rect may still not contain the position information request point (this is most easily noticeable when focusing a textarea, typing a few letters, and then moving the cursor to near the bottom of the textarea element). To fix this, add a fallback path for the scenario where we want to show an IBeam, but fail to find line rects that contain the request point. Instead, we still show an IBeam, but simply fake the lineCaretExtent to be an element-wide rect that is the height of the caret, and is also vertically centered about the request point. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::populateCaretContext): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255827 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-05 Wenson Hsieh [macCatalyst] IBeam cursor doesn't show up when hovering over text form controls prior to editing https://bugs.webkit.org/show_bug.cgi?id=207268 Reviewed by Tim Horton. On macCatalyst, when hovering over textareas and input fields that have not been edited yet, the cursor fails to change to an IBeam and instead falls back to the default style. Even though `EventHandler::selectCursor()` returns `IBeam`, we end up not actually using an IBeam because the position information's `lineCaretExtent` is an empty rect, which means the caret height is 0 and, more importantly, the line rect will not contain the request point. The line rect is empty in text fields that have not been edited yet because the form control's inner plaintext contenteditable div (embedded in the shadow root) does not contain any child renderers with a non-zero height. Even if it did, however, the element may still be much taller than the combined height of the inner div's children, so the line rect may still not contain the position information request point (this is most easily noticeable when focusing a textarea, typing a few letters, and then moving the cursor to near the bottom of the textarea element). To fix this, add a fallback path for the scenario where we want to show an IBeam, but fail to find line rects that contain the request point. Instead, we still show an IBeam, but simply fake the lineCaretExtent to be an element-wide rect that is the height of the caret, and is also vertically centered about the request point. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::populateCaretContext): 2020-02-10 Kocsen Chung Cherry-pick r255814. rdar://problem/59298180 Unreviewed, follow-up assertion fix after r255662. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255814 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-05 Chris Dumez Unreviewed, follow-up assertion fix after r255662. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): 2020-02-10 Kocsen Chung Cherry-pick r255786. rdar://problem/59298135 REGRESSION (r251320): Can't double tap to select word in Notes on iCloud.com https://bugs.webkit.org/show_bug.cgi?id=207239 Reviewed by Tim Horton. Source/WebKit: Following r251320, all synthetic mouse events on iOS additionally dispatched corresponding pointer events. This led to duplicate "pointerdown"/"pointerup" events dispatched with every tap. r253878 fixed this by avoiding pointer event dispatch for synthetically generated mouse events (and made this determination by consulting `syntheticClickType()`). However, in the case where we're synthesizing a mouse event for a "dblclick" event handler (after a double- tap), we currently pass `NoTap` as the synthetic click event type when creating the mouse event. This causes additional pointer events to be synthesized and dispatched during a double tap, which creates three pairs of "pointerdown"/"pointerup" events upon double-tap. This subsequently confuses iCloud Notes' web app when double tapping to select a word. Fix this by passing in `OneFingerTap` as the synthetic click type instead (since two-finger double taps should already be handled by the two-finger double-tap magnification gesture). Test: pointerevents/ios/pointer-events-for-double-tap.html * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint): LayoutTests: Add a test to verify that performing a double tap on an element with a dblclick handler results in the following sequence of events: `[ "pointerdown", "pointerup", "pointerdown", "pointerup", "dblclick" ]`. * pointerevents/ios/pointer-events-for-double-tap-expected.txt: Added. * pointerevents/ios/pointer-events-for-double-tap.html: Added. * pointerevents/utils.js: (const.ui.new.UIController.prototype.doubleTap): Add a helper method to simulate a double-tap gesture. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255786 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-04 Wenson Hsieh REGRESSION (r251320): Can't double tap to select word in Notes on iCloud.com https://bugs.webkit.org/show_bug.cgi?id=207239 Reviewed by Tim Horton. Following r251320, all synthetic mouse events on iOS additionally dispatched corresponding pointer events. This led to duplicate "pointerdown"/"pointerup" events dispatched with every tap. r253878 fixed this by avoiding pointer event dispatch for synthetically generated mouse events (and made this determination by consulting `syntheticClickType()`). However, in the case where we're synthesizing a mouse event for a "dblclick" event handler (after a double- tap), we currently pass `NoTap` as the synthetic click event type when creating the mouse event. This causes additional pointer events to be synthesized and dispatched during a double tap, which creates three pairs of "pointerdown"/"pointerup" events upon double-tap. This subsequently confuses iCloud Notes' web app when double tapping to select a word. Fix this by passing in `OneFingerTap` as the synthetic click type instead (since two-finger double taps should already be handled by the two-finger double-tap magnification gesture). Test: pointerevents/ios/pointer-events-for-double-tap.html * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint): 2020-02-10 Kocsen Chung Cherry-pick r255710. rdar://problem/59299340 macCatalyst: Shouldn't get text cursor on checkboxes https://bugs.webkit.org/show_bug.cgi?id=207234 Reviewed by Wenson Hsieh. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::canForceCaretForPosition): (WebKit::populateCaretContext): (WebKit::lineCaretExtent): Deleted. The I-beam forcing code was a bit too aggressive; it should consider the style of the node that it ends up finding after searching, not just assume it wants an I-beam because it's "texty". git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255710 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-04 Tim Horton macCatalyst: Shouldn't get text cursor on checkboxes https://bugs.webkit.org/show_bug.cgi?id=207234 Reviewed by Wenson Hsieh. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::canForceCaretForPosition): (WebKit::populateCaretContext): (WebKit::lineCaretExtent): Deleted. The I-beam forcing code was a bit too aggressive; it should consider the style of the node that it ends up finding after searching, not just assume it wants an I-beam because it's "texty". 2020-02-10 Kocsen Chung Cherry-pick r255705. rdar://problem/59298180 Unreviewed, follow-up assertion fix after r255662. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255705 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-04 Chris Dumez Unreviewed, follow-up assertion fix after r255662. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): 2020-02-10 Kocsen Chung Cherry-pick r255691. rdar://problem/59299315 [macCatalyst] Missing custom cursors in subframes that are offset from the origin of the root view https://bugs.webkit.org/show_bug.cgi?id=207215 Reviewed by Tim Horton. added support for custom cursor styles when hovering over subframes. However, we currently try to hit-test content in the subframe using the interaction information request's point, which is in root view coordinates; as such, we only get the correct custom cursor styles when hovering over elements in a subframe, if the subframe is also at the origin of the root view. To fix this, simply convert from root view coordinates to frame coordinates when performing the hit-test. Unfortunately, this change is currently untestable; see . * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::lineCaretExtent): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255691 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-04 Wenson Hsieh [macCatalyst] Missing custom cursors in subframes that are offset from the origin of the root view https://bugs.webkit.org/show_bug.cgi?id=207215 Reviewed by Tim Horton. added support for custom cursor styles when hovering over subframes. However, we currently try to hit-test content in the subframe using the interaction information request's point, which is in root view coordinates; as such, we only get the correct custom cursor styles when hovering over elements in a subframe, if the subframe is also at the origin of the root view. To fix this, simply convert from root view coordinates to frame coordinates when performing the hit-test. Unfortunately, this change is currently untestable; see . * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::lineCaretExtent): 2020-02-10 Kocsen Chung Cherry-pick r255681. rdar://problem/59298166 NetworkProcess should be notified by UIProcess when its service worker process connection should be on https://bugs.webkit.org/show_bug.cgi?id=207122 Reviewed by Chris Dumez. Source/WebCore: Add a completion handler to the create context connection callback. This is called when the context connection should have been created. In case there is a context connection, completion handler does nothing. Otherwise, SWServer will retry creating a context connection if needed. The pending connection map entry is now removed in the completion handler instead of addContextConnection. This ensures that only one connection request is sent by network process at a time. Add extra logging to monitor creation of a context connection. * workers/service/context/SWContextManager.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::addContextConnection): (WebCore::SWServer::removeContextConnection): (WebCore::SWServer::createContextConnectionFinished): * workers/service/server/SWServer.h: Source/WebKit: Add completion handlers to the messaging from NetworkProcess -> UIProcess -> WebProcess -> NetworkProcess used to create a service worker context connection. This allows NetworkProcess to ask again for a connection if the connection is still needed but NetworkProcess did not find the context connection. This is difficult to test since we would need for the process selected to host service workers to exit between the time it is selected and the time it sends the message to Networking process. To ensure that the context connection is created by WebProcess, WebProcessProxy takes a background assertion until WebProcess finishes creating the context connection to Network process. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::swServerForSession): * NetworkProcess/NetworkProcess.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::establishServiceWorkerContext): * UIProcess/WebProcessProxy.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::m_userAgent): (WebKit::WebSWContextManagerConnection::establishConnection): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255681 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-04 youenn fablet NetworkProcess should be notified by UIProcess when its service worker process connection should be on https://bugs.webkit.org/show_bug.cgi?id=207122 Reviewed by Chris Dumez. Add completion handlers to the messaging from NetworkProcess -> UIProcess -> WebProcess -> NetworkProcess used to create a service worker context connection. This allows NetworkProcess to ask again for a connection if the connection is still needed but NetworkProcess did not find the context connection. This is difficult to test since we would need for the process selected to host service workers to exit between the time it is selected and the time it sends the message to Networking process. To ensure that the context connection is created by WebProcess, WebProcessProxy takes a background assertion until WebProcess finishes creating the context connection to Network process. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::swServerForSession): * NetworkProcess/NetworkProcess.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::establishServiceWorkerContext): * UIProcess/WebProcessProxy.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::m_userAgent): (WebKit::WebSWContextManagerConnection::establishConnection): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2020-02-10 Kocsen Chung Cherry-pick r255679. rdar://problem/59298180 Unreviewed, follow-up assertion fix after r255662. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255679 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-04 Chris Dumez Unreviewed, follow-up assertion fix after r255662. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): 2020-02-10 Kocsen Chung Cherry-pick r255677. rdar://problem/59299115 REGRESSION(r255595): page not closed after beforeunload handler returns true https://bugs.webkit.org/show_bug.cgi?id=207189 Patch by Carlos Garcia Campos on 2020-02-04 Reviewed by Chris Dumez. We are assuming the try close did timeout in that case, because the timer is stopped before running the beforeunload dialog. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Start the try close timer again when the beforeunload dialog replies. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255677 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-04 Carlos Garcia Campos REGRESSION(r255595): page not closed after beforeunload handler returns true https://bugs.webkit.org/show_bug.cgi?id=207189 Reviewed by Chris Dumez. We are assuming the try close did timeout in that case, because the timer is stopped before running the beforeunload dialog. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Start the try close timer again when the beforeunload dialog replies. 2020-02-10 Kocsen Chung Cherry-pick r255664. rdar://problem/59299338 Add a WebKitAdditions hook to provide additional customizations to UIDragInteraction https://bugs.webkit.org/show_bug.cgi?id=207177 Reviewed by Tim Horton. Add a WebKitAdditions extension point that runs immediately after setting up UIDragInteraction and UIDropInteraction. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupDragAndDropInteractions]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255664 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-03 Wenson Hsieh Add a WebKitAdditions hook to provide additional customizations to UIDragInteraction https://bugs.webkit.org/show_bug.cgi?id=207177 Reviewed by Tim Horton. Add a WebKitAdditions extension point that runs immediately after setting up UIDragInteraction and UIDropInteraction. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupDragAndDropInteractions]): 2020-02-10 Kocsen Chung Cherry-pick r255662. rdar://problem/59298180 Stop relying on ResponsivenessTimer to keep the WebProcess from suspending during initialization https://bugs.webkit.org/show_bug.cgi?id=207144 Reviewed by Brady Eidson. Stop relying on ResponsivenessTimer to keep the WebProcess from suspending during initialization. Instead, make the WebProcess::InitializeWebProcess IPC async with a reply and take a process assertion on behalf of the WebContent process until we get a response back. This avoids sending an extra WebProcess::MainThreadPing IPC to the WebProcess for no reason (since we're already sending the WebProcess::InitializeWebProcess IPC) and this is also more reliable since the ResponsivenessTimer can actually time out and cause the process to get suspended during initialization still. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255662 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-03 Chris Dumez Stop relying on ResponsivenessTimer to keep the WebProcess from suspending during initialization https://bugs.webkit.org/show_bug.cgi?id=207144 Reviewed by Brady Eidson. Stop relying on ResponsivenessTimer to keep the WebProcess from suspending during initialization. Instead, make the WebProcess::InitializeWebProcess IPC async with a reply and take a process assertion on behalf of the WebContent process until we get a response back. This avoids sending an extra WebProcess::MainThreadPing IPC to the WebProcess for no reason (since we're already sending the WebProcess::InitializeWebProcess IPC) and this is also more reliable since the ResponsivenessTimer can actually time out and cause the process to get suspended during initialization still. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2020-02-10 Kocsen Chung Cherry-pick r255658. rdar://problem/59299333 Unreviewed, fix the internal build after * UIProcess/ios/WKContentViewInteraction.h: Declare this helper in the header, now that it's consulted by some WebKitAdditions code. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255658 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-03 Wenson Hsieh Unreviewed, fix the internal build after * UIProcess/ios/WKContentViewInteraction.h: Declare this helper in the header, now that it's consulted by some WebKitAdditions code. 2020-02-10 Kocsen Chung Cherry-pick r255625. rdar://problem/59299317 Add a WebKitAdditions hook to override the behavior of -[WKContentView gestureRecognizer:shouldReceiveTouch:] https://bugs.webkit.org/show_bug.cgi?id=207162 Reviewed by Tim Horton. Allow an internal implementation of `-_allowGestureRecognizer:toReceiveTouch:` to prevent touches from being routed to certain gesture recognizers, if necessary. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255625 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-03 Wenson Hsieh Add a WebKitAdditions hook to override the behavior of -[WKContentView gestureRecognizer:shouldReceiveTouch:] https://bugs.webkit.org/show_bug.cgi?id=207162 Reviewed by Tim Horton. Allow an internal implementation of `-_allowGestureRecognizer:toReceiveTouch:` to prevent touches from being routed to certain gesture recognizers, if necessary. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): 2020-02-10 Kocsen Chung Cherry-pick r255610. rdar://problem/59298157 [WK2] Use per-UIProcess default cookie storage for Mac Catalyst apps https://bugs.webkit.org/show_bug.cgi?id=207139 Reviewed by Brent Fulgham. Use per-UIProcess default cookie storage for Mac Catalyst apps, similarly to what we do for regular macOS apps. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255610 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-03 Chris Dumez [WK2] Use per-UIProcess default cookie storage for Mac Catalyst apps https://bugs.webkit.org/show_bug.cgi?id=207139 Reviewed by Brent Fulgham. Use per-UIProcess default cookie storage for Mac Catalyst apps, similarly to what we do for regular macOS apps. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2020-02-10 Kocsen Chung Cherry-pick r255603. rdar://problem/59299321 [iOS 13] Dragging on-screen volume control on a YouTube video selects text around the panel https://bugs.webkit.org/show_bug.cgi?id=207140 Reviewed by Tim Horton. Source/WebKit: This bug occurs on iPadOS when long pressing the volume controls on the desktop version of YouTube, and then performing a pan gesture; this activates the highlight text selection gesture recognizer added in iOS 13, causing text to be selected while adjusting the volume using these custom controls. On macOS, we avoid this because `Node::canStartSelection()` returns `false`, due to a container node having both `user-drag: element` and `user-select: none`; in this scenario, we allow dragging to take precendence over text selection, so the volume slider can be moved using a mouse without simultaneously selecting text. This logic is currently absent on iOS, where UIKit text interaction gesture recognizers ask us for information about the DOM at given locations, and we determine whether to allow text interaction gestures (such as long pressing) to begin in `-textInteractionGesture:shouldBeginAtPoint:` and `-hasSelectablePositionAtPoint:`. Ideally, we'd want to eventually unify these two codepaths for triggering text selection (and preferably just have both go through EventHandler); in lieu of this, simply make the iOS codepath behave a little more like macOS by adding a bit to allow text interaction gestures to bail in the case where at least one container of the hit-tested element is both draggable and unselectable. Test: editing/selection/ios/prefer-drag-over-text-selection.html * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): Add the new bit to InteractionInformationAtPosition. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): Avoid beginning text selection if the bit is set. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::selectionPositionInformation): Move a comment about the ">= 97% of the document's visible area" heuristic next to the relevant code, and also leave a FIXME mentioning that we should reconsider whether this is really needed; it seems that this was originally intended to avoid ending up with an excessively large block selection, but block selection has been removed entirely since iOS 12. That said, this logic may still be helping avoid situations where the text selection is too aggressive on iOS and ends up selecting too much text. LayoutTests: Add a layout test to verify that we don't allow text selection gestures inside of containers that have both `user-drag: element` and `user-select: none`. * editing/selection/ios/prefer-drag-over-text-selection-expected.txt: Added. * editing/selection/ios/prefer-drag-over-text-selection.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255603 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-03 Wenson Hsieh [iOS 13] Dragging on-screen volume control on a YouTube video selects text around the panel https://bugs.webkit.org/show_bug.cgi?id=207140 Reviewed by Tim Horton. This bug occurs on iPadOS when long pressing the volume controls on the desktop version of YouTube, and then performing a pan gesture; this activates the highlight text selection gesture recognizer added in iOS 13, causing text to be selected while adjusting the volume using these custom controls. On macOS, we avoid this because `Node::canStartSelection()` returns `false`, due to a container node having both `user-drag: element` and `user-select: none`; in this scenario, we allow dragging to take precendence over text selection, so the volume slider can be moved using a mouse without simultaneously selecting text. This logic is currently absent on iOS, where UIKit text interaction gesture recognizers ask us for information about the DOM at given locations, and we determine whether to allow text interaction gestures (such as long pressing) to begin in `-textInteractionGesture:shouldBeginAtPoint:` and `-hasSelectablePositionAtPoint:`. Ideally, we'd want to eventually unify these two codepaths for triggering text selection (and preferably just have both go through EventHandler); in lieu of this, simply make the iOS codepath behave a little more like macOS by adding a bit to allow text interaction gestures to bail in the case where at least one container of the hit-tested element is both draggable and unselectable. Test: editing/selection/ios/prefer-drag-over-text-selection.html * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): Add the new bit to InteractionInformationAtPosition. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): Avoid beginning text selection if the bit is set. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::selectionPositionInformation): Move a comment about the ">= 97% of the document's visible area" heuristic next to the relevant code, and also leave a FIXME mentioning that we should reconsider whether this is really needed; it seems that this was originally intended to avoid ending up with an excessively large block selection, but block selection has been removed entirely since iOS 12. That said, this logic may still be helping avoid situations where the text selection is too aggressive on iOS and ends up selecting too much text. 2020-02-10 Kocsen Chung Cherry-pick r255581. rdar://problem/59298169 [macOS] AirPlay sometimes stops after 60 minutes of playback https://bugs.webkit.org/show_bug.cgi?id=207056 Source/WebCore: Reviewed by Jer Noble. No new tests, this only reproduces when playing to an AirPlay device. AVPlayerItem.tracks is empty during AirPlay. If AirPlay is activated immediately after the item is created, as is typically the case when switching from an MSE to a url based player, MediaPlayerPrivateAVFoundationObjC doesn't know if the AVPlayerItem has audio or video so the state reported to the WebMediaSessionManager is incorrect. AirPlay can't actually be active if an item doesn't have audio or video, so always claim to have both during AirPlay. Converted WebMediaSessionManager logging from debug-only to runtime to make it easier to diagnose problems in the future. * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::mediaProducerStateString): (WebCore::WebMediaSessionLogger::create): (WebCore::WebMediaSessionLogger::WebMediaSessionLogger): (WebCore::WebMediaSessionLogger::log const): (WebCore::WebMediaSessionManager::logger): (WebCore::WebMediaSessionManager::alwaysOnLoggingAllowed const): (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled): (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState): (WebCore::WebMediaSessionManager::mockMediaPlaybackTargetPickerDismissPopup): (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient): (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient): (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients): (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): (WebCore::WebMediaSessionManager::clientStateDidChange): (WebCore::WebMediaSessionManager::setPlaybackTarget): (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange): (WebCore::WebMediaSessionManager::playbackTargetPickerWasDismissed): (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring): (WebCore::WebMediaSessionManager::configureWatchdogTimer): (WebCore::WebMediaSessionManager::watchdogTimerFired): (WebCore::ClientState::logAlways const): Deleted. * Modules/mediasession/WebMediaSessionManager.h: * Modules/mediasession/WebMediaSessionManagerClient.h: (WebCore::WebMediaSessionManagerClient::alwaysOnLoggingAllowed): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaState const): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::hasVideo const): (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAudio const): Source/WebKit: Reviewed by Jer Noble. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255581 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-03 Eric Carlson [macOS] AirPlay sometimes stops after 60 minutes of playback https://bugs.webkit.org/show_bug.cgi?id=207056 Reviewed by Jer Noble. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: 2020-02-10 Kocsen Chung Cherry-pick r255527. rdar://problem/59299116 Unreviewed build fix after r255522. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): Switched to a C-style cast. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255527 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-31 Andy Estes Unreviewed build fix after r255522. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): Switched to a C-style cast. 2020-02-10 Kocsen Chung Cherry-pick r255522. rdar://problem/59299116 Add KVO SPI WKWebView._negotiatedLegacyTLS https://bugs.webkit.org/show_bug.cgi?id=207067 Patch by Alex Christensen on 2020-01-31 Reviewed by Andy Estes. Source/WebKit: Covered by API tests. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::negotiatedLegacyTLS const): * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::negotiatedLegacyTLS const): * NetworkProcess/NetworkLoad.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::negotiatedLegacyTLS const): * Shared/Authentication/AuthenticationManager.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _negotiatedLegacyTLS]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::willChangeNegotiatedLegacyTLS): (WebKit::NavigationState::didChangeNegotiatedLegacyTLS): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::negotiatedLegacyTLS): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::commitChanges): (WebKit::PageLoadState::hasNegotiatedLegacyTLS const): (WebKit::PageLoadState::negotiatedLegacyTLS): (WebKit::PageLoadState::didCommitLoad): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Observer::willChangeNegotiatedLegacyTLS): (WebKit::PageLoadState::Observer::didChangeNegotiatedLegacyTLS): (WebKit::PageLoadState::Data::Data): Deleted. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: Tools: * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm: (-[TLSObserver observeValueForKeyPath:ofObject:change:context:]): (-[TLSObserver waitUntilNegotiatedLegacyTLSChanged]): (TestWebKitAPI::TEST): * TestWebKitAPI/config.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255522 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-31 Alex Christensen Add KVO SPI WKWebView._negotiatedLegacyTLS https://bugs.webkit.org/show_bug.cgi?id=207067 Reviewed by Andy Estes. Covered by API tests. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::negotiatedLegacyTLS const): * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::negotiatedLegacyTLS const): * NetworkProcess/NetworkLoad.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::negotiatedLegacyTLS const): * Shared/Authentication/AuthenticationManager.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _negotiatedLegacyTLS]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::willChangeNegotiatedLegacyTLS): (WebKit::NavigationState::didChangeNegotiatedLegacyTLS): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::negotiatedLegacyTLS): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::commitChanges): (WebKit::PageLoadState::hasNegotiatedLegacyTLS const): (WebKit::PageLoadState::negotiatedLegacyTLS): (WebKit::PageLoadState::didCommitLoad): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Observer::willChangeNegotiatedLegacyTLS): (WebKit::PageLoadState::Observer::didChangeNegotiatedLegacyTLS): (WebKit::PageLoadState::Data::Data): Deleted. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: 2020-02-10 Kocsen Chung Cherry-pick r255438. rdar://problem/59299136 Disable Service Workers before terminating an unresponsive service worker process https://bugs.webkit.org/show_bug.cgi?id=206994 Reviewed by Chris Dumez. In case a process becomes unresponsive, we terminate it in case it is a service worker process. In that case, we should make sure not to call the service worker process crash callback. To do so, disable service workers before terminating the IPC connection. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didBecomeUnresponsive): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255438 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-30 youenn fablet Disable Service Workers before terminating an unresponsive service worker process https://bugs.webkit.org/show_bug.cgi?id=206994 Reviewed by Chris Dumez. In case a process becomes unresponsive, we terminate it in case it is a service worker process. In that case, we should make sure not to call the service worker process crash callback. To do so, disable service workers before terminating the IPC connection. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didBecomeUnresponsive): 2020-02-10 Kocsen Chung Cherry-pick r255875. rdar://problem/59298172 Regression(r248734) StorageAreaMap objects are getting leaked https://bugs.webkit.org/show_bug.cgi?id=207073 Reviewed by Darin Adler. Source/WebCore: Add test infrastructure for testing this change. Test: http/tests/storage/storage-map-leaking.html * storage/StorageNamespace.h: (WebCore::StorageNamespace::storageAreaMapCountForTesting const): * storage/StorageNamespaceProvider.h: * testing/Internals.cpp: (WebCore::Internals::storageAreaMapCount const): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: Make sure that StorageAreaMap objects are getting removed from the HashMap in StorageNamespaceImpl, once they no longer have any users. * WebProcess/WebStorage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::~StorageAreaImpl): * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::incrementUseCount): (WebKit::StorageAreaMap::decrementUseCount): * WebProcess/WebStorage/StorageAreaMap.h: * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::destroyStorageAreaMap): (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap): Deleted. * WebProcess/WebStorage/StorageNamespaceImpl.h: (WebKit::StorageNamespaceImpl::storageType const): Deleted. (WebKit::StorageNamespaceImpl::storageNamespaceID const): Deleted. (WebKit::StorageNamespaceImpl::topLevelOrigin const): Deleted. (WebKit::StorageNamespaceImpl::quotaInBytes const): Deleted. LayoutTests: Add layout test coverage. * TestExpectations: * http/tests/storage/resources/storage-map-leaking-iframe.html: Added. * http/tests/storage/storage-map-leaking-expected.txt: Added. * http/tests/storage/storage-map-leaking.html: Added. * platform/wk2/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255875 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-02-05 Chris Dumez Regression(r248734) StorageAreaMap objects are getting leaked https://bugs.webkit.org/show_bug.cgi?id=207073 Reviewed by Darin Adler. Make sure that StorageAreaMap objects are getting removed from the HashMap in StorageNamespaceImpl, once they no longer have any users. * WebProcess/WebStorage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::~StorageAreaImpl): * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::incrementUseCount): (WebKit::StorageAreaMap::decrementUseCount): * WebProcess/WebStorage/StorageAreaMap.h: * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::destroyStorageAreaMap): (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap): Deleted. * WebProcess/WebStorage/StorageNamespaceImpl.h: (WebKit::StorageNamespaceImpl::storageType const): Deleted. (WebKit::StorageNamespaceImpl::storageNamespaceID const): Deleted. (WebKit::StorageNamespaceImpl::topLevelOrigin const): Deleted. (WebKit::StorageNamespaceImpl::quotaInBytes const): Deleted. 2020-02-05 Russell Epstein Cherry-pick r254873. rdar://problem/59161343 Revert suppressesConnectionTerminationOnSystemChange part of r254081 https://bugs.webkit.org/show_bug.cgi?id=205751 There was an API client that still hadn't migrated to the replacement SPI. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254873 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-21 Alex Christensen Revert suppressesConnectionTerminationOnSystemChange part of r254081 https://bugs.webkit.org/show_bug.cgi?id=205751 There was an API client that still hadn't migrated to the replacement SPI. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2020-02-05 Russell Epstein Cherry-pick r254081. rdar://problem/59161343 Remove _WKProcessPoolConfiguration.CTDataConnectionServiceType and suppressesConnectionTerminationOnSystemChange https://bugs.webkit.org/show_bug.cgi?id=205751 Patch by Alex Christensen on 2020-01-06 Reviewed by Darin Adler. Their replacements on _WKWebViewConfiguration have been adopted. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): Deleted. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::dataConnectionServiceType const): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::globalCTDataConnectionServiceType): Deleted. (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType): Deleted. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): Deleted. (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): Deleted. (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]): Deleted. (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]): Deleted. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254081 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-06 Alex Christensen Remove _WKProcessPoolConfiguration.CTDataConnectionServiceType and suppressesConnectionTerminationOnSystemChange https://bugs.webkit.org/show_bug.cgi?id=205751 Reviewed by Darin Adler. Their replacements on _WKWebViewConfiguration have been adopted. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): Deleted. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::dataConnectionServiceType const): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::globalCTDataConnectionServiceType): Deleted. (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType): Deleted. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): Deleted. (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): Deleted. (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]): Deleted. (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]): Deleted. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): 2020-02-05 Brent Fulgham Correct branch sandboxes. rdar://problem/59098315 * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-02-04 Russell Epstein Cherry-pick r255189. rdar://problem/58943054 Unreviewed, revert r253984 as it appears to be causing assertion leaks. https://bugs.webkit.org/show_bug.cgi?id=205687 Source/WebKit: * Configurations/WebKit.xcconfig: * Platform/spi/ios/RunningBoardServicesSPI.h: Removed. * Scripts/process-entitlements.sh: * Shared/DependencyProcessAssertion.cpp: Removed. * Shared/DependencyProcessAssertion.h: Removed. * Shared/NativeWebTouchEvent.h: * Shared/ios/DependencyProcessAssertionIOS.mm: Removed. * Sources.txt: * SourcesCocoa.txt: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::processWasResumed): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): (WebKit::WebProcess::releaseProcessWasResumedAssertions): WebKitLibraries: * WebKitPrivateFrameworkStubs/iOS/13/RunningBoardServices.framework/RunningBoardServices.tbd: Removed. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255189 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-27 Chris Dumez Unreviewed, revert r253984 as it appears to be causing assertion leaks. https://bugs.webkit.org/show_bug.cgi?id=205687 * Configurations/WebKit.xcconfig: * Platform/spi/ios/RunningBoardServicesSPI.h: Removed. * Scripts/process-entitlements.sh: * Shared/DependencyProcessAssertion.cpp: Removed. * Shared/DependencyProcessAssertion.h: Removed. * Shared/NativeWebTouchEvent.h: * Shared/ios/DependencyProcessAssertionIOS.mm: Removed. * Sources.txt: * SourcesCocoa.txt: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::processWasResumed): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): (WebKit::WebProcess::releaseProcessWasResumedAssertions): 2020-02-04 Russell Epstein Cherry-pick r255428. rdar://problem/59097797 [iOS] Remove report rule for 'com.apple.runningboard' from the Network and GPU process sandboxes https://bugs.webkit.org/show_bug.cgi?id=206980 Reviewed by Maciej Stachowiak. Remove the logging now that we have useful backtraces. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255428 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-30 Brent Fulgham [iOS] Remove report rule for 'com.apple.runningboard' from the Network and GPU process sandboxes https://bugs.webkit.org/show_bug.cgi?id=206980 Reviewed by Maciej Stachowiak. Remove the logging now that we have useful backtraces. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2020-02-04 Russell Epstein Cherry-pick r255461. rdar://problem/59153618 Add WKNavigationDelegate SPI to disable TLS 1.0 and 1.1 https://bugs.webkit.org/show_bug.cgi?id=206979 Reviewed by Brady Eidson. Source/WebCore/PAL: * pal/spi/cf/CFNetworkSPI.h: Source/WebKit: * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveChallenge): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveChallenge): * NetworkProcess/PingLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::didReceiveChallenge): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (processServerTrustEvaluation): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Shared/Authentication/AuthenticationManager.h: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::shouldAllowLegacyTLS): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::systemAllowsLegacyTLSFor): (WebKit::NavigationState::NavigationClient::shouldAllowLegacyTLS): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Tools: * MiniBrowser/mac/SettingsController.m: * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm: (-[TLSNavigationDelegate waitForDidFinishNavigation]): (-[TLSNavigationDelegate waitForDidFailProvisionalNavigation]): (-[TLSNavigationDelegate receivedShouldAllowLegacyTLS]): (-[TLSNavigationDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]): (-[TLSNavigationDelegate webView:didFinishNavigation:]): (-[TLSNavigationDelegate webView:didFailProvisionalNavigation:withError:]): (-[TLSNavigationDelegate _webView:authenticationChallenge:shouldAllowLegacyTLS:]): (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255461 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-30 Alex Christensen Add WKNavigationDelegate SPI to disable TLS 1.0 and 1.1 https://bugs.webkit.org/show_bug.cgi?id=206979 Reviewed by Brady Eidson. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveChallenge): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveChallenge): * NetworkProcess/PingLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::didReceiveChallenge): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (processServerTrustEvaluation): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Shared/Authentication/AuthenticationManager.h: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::shouldAllowLegacyTLS): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::systemAllowsLegacyTLSFor): (WebKit::NavigationState::NavigationClient::shouldAllowLegacyTLS): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: 2020-02-04 Russell Epstein Cherry-pick r255533. rdar://problem/59098565 REGRESSION(r252185): NetworkSessionCocoa cancels downloads that receive authentication challenges https://bugs.webkit.org/show_bug.cgi?id=206984 rdar://problem/58999654 Reviewed by Brady Eidson. Source/WebKit: r252185 changed the early return in WKNetworkSessionDelegate's -...task:didReceiveChallenge:... method from "cancel the task and return early if self has no _session" to "cancel the task and return early if we can't determine the network session for the given data task". When this method is called for an NSURLSessionDownloadTask, this early return is hit because there is no NetworkDataTaskCocoa for an active download. As a result, the download is canceled when it might have otherwise been able to proceed. Fix this by adding a code path to fetch the NetworkSession associated with the Download when an NSURLSessionDownloadTask receives an authentication challenge. This ensures we can actually handle the challenge appropriately and not just cancel the task. * NetworkProcess/Downloads/Download.h: (WebKit::Download::sessionID const): Expose the session ID so we can use it to look up the NetworkSession for a Download. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): Remove an unnecessary redeclaration of networkDataTask, and also an unneeded assertion that networkDataTask != nullptr. Even if this is the case, the code that eventually handles this task will null check it and handle the challenge as a websocket task or download task based on the taskIdentifier. Tools: Add an API test for a resumed download that receives an authentication challenge. The download delegate should be asked to handle the challenge, and the download should be able to finish. * TestWebKitAPI/Tests/WebKitCocoa/Download.mm: (-[DownloadCancelingDelegate _download:decideDestinationWithSuggestedFilename:completionHandler:]): (-[DownloadCancelingDelegate _download:didReceiveData:]): (-[DownloadCancelingDelegate _downloadDidCancel:]): (-[AuthenticationChallengeHandlingDelegate _download:didReceiveAuthenticationChallenge:completionHandler:]): (-[AuthenticationChallengeHandlingDelegate _downloadDidFinish:]): (TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255533 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-31 David Quesada REGRESSION(r252185): NetworkSessionCocoa cancels downloads that receive authentication challenges https://bugs.webkit.org/show_bug.cgi?id=206984 rdar://problem/58999654 Reviewed by Brady Eidson. r252185 changed the early return in WKNetworkSessionDelegate's -...task:didReceiveChallenge:... method from "cancel the task and return early if self has no _session" to "cancel the task and return early if we can't determine the network session for the given data task". When this method is called for an NSURLSessionDownloadTask, this early return is hit because there is no NetworkDataTaskCocoa for an active download. As a result, the download is canceled when it might have otherwise been able to proceed. Fix this by adding a code path to fetch the NetworkSession associated with the Download when an NSURLSessionDownloadTask receives an authentication challenge. This ensures we can actually handle the challenge appropriately and not just cancel the task. * NetworkProcess/Downloads/Download.h: (WebKit::Download::sessionID const): Expose the session ID so we can use it to look up the NetworkSession for a Download. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): Remove an unnecessary redeclaration of networkDataTask, and also an unneeded assertion that networkDataTask != nullptr. Even if this is the case, the code that eventually handles this task will null check it and handle the challenge as a websocket task or download task based on the taskIdentifier. 2020-02-04 Russell Epstein Cherry-pick r255507. rdar://problem/59098088 REGRESSION: [ iPadOS ] imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html always fails Reviewed by Brent Fulgham. Source/WebKit: Test: imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html * Platform/spi/ios/UIKitSPI.h: (-[UIViewController isPerformingModalTransition]): Add SPI declaration. Tools: * WebKitTestRunner/ios/UIScriptControllerIOS.h: (WTR::UIScriptControllerIOS::waitForModalTransitionToFinish const): - Add declaration. * WebKitTestRunner/ios/UIScriptControllerIOS.mm: (WTR::UIScriptControllerIOS::waitForModalTransitionToFinish const): - Implement by waiting for -[UIViewController isPerformingModalTransition] to return NO while spinning the runloop. (WTR::UIScriptControllerIOS::singleTapAtPointWithModifiers): - Call waitForModalTransitionToFinish() to fix the test. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255507 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-31 David Kilzer REGRESSION: [ iPadOS ] imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html always fails Reviewed by Brent Fulgham. Test: imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html * Platform/spi/ios/UIKitSPI.h: (-[UIViewController isPerformingModalTransition]): Add SPI declaration. 2020-02-04 Russell Epstein Cherry-pick r255415. rdar://problem/59098091 REGRESSION (r255322): macCatalyst: Tapping in an input field doesn't change the selection location https://bugs.webkit.org/show_bug.cgi?id=206978 Reviewed by Wenson Hsieh. Source/WebCore: * page/ChromeClient.h: (WebCore::ChromeClient::shouldUseMouseEventForSelection): (WebCore::ChromeClient::shouldUseMouseEventsForSelection): Deleted. * page/EventHandler.cpp: (WebCore::EventHandler::canMouseDownStartSelect): (WebCore::EventHandler::handleMousePressEvent): * page/EventHandler.h: Plumb the event through to the ChromeClient so it can use it to make decisions. Source/WebKit: * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::shouldUseMouseEventForSelection): (WebKit::WebChromeClient::shouldUseMouseEventsForSelection): Deleted. Allow single-click events to change the selection; this is required in order to allow WebCore to set the selection in the case that the UITextInteraction gestures haven't yet been installed. Continue to not allow multi-click events to change the selection, because these are the ones that conflict with UIKit's behaviors. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255415 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-29 Tim Horton REGRESSION (r255322): macCatalyst: Tapping in an input field doesn't change the selection location https://bugs.webkit.org/show_bug.cgi?id=206978 Reviewed by Wenson Hsieh. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::shouldUseMouseEventForSelection): (WebKit::WebChromeClient::shouldUseMouseEventsForSelection): Deleted. Allow single-click events to change the selection; this is required in order to allow WebCore to set the selection in the case that the UITextInteraction gestures haven't yet been installed. Continue to not allow multi-click events to change the selection, because these are the ones that conflict with UIKit's behaviors. 2020-02-04 Russell Epstein Cherry-pick r255322. rdar://problem/59097817 macCatalyst: Triple clicking to select a sentence results in an empty selection https://bugs.webkit.org/show_bug.cgi?id=206863 Reviewed by Wenson Hsieh. Source/WebCore: * editing/EditingBehavior.h: (WebCore::EditingBehavior::shouldSelectOnContextualMenuClick const): * page/ChromeClient.h: (WebCore::ChromeClient::shouldUseMouseEventsForSelection): * page/EventHandler.cpp: (WebCore::EventHandler::canMouseDownStartSelect): (WebCore::canMouseDownStartSelect): Deleted. * page/EventHandler.h: Disable WebCore's mouse-event-driven selection mechanisms on macCatalyst, where we use a UITextInteraction-driven selection instead. Otherwise, they conflict with each other in a chaotic fashion. Source/WebKit: * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): * UIProcess/API/mac/WKWebViewPrivateForTestingMac.h: * UIProcess/API/mac/WKWebViewTestingMac.mm: (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::handleProcessSwapOrExit): (WebKit::WebViewImpl::doAfterProcessingAllPendingMouseEvents): Deleted. (WebKit::WebViewImpl::didFinishProcessingAllPendingMouseEvents): Deleted. (WebKit::WebViewImpl::flushPendingMouseEventCallbacks): Deleted. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::doAfterProcessingAllPendingMouseEvents): (WebKit::WebPageProxy::didFinishProcessingAllPendingMouseEvents): (WebKit::WebPageProxy::flushPendingMouseEventCallbacks): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::didFinishProcessingAllPendingMouseEvents): Deleted. Move "doAfterProcessingAllPendingMouseEvents" to WebPage instead of WebViewImpl, so it can be used on all platforms. Expose it via WKWebView. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::shouldUseMouseEventsForSelection): Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKitCocoa/MacCatalystMouseSupport.mm: Added. (-[WKTestingEvent locationInView:]): (-[WKTestingEvent _setButtonMask:]): (-[WKTestingEvent _buttonMask]): (-[WKTestingTouch locationInView:]): (-[WKTestingTouch setTapCount:]): (-[WKTestingTouch tapCount]): (mouseGesture): (TEST): Add a test ensuring that simply plumbing mouse events to WebCore does not result in a selection change in macCatalyst (because UIKit will handle the selection change itself, instead). git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255322 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-28 Tim Horton macCatalyst: Triple clicking to select a sentence results in an empty selection https://bugs.webkit.org/show_bug.cgi?id=206863 Reviewed by Wenson Hsieh. * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): * UIProcess/API/mac/WKWebViewPrivateForTestingMac.h: * UIProcess/API/mac/WKWebViewTestingMac.mm: (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::handleProcessSwapOrExit): (WebKit::WebViewImpl::doAfterProcessingAllPendingMouseEvents): Deleted. (WebKit::WebViewImpl::didFinishProcessingAllPendingMouseEvents): Deleted. (WebKit::WebViewImpl::flushPendingMouseEventCallbacks): Deleted. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::doAfterProcessingAllPendingMouseEvents): (WebKit::WebPageProxy::didFinishProcessingAllPendingMouseEvents): (WebKit::WebPageProxy::flushPendingMouseEventCallbacks): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::didFinishProcessingAllPendingMouseEvents): Deleted. Move "doAfterProcessingAllPendingMouseEvents" to WebPage instead of WebViewImpl, so it can be used on all platforms. Expose it via WKWebView. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::shouldUseMouseEventsForSelection): 2020-02-04 Russell Epstein Cherry-pick r255234. rdar://problem/59098321 [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled https://bugs.webkit.org/show_bug.cgi?id=206173 Reviewed by Dean Jackson. Source/WebCore: Make the timeline property of Animation read-write only if the new WebAnimationsMutableTimelines runtime flag is enabled. * animation/WebAnimation.idl: Make the "timeline" property conditionally read-write if WebAnimationsMutableTimelines is enabled. * bindings/js/WebCoreBuiltinNames.h: With the new RuntimeConditionallyReadWrite property used in WebAnimation.idl, it is necessary to declare the name of the affected property, in this case "timeline", in WebCoreBuiltinNames. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebAnimationsMutableTimelinesEnabled): (WebCore::RuntimeEnabledFeatures::webAnimationsMutableTimelinesEnabled const): Source/WebKit: Add a new WebAnimationsMutableTimelines runtime flag. * Shared/WebPreferences.yaml: Source/WebKitLegacy/mac: Add a new WebAnimationsMutableTimelines runtime flag. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (-[WebPreferences webAnimationsMutableTimelinesEnabled]): (-[WebPreferences setWebAnimationsMutableTimelinesEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Source/WebKitLegacy/win: Add a new WebAnimationsMutableTimelines runtime flag. * Interfaces/IWebPreferencesPrivate.idl: * WebPreferenceKeysPrivate.h: * WebPreferences.cpp: (WebPreferences::initializeDefaultSettings): (WebPreferences::setWebAnimationsMutableTimelinesEnabled): (WebPreferences::webAnimationsMutableTimelinesEnabled): * WebPreferences.h: * WebView.cpp: (WebView::notifyPreferencesChanged): Tools: Manually enable the new WebAnimationsMutableTimelines runtime flag in DumpRenderTree. * DumpRenderTree/mac/DumpRenderTree.mm: (enableExperimentalFeatures): * DumpRenderTree/win/DumpRenderTree.cpp: (enableExperimentalFeatures): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255234 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-27 Antoine Quint [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled https://bugs.webkit.org/show_bug.cgi?id=206173 Reviewed by Dean Jackson. Add a new WebAnimationsMutableTimelines runtime flag. * Shared/WebPreferences.yaml: 2020-02-03 Russell Epstein Cherry-pick r255375. rdar://problem/59097770 Crash under com.apple.WebKit.Networking at WebKit: WebKit::WebIDBServer::suspend https://bugs.webkit.org/show_bug.cgi?id=206904 Reviewed by Maciej Stachowiak. Wait until m_server is set in constructor of WebIDBServer to make sure m_server can be accessed in WebIDBServer::suspend. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::WebIDBServer): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255375 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-29 Sihui Liu Crash under com.apple.WebKit.Networking at WebKit: WebKit::WebIDBServer::suspend https://bugs.webkit.org/show_bug.cgi?id=206904 Reviewed by Maciej Stachowiak. Wait until m_server is set in constructor of WebIDBServer to make sure m_server can be accessed in WebIDBServer::suspend. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::WebIDBServer): 2020-02-03 Russell Epstein Cherry-pick r255054. rdar://problem/58942727 [iOS] Support setting minimum effective device width during dynamic viewport size updates https://bugs.webkit.org/show_bug.cgi?id=206709 Reviewed by Tim Horton. Source/WebKit: Changes to minimum effective device width are currently always propagated to the web process via out-of-band updates to the web process. During animated resize, Safari currently changes the minimum effective device width prior to updating the view size; this causes the viewport configuration to temporarily be in a state where the new value for minimum effective device width is used, but the old viewport width and height are still used. This subsequently breaks existing logic in WebPage::dynamicViewportSizeUpdate that attempts to keep the portion of the unobscured content width that is visible consistent before and after rotation (see visibleHorizontalFraction), since that code will be mislead into believing that the wrong fraction of content width is visible. To fix this, we roll minimum effective device width changes along with view size (and other attributes) in dynamic viewport size updates. Test: WebKit.ChangeFrameAndMinimumEffectiveDeviceWidthDuringAnimatedResize * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setViewScale:]): (-[WKWebView _setMinimumEffectiveDeviceWidth:]): During animated resize, just set m_minimumEffectiveDeviceWidth without notifying the web process; if the value changed during the update block, we send the new minimum effective device width to the web page as a part of the dynamic viewport size update. Also, make a drive-by adjustment to use `_page->viewLayoutSize()` instead of recomputing the active layout bounds when we know that only the minimum effective device width is changing. We also apply the same adjustment above, in -_setViewScale:. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::viewLayoutSize const): (WebKit::WebPageProxy::setMinimumEffectiveDeviceWidthWithoutViewportConfigurationUpdate): Add a helper method to update the minimum effective device width without updating the viewport configuration in the web process. This is only used when the minimum effective device width is specified in the middle of a dynamic viewport size update (i.e. animated resize). * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): Plumb the new minimum effective device width over to the web process as a part of the dynamic viewport size update, and update both the new view size and minimum effective device width on the viewport configuration at the same time. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): Tools: Adds a new API test that changes both the effective minimum device width and view size during animated resize. * TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255054 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-23 Wenson Hsieh [iOS] Support setting minimum effective device width during dynamic viewport size updates https://bugs.webkit.org/show_bug.cgi?id=206709 Reviewed by Tim Horton. Changes to minimum effective device width are currently always propagated to the web process via out-of-band updates to the web process. During animated resize, Safari currently changes the minimum effective device width prior to updating the view size; this causes the viewport configuration to temporarily be in a state where the new value for minimum effective device width is used, but the old viewport width and height are still used. This subsequently breaks existing logic in WebPage::dynamicViewportSizeUpdate that attempts to keep the portion of the unobscured content width that is visible consistent before and after rotation (see visibleHorizontalFraction), since that code will be mislead into believing that the wrong fraction of content width is visible. To fix this, we roll minimum effective device width changes along with view size (and other attributes) in dynamic viewport size updates. Test: WebKit.ChangeFrameAndMinimumEffectiveDeviceWidthDuringAnimatedResize * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setViewScale:]): (-[WKWebView _setMinimumEffectiveDeviceWidth:]): During animated resize, just set m_minimumEffectiveDeviceWidth without notifying the web process; if the value changed during the update block, we send the new minimum effective device width to the web page as a part of the dynamic viewport size update. Also, make a drive-by adjustment to use `_page->viewLayoutSize()` instead of recomputing the active layout bounds when we know that only the minimum effective device width is changing. We also apply the same adjustment above, in -_setViewScale:. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::viewLayoutSize const): (WebKit::WebPageProxy::setMinimumEffectiveDeviceWidthWithoutViewportConfigurationUpdate): Add a helper method to update the minimum effective device width without updating the viewport configuration in the web process. This is only used when the minimum effective device width is specified in the middle of a dynamic viewport size update (i.e. animated resize). * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): Plumb the new minimum effective device width over to the web process as a part of the dynamic viewport size update, and update both the new view size and minimum effective device width on the viewport configuration at the same time. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2020-02-03 Russell Epstein Cherry-pick r255532. rdar://problem/59098561 Add support for specifying background colors when setting marked text https://bugs.webkit.org/show_bug.cgi?id=207065 Reviewed by Tim Horton. Source/WebCore: Add support for rendering custom highlights (background colors) behind marked text in WebCore. To do this, we plumb a Vector of CompositionHighlights alongside the Vector of CompositionUnderlines to Editor. At paint time, we then consult this highlight data to determine which ranges of text in the composition should paint using custom background colors. Note that in the future, we should consider refactoring both composition underlines and highlights to use the MarkedText mechanism for decorating ranges of text instead. Test: editing/input/composition-highlights.html * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * editing/CompositionHighlight.h: Added. (WebCore::CompositionHighlight::CompositionHighlight): (WebCore::CompositionHighlight::encode const): (WebCore::CompositionHighlight::decode): Add CompositionHighlight, which represents a range in the composition that should be highlighted with a given background color. * editing/Editor.cpp: (WebCore::Editor::clear): (WebCore::Editor::setComposition): Add logic for clearing and updating m_customCompositionHighlights. * editing/Editor.h: (WebCore::Editor::compositionUsesCustomHighlights const): (WebCore::Editor::customCompositionHighlights const): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintCompositionBackground): If custom composition highlights are given, use those when painting the composition background; otherwise, default to painting the entire composition range using `Color::compositionFill`. Source/WebCore/PAL: Add an SPI soft-linking declaration for NSMarkedClauseSegmentAttributeName. * pal/spi/cocoa/NSAttributedStringSPI.h: Source/WebKit: Implement -setAttributedMarkedText:selectedRange: on WKContentView, and have it extract highlight color information from the given attributed string. Plumb this through to the web process by serializing and deserializing `WebCore::CompositionHighlight`s. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setMarkedText): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (compositionHighlights): For each marked text clause, grab the specified background color (defaulting to Color::compositionFill) and use it to create a list of CompositionHighlights. (-[WKContentView setAttributedMarkedText:selectedRange:]): (-[WKContentView setMarkedText:selectedRange:]): (-[WKContentView _setMarkedText:highlights:selectedRange:]): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetComposition): Add testing support for specifying highlight ranges when setting marked text. * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: * WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp: (WebKit::WebEditorClient::didDispatchInputMethodKeydown): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setCompositionForTesting): (WebKit::WebPage::setCompositionAsync): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Source/WebKitLegacy/mac: Adjust some call sites of Editor::setComposition(). * WebView/WebFrame.mm: (-[WebFrame setMarkedText:selectedRange:]): (-[WebFrame setMarkedText:forCandidates:]): * WebView/WebHTMLView.mm: (-[WebHTMLView setMarkedText:selectedRange:]): Source/WebKitLegacy/win: Adjust some call sites of Editor::setComposition(). * WebView.cpp: (WebView::onIMEComposition): (WebView::setCompositionForTesting): Tools: Add support in WebKitTestRunner for specifying a list of highlight ranges when setting marked text. This comes in the form of an additional argument to TextInputController::setMarkedText, which contains an array of objects, each describing one range (in the composition) to highlight. * DumpRenderTree/ios/TextInputControllerIOS.m: (+[TextInputController isSelectorExcludedFromWebScript:]): (+[TextInputController webScriptNameForSelector:]): (-[TextInputController setMarkedText:selectedFrom:length:suppressUnderline:highlights:]): (-[TextInputController setMarkedText:selectedFrom:length:suppressUnderline:]): Deleted. * DumpRenderTree/mac/TextInputControllerMac.m: (+[TextInputController isSelectorExcludedFromWebScript:]): (+[TextInputController webScriptNameForSelector:]): (-[TextInputController setMarkedText:selectedFrom:length:suppressUnderline:highlights:]): (-[TextInputController setMarkedText:selectedFrom:length:suppressUnderline:]): Deleted. * WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl: * WebKitTestRunner/InjectedBundle/TextInputController.cpp: (WTR::arrayLength): (WTR::createCompositionHighlightData): Add logic to convert a given JSObject containing the composition highlight information into a WKArrayRef, which is then passed into WebKit via WKBundlePageSetComposition. (WTR::TextInputController::setMarkedText): * WebKitTestRunner/InjectedBundle/TextInputController.h: LayoutTests: Add a test to check that highlighting different parts of a composition range results in the same behavior as applying background colors using CSS. This test is currently only supported in WebKit2. * TestExpectations: * editing/input/composition-highlights-expected.html: Added. * editing/input/composition-highlights.html: Added. * platform/wk2/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255532 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-31 Wenson Hsieh Add support for specifying background colors when setting marked text https://bugs.webkit.org/show_bug.cgi?id=207065 Reviewed by Tim Horton. Implement -setAttributedMarkedText:selectedRange: on WKContentView, and have it extract highlight color information from the given attributed string. Plumb this through to the web process by serializing and deserializing `WebCore::CompositionHighlight`s. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setMarkedText): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (compositionHighlights): For each marked text clause, grab the specified background color (defaulting to Color::compositionFill) and use it to create a list of CompositionHighlights. (-[WKContentView setAttributedMarkedText:selectedRange:]): (-[WKContentView setMarkedText:selectedRange:]): (-[WKContentView _setMarkedText:highlights:selectedRange:]): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetComposition): Add testing support for specifying highlight ranges when setting marked text. * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: * WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp: (WebKit::WebEditorClient::didDispatchInputMethodKeydown): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setCompositionForTesting): (WebKit::WebPage::setCompositionAsync): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2020-02-03 Russell Epstein Cherry-pick r255503. rdar://problem/59097793 REGRESSION (r251511): [iOS] HDR Playback broken https://bugs.webkit.org/show_bug.cgi?id=207052 Reviewed by Maciej Stachowiak. I missed an XPC service in Bug 203318 when I stopped importing the 'common.sb' sandbox. This broke some aspects of HDR playback for certain clients. This patch returns the XPC service, and unblocks access to a network preference file that AVFoundation needs to read to support some media playback features. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255503 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-31 Brent Fulgham REGRESSION (r251511): [iOS] HDR Playback broken https://bugs.webkit.org/show_bug.cgi?id=207052 Reviewed by Maciej Stachowiak. I missed an XPC service in Bug 203318 when I stopped importing the 'common.sb' sandbox. This broke some aspects of HDR playback for certain clients. This patch returns the XPC service, and unblocks access to a network preference file that AVFoundation needs to read to support some media playback features. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-02-03 Russell Epstein Cherry-pick r255466. rdar://problem/59097777 Unreviewed, another speculative test fix after r255041 Source/WebKit: * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::getAttestation const): Adds kSecAttrAccessible: kSecAttrAccessibleAfterFirstUnlock to secItem to bypass potential error due to screen locks. Tools: * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::TestController::addTestKeyToKeychain): Adds kSecAttrAccessible: kSecAttrAccessibleAfterFirstUnlock to secItem to bypass potential error due to screen locks. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255466 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-30 Jiewen Tan Unreviewed, another speculative test fix after r255041 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::getAttestation const): Adds kSecAttrAccessible: kSecAttrAccessibleAfterFirstUnlock to secItem to bypass potential error due to screen locks. 2020-02-03 Russell Epstein Cherry-pick r255458. rdar://problem/59097790 Can still get stuck after swipe backwards with a slow server, even after r254552 https://bugs.webkit.org/show_bug.cgi?id=207017 Reviewed by Chris Dumez. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::unfreezeLayerTreeDueToSwipeAnimation): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: There's a second case where you can get stuck with the "swipe gesture" layer tree freeze reason in the web process: when doing a cross-origin navigation where the load takes more than 3 seconds (the swipe snapshot timeout) to commit, the provisional page will have mirrored the original page's frozen state upon creation, but will not ever receive the unfreeze, because it is sent while still provisional. To fix this, just forward the unfreeze message to the provisional page. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255458 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-30 Tim Horton Can still get stuck after swipe backwards with a slow server, even after r254552 https://bugs.webkit.org/show_bug.cgi?id=207017 Reviewed by Chris Dumez. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::unfreezeLayerTreeDueToSwipeAnimation): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: There's a second case where you can get stuck with the "swipe gesture" layer tree freeze reason in the web process: when doing a cross-origin navigation where the load takes more than 3 seconds (the swipe snapshot timeout) to commit, the provisional page will have mirrored the original page's frozen state upon creation, but will not ever receive the unfreeze, because it is sent while still provisional. To fix this, just forward the unfreeze message to the provisional page. 2020-02-03 Russell Epstein Cherry-pick r255385. rdar://problem/59097758 [iPadOS] Select popovers on amazon.com sometimes dismiss immediately after appearing https://bugs.webkit.org/show_bug.cgi?id=206948 Reviewed by Tim Horton. Source/WebKit: Amazon adds active touchstart event listeners to their select elements, where they call preventDefault() and programmatically focus the select element. Doing so prevents clicks from being dispatched by allowing the web touch event gesture to recognize instead of the synthetic click gesture, which (inside -_singleTapRecognized:) would otherwise dismiss any currently presented popover. After making touchstart events dispatch asynchronously, preventing touchstart no longer causes other native gestures (such as the synthetic click gesture) to fail in the case where there is a sync touchmove or touchend event listener, and the touch gesture has ended before the touchstart handler has finished executing and told the UI process whether or not the touch was handled. This is because the touchend or touchmove is dispatched synchronously while the touchstart is still being processed; while the web page sees the correct order of events, the UI process will end up learning that the synchronous touch was handled before the response to the asynchronously dispatched touchstart event has arrived. Our current logic in the sync touch event dispatch case then unconditionally ends gesture deferral by calling `doneDeferringNativeGestures` with `handled` equal to whether or not the touch event (a "touchend", in this case) had been handled. However, in the case where touchstart event is prevented but the touchend event is not, this will cause us to prematurely stop deferring gestures even though the page called `preventDefault()` in the touchstart event handler, and allow the synthetic click gesture to recognize when it shouldn't. To fix this, keep deferring native gestures after handling a sync touch in the case where a touchstart event is still being handled; instead, remember whether the touch event was handled using a new member variable (`m_handledSynchronousTouchEventWhileDispatchingPreventableTouchStart`), and consult this when the response to the touchstart has been received in the UI process to determine whether platform gestures should be allowed to recognize. This variable is reset once we're done handling the touchstart. Test: fast/events/touch/ios/prevent-default-with-slow-touchstart-handler.html * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handlePreventableTouchEvent): * UIProcess/WebPageProxy.h: LayoutTests: Adds a new layout test to verify that preventing default on elements with slow, active touchstart event handlers actually prevents click events from being dispatched. * fast/events/touch/ios/prevent-default-with-slow-touchstart-handler-expected.txt: Added. * fast/events/touch/ios/prevent-default-with-slow-touchstart-handler.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255385 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-29 Wenson Hsieh [iPadOS] Select popovers on amazon.com sometimes dismiss immediately after appearing https://bugs.webkit.org/show_bug.cgi?id=206948 Reviewed by Tim Horton. Amazon adds active touchstart event listeners to their select elements, where they call preventDefault() and programmatically focus the select element. Doing so prevents clicks from being dispatched by allowing the web touch event gesture to recognize instead of the synthetic click gesture, which (inside -_singleTapRecognized:) would otherwise dismiss any currently presented popover. After making touchstart events dispatch asynchronously, preventing touchstart no longer causes other native gestures (such as the synthetic click gesture) to fail in the case where there is a sync touchmove or touchend event listener, and the touch gesture has ended before the touchstart handler has finished executing and told the UI process whether or not the touch was handled. This is because the touchend or touchmove is dispatched synchronously while the touchstart is still being processed; while the web page sees the correct order of events, the UI process will end up learning that the synchronous touch was handled before the response to the asynchronously dispatched touchstart event has arrived. Our current logic in the sync touch event dispatch case then unconditionally ends gesture deferral by calling `doneDeferringNativeGestures` with `handled` equal to whether or not the touch event (a "touchend", in this case) had been handled. However, in the case where touchstart event is prevented but the touchend event is not, this will cause us to prematurely stop deferring gestures even though the page called `preventDefault()` in the touchstart event handler, and allow the synthetic click gesture to recognize when it shouldn't. To fix this, keep deferring native gestures after handling a sync touch in the case where a touchstart event is still being handled; instead, remember whether the touch event was handled using a new member variable (`m_handledSynchronousTouchEventWhileDispatchingPreventableTouchStart`), and consult this when the response to the touchstart has been received in the UI process to determine whether platform gestures should be allowed to recognize. This variable is reset once we're done handling the touchstart. Test: fast/events/touch/ios/prevent-default-with-slow-touchstart-handler.html * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handlePreventableTouchEvent): * UIProcess/WebPageProxy.h: 2020-02-03 Russell Epstein Cherry-pick r255378. rdar://problem/59097763 [iOS] Make sure unused service worker processes exit promptly on low memory warning https://bugs.webkit.org/show_bug.cgi?id=206939 Reviewed by Alex Christensen. Make sure unused service worker processes exit promptly on low memory warning. They normally take 10 seconds to exit for performance reasons. However, in case of memory pressure, keeping those processes around that long is not the right thing to do. Source/WebCore: * workers/service/server/SWServer.cpp: (WebCore::SWServer::handleLowMemoryWarning): * workers/service/server/SWServer.h: Source/WebKit: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::lowMemoryHandler): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255378 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-29 Chris Dumez [iOS] Make sure unused service worker processes exit promptly on low memory warning https://bugs.webkit.org/show_bug.cgi?id=206939 Reviewed by Alex Christensen. Make sure unused service worker processes exit promptly on low memory warning. They normally take 10 seconds to exit for performance reasons. However, in case of memory pressure, keeping those processes around that long is not the right thing to do. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::lowMemoryHandler): 2020-02-03 Russell Epstein Cherry-pick r255376. rdar://problem/59097754 Unreviewed, fix Catalyst build after r255366 * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled): * Shared/WebPreferencesDefaultValues.h: * Shared/ios/WebPreferencesDefaultValuesIOS.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255376 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-29 Chris Dumez Unreviewed, fix Catalyst build after r255366 * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled): * Shared/WebPreferencesDefaultValues.h: * Shared/ios/WebPreferencesDefaultValuesIOS.mm: 2020-02-03 Russell Epstein Cherry-pick r255366. rdar://problem/59097754 [iOS] Add managed preference to allow legacy sync XHRs during page dismissal https://bugs.webkit.org/show_bug.cgi?id=206944 Reviewed by Alex Christensen. Add managed preference for iOS to allow enterprise customers to keep using legacy sync XHRs during page dismissal. * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled): * Shared/WebPreferencesDefaultValues.h: * Shared/ios/WebPreferencesDefaultValuesIOS.mm: (WebKit::allowsDeprecatedSynchronousXMLHttpRequestDuringUnload): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255366 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-29 Chris Dumez [iOS] Add managed preference to allow legacy sync XHRs during page dismissal https://bugs.webkit.org/show_bug.cgi?id=206944 Reviewed by Alex Christensen. Add managed preference for iOS to allow enterprise customers to keep using legacy sync XHRs during page dismissal. * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled): * Shared/WebPreferencesDefaultValues.h: * Shared/ios/WebPreferencesDefaultValuesIOS.mm: (WebKit::allowsDeprecatedSynchronousXMLHttpRequestDuringUnload): 2020-02-03 Russell Epstein Cherry-pick r255222. rdar://problem/59097766 Support observing a different set of view service state notifications in ApplicationStateTracker https://bugs.webkit.org/show_bug.cgi?id=201737 rdar://problem/54786414 Reviewed by Chris Dumez. * UIProcess/ApplicationStateTracker.mm: Make ApplicationStateTracker conditionally (based on a flag to be defined in WebKitAdditions) use a different pair of notifications when it is in a view service or extension. These notifications report state changes of the individual scene that hosts the web view, rather than the state of the overall host application. This allows for more accurate state tracking for web views in extensions or view services hosted by apps with multiple open scenes. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255222 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-27 David Quesada Support observing a different set of view service state notifications in ApplicationStateTracker https://bugs.webkit.org/show_bug.cgi?id=201737 rdar://problem/54786414 Reviewed by Chris Dumez. * UIProcess/ApplicationStateTracker.mm: Make ApplicationStateTracker conditionally (based on a flag to be defined in WebKitAdditions) use a different pair of notifications when it is in a view service or extension. These notifications report state changes of the individual scene that hosts the web view, rather than the state of the overall host application. This allows for more accurate state tracking for web views in extensions or view services hosted by apps with multiple open scenes. 2020-02-03 Russell Epstein Cherry-pick r255188. rdar://problem/59097777 Unreviewed, a build fix after r255111 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: Adding some missing headers. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255188 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-27 Jiewen Tan Unreviewed, a build fix after r255111 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: Adding some missing headers. 2020-02-03 Russell Epstein Cherry-pick r255111. rdar://problem/59097777 Unreviewed, a speculative test fix after r255041 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::getAttestation const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255111 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-24 Jiewen Tan Unreviewed, a speculative test fix after r255041 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::getAttestation const): 2020-02-03 Russell Epstein Cherry-pick r255058. rdar://problem/59097764 Make sure fetch tasks go to network if service worker never gets to activated https://bugs.webkit.org/show_bug.cgi?id=206648 Reviewed by Chris Dumez. Source/WebCore: In case worker context process crashes, the SWServerWorker gets set to NotRunning. If the SWServerWorker has pending activating completion handlers, they will never be called until the worker is destroyed. But the worker may never be destroyed until its registration is destroyed. This may trigger service worker fetch task hangs. To fix this, make sure to call activating completion handlers whenever the SWServerWorker state is changed to either Terminating or NotRunning. Covered by updated test. * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::~SWServerWorker): (WebCore::SWServerWorker::whenActivated): (WebCore::SWServerWorker::setState): * workers/service/server/SWServerWorker.h: Source/WebKit: In case activating completion handlers are not called, the fetch task timeout should kick in and make the load go to network process. The issue is that our code was using the context connection to do so. If the fetch task is waiting for the worker activation, the context connection might not be set and the timeout will be a no-op. To fix this, the fetch task will do as if its context is closed when the timeout fires. The fetck task now has a weak pointer to the WebSWServerConnection and will use to terminate the service worker as done previously. We no longer handle all ongoing fetch tasks of the ongoing service worker. Each individual fetch task timeout provides the same level of protection. The service worker will anyway get terminated which will race to finalize the service worker fetch tasks with each of their timeout. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::createFetchTask): (WebKit::WebSWServerConnection::fetchTaskTimedOut): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): LayoutTests: * http/wpt/service-workers/service-worker-spinning-activate.https-expected.txt: * http/wpt/service-workers/service-worker-spinning-activate.https.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255058 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-24 youenn fablet Make sure fetch tasks go to network if service worker never gets to activated https://bugs.webkit.org/show_bug.cgi?id=206648 Reviewed by Chris Dumez. In case activating completion handlers are not called, the fetch task timeout should kick in and make the load go to network process. The issue is that our code was using the context connection to do so. If the fetch task is waiting for the worker activation, the context connection might not be set and the timeout will be a no-op. To fix this, the fetch task will do as if its context is closed when the timeout fires. The fetck task now has a weak pointer to the WebSWServerConnection and will use to terminate the service worker as done previously. We no longer handle all ongoing fetch tasks of the ongoing service worker. Each individual fetch task timeout provides the same level of protection. The service worker will anyway get terminated which will race to finalize the service worker fetch tasks with each of their timeout. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::createFetchTask): (WebKit::WebSWServerConnection::fetchTaskTimedOut): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): 2020-02-03 Russell Epstein Cherry-pick r254381. rdar://problem/59097774 [iOS] Remove reporting for some well-understood sandbox rules https://bugs.webkit.org/show_bug.cgi?id=206111 Reviewed by Per Arne Vollan. Remove sandbox rules designed to generate reporting about resource use for some well-understood items that are frequently hit in WebKit use. No new tests. No change in behavior. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254381 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-10 Brent Fulgham [iOS] Remove reporting for some well-understood sandbox rules https://bugs.webkit.org/show_bug.cgi?id=206111 Reviewed by Per Arne Vollan. Remove sandbox rules designed to generate reporting about resource use for some well-understood items that are frequently hit in WebKit use. No new tests. No change in behavior. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-30 Alan Coon Cherry-pick r255339. rdar://problem/58936679 Fix the build * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255339 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-28 Timothy Horton Fix the build * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): 2020-01-30 Alan Coon Cherry-pick r255337. rdar://problem/58936679 macCatalyst: Right clicking on a link follows it immediately https://bugs.webkit.org/show_bug.cgi?id=206919 Reviewed by Wenson Hsieh. Source/WebKit: * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]): (-[WKMouseGestureRecognizer touchesBegan:withEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): UIKit's _buttonMask does not include the currently-released button, so in order to correctly identify the released button in touchesEnded, store the mask for the length of the click. Tools: * TestWebKitAPI/Tests/WebKitCocoa/MacCatalystMouseSupport.mm: (TEST): Add a test ensuring that mouseup is still called with the secondary button, even if the event's buttonmask is 0. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255337 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-28 Tim Horton macCatalyst: Right clicking on a link follows it immediately https://bugs.webkit.org/show_bug.cgi?id=206919 Reviewed by Wenson Hsieh. * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]): (-[WKMouseGestureRecognizer touchesBegan:withEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): UIKit's _buttonMask does not include the currently-released button, so in order to correctly identify the released button in touchesEnded, store the mask for the length of the click. 2020-01-27 Russell Epstein Cherry-pick r255114. rdar://problem/58920176 macCatalyst: Don't get any custom cursors in subframes https://bugs.webkit.org/show_bug.cgi?id=206781 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): Adjust the hit test to allow child frame content, and reorganize the rest of the code to use the hit frame instead of the main frame. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255114 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-24 Tim Horton macCatalyst: Don't get any custom cursors in subframes https://bugs.webkit.org/show_bug.cgi?id=206781 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): Adjust the hit test to allow child frame content, and reorganize the rest of the code to use the hit frame instead of the main frame. 2020-01-27 Russell Epstein Cherry-pick r255108. rdar://problem/58920185 [iOS] Long pressing text inside a selection should update the selection https://bugs.webkit.org/show_bug.cgi?id=206769 Reviewed by Tim Horton. Source/WebCore: Remove `hasSelectionAtPosition`, which is no longer needed. * page/Page.cpp: (WebCore::Page::hasSelectionAtPosition const): Deleted. * page/Page.h: Source/WebKit: Makes it possible to update the selection using text interaction gestures inside an existing text selection. To do this, we remove code that was previously required in order to disambiguate text selection and drag gestures. However, since adopting asynchronous drag interaction SPI, this check has not been necessary. The only other purpose of this check was to avoid triggering text selection gestures after canceling a drag that did not begin (i.e. the touch location did not move). Instead of bailing in -textInteractionGestures: shouldBeginAtPoint: and -hasSelectablePositionAtPoint:, we can achieve the same effect by simply resetting the text interaction gestures when the drag lift begins (at which point we know the drag interaction is starting). This also ensures that on iPad, in the case where the drag was cancelled by the page, long pressing may still trigger text selection. Test: editing/selection/ios/select-text-in-existing-selection.html * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): Remove the hasSelectionAtPosition flag from position information, since we no longer need it. * UIProcess/ios/WKContentViewInteraction.mm: (-[UIGestureRecognizer _wk_cancel]): Drive-by fix: just ignore the gesture if it is already disabled. This prevents us from causing a gesture recognizer that was previously disabled to become enabled as a result of calling -_wk_cancel. (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView cancelActiveTextInteractionGestures]): Instead of making the text interaction gestures return NO from -gestureRecognizerShouldBegin:, explicitly cancel the text interaction gestures that may select text. (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): Remove the hasSelectionAtPosition flag from position information, since we no longer need it. LayoutTests: Add a layout test to verify that it's possible to select text by long pressing inside an existing text selection. The test is runnable on both iPad and iPhone, since it programmatically prevents `dragstart`. * editing/selection/ios/select-text-in-existing-selection-expected.txt: Added. * editing/selection/ios/select-text-in-existing-selection.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255108 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-24 Wenson Hsieh [iOS] Long pressing text inside a selection should update the selection https://bugs.webkit.org/show_bug.cgi?id=206769 Reviewed by Tim Horton. Makes it possible to update the selection using text interaction gestures inside an existing text selection. To do this, we remove code that was previously required in order to disambiguate text selection and drag gestures. However, since adopting asynchronous drag interaction SPI, this check has not been necessary. The only other purpose of this check was to avoid triggering text selection gestures after canceling a drag that did not begin (i.e. the touch location did not move). Instead of bailing in -textInteractionGestures: shouldBeginAtPoint: and -hasSelectablePositionAtPoint:, we can achieve the same effect by simply resetting the text interaction gestures when the drag lift begins (at which point we know the drag interaction is starting). This also ensures that on iPad, in the case where the drag was cancelled by the page, long pressing may still trigger text selection. Test: editing/selection/ios/select-text-in-existing-selection.html * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): Remove the hasSelectionAtPosition flag from position information, since we no longer need it. * UIProcess/ios/WKContentViewInteraction.mm: (-[UIGestureRecognizer _wk_cancel]): Drive-by fix: just ignore the gesture if it is already disabled. This prevents us from causing a gesture recognizer that was previously disabled to become enabled as a result of calling -_wk_cancel. (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView cancelActiveTextInteractionGestures]): Instead of making the text interaction gestures return NO from -gestureRecognizerShouldBegin:, explicitly cancel the text interaction gestures that may select text. (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): Remove the hasSelectionAtPosition flag from position information, since we no longer need it. 2020-01-27 Russell Epstein Cherry-pick r255105. rdar://problem/58920180 macCatalyst: Right clicking on links follows the link, but shouldn't https://bugs.webkit.org/show_bug.cgi?id=206777 Reviewed by Wenson Hsieh. * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): I got 'button' and 'buttons' backwards. 'button' indicates which button the event is about, so in MouseUp, it should still be 2. 'buttons' indicate which buttons are still down, so in MouseUp, it should not include 2. Since we don't currently track mouse button chording here, we'll just say "none". Leave a FIXME about that. This makes WebCore's behavior correct, and now it doesn't follow the link. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255105 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-24 Tim Horton macCatalyst: Right clicking on links follows the link, but shouldn't https://bugs.webkit.org/show_bug.cgi?id=206777 Reviewed by Wenson Hsieh. * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): I got 'button' and 'buttons' backwards. 'button' indicates which button the event is about, so in MouseUp, it should still be 2. 'buttons' indicate which buttons are still down, so in MouseUp, it should not include 2. Since we don't currently track mouse button chording here, we'll just say "none". Leave a FIXME about that. This makes WebCore's behavior correct, and now it doesn't follow the link. 2020-01-27 Russell Epstein Cherry-pick r255046. rdar://problem/58920204 macCatalyst: I-Beam is too conservative, doesn't show up in editable areas with no text https://bugs.webkit.org/show_bug.cgi?id=206716 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::lineCaretExtent): (WebKit::populateCaretContext): (WebKit::WebPage::positionInformation): Instead of uniting the caret position for the first and last position on the line to find the I-Beam region, use the bounds of the selection rect for the line, which extends beyond existing text, matching our traditional behavior of showing the I-Beam over blank regions. * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::absoluteSelectionBoundsForLine const): * editing/VisiblePosition.h: Expose the bounds of the possible selection for the line that the given position belongs to. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255046 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-23 Tim Horton macCatalyst: I-Beam is too conservative, doesn't show up in editable areas with no text https://bugs.webkit.org/show_bug.cgi?id=206716 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::lineCaretExtent): (WebKit::populateCaretContext): (WebKit::WebPage::positionInformation): Instead of uniting the caret position for the first and last position on the line to find the I-Beam region, use the bounds of the selection rect for the line, which extends beyond existing text, matching our traditional behavior of showing the I-Beam over blank regions. 2020-01-24 Russell Epstein Cherry-pick r255039. rdar://problem/58855996 Background thread with ITP Database should lock when the network process is suspended https://bugs.webkit.org/show_bug.cgi?id=206593 rdar://problem/58713379 Reviewed by Chris Dumez. This patch adds a function to hang the background queue when the NetworkProcess is preparing to suspend. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::suspend): (WebKit::WebResourceLoadStatisticsStore::resume): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::resume): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255039 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-23 Kate Cheney Background thread with ITP Database should lock when the network process is suspended https://bugs.webkit.org/show_bug.cgi?id=206593 rdar://problem/58713379 Reviewed by Chris Dumez. This patch adds a function to hang the background queue when the NetworkProcess is preparing to suspend. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::suspend): (WebKit::WebResourceLoadStatisticsStore::resume): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::resume): 2020-01-24 Russell Epstein Cherry-pick r254938. rdar://problem/58856028 Fix SDK availability macros https://bugs.webkit.org/show_bug.cgi?id=206463 Reviewed by Timothy Hatcher. Bug 197841 updated WebKit.xcconfig with regards to when it runs a header post-processing script. This post-processing script grovels over our exported headers, changing macros like WK_API_AVAILABLE to the standard API_AVAILABLE. Because of the change in Bug 197841, the script was no longer being run when preparing macOS 10.15 SDKs, which was breaking those SDKs. Fix this by reverting the change, allowing the macros to be replaced for macOS 10.15. We also need to touch WKFoundation.h in order to support incremental builds. If we don't, then the version of WKFoundation.h that was exported in the previous build and that was incorrectly post-processed would remain incorrectly post-processed. Touch the file so that it will get re-exported and re-post-processed. No new tests - no added or changed functionality. * Configurations/WebKit.xcconfig: * Shared/API/Cocoa/WKFoundation.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254938 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-22 Keith Rollin Fix SDK availability macros https://bugs.webkit.org/show_bug.cgi?id=206463 Reviewed by Timothy Hatcher. Bug 197841 updated WebKit.xcconfig with regards to when it runs a header post-processing script. This post-processing script grovels over our exported headers, changing macros like WK_API_AVAILABLE to the standard API_AVAILABLE. Because of the change in Bug 197841, the script was no longer being run when preparing macOS 10.15 SDKs, which was breaking those SDKs. Fix this by reverting the change, allowing the macros to be replaced for macOS 10.15. We also need to touch WKFoundation.h in order to support incremental builds. If we don't, then the version of WKFoundation.h that was exported in the previous build and that was incorrectly post-processed would remain incorrectly post-processed. Touch the file so that it will get re-exported and re-post-processed. No new tests - no added or changed functionality. * Configurations/WebKit.xcconfig: * Shared/API/Cocoa/WKFoundation.h: 2020-01-23 Russell Epstein Cherry-pick r254892. rdar://problem/58816313 [IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess https://bugs.webkit.org/show_bug.cgi?id=206558 Reviewed by Alex Christensen. Port UpdateQuotaBasedOnSpaceUsageForTesting IPC from the NetworkProcess to the NetworkConnectionToWebProcess since it is sent by the WebContent process. As a result, we can now stop forwarding all Messages::NetworkProcess IPC messages from the WebContent process to the NetworkProcess class. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage): (WebKit::NetworkConnectionToWebProcess::updateQuotaBasedOnSpaceUsageForTesting): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didReceiveMessage): (WebKit::NetworkProcess::didReceiveSyncMessage): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/StringReference.h: (IPC::StringReference::operator!=): * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254892 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-21 Chris Dumez [IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess https://bugs.webkit.org/show_bug.cgi?id=206558 Reviewed by Alex Christensen. Port UpdateQuotaBasedOnSpaceUsageForTesting IPC from the NetworkProcess to the NetworkConnectionToWebProcess since it is sent by the WebContent process. As a result, we can now stop forwarding all Messages::NetworkProcess IPC messages from the WebContent process to the NetworkProcess class. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage): (WebKit::NetworkConnectionToWebProcess::updateQuotaBasedOnSpaceUsageForTesting): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didReceiveMessage): (WebKit::NetworkProcess::didReceiveSyncMessage): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/StringReference.h: (IPC::StringReference::operator!=): * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage): 2020-01-23 Russell Epstein Cherry-pick r254884. rdar://problem/58807972 ProvisionalPageProxy::loadData should pass last navigation's shouldOpenExternalURLsPolicy flag to WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=206462 Reviewed by Chris Dumez. Source/WebKit: Covered by API tests. This patch also does it for ProvisionalPageProxy::loadRequest. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::loadData): (WebKit::ProvisionalPageProxy::loadRequest): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): Tools: * TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm: (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254884 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-21 Jiewen Tan ProvisionalPageProxy::loadData should pass last navigation's shouldOpenExternalURLsPolicy flag to WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=206462 Reviewed by Chris Dumez. Covered by API tests. This patch also does it for ProvisionalPageProxy::loadRequest. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::loadData): (WebKit::ProvisionalPageProxy::loadRequest): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): 2020-01-23 Russell Epstein Cherry-pick r254880. rdar://problem/58816328 [macOS] Add managed preference to allow synchronous XHR during page dismissal https://bugs.webkit.org/show_bug.cgi?id=206540 Reviewed by Alex Christensen. Add managed preference to allow synchronous XHR during page dismissal. This is temporarily needed by some enterprise products until they can update their code. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled): * Shared/WebPreferencesDefaultValues.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254880 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-21 Chris Dumez [macOS] Add managed preference to allow synchronous XHR during page dismissal https://bugs.webkit.org/show_bug.cgi?id=206540 Reviewed by Alex Christensen. Add managed preference to allow synchronous XHR during page dismissal. This is temporarily needed by some enterprise products until they can update their code. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled): * Shared/WebPreferencesDefaultValues.h: 2020-01-23 Russell Epstein Cherry-pick r254874. rdar://problem/58816330 macCatalyst: Two-finger click is dispatched to DOM as left click https://bugs.webkit.org/show_bug.cgi?id=206549 Reviewed by Simon Fraser. * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]): (-[WKMouseGestureRecognizer touchesBegan:withEvent:]): (-[WKMouseGestureRecognizer touchesMoved:withEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): (-[WKMouseGestureRecognizer _hoverEntered:withEvent:]): (-[WKMouseGestureRecognizer _hoverMoved:withEvent:]): (-[WKMouseGestureRecognizer _hoverExited:withEvent:]): (-[WKMouseGestureRecognizer createMouseEventWithType:]): Deleted. We correctly say button=2 for ctrl-click, but not for secondary-button click. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254874 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-21 Tim Horton macCatalyst: Two-finger click is dispatched to DOM as left click https://bugs.webkit.org/show_bug.cgi?id=206549 Reviewed by Simon Fraser. * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]): (-[WKMouseGestureRecognizer touchesBegan:withEvent:]): (-[WKMouseGestureRecognizer touchesMoved:withEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): (-[WKMouseGestureRecognizer _hoverEntered:withEvent:]): (-[WKMouseGestureRecognizer _hoverMoved:withEvent:]): (-[WKMouseGestureRecognizer _hoverExited:withEvent:]): (-[WKMouseGestureRecognizer createMouseEventWithType:]): Deleted. We correctly say button=2 for ctrl-click, but not for secondary-button click. 2020-01-23 Russell Epstein Cherry-pick r254711. rdar://problem/58816343 Regression(r253224) No longer able to prevent a tab from closing via the beforeunload prompt https://bugs.webkit.org/show_bug.cgi?id=206366 Reviewed by Geoffrey Garen. Source/WebKit: Change is covered by new API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _tryClose]): (-[WKWebView _isClosed]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add new _tryClose / _isClosed SPI on WKWebView in order to write an API test to cover the change. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): In WebPageProxy::tryClose(), we start a timer before sending the TryClose async IPC to the WebProcess. We would then stop the timer when receiving the response to the TryClose IPC. If the timer fires, we would forcefully close the page. The issue was that before answering the TryClose IPC, the WebContent process would send a sync RunBeforeUnloadConfirmPanel IPC to the UIProcess to show the confirmation prompt, and this would fail to stop the timer. WebPageProxy::runBeforeUnloadConfirmPanel() would spin a nested run loop to show the prompt and we would time out while showing the prompt. Tools: tryClose_timeout_fix * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKit/beforeunload.html: Added. * TestWebKitAPI/Tests/WebKitCocoa/ModalAlerts.mm: (-[SlowBeforeUnloadPromptUIDelegate _webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:]): (-[SlowBeforeUnloadPromptUIDelegate webViewDidClose:]): (TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254711 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-16 Chris Dumez Regression(r253224) No longer able to prevent a tab from closing via the beforeunload prompt https://bugs.webkit.org/show_bug.cgi?id=206366 Reviewed by Geoffrey Garen. Change is covered by new API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _tryClose]): (-[WKWebView _isClosed]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add new _tryClose / _isClosed SPI on WKWebView in order to write an API test to cover the change. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): In WebPageProxy::tryClose(), we start a timer before sending the TryClose async IPC to the WebProcess. We would then stop the timer when receiving the response to the TryClose IPC. If the timer fires, we would forcefully close the page. The issue was that before answering the TryClose IPC, the WebContent process would send a sync RunBeforeUnloadConfirmPanel IPC to the UIProcess to show the confirmation prompt, and this would fail to stop the timer. WebPageProxy::runBeforeUnloadConfirmPanel() would spin a nested run loop to show the prompt and we would time out while showing the prompt. 2020-01-23 Russell Epstein Cherry-pick r254706. rdar://problem/58811361 Add finite timeout when synchronously terminating a service worker https://bugs.webkit.org/show_bug.cgi?id=206325 Patch by Alex Christensen on 2020-01-16 Reviewed by Youenn Fablet. When this message reply is never received, it hangs everything. If we haven't received verification that a service worker was terminated in 10 seconds, unhang everything and tell the UI process to terminate the hanging service worker process. Continue handling messages during these 10 seconds to hopefully turn a bad hang into no perceptible hang. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::syncTerminateWorker): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254706 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-16 Alex Christensen Add finite timeout when synchronously terminating a service worker https://bugs.webkit.org/show_bug.cgi?id=206325 Reviewed by Youenn Fablet. When this message reply is never received, it hangs everything. If we haven't received verification that a service worker was terminated in 10 seconds, unhang everything and tell the UI process to terminate the hanging service worker process. Continue handling messages during these 10 seconds to hopefully turn a bad hang into no perceptible hang. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::syncTerminateWorker): 2020-01-23 Russell Epstein Cherry-pick r254552. rdar://problem/58812968 REGRESSION (r253394): After swiping back during a navigation, WKWebView gets stuck with the forward content, stops repainting https://bugs.webkit.org/show_bug.cgi?id=206268 Reviewed by Simon Fraser. * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::endSwipeGesture): * UIProcess/ViewGestureController.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): After r253394, we start loading the destination page in willEndSwipeGesture, when we know the gesture will complete, instead of in endSwipeGesture, when it is actually done. This means that if we decide that we should tear down the snapshot immediately, this can now happen in the window between willEndSwipeGesture and endSwipeGesture. However, removeSwipeSnapshot has numerous dependencies on endSwipeGesture (especially on iOS, where there are /also/ dependencies in the other direction - endSwipeGesture will never be called after removeSwipeSnapshot because of the gestureID mismatch). Regardless, it does not make sense to remove the snapshot while the animation is still running. So, if something causes removeSwipeSnapshot to be called before endSwipeGesture, we just set a bit and call it inside endSwipeGesture instead. This ends up putting the snapshot removal ordering back as it was before r253394. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254552 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-14 Tim Horton REGRESSION (r253394): After swiping back during a navigation, WKWebView gets stuck with the forward content, stops repainting https://bugs.webkit.org/show_bug.cgi?id=206268 Reviewed by Simon Fraser. * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::endSwipeGesture): * UIProcess/ViewGestureController.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): After r253394, we start loading the destination page in willEndSwipeGesture, when we know the gesture will complete, instead of in endSwipeGesture, when it is actually done. This means that if we decide that we should tear down the snapshot immediately, this can now happen in the window between willEndSwipeGesture and endSwipeGesture. However, removeSwipeSnapshot has numerous dependencies on endSwipeGesture (especially on iOS, where there are /also/ dependencies in the other direction - endSwipeGesture will never be called after removeSwipeSnapshot because of the gestureID mismatch). Regardless, it does not make sense to remove the snapshot while the animation is still running. So, if something causes removeSwipeSnapshot to be called before endSwipeGesture, we just set a bit and call it inside endSwipeGesture instead. This ends up putting the snapshot removal ordering back as it was before r253394. 2020-01-23 Russell Epstein Cherry-pick r254550. rdar://problem/58812988 REGRESSION(iOS 13): createMediaElementSource not working https://bugs.webkit.org/show_bug.cgi?id=203435 Reviewed by David Kilzer. The WebContent process is missing an entitlement according to logs. * Scripts/process-entitlements.sh: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254550 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-14 Per Arne Vollan REGRESSION(iOS 13): createMediaElementSource not working https://bugs.webkit.org/show_bug.cgi?id=203435 Reviewed by David Kilzer. The WebContent process is missing an entitlement according to logs. * Scripts/process-entitlements.sh: 2020-01-23 Russell Epstein Cherry-pick r254487. rdar://problem/58606185 Reformat WebProcessPool logging https://bugs.webkit.org/show_bug.cgi?id=205882 Reviewed by Brent Fulgham. Update the format used by WebProcessPool in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: Using prewarmed process 0 becomes: 0x7f81e8804008 - WebProcessPool::processForRegistrableDomain: Using prewarmed process (process=0x1471c2a00, PID=64197) No new tests - no added or changed functionality. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::applicationIsAboutToSuspend): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::tryTakePrewarmedProcess): (WebKit::WebProcessPool::prewarmProcess): (WebKit::WebProcessPool::processForRegistrableDomain): (WebKit::WebProcessPool::didReachGoodTimeToPrewarm): (WebKit::WebProcessPool::handleMemoryPressureWarning): (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::processForNavigationInternal): (WebKit::WebProcessPool::setWebProcessHasUploads): (WebKit::WebProcessPool::clearWebProcessHasUploads): (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia): (WebKit::WebProcessPool::clearWebProcessIsPlayingAudibleMedia): (WebKit::WebProcessPool::setUseSeparateServiceWorkerProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254487 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-13 Keith Rollin Reformat WebProcessPool logging https://bugs.webkit.org/show_bug.cgi?id=205882 Reviewed by Brent Fulgham. Update the format used by WebProcessPool in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: Using prewarmed process 0 becomes: 0x7f81e8804008 - WebProcessPool::processForRegistrableDomain: Using prewarmed process (process=0x1471c2a00, PID=64197) No new tests - no added or changed functionality. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::applicationIsAboutToSuspend): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::tryTakePrewarmedProcess): (WebKit::WebProcessPool::prewarmProcess): (WebKit::WebProcessPool::processForRegistrableDomain): (WebKit::WebProcessPool::didReachGoodTimeToPrewarm): (WebKit::WebProcessPool::handleMemoryPressureWarning): (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::processForNavigationInternal): (WebKit::WebProcessPool::setWebProcessHasUploads): (WebKit::WebProcessPool::clearWebProcessHasUploads): (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia): (WebKit::WebProcessPool::clearWebProcessIsPlayingAudibleMedia): (WebKit::WebProcessPool::setUseSeparateServiceWorkerProcess): 2020-01-23 Russell Epstein Cherry-pick r254296. rdar://problem/58606275 Resource Load Statistics: Add timing information to WebPageProxy::logFrameNavigation() to detect delayed client-side redirects https://bugs.webkit.org/show_bug.cgi?id=205522 Reviewed by Chris Dumez. Source/WebKit: The purpose of this patch is to capture navigations that happen programmatically after the document has loaded. These are delayed redirects and should be counted as redirects in ITP. To achieve this, a timestamp is captured in WebPageProxy::didFinishDocumentLoadForFrame() to be able to calculate how much time has passed since that timestamp in the IPC sent from WebPageProxy::logFrameNavigation(). The IPC also gets information on whether userInitiatedActivity exists so that ITP can decide whether to treat the navigation as triggered by the user or not. A new test was added and existing test expectations were updated. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. The deleted WebResourceLoadStatisticsStore::logFrameNavigation() was dead code. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:]): Deleted. Dead code. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Now captures a timestamp. (WebKit::WebPageProxy::decidePolicyForNavigationAction): Removed dead code. (WebKit::WebPageProxy::logFrameNavigation): Now sends the diff between now and the timestamp captured in WebPageProxy::didFinishDocumentLoadForFrame(). * UIProcess/WebPageProxy.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformInitialize): Removed dead code. (WebKit::WebsiteDataStore::platformDestroy): Removed dead code. * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resourceLoadStatistics const): Deleted. Dead code. Tools: * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::initializeWebViewConfiguration): Removed dead code. LayoutTests: Results updated with additional data now that delayed redirects are captured. * http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration-database-expected.txt: * http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration-expected.txt: * http/tests/resourceLoadStatistics/log-delayed-client-side-redirects-database-expected.txt: Added. * http/tests/resourceLoadStatistics/log-delayed-client-side-redirects-database.html: Added. * http/tests/resourceLoadStatistics/log-delayed-client-side-redirects-expected.txt: Added. * http/tests/resourceLoadStatistics/log-delayed-client-side-redirects.html: Added. * http/tests/storageAccess/aggregate-sorted-data-with-storage-access-database-expected.txt: * http/tests/storageAccess/aggregate-sorted-data-with-storage-access-expected.txt: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254296 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-09 John Wilander Resource Load Statistics: Add timing information to WebPageProxy::logFrameNavigation() to detect delayed client-side redirects https://bugs.webkit.org/show_bug.cgi?id=205522 Reviewed by Chris Dumez. The purpose of this patch is to capture navigations that happen programmatically after the document has loaded. These are delayed redirects and should be counted as redirects in ITP. To achieve this, a timestamp is captured in WebPageProxy::didFinishDocumentLoadForFrame() to be able to calculate how much time has passed since that timestamp in the IPC sent from WebPageProxy::logFrameNavigation(). The IPC also gets information on whether userInitiatedActivity exists so that ITP can decide whether to treat the navigation as triggered by the user or not. A new test was added and existing test expectations were updated. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. The deleted WebResourceLoadStatisticsStore::logFrameNavigation() was dead code. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:]): Deleted. Dead code. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Now captures a timestamp. (WebKit::WebPageProxy::decidePolicyForNavigationAction): Removed dead code. (WebKit::WebPageProxy::logFrameNavigation): Now sends the diff between now and the timestamp captured in WebPageProxy::didFinishDocumentLoadForFrame(). * UIProcess/WebPageProxy.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformInitialize): Removed dead code. (WebKit::WebsiteDataStore::platformDestroy): Removed dead code. * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resourceLoadStatistics const): Deleted. Dead code. 2020-01-21 Alan Coon Cherry-pick r254125. rdar://problem/58353217 Fix non GPUProcess build issue in UserMediaCaptureManager https://bugs.webkit.org/show_bug.cgi?id=205851 Reviewed by Eric Carlson. Build fix, no change of behavior. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::connection): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254125 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-07 youenn fablet Fix non GPUProcess build issue in UserMediaCaptureManager https://bugs.webkit.org/show_bug.cgi?id=205851 Reviewed by Eric Carlson. Build fix, no change of behavior. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::connection): 2020-01-17 Alan Coon Cherry-pick r254433. rdar://problem/58686757 [macCatalyst] UI process crashes on launch after r254101 https://bugs.webkit.org/show_bug.cgi?id=206156 Reviewed by Brent Fulgham. Fixes the crash by not soft-linking BackBoardServices in an attempt to invoke BKSDisplayBrightnessGetCurrent on macCatalyst. Prior to r254101, this was only defined on iOS and not watchOS or tvOS; after this change, it should be defined only on iOS, watchOS and tvOS. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::registerNotificationObservers): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebProcessPool.h: * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254433 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-12 Wenson Hsieh [macCatalyst] UI process crashes on launch after r254101 https://bugs.webkit.org/show_bug.cgi?id=206156 Reviewed by Brent Fulgham. Fixes the crash by not soft-linking BackBoardServices in an attempt to invoke BKSDisplayBrightnessGetCurrent on macCatalyst. Prior to r254101, this was only defined on iOS and not watchOS or tvOS; after this change, it should be defined only on iOS, watchOS and tvOS. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::registerNotificationObservers): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebProcessPool.h: * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: 2020-01-15 Alan Coon Cherry-pick r254187. rdar://problem/58605950 Implement css3-images image-orientation https://bugs.webkit.org/show_bug.cgi?id=89052 Patch by Said Abou-Hallawa on 2020-01-07 Reviewed by Simon Fraser. LayoutTests/imported/w3c: * web-platform-tests/css/css-images/inheritance-expected.txt: * web-platform-tests/css/css-images/inheritance.html: This test is re-synced from upstream * web-platform-tests/css/css-images/parsing/image-orientation-computed-expected.txt: * web-platform-tests/css/css-images/parsing/image-orientation-valid-expected.txt: Source/JavaScriptCore: Remove the ENABLE_CSS_IMAGE_ORIENTATION feature flag. * Configurations/FeatureDefines.xcconfig: Source/WebCore: Implement the CSS image-orientation property for content images. The valid values are "from-image" or "none". The default value is "from-image". Specification: https://drafts.csswg.org/css-images-3/#the-image-orientation GitHub issue: https://github.com/w3c/csswg-drafts/issues/4164 Tests: fast/images/image-orientation-dynamic-from-image.html fast/images/image-orientation-dynamic-none.html fast/images/image-orientation-none.html * Configurations/FeatureDefines.xcconfig: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::operator ImageOrientation const): Deleted. * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeImageOrientation): (WebCore::CSSPropertyParser::parseSingleValue): * rendering/RenderElement.cpp: (WebCore::RenderElement::imageOrientation const): * rendering/RenderImage.cpp: (WebCore::RenderImage::styleDidChange): * rendering/style/RenderStyle.cpp: (WebCore::rareInheritedDataChangeRequiresLayout): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setImageOrientation): (WebCore::RenderStyle::initialImageOrientation): (WebCore::RenderStyle::imageOrientation const): * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): * rendering/style/StyleRareInheritedData.h: * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertImageOrientation): Source/WebCore/PAL: Remove the ENABLE_CSS_IMAGE_ORIENTATION feature flag. * Configurations/FeatureDefines.xcconfig: Source/WebKit: Remove the ENABLE_CSS_IMAGE_ORIENTATION feature flag. * Configurations/FeatureDefines.xcconfig: Source/WebKitLegacy/mac: Remove the ENABLE_CSS_IMAGE_ORIENTATION feature flag. * Configurations/FeatureDefines.xcconfig: Source/WTF: Remove the ENABLE_CSS_IMAGE_ORIENTATION feature flag. * wtf/FeatureDefines.h: Tools: Remove the ENABLE_CSS_IMAGE_ORIENTATION feature flag. * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: LayoutTests: Test the css image-orientation property. * fast/images/image-orientation-dynamic-from-image-expected.html: Added. * fast/images/image-orientation-dynamic-from-image.html: Added. * fast/images/image-orientation-dynamic-none-expected.html: Added. * fast/images/image-orientation-dynamic-none.html: Added. * fast/images/image-orientation-none-expected.html: Added. * fast/images/image-orientation-none.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254187 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-07 Said Abou-Hallawa Implement css3-images image-orientation https://bugs.webkit.org/show_bug.cgi?id=89052 Reviewed by Simon Fraser. Remove the ENABLE_CSS_IMAGE_ORIENTATION feature flag. * Configurations/FeatureDefines.xcconfig: 2020-01-14 Alan Coon Cherry-pick r254344. rdar://problem/58559189 Add SPI to enable TLS 1.0 and 1.1 in WKWebViews https://bugs.webkit.org/show_bug.cgi?id=206046 Patch by Alex Christensen on 2020-01-10 Reviewed by Youenn Fablet. Source/WebKit: This is needed for Covered by API tests. * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration legacyTLSEnabled]): (-[_WKWebsiteDataStoreConfiguration setLegacyTLSEnabled:]): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy const): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::legacyTLSEnabled const): (WebKit::WebsiteDataStoreConfiguration::setLegacyTLSEnabled): Tools: * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm: (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254344 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-10 Alex Christensen Add SPI to enable TLS 1.0 and 1.1 in WKWebViews https://bugs.webkit.org/show_bug.cgi?id=206046 Reviewed by Youenn Fablet. This is needed for Covered by API tests. * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration legacyTLSEnabled]): (-[_WKWebsiteDataStoreConfiguration setLegacyTLSEnabled:]): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy const): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::legacyTLSEnabled const): (WebKit::WebsiteDataStoreConfiguration::setLegacyTLSEnabled): 2020-01-14 Alan Coon Cherry-pick r254310. rdar://problem/58552856 Check the existence of the optional m_sessionID before using it in WebProcess::setResourceLoadStatisticsEnabled() https://bugs.webkit.org/show_bug.cgi?id=206035 Reviewed by Brent Fulgham. No new tests. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setResourceLoadStatisticsEnabled): Added a check that m_sessionID exists. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254310 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-09 John Wilander Check the existence of the optional m_sessionID before using it in WebProcess::setResourceLoadStatisticsEnabled() https://bugs.webkit.org/show_bug.cgi?id=206035 Reviewed by Brent Fulgham. No new tests. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setResourceLoadStatisticsEnabled): Added a check that m_sessionID exists. 2020-01-14 Alan Coon Cherry-pick r254293. rdar://problem/58549084 Resource Load Statistics: Flip experimental website data removal setting from an enable to a disable https://bugs.webkit.org/show_bug.cgi?id=205966 Reviewed by Brent Fulgham. To get default on behavior, experimental features in the network process need to be turned from enable flags to disable flags. This patch does that for the experimental website data removal flag. Source/WebCore: No new tests. This change just reverses the interpretation of a flag. * page/Settings.yaml: Source/WebKit: This change also aligns the init values of the setting to match the default. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.h: * Shared/WebPreferences.yaml: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254293 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-09 John Wilander Resource Load Statistics: Flip experimental website data removal setting from an enable to a disable https://bugs.webkit.org/show_bug.cgi?id=205966 Reviewed by Brent Fulgham. To get default on behavior, experimental features in the network process need to be turned from enable flags to disable flags. This patch does that for the experimental website data removal flag. This change also aligns the init values of the setting to match the default. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.h: * Shared/WebPreferences.yaml: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2020-01-14 Alan Coon Cherry-pick r254292. rdar://problem/58552868 Set the title for images so it will be correctly displayed in UIContextMenus https://bugs.webkit.org/show_bug.cgi?id=205980 Reviewed by Dean Jackson. Need to set the title text for images. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView continueContextMenuInteraction:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254292 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-09 Megan Gardner Set the title for images so it will be correctly displayed in UIContextMenus https://bugs.webkit.org/show_bug.cgi?id=205980 Reviewed by Dean Jackson. Need to set the title text for images. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView continueContextMenuInteraction:]): 2020-01-14 Alan Coon Cherry-pick r254287. rdar://problem/58552886 Fullscreen videos do not enter PiP in first tap https://bugs.webkit.org/show_bug.cgi?id=205986 Reviewed by Eric Carlson. This patch essentially reverts the fix for webkit.org/b/204461. The fix for webkit.org/b/204461 depends on a fix in AVKit along with a corresponding update in WebKit (webkit.org/b/204979). We will need to reapply the fix for webkit.org/b/204461 after they are landed. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254287 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-09 Peng Liu Fullscreen videos do not enter PiP in first tap https://bugs.webkit.org/show_bug.cgi?id=205986 Reviewed by Eric Carlson. This patch essentially reverts the fix for webkit.org/b/204461. The fix for webkit.org/b/204461 depends on a fix in AVKit along with a corresponding update in WebKit (webkit.org/b/204979). We will need to reapply the fix for webkit.org/b/204461 after they are landed. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement): 2020-01-14 Alan Coon Cherry-pick r254254. rdar://problem/58548978 WebKitTestRunner leaks objects in a top-level autoreleasePool that's never cleared Reviewed by Joseph Pecoraro. Source/WebKit: * UIProcess/mac/WebPreferencesMac.mm: (WebKit::WebPreferences::platformInitializeStore): - Add an @autoreleasepool block around the contents of this method since it generates numerous autoreleased objects when run. Tools: * WebKitTestRunner/ios/mainIOS.mm: (main): - Add an @autoreleasepool block around a line of code that generates autoreleased objects. These objects would never be released for the life of the process prior to this change. * WebKitTestRunner/mac/main.mm: (main): - Move instantiation of WTR::TestController outside of @autoreleasepool block so the pool can be drained while running tests. Prior to this change, this autoreleasePool would never be drained. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254254 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-09 David Kilzer WebKitTestRunner leaks objects in a top-level autoreleasePool that's never cleared Reviewed by Joseph Pecoraro. * UIProcess/mac/WebPreferencesMac.mm: (WebKit::WebPreferences::platformInitializeStore): - Add an @autoreleasepool block around the contents of this method since it generates numerous autoreleased objects when run. 2020-01-14 Alan Coon Cherry-pick r254239. rdar://problem/58549100 Resource Load Statistics: Flip experimental cookie blocking setting from an enable to a disable https://bugs.webkit.org/show_bug.cgi?id=205963 Reviewed by Brent Fulgham. To get default on behavior, experimental features in the network process need to be turned from enable flags to disable flags. This patch does that for the experimental cookie blocking flag. Source/WebCore: No new tests. This change just reverses the interpretation of a flag. * page/Settings.yaml: Source/WebKit: This change also aligns the init values of the setting to match the default. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.h: * Shared/WebPreferences.yaml: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254239 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-08 John Wilander Resource Load Statistics: Flip experimental cookie blocking setting from an enable to a disable https://bugs.webkit.org/show_bug.cgi?id=205963 Reviewed by Brent Fulgham. To get default on behavior, experimental features in the network process need to be turned from enable flags to disable flags. This patch does that for the experimental cookie blocking flag. This change also aligns the init values of the setting to match the default. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.h: * Shared/WebPreferences.yaml: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2020-01-14 Alan Coon Cherry-pick r254208. rdar://problem/58559193 IPC::Connection::sendMessage() should use CRASH_WITH_INFO() Reviewed by Mark Lam. * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::Connection::sendMessage): - Switch from CRASH() to CRASH_WITH_INFO(). git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254208 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-08 David Kilzer IPC::Connection::sendMessage() should use CRASH_WITH_INFO() Reviewed by Mark Lam. * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::Connection::sendMessage): - Switch from CRASH() to CRASH_WITH_INFO(). 2020-01-14 Alan Coon Cherry-pick r254147. rdar://problem/58549096 Reformat WebFrameLoaderClient logging https://bugs.webkit.org/show_bug.cgi?id=205869 Reviewed by Brent Fulgham. Update the format used by WebFrameLoaderClient in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x4a1d7c310 - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition, page = 0x7f83ba009208 becomes: 0x4a1d7c310 - [webFrame=0x7ff703f03b68, webFrameID=3, webPage=0x7ff704831808, webPageID=15] WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition No new tests - no added or changed functionality. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailLoad): (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254147 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-07 Keith Rollin Reformat WebFrameLoaderClient logging https://bugs.webkit.org/show_bug.cgi?id=205869 Reviewed by Brent Fulgham. Update the format used by WebFrameLoaderClient in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x4a1d7c310 - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition, page = 0x7f83ba009208 becomes: 0x4a1d7c310 - [webFrame=0x7ff703f03b68, webFrameID=3, webPage=0x7ff704831808, webPageID=15] WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition No new tests - no added or changed functionality. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailLoad): (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone): 2020-01-14 Alan Coon Cherry-pick r254092. rdar://problem/58552872 NetworkSessionCocoa::isolatedSession should not use iterator after mutating m_isolatedSessions https://bugs.webkit.org/show_bug.cgi?id=205824 Patch by Alex Christensen on 2020-01-06 Reviewed by Chris Dumez. Classic iterator use after mutating iterated container was causing crashes by returning a null SessionWrapper& This was introduced in r252185 or r248640. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::isolatedSession): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254092 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-06 Alex Christensen NetworkSessionCocoa::isolatedSession should not use iterator after mutating m_isolatedSessions https://bugs.webkit.org/show_bug.cgi?id=205824 Reviewed by Chris Dumez. Classic iterator use after mutating iterated container was causing crashes by returning a null SessionWrapper& This was introduced in r252185 or r248640. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::isolatedSession): 2020-01-14 Alan Coon Cherry-pick r254078. rdar://problem/58549073 Reformat WebPage logging https://bugs.webkit.org/show_bug.cgi?id=205709 Reviewed by Brent Fulgham. Update the format used by WebPage in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x4a1df5000 - WebLoaderStrategy::scheduleLoad: Resource is being scheduled with the NetworkProcess (frame=0x4a1db0220, priority=0, webPageID=15, frameID=3, resourceID=32)', becomes: 0x4a1df5000 - [resourceLoader=0x1418b7200, frameLoader=0x1326d7340, frame=0x4a1db0220, webPageID=15, frameID=3, resourceID=32] WebLoaderStrategy::scheduleLoad: Resource is being scheduled with the NetworkProcess (priority=2) This new form is a lot more verbose, but it really helps in tracing activity from the top of our page/frame/resource load stack to the bottom. No new tests - no added or changed functionality. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::networkProcessCrashed): (WebKit::WebLoaderStrategy::loadResourceSynchronously): * WebProcess/Network/WebLoaderStrategy.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254078 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-06 Keith Rollin Reformat WebPage logging https://bugs.webkit.org/show_bug.cgi?id=205709 Reviewed by Brent Fulgham. Update the format used by WebPage in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x4a1df5000 - WebLoaderStrategy::scheduleLoad: Resource is being scheduled with the NetworkProcess (frame=0x4a1db0220, priority=0, webPageID=15, frameID=3, resourceID=32)', becomes: 0x4a1df5000 - [resourceLoader=0x1418b7200, frameLoader=0x1326d7340, frame=0x4a1db0220, webPageID=15, frameID=3, resourceID=32] WebLoaderStrategy::scheduleLoad: Resource is being scheduled with the NetworkProcess (priority=2) This new form is a lot more verbose, but it really helps in tracing activity from the top of our page/frame/resource load stack to the bottom. No new tests - no added or changed functionality. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::networkProcessCrashed): (WebKit::WebLoaderStrategy::loadResourceSynchronously): * WebProcess/Network/WebLoaderStrategy.h: 2020-01-14 Alan Coon Cherry-pick r254042. rdar://problem/58549102 Source/WebCore/PAL: DumpRenderTree doesn't always call updateRendering() when a test completes https://bugs.webkit.org/show_bug.cgi?id=205761 Reviewed by Darin Adler. Add -[CATransaction synchronize]. * pal/spi/cocoa/QuartzCoreSPI.h: Source/WebKit: DumpRenderTree doesn't always call updateRendering() when a test completes https://bugs.webkit.org/show_bug.cgi?id=205761 Reviewed by Darin Adler. Use the QuartzCore SPI header. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: Source/WebKitLegacy/mac: Fix a souce of WebKit1 test flakiness https://bugs.webkit.org/show_bug.cgi?id=205761 Reviewed by Darin Adler. Some animation tests (and possibly many others) are flakey or broken in WK1 because there was no code to guarantee that Page::updateRendering() was called at notifyDone() time. WK2 calls DrawingArea::forceRepaint(), which does updateRendering(), flushes layers, and flushes a CATransaction. In WK1, we historically relied in AppKit to call -viewWillDraw on WebView and/or WebHTMLView, and just called [webView display] to make this happen. However, with layer backing, AppKit behavior changes, and WebCore changes that make more things happen with HTML event loop timing, this approach no longer works. The fix is to add WebView SPI, _forceRepaintForTesting, which emulates what WK2 is doing. * WebView/WebView.mm: (-[WebView _forceRepaintForTesting]): * WebView/WebViewPrivate.h: Tools: DumpRenderTree doesn't always call updateRendering() when a test completes https://bugs.webkit.org/show_bug.cgi?id=205761 Reviewed by Darin Adler. Some animation tests (and possibly many others) are flakey or broken in WK1 because there was no code to guarantee that Page::updateRendering() was called at notifyDone() time. WK2 calls DrawingArea::forceRepaint(), which does updateRendering(), flushes layers, and flushes a CATransaction. In WK1, we historically relied in AppKit to call -viewWillDraw on WebView and/or WebHTMLView, and just called [webView display] to make this happen. However, with layer backing, AppKit behavior changes, and WebCore changes that make more things happen with HTML event loop timing, this approach no longer works. The fix is to add WebView SPI, _forceRepaintForTesting, which emulates what WK2 is doing. * DumpRenderTree/mac/DumpRenderTree.mm: (updateDisplay): * DumpRenderTree/mac/PixelDumpSupportMac.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254042 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-05 Simon Fraser DumpRenderTree doesn't always call updateRendering() when a test completes https://bugs.webkit.org/show_bug.cgi?id=205761 Reviewed by Darin Adler. Use the QuartzCore SPI header. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 2020-01-14 Alan Coon Cherry-pick r254033. rdar://problem/58548645 Reformat WebPage logging https://bugs.webkit.org/show_bug.cgi?id=205705 Reviewed by Alex Christensen. Update the format used by WebPage in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x7f83ba009208 - WebPage (webPageID=15) - Adding a reason 1 to freeze layer tree (now 1); old reasons were 0 becomes: 0x7f83ba009208 - [webPageID=15] WebPage::freezeLayerTree: Adding a reason to freeze layer tree (reason=1, new=1, old=0) No new tests - no added or changed functionality. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): (WebKit::WebPage::createPlugin): (WebKit::WebPage::freezeLayerTree): (WebKit::WebPage::unfreezeLayerTree): (WebKit::WebPage::markLayersVolatile): (WebKit::WebPage::cancelMarkLayersVolatile): (WebKit::WebPage::touchEventSync): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254033 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-04 Keith Rollin Reformat WebPage logging https://bugs.webkit.org/show_bug.cgi?id=205705 Reviewed by Alex Christensen. Update the format used by WebPage in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x7f83ba009208 - WebPage (webPageID=15) - Adding a reason 1 to freeze layer tree (now 1); old reasons were 0 becomes: 0x7f83ba009208 - [webPageID=15] WebPage::freezeLayerTree: Adding a reason to freeze layer tree (reason=1, new=1, old=0) No new tests - no added or changed functionality. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): (WebKit::WebPage::createPlugin): (WebKit::WebPage::freezeLayerTree): (WebKit::WebPage::unfreezeLayerTree): (WebKit::WebPage::markLayersVolatile): (WebKit::WebPage::cancelMarkLayersVolatile): (WebKit::WebPage::touchEventSync): 2020-01-13 Alan Coon Cherry-pick r254101. rdar://problem/58535157 [iOS] Get display level in the UI process for all iOS platforms https://bugs.webkit.org/show_bug.cgi?id=205835 Reviewed by Brent Fulgham. This was previously only done for iOS, but should be done for all iOS platforms. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::registerNotificationObservers): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebProcessPool.h: * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254101 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-01-06 Per Arne Vollan [iOS] Get display level in the UI process for all iOS platforms https://bugs.webkit.org/show_bug.cgi?id=205835 Reviewed by Brent Fulgham. This was previously only done for iOS, but should be done for all iOS platforms. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::registerNotificationObservers): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebProcessPool.h: * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: 2020-01-03 Garrett Davidson IconLoadingClient::getLoadDecisionForIcon() leaks an Objective-C block https://bugs.webkit.org/show_bug.cgi?id=205750 Reviewed by Wenson Hsieh. Replace a Block_copy with makeBlockPtr to prevent leaking the ObjC block. * UIProcess/Cocoa/IconLoadingDelegate.mm: (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon): 2020-01-03 Tim Horton Crashes under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]_block_invoke https://bugs.webkit.org/show_bug.cgi?id=205749 Reviewed by Simon Fraser. Implement a speculative fix for a common crash. We believe that this is due to a mechanism UIKit uses to bounce -dealloc (in our case, of WKWebView and/or WKContentView) to the main thread when the last reference is dropped on a background thread. At that point, deallocation has already begun, -retain cannot revive the object, but -dealloc has not yet been called (because of the nature of this mechanism). To avoid this, make PageClientImpl -> WKContentView and WKContentView -> WKWebView weak instead of raw references. This way, we won't even get to _addUpdateVisibleContentRectPreCommitHandler with a deallocating WKWebView, nor try (and fail) to retain it for later use in the block. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::viewSize): (WebKit::PageClientImpl::didPerformDictionaryLookup): (WebKit::PageClientImpl::createValidationBubble): (WebKit::PageClientImpl::createDataListSuggestionsDropdown): (WebKit::PageClientImpl::createDrawingView): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): (-[WKContentView webView]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView _didCommitLayerTree:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView _updateLongPressAndHighlightLongPressGestures]): (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]): (-[WKContentView gestureRecognizerMayPinchToZoomWebView:]): (-[WKContentView _showAttachmentSheet]): (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView pointIsNearMarkedText:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView _stylusSingleTapRecognized:]): (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]): (-[WKContentView _updateInteractionTintColor]): (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView accessibilityRetrieveSpeakSelectionContent]): (-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]): (-[WKContentView accessoryAutoFill]): (-[WKContentView _updateAccessory]): (-[WKContentView _didChangeWebViewEditability]): (-[WKContentView insertTextSuggestion:]): (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]): (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:inDirection:]): (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]): (-[WKContentView addFocusedFormControlOverlay]): (-[WKContentView presentViewControllerForCurrentFocusedElement]): (-[WKContentView dismissAllInputViewControllers:]): (-[WKContentView _showShareSheet:inRect:completionHandler:]): (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]): (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]): (-[WKContentView dataDetectionContextForPositionInformation:]): (-[WKContentView actionSheetAssistant:getAlternateURLForImage:completion:]): (-[WKContentView _didChangeDragInteractionPolicy]): (-[WKContentView dragLiftDelay]): (-[WKContentView setupDragAndDropInteractions]): (-[WKContentView _didPerformDragOperation:]): (-[WKContentView _dragDestinationActionForDropSession:]): (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationLists:stagedDragSource:]): (-[WKContentView _handleDropByInsertingImagePlaceholders:session:]): (-[WKContentView _dragInteraction:dataOwnerForSession:]): (-[WKContentView dragInteraction:previewForLiftingItem:session:]): (-[WKContentView dragInteraction:sessionWillBegin:]): (-[WKContentView dragInteraction:session:didEndWithOperation:]): (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]): (-[WKContentView _dropInteraction:dataOwnerForSession:]): (-[WKContentView dropInteraction:sessionDidUpdate:]): (-[WKContentView dropInteraction:performDrop:]): (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]): (-[WKContentView viewController:inputContextViewHeightForSize:]): (-[WKContentView inputContextViewForViewController:]): (-[WKContentView _registerPreview]): (-[WKContentView assignLegacyDataForContextMenuInteraction]): (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]): (-[WKContentView continueContextMenuInteraction:]): (-[WKContentView _createTargetedPreviewIfPossible]): (-[WKContentView contextMenuInteraction:willDisplayMenuForConfiguration:animator:]): (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]): (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): (-[WKContentView _dataForPreviewItemController:atPosition:type:]): (-[WKContentView _presentedViewControllerForPreviewItemController:]): (-[WKContentView _previewItemController:commitPreview:]): (-[WKContentView _previewItemController:didDismissPreview:committing:]): 2020-01-03 Peng Liu Update the RemoteMediaPlayerManagerProxy::Load XPC message to provide the updated RemoteMediaPlayerConfiguration to the web process https://bugs.webkit.org/show_bug.cgi?id=205740 Reviewed by Eric Carlson. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::load): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::load): * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): 2020-01-03 Andy Estes [Apple Pay] Provide a better error message when Apple Pay blocks user agent script evaluation https://bugs.webkit.org/show_bug.cgi?id=205730 Reviewed by Brady Eidson. * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::userAgentScriptsBlockedErrorMessage const): * WebProcess/ApplePay/WebPaymentCoordinator.h: 2020-01-03 Dean Jackson Provide pid to crashing service worker process and GPU process https://bugs.webkit.org/show_bug.cgi?id=205564 Build fix for TestWebKitAPI. * UIProcess/API/C/WKContext.h: 2020-01-03 Yusuke Suzuki Put more WebCore/WebKit JS objects into IsoSubspace https://bugs.webkit.org/show_bug.cgi?id=205711 Reviewed by Keith Miller. * WebProcess/Plugins/Netscape/JSNPMethod.h: * WebProcess/Plugins/Netscape/JSNPObject.h: 2020-01-03 Simon Fraser Add some shared schemes to the WebKit.xcworkspace https://bugs.webkit.org/show_bug.cgi?id=205698 Reviewed by Tim Horton. Make WebKit.xcworkspace show the following schemes by default: All Source All Tools WTF JavaScriptCore WebCore WebKit WebKitLegacy DumpRenderTree WebKitTestRunner TestWebKitAPI MiniBrowser MobileMiniBrowser. Also remove the MobileMiniBrowserUITests scheme. * WebKit.xcodeproj/xcshareddata/xcschemes/WebKit.xcscheme: Copied from Tools/MobileMiniBrowser/MobileMiniBrowser.xcodeproj/xcshareddata/xcschemes/MobileMiniBrowserUITests.xcscheme. 2020-01-03 youenn fablet Provide pid to crashing service worker process and GPU process https://bugs.webkit.org/show_bug.cgi?id=205564 Reviewed by Alex Christensen. No change of behavior, we provide pids to the WKContext callbacks. * UIProcess/API/C/WKContext.h: * UIProcess/API/C/WKContextPrivate.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::gpuProcessCrashed): * UIProcess/WebContextClient.cpp: (WebKit::WebContextClient::serviceWorkerProcessDidCrash): (WebKit::WebContextClient::gpuProcessDidCrash): * UIProcess/WebContextClient.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::serviceWorkerProcessCrashed): (WebKit::WebProcessPool::gpuProcessCrashed): * UIProcess/WebProcessPool.h: 2020-01-03 Alex Christensen Deprecate _WKWebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=205539 Reviewed by Wenson Hsieh. Its last use was removed in rdar://problem/58064847 but we need to keep it in WebKit until the next Safari release to keep Safari working with built versions of open source WebKit with run-safari. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateWebsitePolicies:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): 2020-01-03 youenn fablet NetworkResourceLoader::didFinishWithRedirectResponse should not assume the load is coming from network https://bugs.webkit.org/show_bug.cgi?id=205715 Reviewed by Alex Christensen. Covered by updated test. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse): If redirection is coming from cache, the load is not null. We just need to use the request URL since the redirection mode is manual. 2020-01-03 Chris Dumez Unreviewed, drop new assertion added in r253984 which hits on OpenSource bots * Shared/ios/DependencyProcessAssertionIOS.mm: (WebKit::DependencyProcessAssertion::DependencyProcessAssertion): 2020-01-03 Chris Dumez Improve release logging in ServiceWorkerFetchTask https://bugs.webkit.org/show_bug.cgi?id=205692 Reviewed by Youenn Fablet. Improve release logging in ServiceWorkerFetchTask to facilitate debugging. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::~ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::start): (WebKit::ServiceWorkerFetchTask::contextClosed): (WebKit::ServiceWorkerFetchTask::startFetch): (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didFinish): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): (WebKit::ServiceWorkerFetchTask::cannotHandle): (WebKit::ServiceWorkerFetchTask::cancelFromClient): (WebKit::ServiceWorkerFetchTask::continueDidReceiveFetchResponse): (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): (WebKit::ServiceWorkerFetchTask::softUpdateIfNeeded): 2020-01-03 youenn fablet Fix non-libwebrtc builds after r253957 https://bugs.webkit.org/show_bug.cgi?id=205714 Unreviewed. * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: Move the includes inside the compilation guard. 2020-01-02 Keith Rollin Reformat WebProcess logging https://bugs.webkit.org/show_bug.cgi?id=205691 Reviewed by Chris Dumez. Update the format used by WebProcess in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x6f1df7000 - WebProcess::destroyRenderingResources() took 0.02ms becomes: 0x6f1df7000 - [sessionID=2] WebProcess::destroyRenderingResources: took 0.02ms While we're at it, also convert over to the RELEASE_LOG_IF_ALLOWED style of logging macro. We didn't used to be able to do this since the decision on whether or not to allow logging is typically based on SessionID, which didn't used to be an attribute of WebProcess. Now WebProcesses do (or can) have a SessionID, so use that to support the hiding of logging in private sessions. No new tests - no added or changed functionality. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::prepareToSuspend): (WebKit::WebProcess::markAllLayersVolatile): (WebKit::WebProcess::freezeAllLayerTrees): (WebKit::WebProcess::unfreezeAllLayerTrees): (WebKit::WebProcess::processDidResume): (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions): (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions): * WebProcess/WebProcess.h: (WebKit::WebProcess::isAlwaysOnLoggingAllowed): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): (WebKit::WebProcess::updateCPUMonitorState): (WebKit::WebProcess::destroyRenderingResources): (WebKit::WebProcess::updateFreezerStatus): 2020-01-02 Yusuke Suzuki and Simon Fraser Experiment: create lots of different malloc zones for easier accounting of memory use https://bugs.webkit.org/show_bug.cgi?id=186422 Reviewed by Saam Barati. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::~ShareableBitmap): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataEncoder::HistoryEntryDataEncoder): (WebKit::HistoryEntryDataEncoder::finishEncoding): (WebKit::encodeSessionHistoryEntryData): (WebKit::encodeLegacySessionState): 2020-01-02 Chris Dumez [iOS] Replace "unexpectedly resumed" observer with RunningBoard suspendible assertions https://bugs.webkit.org/show_bug.cgi?id=205687 Reviewed by Tim Horton. Adopt new RunningBoard process assertion to indicate that WebContent processes depend on their UIProcess (and therefore, the UIProcess must be running if the WebContent process is). This replaces our "Unexpectedly resumed" assertion which was causing unexpected terminations in some cases. * Configurations/WebKit.xcconfig: * Platform/spi/ios/RunningBoardServicesSPI.h: Added. * Scripts/process-entitlements.sh: * Shared/DependencyProcessAssertion.cpp: Added. (WebKit::DependencyProcessAssertion::DependencyProcessAssertion): (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion): * Shared/DependencyProcessAssertion.h: Added. * Shared/ios/DependencyProcessAssertionIOS.mm: Added. (WebKit::DependencyProcessAssertion::DependencyProcessAssertion): (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion): * Sources.txt: * SourcesCocoa.txt: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: 2020-01-02 Keith Rollin Reformat WebProcessCache logging https://bugs.webkit.org/show_bug.cgi?id=205683 Reviewed by Alex Christensen. Update the format used by WebProcessCache in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x1145ed208 - WebProcessCache::canCacheProcess(): Not caching process 83671 because it does not have an associated registrable domain becomes: 0x1145ed208 - [PID=83671] WebProcessCache::canCacheProcess: Not caching process because it does not have an associated registrable domain No new tests - no added or changed functionality. * UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::canCacheProcess const): (WebKit::WebProcessCache::addProcessIfPossible): (WebKit::WebProcessCache::addProcess): (WebKit::WebProcessCache::takeProcess): (WebKit::WebProcessCache::updateCapacity): (WebKit::WebProcessCache::clear): (WebKit::WebProcessCache::clearAllProcessesForSession): (WebKit::WebProcessCache::setApplicationIsActive): (WebKit::WebProcessCache::removeProcess): 2020-01-02 Keith Rollin Reformat ProcessThrottler logging https://bugs.webkit.org/show_bug.cgi?id=205679 Reviewed by Alex Christensen. Update the format used by ProcessThrottler in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: [PID: 0] 0x1145ce5e8 - ProcessThrottler::invalidateAllActivities() BEGIN becomes: 0x1145ce5e8 - [PID: 0] ProcessThrottler::invalidateAllActivities: BEGIN No new tests - no added or changed functionality. * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::invalidateAllActivities): (WebKit::ProcessThrottler::setAssertionState): (WebKit::ProcessThrottler::updateAssertionIfNeeded): (WebKit::ProcessThrottler::didConnectToProcess): (WebKit::ProcessThrottler::prepareToSuspendTimeoutTimerFired): (WebKit::ProcessThrottler::processReadyToSuspend): (WebKit::ProcessThrottler::sendPrepareToSuspendIPC): (WebKit::ProcessThrottler::uiAssertionWillExpireImminently): * UIProcess/ProcessThrottler.h: (WebKit::ProcessThrottler::Activity::Activity): (WebKit::ProcessThrottler::Activity::invalidate): 2020-01-02 Keith Rollin Reformat WebResourceLoader logging https://bugs.webkit.org/show_bug.cgi?id=205680 Reviewed by Alex Christensen. Update the format used by WebResourceLoader in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x4a1dbcb58 - WebResourceLoader::didFinishResourceLoad: (webPageID=15, frameID=3, resourceID=1, length=212132) becomes: 0x4a1dbcb58 - [webPageID=15, frameID=3, resourceID=1] WebResourceLoader::didFinishResourceLoad: (length=212132) No new tests - no added or changed functionality. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): (WebKit::WebResourceLoader::didReceiveResponse): (WebKit::WebResourceLoader::didReceiveData): (WebKit::WebResourceLoader::didFinishResourceLoad): (WebKit::WebResourceLoader::serviceWorkerDidNotHandle): (WebKit::WebResourceLoader::didFailResourceLoad): (WebKit::WebResourceLoader::didBlockAuthenticationChallenge): (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): (WebKit::WebResourceLoader::didReceiveResource): 2020-01-02 Alex Christensen Add SPI to disable CORS on requests to URLs matching a pattern https://bugs.webkit.org/show_bug.cgi?id=205534 Reviewed by Chris Dumez. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy const): (API::PageConfiguration::PageConfiguration): Deleted. (API::PageConfiguration::~PageConfiguration): Deleted. * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::corsDisablingPatterns const): (API::PageConfiguration::setCORSDisablingPatterns): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _corsDisablingPatterns]): (-[WKWebViewConfiguration _setCORSDisablingPatterns:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/WebPageProxy.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2020-01-02 Sam Weinig Simplify StringBuilder API/align with makeString by removing appendFixed* functions and using FormatNumber struct instead https://bugs.webkit.org/show_bug.cgi?id=205671 Reviewed by Alex Christensen. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::dumpContentsToFile): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::asJSON const): * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::loggingString const): Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)). 2020-01-02 Carlos Garcia Campos [GTK] Make ondemand hardware acceleration policy never leave AC mode https://bugs.webkit.org/show_bug.cgi?id=205558 Reviewed by Sergio Villar Senin. We still enter AC mode on demand but we never leave it for the same drawing area. This avoids scrolling performance problems with some websites that start small accelerated animation while scrolling (like WebKit bugzilla review tool), due to constant enter/leave AC mode. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_class_init): Update API documentation. * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Force AC mode the first time we enter it. 2019-12-22 Jeff Miller Update user-visible copyright strings to include 2020 https://bugs.webkit.org/show_bug.cgi?id=205552 Reviewed by Darin Adler. * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-OSX.plist: * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist: * Info.plist: * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-OSX.plist: * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist: * PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.64.Info.plist: * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist: 2019-12-31 Peng Liu Add remote media resource loader for the GPU process https://bugs.webkit.org/show_bug.cgi?id=205379 Reviewed by Youenn Fablet. In the GPU process, the RemoteMediaResourceLoader creates RemoteMediaResource(s), which will notify the media resource clients (WebCoreNSURLSessionDataTaskClient). Then the data will be forwarded to AVFoundation. In the Web process, MeidaResourceLoader creates MediaResource(s), which take care of downloading media data through the network process. The received data will be forwarded to RemoteMediaResourceProxy, which will forward the data to the corresponding RemoteMediaResource through XPC messages. (WebKit::GPUConnectionToWebProcess::remoteMediaResourceManager): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::~RemoteMediaPlayerProxy): (WebKit::RemoteMediaPlayerProxy::requestResource): (WebKit::RemoteMediaPlayerProxy::removeResource): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCreateResourceLoader): * GPUProcess/media/RemoteMediaPlayerProxy.h: (WebKit::RemoteMediaPlayerProxy::~RemoteMediaPlayerProxy): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier): Deleted. * GPUProcess/media/RemoteMediaResource.cpp: Added. (WebKit::RemoteMediaResource::create): (WebKit::RemoteMediaResource::RemoteMediaResource): (WebKit::RemoteMediaResource::~RemoteMediaResource): (WebKit::RemoteMediaResource::stop): (WebKit::RemoteMediaResource::didPassAccessControlCheck const): (WebKit::RemoteMediaResource::responseReceived): (WebKit::RemoteMediaResource::redirectReceived): (WebKit::RemoteMediaResource::shouldCacheResponse): (WebKit::RemoteMediaResource::dataSent): (WebKit::RemoteMediaResource::dataReceived): (WebKit::RemoteMediaResource::accessControlCheckFailed): (WebKit::RemoteMediaResource::loadFailed): (WebKit::RemoteMediaResource::loadFinished): * GPUProcess/media/RemoteMediaResource.h: Added. (WebKit::RemoteMediaResource::ready const): (WebKit::RemoteMediaResource::setReady): * GPUProcess/media/RemoteMediaResourceIdentifier.h: Added. * GPUProcess/media/RemoteMediaResourceLoader.cpp: Added. (WebKit::RemoteMediaResourceLoader::RemoteMediaResourceLoader): (WebKit::RemoteMediaResourceLoader::~RemoteMediaResourceLoader): (WebKit::RemoteMediaResourceLoader::requestResource): * GPUProcess/media/RemoteMediaResourceLoader.h: Added. * GPUProcess/media/RemoteMediaResourceManager.cpp: Added. (WebKit::RemoteMediaResourceManager::RemoteMediaResourceManager): (WebKit::RemoteMediaResourceManager::~RemoteMediaResourceManager): (WebKit::RemoteMediaResourceManager::addMediaResource): (WebKit::RemoteMediaResourceManager::removeMediaResource): (WebKit::RemoteMediaResourceManager::responseReceived): (WebKit::RemoteMediaResourceManager::redirectReceived): (WebKit::RemoteMediaResourceManager::dataSent): (WebKit::RemoteMediaResourceManager::dataReceived): (WebKit::RemoteMediaResourceManager::accessControlCheckFailed): (WebKit::RemoteMediaResourceManager::loadFailed): (WebKit::RemoteMediaResourceManager::loadFinished): * GPUProcess/media/RemoteMediaResourceManager.h: Added. * GPUProcess/media/RemoteMediaResourceManager.messages.in: Added. * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::requestResource): (WebKit::MediaPlayerPrivateRemote::removeResource): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/MediaPlayerPrivateRemoteIdentifier.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::supportsTypeAndCodecs): (WebKit::RemoteMediaPlayerManager::originsInMediaCache): (WebKit::RemoteMediaPlayerManager::clearMediaCacheForOrigins): (WebKit::RemoteMediaPlayerManager::networkStateChanged): (WebKit::RemoteMediaPlayerManager::readyStateChanged): (WebKit::RemoteMediaPlayerManager::volumeChanged): (WebKit::RemoteMediaPlayerManager::muteChanged): (WebKit::RemoteMediaPlayerManager::timeChanged): (WebKit::RemoteMediaPlayerManager::durationChanged): (WebKit::RemoteMediaPlayerManager::rateChanged): (WebKit::RemoteMediaPlayerManager::playbackStateChanged): (WebKit::RemoteMediaPlayerManager::engineFailedToLoad): (WebKit::RemoteMediaPlayerManager::requestResource): (WebKit::RemoteMediaPlayerManager::removeResource): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromGPUProcess): (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromWebProcess): Deleted. * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: * WebProcess/GPU/media/RemoteMediaResourceProxy.cpp: Added. (WebKit::RemoteMediaResourceProxy::RemoteMediaResourceProxy): (WebKit::RemoteMediaResourceProxy::~RemoteMediaResourceProxy): (WebKit::RemoteMediaResourceProxy::responseReceived): (WebKit::RemoteMediaResourceProxy::redirectReceived): (WebKit::RemoteMediaResourceProxy::shouldCacheResponse): (WebKit::RemoteMediaResourceProxy::dataSent): (WebKit::RemoteMediaResourceProxy::dataReceived): (WebKit::RemoteMediaResourceProxy::accessControlCheckFailed): (WebKit::RemoteMediaResourceProxy::loadFailed): (WebKit::RemoteMediaResourceProxy::loadFinished): * WebProcess/GPU/media/RemoteMediaResourceProxy.h: Added. 2019-12-31 youenn fablet Implement RTC VTB decoders in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=205607 Reviewed by Eric Carlson. Implement decoder factory callbacks. Implement WebProcess codecs by sending IPC for creating/releasing/decoding a frame. WebProcess receives IPC messages from GPU Process whenever a frame is decoded. * Configurations/WebKit.xcconfig: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::libWebRTCCodecsProxy): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: Added. (WebKit::LibWebRTCCodecsProxy::didReceiveMessageFromWebProcess): * GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in: Added. * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: Added. (WebKit::LibWebRTCCodecsProxy::LibWebRTCCodecsProxy): (WebKit::LibWebRTCCodecsProxy::~LibWebRTCCodecsProxy): (WebKit::LibWebRTCCodecsProxy::createDecoder): (WebKit::LibWebRTCCodecsProxy::releaseDecoder): (WebKit::LibWebRTCCodecsProxy::decodeFrame): * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/GPUProcessConnection.cpp: (WebKit::GPUProcessConnection::didReceiveMessage): * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: Added. (WebKit::createVideoDecoder): (WebKit::releaseVideoDecoder): (WebKit::decodeVideoFrame): (WebKit::registerDecodeCompleteCallback): (WebKit::LibWebRTCCodecs::setVideoDecoderCallbacks): (WebKit::LibWebRTCCodecs::createDecoder): (WebKit::LibWebRTCCodecs::releaseDecoder): (WebKit::LibWebRTCCodecs::decodeFrame): (WebKit::LibWebRTCCodecs::registerDecodeFrameCallback): (WebKit::LibWebRTCCodecs::failedDecoding): (WebKit::LibWebRTCCodecs::completedDecoding): * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: Added. * WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in: Added. * WebProcess/GPU/webrtc/RTCDecoderIdentifier.h: Added. * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::LibWebRTCProvider::createDecoderFactory): * WebProcess/Network/webrtc/LibWebRTCProvider.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::libWebRTCCodecs): * WebProcess/WebProcess.h: 2019-12-30 Brady Eidson Add WKWebView SPI to evaluate a function with arguments https://bugs.webkit.org/show_bug.cgi?id=205239 Reviewed by Alex Christensen. * Shared/API/APISerializedScriptValue.h: * UIProcess/API/C/WKPage.cpp: (WKPageRunJavaScriptInMainFrame): * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm: (API::sharedContext): (API::SerializedScriptValue::deserialize): (API::SerializedScriptValue::wireBytesFromNSObject): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView evaluateJavaScript:completionHandler:]): (validateArgument): (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:]): (-[WKWebView _callAsyncFunction:withArguments:completionHandler:]): (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]): (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_run_javascript): (webkit_web_view_run_javascript_in_world): (resourcesStreamReadCallback): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): * UIProcess/WebPageProxy.h: * UIProcess/socket/RemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::runScript): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScript): (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld): (WebKit::WebPage::runJavaScriptInFrame): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-12-29 Peng Liu Tweak the format and comment in the code to support media in GPU process https://bugs.webkit.org/show_bug.cgi?id=205631 Reviewed by Eric Carlson. No new tests, no functional change. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::logChannel const): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: * WebProcess/GPU/GPUProcessConnectionInfo.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: * WebProcess/GPU/media/MediaPlayerPrivateRemoteIdentifier.h: * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: * WebProcess/GPU/media/RemoteMediaPlayerState.h: 2019-12-29 Eric Carlson Cleanup media IPC encoders https://bugs.webkit.org/show_bug.cgi?id=205630 Reviewed by Anders Carlsson. * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: (WebKit::RemoteMediaPlayerProxyConfiguration::decode): * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: (WebKit::RemoteMediaPlayerConfiguration::decode): 2019-12-28 Antti Koivisto Make simple line layout an internal feature https://bugs.webkit.org/show_bug.cgi?id=205615 Reviewed by Zalan Bujtas. So it can be enabled/disabled from run-webkit-tests command line. This also adds it to the internal feature menus, allowing removal of hardcoded menu entries. * Shared/WebPreferences.yaml: 2019-12-23 Darin Adler Refactor to simplify broadcasting to all media elements https://bugs.webkit.org/show_bug.cgi?id=205567 Reviewed by Eric Carlson. * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: (WebKit::InjectedBundleHitTestResult::mediaType const): Use is. 2019-12-26 Carlos Garcia Campos [GTK][WPE] Remove duplicated code https://bugs.webkit.org/show_bug.cgi?id=205560 Reviewed by Sergio Villar Senin. Remove duplicated code related to IME between GTK and WPE that can be shared. * SourcesGTK.txt: * SourcesWPE.txt: * WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp: Added. (WebKit::WebEditorClient::handleInputMethodKeydown): (WebKit::WebEditorClient::didDispatchInputMethodKeydown): * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: * WebProcess/WebPage/glib/WebPageGLib.cpp: (WebKit::WebPage::setInputMethodState): * WebProcess/WebPage/gtk/WebPageGtk.cpp: * WebProcess/WebPage/wpe/WebPageWPE.cpp: 2019-12-24 Eric Carlson [Media in GPU process] Enable media player proxy logging https://bugs.webkit.org/show_bug.cgi?id=205557 Reviewed by Youenn Fablet. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::create): (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): (WebKit::GPUConnectionToWebProcess::logger): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::createGPUConnectionToWebProcess): * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::logger const): (WebKit::nullLogger): Deleted. * Platform/Logging.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::openGPUProcessConnection): * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::logChannel const): 2019-12-24 youenn fablet Service Worker doesn't terminate after a period of time when thread blocking https://bugs.webkit.org/show_bug.cgi?id=202992 Reviewed by Chris Dumez. Add a preference to enable/disable service worker short timeouts. Add IPC handling for passing service worker heart beat failures and to get from WebProcess whether a given service worker is running or not. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::contextConnectionCreated): (WebKit::WebSWServerConnection::syncTerminateWorkerFromClient): (WebKit::WebSWServerConnection::isServiceWorkerRunning): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesGetServiceWorkerTestMode): (WKPreferencesSetServiceWorkerTestMode): * UIProcess/API/C/WKPreferencesRef.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::isServiceWorkerRunning): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updatePreferencesStore): (WebKit::WebSWContextManagerConnection::didFailHeartBeatCheck): * WebProcess/Storage/WebSWContextManagerConnection.h: 2019-12-23 Alexey Proskuryakov watchOS build fix attempt Not sure what broke the build, seems like UserInterfaceIdiom.h used to be included via unified build, and no longer is. Added the include. While at it, removed an ancient __IPHONE_OS_VERSION_MIN_REQUIRED version check. * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: 2019-12-23 Wenson Hsieh Unreviewed, fix the macCatalyst build after r253866 * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): MediaPlayer::mediaKeysStorageDirectory() is guarded by ENABLE(LEGACY_ENCRYPTED_MEDIA). 2019-12-23 Carlos Garcia Campos WebDriver: fix handling of session timeouts for values higher than MAX_INT https://bugs.webkit.org/show_bug.cgi?id=204114 Reviewed by Brian Burg. Use number instead of integer for all optional timeout parameters. In the case of script timeout, not passing a value means a timeout should not be used, so use Optional also for the IPC message and handle the optional value in the web process to not set any timeout in that case. * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::waitForNavigationToComplete): (WebKit::WebAutomationSession::navigateBrowsingContext): (WebKit::WebAutomationSession::goBackInBrowsingContext): (WebKit::WebAutomationSession::goForwardInBrowsingContext): (WebKit::WebAutomationSession::reloadBrowsingContext): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): * UIProcess/Automation/WebAutomationSession.h: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.js: (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): * WebProcess/Automation/WebAutomationSessionProxy.messages.in: 2019-12-23 Carlos Garcia Campos [GTK] InputMethod API unit tests don't work under X11 https://bugs.webkit.org/show_bug.cgi?id=205497 Reviewed by Žan Doberšek. Assume the web view is always focused when running tests under Xvfb, since there isn't a window manager to focus the toplevel window in that case. * UIProcess/API/glib/InputMethodFilter.cpp: (WebKit::InputMethodFilter::isViewFocused const): 2019-12-23 Carlos Garcia Campos [GTK][WPE] Special combination characters doesn't respect the keystroke order when high CPU load https://bugs.webkit.org/show_bug.cgi?id=185248 Reviewed by Žan Doberšek. Key events are queued by the WebPageProxy so that the next event is not sent to the web process until the previous one has been handled by the web process already. However, the composition results generated by key events are sent to the web process using IPC messages when they happen. In case of high CPU load it can happen that the composition results are sent to the web process even before the associated keys, that are still in the queue waiting to be sent. We need to ensure that composition results are always processed right after its associated key press event. So, instead of sending the results independently, we now include them as part of the key event. * Shared/NativeWebKeyboardEvent.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor. * Shared/WebEvent.h: (WebKit::WebKeyboardEvent::preeditUnderlines const): Return the optional preeditUnderlines. (WebKit::WebKeyboardEvent::preeditSelectionRange const): Return the optional preeditSelectionRange. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): Copy preeditUnderlines and preeditSelectionRange too. * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange parameters and initialize them. (WebKit::WebKeyboardEvent::encode const): Encode preeditUnderlines and preeditSelectionRange. (WebKit::WebKeyboardEvent::decode): Decode preeditUnderlines and preeditSelectionRange. * Shared/gtk/NativeWebKeyboardEventGtk.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange parameters and initialize them. * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange parameters and pass them to WebKeyboardEvent constructor. * Shared/gtk/WebEventFactory.h: * Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange parameters and initialize them. * Shared/libwpe/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRang parameters and pass them to WebKeyboardEvent constructor. * Shared/libwpe/WebEventFactory.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewSynthesizeCompositionKeyPress): Pass the preeditUnderlines and preeditSelectionRange to platform implementation. (webkitWebViewSetComposition): Remove the call to WebPageProxy::setComposition(). (webkitWebViewConfirmComposition): Remove the call to WebPageProxy::confirmComposition(). (webkitWebViewCancelComposition): Call WebPageProxy::cancelComposition(); * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseKeyPressEvent): Pass the preeditUnderlines and preeditSelectionRange to NativeWebKeyboardEvent constructor. (webkitWebViewBaseKeyReleaseEvent): Ditto. (webkitWebViewBaseSynthesizeCompositionKeyPress): Ditto. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::handleKeyboardEvent): Ditto. (WKWPE::View::synthesizeCompositionKeyPress): Ditto. * UIProcess/API/wpe/WPEView.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::WebEditorClient::didDispatchInputMethodKeydown): Handle the composition results here, right after the associated key events has been dispatched. * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: (WebKit::WebEditorClient::didDispatchInputMethodKeydown): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::cancelComposition): Confirm the given string to cancel the composition. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Remove SetComposition message and rename ConfirmComposition as CancelComposition since it's now only used for canceling. 2019-12-22 Simon Fraser Make support for an internal feature, off by default https://bugs.webkit.org/show_bug.cgi?id=205542 Reviewed by Antti Koivisto. Make DialogElementEnabled an internal feature so it shows up in the menus and can be toggled on for experimentation. * Shared/WebPreferences.yaml: 2019-12-21 Simon Fraser Make support for an experimental feature, off by default https://bugs.webkit.org/show_bug.cgi?id=205542 Reviewed by Dean Jackson. Make DialogElementEnabled an experimental feature (off by default). * Shared/WebPreferences.yaml: 2019-12-21 Simon Fraser Make support for an experimental feature, off by default https://bugs.webkit.org/show_bug.cgi?id=205542 Reviewed by Dean Jackson. Make DialogElementEnabled an experimental feature (off by default). * Shared/WebPreferences.yaml: 2019-12-22 Eric Carlson [Media in GPU process] Add remote media player proxy configuration https://bugs.webkit.org/show_bug.cgi?id=205547 Reviewed by Tim Horton. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy): (WebKit::RemoteMediaPlayerProxy::getConfiguration): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded): (WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const): * GPUProcess/media/RemoteMediaPlayerProxy.h: (WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier): * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: Added. (WebKit::RemoteMediaPlayerProxyConfiguration::encode const): (WebKit::RemoteMediaPlayerProxyConfiguration::decode): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::engineDescription const): (WebKit::MediaPlayerPrivateRemote::supportsScanning const): (WebKit::MediaPlayerPrivateRemote::supportsPictureInPicture const): (WebKit::MediaPlayerPrivateRemote::supportsAcceleratedRendering const): (WebKit::MediaPlayerPrivateRemote::canPlayToWirelessPlaybackTarget const): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: Added. (WebKit::RemoteMediaPlayerConfiguration::encode const): (WebKit::RemoteMediaPlayerConfiguration::decode): * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): 2019-12-21 Brian Burg Web Inspector: add InspectedTargetTypes diagnostic event and related hooks https://bugs.webkit.org/show_bug.cgi?id=205174 Reviewed by Devin Rousso. This change supplies Web Inspector with information about the debuggable that it is connected to. This is used for diagnostics and to customize the UI based on the target type being inspected. For remote Web Inspector, WebKit clients can populate an instance of _WKInspectorDebuggableInfo and use it when calling into -[_WKRemoteWebInspectorViewController loadForDebuggable:backendCommandsURL:]. For local Web Inspector, WebInspectorProxy fills in information for the local debuggable by consulting SystemVersion.plist (on Mac port). The new enum _WKInspectorDebuggableType replaces _WKRemoteWebInspectorDebuggableType. Its WebCore equivalent is Inspector::DebuggableType. The type and other information are carried around in a _WKInspectorDebuggableInfo class. The equivalents for this class are API::DebuggableInfo and DebuggableInfoData (for sending over IPC). The DebuggableInfoData is sent as part of the initial message from UIProcess to an Inspector WebProcess, similar to how a debuggableType string was sent before. * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: Add new files. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): Add new object type. * Shared/WebCoreArgumentCoders.h: Add EnumTraits for Inspector::DebuggableType. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewControllerPrivate.h: * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (legacyDebuggableTypeToModernDebuggableType): (-[_WKRemoteWebInspectorViewController loadForDebuggableType:backendCommandsURL:]): (-[_WKRemoteWebInspectorViewController loadForDebuggable:backendCommandsURL:]): (debuggableTypeString): Deleted. Use the new enum in a new method that clients can switch over to. The old method can be removed when it is no longer being used. * UIProcess/RemoteWebInspectorProxy.h: * UIProcess/RemoteWebInspectorProxy.cpp: (WebKit::RemoteWebInspectorProxy::RemoteWebInspectorProxy): (WebKit::RemoteWebInspectorProxy::load): (WebKit::RemoteWebInspectorProxy::reopen): Send DebuggableInfoData struct to RemoteWebInspectorUI. * UIProcess/WebInspectorProxy.h: * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::openLocalInspectorFrontend): (WebKit::WebInspectorProxy::infoForLocalDebuggable): Send DebuggableInfoData struct to WebInspectorUI. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::systemVersionPlist): (WebKit::WebInspectorProxy::infoForLocalDebuggable): Add Mac implementation for local debuggables. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::infoForLocalDebuggable): * UIProcess/win/WebInspectorProxyWin.cpp: (WebKit::WebInspectorProxy::infoForLocalDebuggable): * UIProcess/wpe/WebInspectorProxyWPE.cpp: (WebKit::WebInspectorProxy::infoForLocalDebuggable): Add stubs for other platforms. * UIProcess/glib/RemoteInspectorClient.cpp: * UIProcess/socket/RemoteInspectorClient.h: * UIProcess/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::inspect): (WebKit::debuggableTypeToString): (WebKit::RemoteInspectorClient::setTargetList): Use Inspector::DebuggableType instead of String for debuggable type. * WebProcess/WebPage/RemoteWebInspectorUI.messages.in: * WebProcess/WebPage/RemoteWebInspectorUI.h: * WebProcess/WebPage/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::initialize): (WebKit::RemoteWebInspectorUI::debuggableType const): (WebKit::RemoteWebInspectorUI::targetPlatformName const): (WebKit::RemoteWebInspectorUI::targetBuildVersion const): (WebKit::RemoteWebInspectorUI::targetProductVersion const): (WebKit::RemoteWebInspectorUI::targetIsSimulator const): Implement new methods needed by InspectorFrontendClient / InspectorFrontendHost. * WebProcess/WebPage/WebInspectorUI.messages.in: * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::establishConnection): (WebKit::WebInspectorUI::targetPlatformName const): (WebKit::WebInspectorUI::targetBuildVersion const): (WebKit::WebInspectorUI::targetProductVersion const): Implement new methods needed by InspectorFrontendClient / InspectorFrontendHost. 2019-12-21 Eric Carlson [Media in GPU process] Add remote media player configuration https://bugs.webkit.org/show_bug.cgi?id=205541 Reviewed by Simon Fraser. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded): (WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const): * GPUProcess/media/RemoteMediaPlayerProxy.h: (WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): 2019-12-21 Kate Cheney Add timeStamp to ITP database https://bugs.webkit.org/show_bug.cgi?id=205121 Reviewed by John Wilander. This patch adds support for collecting most-recently-updated timestamps for third-party/first-party domain pairs in the ITP database. It updates the timestamp when new statistics are merged into the database. It then exposes the timestamp via the _getResourceLoadStatisticsDataSummary API. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList): Changed INSERT OR IGNORE queries to be INSERT OR REPLACE so the timestamp will be replaced upon a new attempted insert into one of the third-party/first-party relationship tables. ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList now checks for the keyword "REPLACE" to know if another bind is needed to update the timestamp. (WebKit::ResourceLoadStatisticsDatabaseStore::getMostRecentlyUpdatedTimestamp): Queries the most recent time that the third party has appeared as a subframe or subresource under the first party or redirected to the first party. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: (WebKit::ThirdPartyDataForSpecificFirstParty::toString const): Updated the toString to check if the timestamp occured in the last 24 hours for testing purposes. It doesn't print the specific time because it would change for every run and could not be tested. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _setUseITPDatabase:completionHandler:]): Added new function that enables the ITP Database backend so the timestamp parameter can be tested in in TestWebKitAPI. * UIProcess/API/APIResourceLoadStatisticsFirstParty.h: * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.mm: (-[_WKResourceLoadStatisticsFirstParty timeLastUpdated]): Added the new timestamp parameter to the _WKResourceLoadStatisticsFirstParty.mm class and its wrapper to be sent via API call. 2019-12-20 Eric Carlson [Media in GPU process] Get audio playing https://bugs.webkit.org/show_bug.cgi?id=205511 Reviewed by Jer Noble. * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::updateCachedState): (WebKit::MediaPlayerPrivateRemote::maximumDurationToCacheMediaTime const): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.h: 2019-12-20 Jer Noble Enable HDR Media Capabilities by default https://bugs.webkit.org/show_bug.cgi?id=205518 Reviewed by Eric Carlson. * Shared/WebPreferences.yaml: 2019-12-20 Tim Horton Clean up and generalize some interaction additions https://bugs.webkit.org/show_bug.cgi?id=205430 Reviewed by Wenson Hsieh. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): 2019-12-20 Tim Horton Expose approximate caret extents for the hit line via InteractionInformationAtPosition https://bugs.webkit.org/show_bug.cgi?id=205526 Reviewed by Dean Jackson. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): Compute and expose the union of first and last caret rects on the line. * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): * Shared/ios/InteractionInformationRequest.cpp: (WebKit::InteractionInformationRequest::encode const): (WebKit::InteractionInformationRequest::decode): (WebKit::InteractionInformationRequest::isValidForRequest): * Shared/ios/InteractionInformationRequest.h: Also, add a bit so that we can only fetch this data when needed. 2019-12-20 Brent Fulgham Remove access to 'com.apple.cfprefsd.agent' from the macOS sandbox https://bugs.webkit.org/show_bug.cgi?id=205478 Reviewed by Darin Adler. Telemetry and thorough testing has confirmed that we do not need access to this mach service, and so should remove it. Tested by fast/sandboxing/mac * WebProcess/com.apple.WebProcess.sb.in: 2019-12-20 Brian Burg Unreviewed, try to fix the non-unified sources build. * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp: (WebKit::MockAuthenticatorManager::filterTransports const): The current chunking of unified source files seems to provide a 'using namespace WebCore' for these references to AuthenticatorTransport. Add a namespace qualification so that this file compiles by itself. 2019-12-20 James Savage Include WKPDFConfiguration, WKFindConfiguration, and WKFindResult in umbrella header https://bugs.webkit.org/show_bug.cgi?id=205432 Reviewed by Wenson Hsieh. * Shared/API/Cocoa/WebKit.h: Include new headers. 2019-12-20 Brian Burg Web Inspector: convert some InspectorFrontendHost methods to getters https://bugs.webkit.org/show_bug.cgi?id=205475 Reviewed by Devin Rousso. No reason for these to be method calls, so expose as getters / attributes instead. * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp: (WebKit::WebInspectorUI::localizedStringsURL const): (WebKit::RemoteWebInspectorUI::localizedStringsURL const): (WebKit::WebInspectorUI::localizedStringsURL): Deleted. (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted. * WebProcess/WebPage/mac/WebInspectorUIMac.mm: (WebKit::WebInspectorUI::localizedStringsURL const): (WebKit::RemoteWebInspectorUI::localizedStringsURL const): (WebKit::WebInspectorUI::localizedStringsURL): Deleted. (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted. * WebProcess/WebPage/win/WebInspectorUIWin.cpp: (WebKit::WebInspectorUI::localizedStringsURL const): (WebKit::RemoteWebInspectorUI::localizedStringsURL const): (WebKit::WebInspectorUI::localizedStringsURL): Deleted. (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted. * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: (WebKit::WebInspectorUI::localizedStringsURL const): (WebKit::RemoteWebInspectorUI::localizedStringsURL const): (WebKit::WebInspectorUI::localizedStringsURL): Deleted. (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted. 2019-12-20 Alex Christensen Allow a managed configuration to re-enable TLS 1.0 and 1.1 https://bugs.webkit.org/show_bug.cgi?id=205479 Reviewed by Geoffrey Garen. * Platform/spi/ios/ManagedConfigurationSPI.h: Removed. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView _defineForWebView:]): * WebKit.xcodeproj/project.pbxproj: 2019-12-20 youenn fablet Set whether to use mock capture devices at GPUProcess creation time. https://bugs.webkit.org/show_bug.cgi?id=205492 Reviewed by Eric Carlson. This ensures UIProcess remains always in sync with GPUProcess. Covered by fast/mediastream/captureAudioInGPUProcess.html. * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): (WebKit::GPUProcess::setMockCaptureDevicesEnabled): * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcessCreationParameters.cpp: (WebKit::GPUProcessCreationParameters::encode const): (WebKit::GPUProcessCreationParameters::decode): * GPUProcess/GPUProcessCreationParameters.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::singleton): 2019-12-19 Brent Fulgham Log telemetry for IOUserClient lookups https://bugs.webkit.org/show_bug.cgi?id=205463 Reviewed by Per Arne Vollan. This patch adds some telemetry for IOKit classes. No new tests. No change in behavior. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2019-12-19 Chris Dumez Use a WeakHashSet for WKProcessAssertionBackgroundTaskManager._assertionsNeedingBackgroundTask https://bugs.webkit.org/show_bug.cgi?id=205471 Reviewed by Ryosuke Niwa. Use a WeakHashSet for WKProcessAssertionBackgroundTaskManager._assertionsNeedingBackgroundTask, instead of a HashSet of raw pointers, for extra safety. * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager removeAssertionNeedingBackgroundTask:]): (-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]): (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]): 2019-12-19 Brent Fulgham Unblock iokit-get-property needed for frame buffer initialization https://bugs.webkit.org/show_bug.cgi?id=205468 Reviewed by Per Arne Vollan. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-19 Brent Fulgham Add telemetry to macOS WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=205464 Reviewed by Per Arne Vollan. Add telemetry to various mach lookups, like we did for iOS. No new tests. No change in behavior. * WebProcess/com.apple.WebProcess.sb.in: 2019-12-19 Per Arne Vollan REGRESSION (r253530): Incorrect colors in Dark Mode https://bugs.webkit.org/show_bug.cgi?id=205457 Unreviewed rollout of r253530. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-19 Alex Christensen Deprecate _WKRemoteObjectInterface methods without ofReply: https://bugs.webkit.org/show_bug.cgi?id=205073 Reviewed by Timothy Hatcher. Using them makes it hard to figure out how to add classes allowed for the reply, and there's a comment saying to deprecate them, so let's do it. * Shared/API/Cocoa/_WKRemoteObjectInterface.h: 2019-12-19 Brent Fulgham WebContent process does not need access to 'com.apple.system.logger' https://bugs.webkit.org/show_bug.cgi?id=205411 Reviewed by Per Arne Vollan. Telemetry and thorough testing has confirmed that we do not need access to this mach service, and so should remove it. Tested by fast/sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2019-12-19 Brent Fulgham Deny mach lookup access to "com.apple.TextInput" in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=205423 Reviewed by Per Arne Vollan. Telemetry and thorough testing has confirmed that we do not need access to this mach service, and so should remove it. Tested by fast/sandbox/ios/sandbox-mach-lookup.html. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-19 youenn fablet CacheStorageEngine should not clear caches memory representation for ephemeral sessions https://bugs.webkit.org/show_bug.cgi?id=205332 Reviewed by Chris Dumez. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::dispose): We cannot dispose an ephemeral cache memory representation since it can be reopened by a page with the same session. 2019-12-19 Brent Fulgham Deny mach lookup access to "com.apple.pluginkit.pkd" in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=205421 Reviewed by Per Arne Vollan. Telemetry and thorough testing has confirmed that we do not need access to this mach service, and so should remove it. Tested by fast/sandbox/ios/sandbox-mach-lookup.html. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-19 Brent Fulgham Remove syscall filtering from GPU Process sandbox https://bugs.webkit.org/show_bug.cgi?id=205456 Reviewed by Tim Horton. We don't have a fully built-out GPU Process yet. Let's not lock down the syscall filter set until we know which are actually needed by the process. The current set is just copied over from the WebContent process, and are not likely to be the correct set. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2019-12-19 Chris Dumez imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-installed.https.html is flaky https://bugs.webkit.org/show_bug.cgi?id=205408 Reviewed by Youenn Fablet. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::didFinishSkipWaiting): Deleted. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::skipWaiting): (WebKit::WebSWContextManagerConnection::didFinishSkipWaiting): Deleted. * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2019-12-19 Chris Dumez Stop blocking the worker thread in WorkerMessagePortChannelProvider::postMessageToRemote() https://bugs.webkit.org/show_bug.cgi?id=205414 Reviewed by Youenn Fablet. * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp: (WebKit::WebMessagePortChannelProvider::postMessageToRemote): * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: 2019-12-19 Carlos Garcia Campos [GTK][WPE] Add initial API for input method https://bugs.webkit.org/show_bug.cgi?id=204679 Reviewed by Žan Doberšek. In the case of GTK port, it allows to use a custom IM instead of GtkIMContext that it's still used by default. In the case of WPE it brings IM support, but there's no default implementation so applications need to provide their own. * PlatformGTK.cmake: Add new public header WebKitInputMethodContext.h. * PlatformWPE.cmake: Ditto. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): Encode caretRectAtStart for WPE too. (WebKit::EditorState::PostLayoutData::decode): Decode caretRectAtStart for WPE too. (WebKit::operator<<): Dump caretRectAtStart for WPE too. * Shared/EditorState.h: Define caretRectAtStart for WPE too. * Shared/NativeWebKeyboardEvent.h: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Remove FakedForComposition parameter for GTK and add HandledByInputMethod to WPE. * Shared/WebEvent.h: * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): Add handledByInputMethod parameter for WPE. (WebKit::WebKeyboardEvent::encode const): Encode m_handledByInputMethod in WPE too. (WebKit::WebKeyboardEvent::decode): Decode m_handledByInputMethod in WPE too. * Shared/gtk/NativeWebKeyboardEventGtk.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Remove FakedForComposition and the redundant members that are already in the bcase class or no longer needed. * Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add text and handledByInputMethod parameters * Shared/libwpe/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebKeyboardEvent): Use the given text if not null and pass handledByInputMethod, to WebKeyboardEvent. * Shared/libwpe/WebEventFactory.h: * SourcesGTK.txt: Add new files to compilation. * SourcesWPE.txt: Ditto. * UIProcess/API/glib/InputMethodFilter.cpp: Added. (WebKit::InputMethodFilter::~InputMethodFilter): (WebKit::InputMethodFilter::preeditStartedCallback): (WebKit::InputMethodFilter::preeditChangedCallback): (WebKit::InputMethodFilter::preeditFinishedCallback): (WebKit::InputMethodFilter::committedCallback): (WebKit::InputMethodFilter::setContext): (WebKit::InputMethodFilter::setEnabled): (WebKit::InputMethodFilter::filterKeyEvent): (WebKit::InputMethodFilter::isViewFocused const): (WebKit::InputMethodFilter::notifyFocusedIn): (WebKit::InputMethodFilter::notifyFocusedOut): (WebKit::InputMethodFilter::notifyCursorRect): (WebKit::InputMethodFilter::preeditStarted): (WebKit::InputMethodFilter::preeditChanged): (WebKit::InputMethodFilter::preeditFinished): (WebKit::InputMethodFilter::committed): (WebKit::InputMethodFilter::cancelComposition): * UIProcess/API/glib/InputMethodFilter.h: Added. (WebKit::InputMethodFilter::context const): * UIProcess/API/glib/WebKitInputMethodContext.cpp: Added. (webkitInputMethodUnderlineGetCompositionUnderline): (webkit_input_method_underline_new): (webkit_input_method_underline_copy): (webkit_input_method_underline_free): (webkitInputMethodContextSetWebView): (webkitInputMethodContextGetWebView): (webkit_input_method_context_set_enable_preedit): (webkit_input_method_context_get_preedit): (webkit_input_method_context_notify_focus_in): (webkit_input_method_context_notify_focus_out): (webkit_input_method_context_notify_cursor_area): (webkit_input_method_context_reset): * UIProcess/API/glib/WebKitInputMethodContextPrivate.h: Added. (_WebKitInputMethodUnderline::_WebKitInputMethodUnderline): * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewSynthesizeCompositionKeyPress): (webkitWebViewSetComposition): (webkitWebViewConfirmComposition): (webkitWebViewCancelComposition): (webkit_web_view_set_input_method_context): (webkit_web_view_get_input_method_context): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/InputMethodFilterGtk.cpp: Added. (WebKit::InputMethodFilter::platformTransformCursorRectToViewCoordinates): (WebKit::InputMethodFilter::platformEventKeyIsKeyPress const): * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::doneWithKeyEvent): Remove the early return in case of fake event, composition events are always handled by the web process. * UIProcess/API/gtk/WebKitInputMethodContext.h: Added. * UIProcess/API/gtk/WebKitInputMethodContextGtk.cpp: Added. (webkit_input_method_underline_set_color): (webkit_input_method_context_filter_key_event): * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp: Added. (contextPreeditStartCallback): (contextPreeditChangedCallback): (contextPreeditEndCallback): (contextCommitCallback): (webkitInputMethodContextImplGtkConstructed): (webkitInputMethodContextImplGtkSetEnablePreedit): (webkitInputMethodContextImplGtkGetPreedit): (webkitInputMethodContextImplGtkFilterKeyEvent): (webkitInputMethodContextImplGtkNotifyFocusIn): (webkitInputMethodContextImplGtkNotifyFocusOut): (webkitInputMethodContextImplGtkNotifyCursorArea): (webkitInputMethodContextImplGtkReset): (webkit_input_method_context_impl_gtk_class_init): (webkitInputMethodContextImplGtkNew): (webkitInputMethodContextImplGtkSetClientWindow): * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.h: Added. * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseRealize): If current IM filter is the default one, call webkitInputMethodContextImplGtkSetClientWindow(). (webkitWebViewBaseUnrealize): Ditto. (webkitWebViewBaseDispose): Set a nullptr context on IM filter. (webkitWebViewBaseKeyPressEvent): Use the new IM filter that simplifies the code. (webkitWebViewBaseKeyReleaseEvent): Ditto. (webkitWebViewBaseHandleMouseEvent): Cancel composition in case of click. (webkitWebViewBaseCreateWebPage): The new IM filter doesn't need to know the page. (webkitWebViewBaseUpdateTextInputState): Use new IM filter API. (webkitWebViewBaseSetInputMethodContext): Set the IM filter context. (webkitWebViewBaseGetInputMethodContext): Get the IM filter context. (webkitWebViewBaseSynthesizeCompositionKeyPress): Synthesize a key event for composition. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: * UIProcess/API/wpe/InputMethodFilterWPE.cpp: Added. (WebKit::InputMethodFilter::platformTransformCursorRectToViewCoordinates): (WebKit::InputMethodFilter::platformEventKeyIsKeyPress const): * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::setInputMethodState): (WebKit::PageClientImpl::selectionDidChange): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::setInputMethodContext): Set the IM filter context. (WKWPE::View::inputMethodContext const): Get the IM filter context. (WKWPE::View::setInputMethodState): Enable or disable input methods. (WKWPE::View::selectionDidChange): Notify the IM filter about the cursor position change. (WKWPE::View::setViewState): Notify the IM filter about the focus change. (WKWPE::View::handleKeyboardEvent): Allow the IM filter to handle the key event. (WKWPE::View::synthesizeCompositionKeyPress): Synthesize a key event for composition. * UIProcess/API/wpe/WPEView.h: * UIProcess/API/wpe/WebKitInputMethodContext.h: Added. * UIProcess/API/wpe/WebKitInputMethodContextWPE.cpp: Added. (webkit_input_method_underline_set_color): (webkit_input_method_context_filter_key_event): * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/API/wpe/docs/wpe-docs.sgml: * UIProcess/API/wpe/webkit.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/gtk/InputMethodFilter.cpp: Removed. * UIProcess/gtk/InputMethodFilter.h: Removed. * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::updateEditorState): Save the editor state and notify about selection change. (WebKit::WebPageProxy::setInputMethodState): Notify the page client about the input method state. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::setInputMethodState): Implement this for WPE too. * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: (WebKit::WebEditorClient::handleInputMethodKeydown): Use handledByInputMethod() now. * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/wpe/WebPageWPE.cpp: (WebKit::WebPage::platformEditorState const): Save the current caret cursor rectangle in post layout data struct. (WebKit::WebPage::setInputMethodState): Send SetInputMethodState message to the UI process if state changed. 2019-12-19 Carlos Garcia Campos [CoordinatedGraphics] ThreadedDisplayRefreshMonitor is never released https://bugs.webkit.org/show_bug.cgi?id=205387 Reviewed by Žan Doberšek. Update the window screen ID after creating the layer tree host to ensure that the call to createDisplayRefreshMonitor will create the ThreadedDisplayRefrershMonitor instead of the default one. * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Use the dispalyID of the layer tree host. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: (WebKit::LayerTreeHost::LayerTreeHost): Initialize the display ID. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: 2019-12-18 Sihui Liu IndexedDB: perform IDBServer work only on background thread https://bugs.webkit.org/show_bug.cgi?id=203690 Reviewed by Alex Christensen. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient): * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::create): (WebKit::WebIDBServer::WebIDBServer): (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::suspend): (WebKit::WebIDBServer::resume): (WebKit::WebIDBServer::openDatabase): (WebKit::WebIDBServer::deleteDatabase): (WebKit::WebIDBServer::abortTransaction): (WebKit::WebIDBServer::commitTransaction): (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBServer::createObjectStore): (WebKit::WebIDBServer::deleteObjectStore): (WebKit::WebIDBServer::renameObjectStore): (WebKit::WebIDBServer::clearObjectStore): (WebKit::WebIDBServer::createIndex): (WebKit::WebIDBServer::deleteIndex): (WebKit::WebIDBServer::renameIndex): (WebKit::WebIDBServer::putOrAdd): (WebKit::WebIDBServer::getRecord): (WebKit::WebIDBServer::getAllRecords): (WebKit::WebIDBServer::getCount): (WebKit::WebIDBServer::deleteRecord): (WebKit::WebIDBServer::openCursor): (WebKit::WebIDBServer::iterateCursor): (WebKit::WebIDBServer::establishTransaction): (WebKit::WebIDBServer::databaseConnectionPendingClose): (WebKit::WebIDBServer::databaseConnectionClosed): (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBServer::didFireVersionChangeEvent): (WebKit::WebIDBServer::openDBRequestCancelled): (WebKit::WebIDBServer::getAllDatabaseNames): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::postTask): (WebKit::WebIDBServer::dispatchToThread): (WebKit::WebIDBServer::registerConnection): Deleted. (WebKit::WebIDBServer::unregisterConnection): Deleted. (WebKit::WebIDBServer::confirmDidCloseFromServer): Deleted. * NetworkProcess/IndexedDB/WebIDBServer.h: * NetworkProcess/IndexedDB/WebIDBServer.messages.in: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::prepareToSuspend): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer): Deleted. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: 2019-12-18 Commit Queue Unreviewed, rolling out r253646. https://bugs.webkit.org/show_bug.cgi?id=205433 "We think this may have caused a membuster regression, so rolling it out." (Requested by nham on #webkit). Reverted changeset: "Navigation from empty page doesn't use cached web process" https://bugs.webkit.org/show_bug.cgi?id=205015 https://trac.webkit.org/changeset/253646 2019-12-18 Alex Christensen Add SPI WKWebView._updateWebpagePreferences to replace _updateWebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=205427 Reviewed by Wenson Hsieh. This blocks the removal of _WKWebsitePolicies. This change is verified by an API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateWebsitePolicies:]): (-[WKWebView _updateWebpagePreferences:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2019-12-18 Tim Horton macCatalyst: Cursor should update when the platform deems it necessary https://bugs.webkit.org/show_bug.cgi?id=205429 Reviewed by Wenson Hsieh. * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): Expose the current cursor and caret size on position information so that macCatalyst UIKit can retrieve it out-of-band (in addition to setting it when we do a hit-test, like in r253636. 2019-12-18 Alex Christensen Add ObjC version of WKBundleFrameIsMainFrame https://bugs.webkit.org/show_bug.cgi?id=205415 Reviewed by Brian Weinstein. I need this for rdar://problem/57132290 Covered by API tests. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame isMainFrame]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: 2019-12-18 Eric Carlson Remove more unused MediaPlayer methods https://bugs.webkit.org/show_bug.cgi?id=205405 Reviewed by Jer Noble. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerHandlePlaybackCommand): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsInMediaDocument const): Deleted. * GPUProcess/media/RemoteMediaPlayerProxy.h: 2019-12-18 youenn fablet Add support for Audio Capture in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=205056 Reviewed by Eric Carlson. Make UserMediaCaptureManager and Proxy able to work with GPU process. Add support for capturing audio in the GPU process, this is limited to mock audio sources for now as we do not support AudioSession in the GPU process. Covered by rebased test. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::setMockCaptureDevicesEnabled): * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::UserMediaCaptureManagerProxy): (WebKit::UserMediaCaptureManagerProxy::~UserMediaCaptureManagerProxy): (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::applyConstraints): (WebKit::UserMediaCaptureManagerProxy::clone): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: (WebKit::UserMediaCaptureManagerProxy::didReceiveMessageFromGPUProcess): (WebKit::UserMediaCaptureManagerProxy::didReceiveSyncMessageFromGPUProcess): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: * WebProcess/GPU/GPUProcessConnection.cpp: (WebKit::GPUProcessConnection::didReceiveMessage): * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setShouldCaptureInGPUProcess): (WebKit::UserMediaCaptureManager::Source::shouldCaptureInGPUProcess const): (WebKit::UserMediaCaptureManager::Source::requestToEnd): (WebKit::UserMediaCaptureManager::createCaptureSource): (WebKit::UserMediaCaptureManager::sourceStopped): (WebKit::UserMediaCaptureManager::captureFailed): (WebKit::UserMediaCaptureManager::Source::connection): (WebKit::UserMediaCaptureManager::Source::startProducingData): (WebKit::UserMediaCaptureManager::Source::stopProducingData): (WebKit::UserMediaCaptureManager::Source::capabilities): (WebKit::UserMediaCaptureManager::Source::applyConstraints): (WebKit::UserMediaCaptureManager::sourceEnded): (WebKit::UserMediaCaptureManager::Source::hasEnded): (WebKit::UserMediaCaptureManager::Source::stopBeingObserved): (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource): * WebProcess/cocoa/UserMediaCaptureManager.h: (WebKit::UserMediaCaptureManager::didReceiveMessageFromGPUProcess): 2019-12-18 Ben Nham Add network loading signposts https://bugs.webkit.org/show_bug.cgi?id=204822 Reviewed by Alex Christensen. This adds os_signposts related to network loads to aid in debugging networking performance issues. Since URLs are logged in the signposts, this capability is only enabled on Apple internal builds when an environment variable is set. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::signpostLogHandle): (WebKit::signpostsEnabled): (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::didSendData): (WebKit::NetworkDataTaskCocoa::didReceiveChallenge): (WebKit::NetworkDataTaskCocoa::didCompleteWithError): (WebKit::NetworkDataTaskCocoa::didReceiveData): (WebKit::NetworkDataTaskCocoa::didReceiveResponse): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): (WebKit::NetworkDataTaskCocoa::cancel): (WebKit::NetworkDataTaskCocoa::resume): 2019-12-18 youenn fablet Refine RTCMonitor logging https://bugs.webkit.org/show_bug.cgi?id=205384 Reviewed by Eric Carlson. Catch the case where the rtc thread is blocked in WebProcess and NetworkProcess. Add logging of 'this' so as to disambiguate the case of several pages doing RTC in parallel. No change of behavior. * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): (WebKit::NetworkRTCMonitor::stopUpdating): (WebKit::NetworkRTCMonitor::onNetworksChanged): * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::NetworkRTCProvider): (WebKit::NetworkRTCProvider::close): (WebKit::NetworkRTCProvider::createSocket): * NetworkProcess/webrtc/NetworkRTCProvider.h: (WebKit::NetworkRTCProvider::canLog const): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::WebRTCMonitor::StartUpdating): (WebKit::WebRTCMonitor::StopUpdating): (WebKit::WebRTCMonitor::networksChanged): 2019-12-18 Kate Cheney Only report prevalent domains in the ResourceLoadStatistics data summary API https://bugs.webkit.org/show_bug.cgi?id=205281 Reviewed by Brent Fulgham. ResourceLoadStatisticsStore::aggregatedThirdPartyData() should only return prevalent third party domains. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: 2019-12-18 Brent Fulgham Add syscall to GPU Process sandbox https://bugs.webkit.org/show_bug.cgi?id=205400 Reviewed by Simon Fraser. This patch temporarily adds a syscall to the sandbox to work around a bug in the system Sandbox framework. We will remove this in Bug 205400 once that issue is resolved. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2019-12-18 Eric Carlson Enable generic cue API https://bugs.webkit.org/show_bug.cgi?id=205398 Reviewed by Jon Lee. No new tests, covered by existing tests. * Shared/WebPreferences.yaml: 2019-12-18 Eric Carlson Remove unused MediaPlayer methods https://bugs.webkit.org/show_bug.cgi?id=205341 Reviewed by Jer Noble. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerSawUnsupportedTracks): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerRepaint): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerAcceleratedCompositingEnabled): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerSetSize): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsPaused const): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsLooping const): Deleted. * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::canLoadPoster const): Deleted. (WebKit::MediaPlayerPrivateRemote::setPoster): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: 2019-12-18 Simon Fraser Move m_exposedContentRect into the DelegatedScrollingGeometry optional https://bugs.webkit.org/show_bug.cgi?id=205377 Reviewed by Tim Horton. ScrollView's m_exposedContentRect is only set for delegated scrolling, so move it into DelegatedScrollingGeometry and remove the iOS #ifdefs around it. Move the WAK/NSView-related code into platformExposedContentRect() for iOS WK1. Stub out exposedContentRect() functions on TiledCoreAnimationDrawingArea. * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange): (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect): (WebKit::TiledCoreAnimationDrawingArea::exposedContentRect const): (WebKit::TiledCoreAnimationDrawingArea::setExposedContentRect): (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling): 2019-12-18 Wenson Hsieh Enable the async clipboard API by default on macOS and iOS https://bugs.webkit.org/show_bug.cgi?id=205322 Reviewed by Tim Horton. Enables the asynchronous clipboard API by default on Cocoa platforms. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: 2019-12-18 Philippe Normand [GTK][WebInspector] Support for saving remote data https://bugs.webkit.org/show_bug.cgi?id=204618 Reviewed by Carlos Garcia Campos. Similarly to what landed already in r251069, the Remote WebInspector GTK client can now save data coming from the inspector server. * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: (WebKit::RemoteWebInspectorProxy::platformSave): 2019-12-17 Joonghun Park Unreviewed. Remove the build warning below since r253452. warning: unused variable ‘isNewEntry’ [-Wunused-variable] No new tests, no new behavioral changes. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::addConnection): 2019-12-17 Per Arne Vollan Unreviewed build fix after r253661. * UIProcess/ios/forms/WKFileUploadPanel.mm: 2019-12-17 Per Arne Vollan [iOS] The WebContent process should not use API to get the user interface idiom https://bugs.webkit.org/show_bug.cgi?id=205236 Reviewed by Brent Fulgham. This should be done in the UI process, since using the API in the WebContent process will connect to daemons we intend to block access to. Add a flag to the process creation parameters which indicates whether the user interface idiom is iPad or not. This flag will be set on the UI process side, and on the WebContent process side, this flag will be read and cached for later use. No new tests, covered by existing tests. * Platform/spi/ios/UIKitSPI.h: (currentUserInterfaceIdiomIsPad): Deleted. * Shared/UserInterfaceIdiom.h: Added. * Shared/UserInterfaceIdiom.mm: Added. (WebKit::userInterfaceIdiomIsPad): (WebKit::currentUserInterfaceIdiomIsPad): (WebKit::setCurrentUserInterfaceIdiomIsPad): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/ios/WebPreferencesDefaultValuesIOS.mm: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/ios/SmartMagnificationController.mm: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]): (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]): (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]): (-[WKContentView _zoomToRevealFocusedElement]): (-[WKContentView requiresAccessoryView]): (-[WKContentView _updateAccessory]): (shouldShowKeyboardForElement): (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]): * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm: * UIProcess/ios/WebPageProxyIOS.mm: * UIProcess/ios/forms/WKFormColorControl.mm: (-[WKFormColorControl initWithView:]): * UIProcess/ios/forms/WKFormColorPicker.mm: * UIProcess/ios/forms/WKFormInputControl.mm: * UIProcess/ios/forms/WKFormSelectControl.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-17 Eric Carlson Add remote media player methods for prepareToPlay, preload, private browsing mode, preserves pitch, and failed to load https://bugs.webkit.org/show_bug.cgi?id=205351 Reviewed by Jer Noble. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::prepareToPlay): (WebKit::RemoteMediaPlayerManagerProxy::setPreload): (WebKit::RemoteMediaPlayerManagerProxy::setPrivateBrowsingMode): (WebKit::RemoteMediaPlayerManagerProxy::setPreservesPitch): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::prepareToPlay): (WebKit::RemoteMediaPlayerProxy::setPreload): (WebKit::RemoteMediaPlayerProxy::setPrivateBrowsingMode): (WebKit::RemoteMediaPlayerProxy::setPreservesPitch): * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::prepareToPlay): (WebKit::MediaPlayerPrivateRemote::setPreservesPitch): (WebKit::MediaPlayerPrivateRemote::setPreload): (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode): (WebKit::MediaPlayerPrivateRemote::engineFailedToLoad): (WebKit::MediaPlayerPrivateRemote::platformErrorCode const): Deleted. (WebKit::MediaPlayerPrivateRemote::requiresImmediateCompositing const): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::engineFailedToLoad): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: 2019-12-17 Kate Cheney Add run-time flag for in-app browser privacy https://bugs.webkit.org/show_bug.cgi?id=205288 Reviewed by John Wilander. * Shared/WebPreferences.yaml: 2019-12-17 Ben Nham Navigation from empty page doesn't use cached web process https://bugs.webkit.org/show_bug.cgi?id=205015 Reviewed by Chris Dumez. When navigating from an empty page to another domain foo.com, we always use the source WebProcess (which is basically uninitialized) rather than using an already-initialized cached WebProcess that has navigated to foo.com. The cached WebProcess should probably be preferred since it has more relevant cached resources available to it (e.g. memory cache, JS bytecode cache, prewarmed fonts, ...). Added an API test. * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _ensureRunningProcessForTesting]): Allows tests to force WebProcess to launch to an empty document for testing purposes. This matches the behavior of how Safari uses WKWebView. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): Prefer cached web process over source process if the source process hasn't committed any loads. 2019-12-17 Benjamin Nham Drop support for NSURLCache callbacks in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=203344 Reviewed by Alex Christensen. Remove the NSURLSession caching policy callback in NetworkProcess. It's no longer necessary since we don't use NSURLCache in NetworkProcess (https://bugs.webkit.org/show_bug.cgi?id=185990). * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]): Deleted. 2019-12-17 David Kilzer Remove SafeBrowsingResult Reviewed by Anders Carlsson. * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Remove. * UIProcess/SafeBrowsingResult.h: Remove. 2019-12-17 youenn fablet WebKitTestRunner should report GPU process crashes https://bugs.webkit.org/show_bug.cgi?id=205338 Reviewed by Tim Horton. Expose a callback to notify of GPU process crash. No change of behavior. * UIProcess/API/C/WKContext.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::gpuProcessCrashed): * UIProcess/WebContextClient.cpp: (WebKit::WebContextClient::gpuProcessDidCrash): * UIProcess/WebContextClient.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::gpuProcessCrashed): * UIProcess/WebProcessPool.h: 2019-12-17 Tim Horton macCatalyst: Cursor should update on mouse movement and style change https://bugs.webkit.org/show_bug.cgi?id=205317 Reviewed by Anders Carlsson. * Configurations/WebKit.xcconfig: Link AppKit for NSCursor. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): Enable Cursor encoders. * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::setCursor): * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebChromeClient.h: Unifdef various things. Implement setCursor(). 2019-12-17 Carlos Garcia Campos [GTK][WPE] IndexedDB directory set in WebsiteDataManager is ignored https://bugs.webkit.org/show_bug.cgi?id=205330 Reviewed by Youenn Fablet. There are two problems here: 1- WebKitWebsiteDataManager is no longer setting the indexedDB directory to the WebsiteDatastore configuration. It seems the code was removed by mistake in r249778 when rolling out r249768. 2- The WebProcessPool is not considering the primary WebsiteDataStore for indexedDB configuration. Fixes: /webkit/WebKitWebsiteData/databases /webkit/WebKitWebsiteData/configuration * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: (webkitWebsiteDataManagerGetDataStore): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2019-12-17 youenn fablet Bump the priority of CacheStorageEngine write operations https://bugs.webkit.org/show_bug.cgi?id=205329 Reviewed by Antti Koivisto. Introduce an IOChannel extra optional parameter to set the QOS. Use this parameter for IOChannels created by CacheStorageEngine when writing files to increase the priority to default. Increase the priority of the CacheStorageEngine background queue to default. No observable change of behavior except potential speed increase. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::Engine): (WebKit::CacheStorage::Engine::writeFile): * NetworkProcess/cache/NetworkCacheIOChannel.h: (WebKit::NetworkCache::IOChannel::open): * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: (WebKit::NetworkCache::dispatchQueueFromPriority): (WebKit::NetworkCache::IOChannel::IOChannel): (WebKit::NetworkCache::IOChannel::open): * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: (WebKit::NetworkCache::IOChannel::open): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::open): 2019-12-17 youenn fablet WebKitTestRunner should report service worker process crashes https://bugs.webkit.org/show_bug.cgi?id=205267 Reviewed by Chris Dumez. Expose a way for WTR to be notified of service worker process crashes. * UIProcess/API/C/WKContext.h: * UIProcess/WebContextClient.cpp: (WebKit::WebContextClient::serviceWorkerProcessDidCrash): * UIProcess/WebContextClient.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::serviceWorkerProcessCrashed): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch): 2019-12-17 Chris Dumez Improve release logging in NetworkResourceLoader https://bugs.webkit.org/show_bug.cgi?id=205295 Reviewed by Youenn Fablet. Improve release logging in NetworkResourceLoader to facilitate debugging of loading-related issues. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::retrieveCacheEntryInternal): (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::cleanup): (WebKit::NetworkResourceLoader::convertToDownload): (WebKit::NetworkResourceLoader::abort): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::didBlockAuthenticationChallenge): (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest): (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse): (WebKit::NetworkResourceLoader::restartNetworkLoad): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::continueDidReceiveResponse): (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry): (WebKit::NetworkResourceLoader::didReceiveMainResourceResponse): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): (WebKit::NetworkResourceLoader::sendResultForCacheEntry): (WebKit::NetworkResourceLoader::validateCacheEntry): (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry): (WebKit::NetworkResourceLoader::startWithServiceWorker): (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): 2019-12-16 Simon Fraser Change 'delegatesPageScaling' from a Setting to a flag on ScrollView https://bugs.webkit.org/show_bug.cgi?id=205319 Reviewed by Tim Horton. delegatesPageScaling() is never toggled at runtime (even by tests), and it should be a flag on FrameView just like delegatesScrolling (maybe in future the flags can merge). So remove the Setting, and have DrawingArea control whether page scaling is delegated. In WebKit1, WebFrameLoaderClient::transitionToCommittedForNewPage() turns on delegated page scaling for iOS. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::usesDelegatedPageScaling const): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindIndicatorOverlayClientIOS::drawRect): 2019-12-16 Wenson Hsieh -[UIWKDocumentContext markedTextRange] is wrong when the caret is not at the start of marked text https://bugs.webkit.org/show_bug.cgi?id=205302 Reviewed by Tim Horton. Makes a few minor adjustments around marked text handling in document editing context request code. 1. In the case where markedTextRects are requested, automatically expand the context range (i.e. contextBefore and contextAfter) to encompass the marked text. This fixes UIWKDocumentContext's logic that computes the marked text range by subtracting `contextBefore` string's length from `selectedRangeInMarkedText`'s location. (Note that this still requires an adjustment in UIKit to actually respect `selectedRangeInMarkedText` when computing `markedTextRange`. This is tracked in ). 2. Stop clamping compositionStart and compositionEnd to the range of interest (in this case, the selection range, which is a collapsed caret selection). This makes the composition range seem as if it were empty, which prevents us from computing the marked text string (and importantly, its length). 3. Flip the arguments to `distanceBetweenPositions`, such that we end up with a positive value for `selectedRangeInMarkedText` in the case where `compositionStart` is before `startOfRangeOfInterestInSelection`. Test: DocumentEditingContext.RequestMarkedTextRectsAndTextOnly * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDocumentEditingContext): 2019-12-16 Per Arne Vollan [iOS] Issue mach lookup extension to diagnostics daemon https://bugs.webkit.org/show_bug.cgi?id=205292 Reviewed by Brent Fulgham. For internal installs, issue a mach lookup extension to the diagnostics daemon. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::isInternalInstall): (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-16 Daniel Bates Reproducible case of backwards nextParagraph returning a position ahead of the input position https://bugs.webkit.org/show_bug.cgi?id=196127 Reviewed by Wenson Hsieh. Remove workaround now that WebCore::nextParagraphBoundaryInDirection() behaves correctly. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::moveByGranularityRespectingWordBoundary): 2019-12-16 youenn fablet Make ServiceWorkerSoftUpdateLoader::loadWithCacheEntry more robust https://bugs.webkit.org/show_bug.cgi?id=205202 rdar://problem/57852910 Reviewed by Chris Dumez. In case loading an entry from the cache, we were calling didReceiveResponse, which may destroy the loader and then continue processing. Instead, add a processResponse method that checks the response and returns an error if needed. didReceiveResponse calls this method and returns early in case of error. So does the method loading data from the cache. Covered by existing tests. * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: (WebKit::ServiceWorkerSoftUpdateLoader::loadWithCacheEntry): (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveResponse): (WebKit::ServiceWorkerSoftUpdateLoader::processResponse): * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: 2019-12-16 Antti Koivisto Remove display:contents feature flag https://bugs.webkit.org/show_bug.cgi?id=205276 Reviewed by Ryosuke Niwa. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDisplayContentsEnabled): Deleted. (WKPreferencesGetDisplayContentsEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: 2019-12-16 Wenson Hsieh Fix API availability for -_getResourceLoadStatisticsDataSummary: after r253484 https://bugs.webkit.org/show_bug.cgi?id=205256 Reviewed by Alex Christensen. Replaces WK_API_AVAILABLE(macos(10.15), ios(13.0)) with WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)), since this is new WebKit SPI that hasn't made its way into the SDK. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: 2019-12-16 Daniel Bates -requestDocumentContext always returns 1 text unit more granularity than requested https://bugs.webkit.org/show_bug.cgi?id=205142 Reviewed by Darin Adler and Wenson Hsieh. Use WebCore::atBoundaryOfGranularity() to identify each boundary so that we return the position exactly granularityCount text units advanced from the specified position. When using sentence granularity we do not need to round the resulting position to the nearest word because it already falls before the next word (if there is one). For all other granularities we do what we do now and round to the nearest word, which may cross that granularity's boundary. Additionally, added assertions to ensure that we are passed a non-zero granularity count and a non- null initial position. The function takes advantage of these assumptions to 1) ensure correct results and 2) make use of a do-while loop. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::moveByGranularityRespectingWordBoundary): 2019-12-16 Simon Fraser Let the DrawingArea decide whether scrolling is delegated https://bugs.webkit.org/show_bug.cgi?id=205258 Reviewed by Anders Carlsson. Delegated scrolling was hardcoded on for iOS WK2 (as it is for iOS WK1) and off for macOS, but if macOS is using RemoteLayerTreeDrawingArea that should also use delegated scrolling. Also make some DrawingArea functions const, and put m_frame->coreFrame()->view() into a local RefPtr in WebFrameLoaderClient::transitionToCommittedForNewPage(). * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::supportsAsyncScrolling const): (WebKit::DrawingArea::usesDelegatedScrolling const): (WebKit::DrawingArea::shouldUseTiledBackingForFrameView const): (WebKit::DrawingArea::supportsAsyncScrolling): Deleted. (WebKit::DrawingArea::shouldUseTiledBackingForFrameView): Deleted. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView const): (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Deleted. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView const): (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Deleted. 2019-12-16 Eric Carlson Log when unimplemented remote MediaPlayer methods are called https://bugs.webkit.org/show_bug.cgi?id=205269 Reviewed by Youenn Fablet. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlaybackStateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSawUnsupportedTracks): (WebKit::RemoteMediaPlayerProxy::mediaPlayerResourceNotSupported): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRepaint): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSizeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineUpdated): (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCharacteristicChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingCanBeAccelerated): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerAcceleratedCompositingEnabled): (WebKit::RemoteMediaPlayerProxy::mediaPlayerActiveSourceBuffersChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedKeyForKeyId const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerInitializationDataEncountered): (WebKit::RemoteMediaPlayerProxy::mediaPlayerWaitingForKeyChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerEnterFullscreen): (WebKit::RemoteMediaPlayerProxy::mediaPlayerExitFullscreen): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsFullscreen const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsFullscreenPermitted const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentsScale const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSetSize): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPause): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlay): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlatformVolumeConfigurationRequired const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsPaused const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsLooping const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedResourceLoader): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCreateResourceLoader): (WebKit::RemoteMediaPlayerProxy::doesHaveAttribute const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddAudioTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddTextTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddVideoTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveAudioTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveTextTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveVideoTrack): (WebKit::RemoteMediaPlayerProxy::textTrackRepresentationBoundsChanged): (WebKit::RemoteMediaPlayerProxy::outOfBandTrackSources): (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerHandlePlaybackCommand): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsInMediaDocument const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineFailedToLoad const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRequestedPlaybackRate const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerFullscreenMode const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideoFullscreenStandby const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldDisableSleep const): (WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldCheckHardwareSupport const): * GPUProcess/media/RemoteMediaPlayerProxy.h: 2019-12-16 Kate Cheney Add NS_UNAVAILABLE tags to prevent alloc inits for _WKResourceLoadStatistics* classes https://bugs.webkit.org/show_bug.cgi?id=205221 Reviewed by Anders Carlsson. This patch ensures that no one tries to alloc init _WKResourceLoadStatisticsFirstParty or _WKResourceLoadStatisticsThirdParty. They should only be created via the API call to create(). * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h: 2019-12-16 youenn fablet http/wpt/service-workers/postMessage-fetch-order.https.html is a flaky failure after r253528 https://bugs.webkit.org/show_bug.cgi?id=205261 Reviewed by Chris Dumez. Instead of starting the fetch task asynchronously, start it synchronously but make sure that not handling the fetch is either coming from IPC or is done asynchronously. We add a boolean m_isDone that ensures that the loader will only be called once for didFail/didFinish/didNotHandle. This covers the potential case of a task for which cannotHandle is called synchronously at creation but the call to didNotHandle is not yet done. Before the call to didNotHandle is done, a timeout timer is firing and will call didNotHandle a first time. The second didNotHandle should be a no-op. Covered by existing tests and unflakes above test. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::contextClosed): (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didReceiveData): (WebKit::ServiceWorkerFetchTask::didReceiveFormData): (WebKit::ServiceWorkerFetchTask::didFinish): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): Make sure to call didNotHandle only once based on m_isDone. (WebKit::ServiceWorkerFetchTask::cannotHandle): Do not expose didNotHandle as a public method. Instead expose cannotHandle that will call didNotHandle asynchronously. (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith): No need to set a timer if we will not create a fetch event. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: (WebKit::ServiceWorkerFetchTask::takeRequest): * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): Small refactoring to only use contextClosed and not expose whether the task is handled or not. This also potentially allows to call didNotHandle in case the service worker crashed before answering the fetch event. 2019-12-16 Emilio Cobos Álvarez [GTK] Build with USE_WPE_RENDERER=No fails with undefined EGL_WAYLAND_BUFFER_WL https://bugs.webkit.org/show_bug.cgi?id=205250 Reviewed by Carlos Garcia Campos. Define the enum if not present. No new tests, just a build fix. * UIProcess/gtk/WaylandCompositor.cpp: 2019-12-16 youenn fablet Reset cached getUserMedia queries when calling stopMediaCapture https://bugs.webkit.org/show_bug.cgi?id=205064 Reviewed by Eric Carlson. Reset cached queries when calling stop media capture API allows to trigger again the prompt after the API call. Covered by updated API test. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): * UIProcess/UserMediaPermissionRequestManagerProxy.h: (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::stopMediaCapture): 2019-12-15 Wenson Hsieh -[WKWebView _detectDataWithTypes:completionHandler:] crashes when there is no running process https://bugs.webkit.org/show_bug.cgi?id=205254 Reviewed by Tim Horton. Bail early and call the completion handler in the case where we don't have a running web process, to avoid a null `Connection*` deref. Speculative fix for . * UIProcess/WebPageProxy.cpp: 2019-12-14 Adrian Perez de Castro [GTK][WPE] Fix various non-unified build issues introduced since r251698 https://bugs.webkit.org/show_bug.cgi?id=204891 Reviewed by Alex Christensen. * NetworkProcess/IndexedDB/WebIDBServer.cpp: Add missing WebCore namespace prefixes in function declarations. (WebKit::WebIDBServer::create): (WebKit::WebIDBServer::WebIDBServer): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::suspend): (WebKit::WebIDBServer::idFireVersionChangeEvent): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::requestSpace): Add missing namespace prefix for WebCore::ClientOrigin. * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: Add missing inclusion of WebCore/RegistrableDomain.h (WebKit::NetworkCache::SubresourceInfo::isFirstParty const): Add missing namespace prefix for WebCore::RegistrableDomain. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload): Add missing namespace prefix for WebCore::File::create() and WebCore::FileList::create() calls. 2019-12-14 Simon Fraser Rename "customFixedPositionRect" to "layoutViewportRect" https://bugs.webkit.org/show_bug.cgi?id=205241 Reviewed by Dean Jackson. WK2 computes the rect used to layout out position:fixed elements in the UI process. For historical reasons this was called customFixedPositionRect, but rename it to layoutViewportRect since that what it really is. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode const): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::layoutViewportRect const): (WebKit::operator==): (WebKit::VisibleContentRectUpdateInfo::customFixedPositionRect const): Deleted. * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::layoutViewportRect const): (WebKit::WebPageProxy::customFixedPositionRect const): Deleted. * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView _didCommitLayerTree:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeLayoutViewportRect const): (WebKit::WebPageProxy::unconstrainedLayoutViewportRect const): (WebKit::WebPageProxy::computeCustomFixedPositionRect const): Deleted. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2019-12-14 Per Arne Vollan Map CSS value ID to system color in the UI process https://bugs.webkit.org/show_bug.cgi?id=204314 Reviewed by Brent Fulgham. Create mapping between CSS value IDs and system colors in the UI process and send to the WebContent process on process startup. No new tests, covered by existing tests. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-14 Per Arne Vollan [iOS] Deny mach lookup access to "*.viewservice" in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=205240 Reviewed by Brent Fulgham. As part of sandbox hardening in the WebContent process, mach lookup access to “*.viewservice” should be removed. Test: fast/sandbox/ios/sandbox-mach-lookup.html * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-14 Chris Dumez WebSWServerConnection::startFetch() should never fail synchronously https://bugs.webkit.org/show_bug.cgi?id=205225 Reviewed by Geoffrey Garen. WebSWServerConnection::startFetch() should never fail synchronously. If it does, it will confuse the NetworkResourceLoader. NetworkResourceLoader::serviceWorkerDidNotHandle() will get called *before* NetworkResourceLoader::m_serviceWorkerFetchTask has been sent, which means that we would not properly deal with redirects. Worse, the call site which creates the ServiceWorkerFetchTask would then null out m_networkLoad, which would silently cancel the load that WebSWServerConnection::startFetch() started synchronously. No new tests, I am not sure how to test this. It would have to cause a redirect do a URL that has a service worker and then we would have to get WebSWServerConnection::startFetch() to fail synchronously. I think that to fail synchronously, we would have to not find a ServiceWorker with the given ID, or the ServiceWorker's hasTimedOutAnyFetchTasks would have to be set. I added a RELEASE_ASSERT() in NetworkResourceLoader::serviceWorkerDidNotHandle() that would have caught this. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): 2019-12-14 Simon Fraser Move code out of WKWebView.mm into platform-specific files, for easier navigation https://bugs.webkit.org/show_bug.cgi?id=205233 Reviewed by Tim Horton. Move as much platform-specific code out of WKWebView.mm as possible, moving it to WKWebViewMac/WKWebViewIOS. WKWebView (WKPrivate) is split into WKWebView (WKPrivateIOS) and WKWebView (WKPrivateMac) so the implementations of those functions can move. Code that remains in WKWebView.mm is either Cocoa-generic, or implements API. This is entirely cut/paste, other than the addition of -_takeFindStringFromSelectionInternal: for macOS to allow WKWebView.mm to call -takeFindStringFromSelection:. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebView.mm: (hardwareKeyboardAvailabilityChangedCallback): (-[WKWebView setAllowsBackForwardNavigationGestures:]): (-[WKWebView allowsBackForwardNavigationGestures]): (-[WKWebView setPageZoom:]): (-[WKWebView pageZoom]): (toFindOptions): (-[WKWebView findString:withConfiguration:completionHandler:]): (+[WKWebView handlesURLScheme:]): (-[WKWebView setMediaType:]): (-[WKWebView mediaType]): (-[WKWebView scrollView]): (-[WKWebView setAllowsMagnification:]): (-[WKWebView allowsMagnification]): (-[WKWebView setMagnification:centeredAtPoint:]): (-[WKWebView setMagnification:]): (-[WKWebView magnification]): (-[WKWebView printOperationWithPrintInfo:]): (-[WKWebView _showSafeBrowsingWarning:completionHandler:]): (-[WKWebView _clearSafeBrowsingWarning]): (-[WKWebView _clearSafeBrowsingWarningIfForMainFrameNavigation]): (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]): (dictionaryRepresentationForEditorState): (nsTextAlignment): (selectionAttributes): (-[WKWebView _didChangeEditorState]): (-[WKWebView _toggleStrikeThrough:]): (-[WKWebView _increaseListLevel:]): (-[WKWebView _decreaseListLevel:]): (-[WKWebView _changeListType:]): (-[WKWebView inputAccessoryView]): (-[WKWebView inputView]): (-[WKWebView inputAssistantItem]): (-[WKWebView _selectionAttributes]): (-[WKWebView _viewportSizeForCSSViewportUnits]): (-[WKWebView _setViewportSizeForCSSViewportUnits:]): (-[WKWebView _inspector]): (-[WKWebView _mainFrame]): (-[WKWebView _isEditable]): (-[WKWebView _setEditable:]): (-[WKWebView _executeEditCommand:argument:completion:]): (-[WKWebView _textManipulationDelegate]): (-[WKWebView _setTextManipulationDelegate:]): (-[WKWebView _startTextManipulationsWithConfiguration:completion:]): (-[WKWebView _completeTextManipulation:completion:]): (-[WKWebView _takeFindStringFromSelection:]): (+[WKWebView _stringForFind]): (+[WKWebView _setStringForFind:]): (-[WKWebView _remoteObjectRegistry]): (-[WKWebView _handle]): (-[WKWebView _observedRenderingProgressEvents]): (-[WKWebView _historyDelegate]): (-[WKWebView _setHistoryDelegate:]): (-[WKWebView _updateMediaPlaybackControlsManager]): (-[WKWebView _canTogglePictureInPicture]): (-[WKWebView _isPictureInPictureActive]): (-[WKWebView _togglePictureInPicture]): (-[WKWebView _closeAllMediaPresentations]): (-[WKWebView _stopMediaCapture]): (-[WKWebView _stopAllMediaPlayback]): (-[WKWebView _suspendAllMediaPlayback]): (-[WKWebView _resumeAllMediaPlayback]): (-[WKWebView _unreachableURL]): (-[WKWebView _mainFrameURL]): (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]): (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]): (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): (-[WKWebView _certificateChain]): (-[WKWebView _committedURL]): (-[WKWebView _MIMEType]): (-[WKWebView _userAgent]): (-[WKWebView _applicationNameForUserAgent]): (-[WKWebView _setApplicationNameForUserAgent:]): (-[WKWebView _customUserAgent]): (-[WKWebView _setCustomUserAgent:]): (-[WKWebView _setUserContentExtensionsEnabled:]): (-[WKWebView _userContentExtensionsEnabled]): (-[WKWebView _webProcessIdentifier]): (-[WKWebView _provisionalWebProcessIdentifier]): (-[WKWebView _webProcessIsResponsive]): (-[WKWebView _killWebContentProcess]): (-[WKWebView _reloadWithoutContentBlockers]): (-[WKWebView _reloadExpiredOnly]): (-[WKWebView _killWebContentProcessAndResetState]): (-[WKWebView _convertRectFromRootViewCoordinates:]): (-[WKWebView _convertRectToRootViewCoordinates:]): (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): (-[WKWebView _focusTextInputContext:completionHandler:]): (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]): (-[WKWebView _sessionStateData]): (-[WKWebView _sessionState]): (-[WKWebView _sessionStateWithFilter:]): (-[WKWebView _restoreFromSessionStateData:]): (-[WKWebView _restoreSessionState:andNavigate:]): (-[WKWebView _close]): (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]): (-[WKWebView _attachmentForIdentifier:]): (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]): (+[WKWebView _handlesSafeBrowsing]): (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]): (+[WKWebView _confirmMalwareSentinel]): (+[WKWebView _visitUnsafeWebsiteSentinel]): (-[WKWebView _isJITEnabled:]): (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]): (-[WKWebView _updateWebsitePolicies:]): (-[WKWebView _allowsRemoteInspection]): (-[WKWebView _setAllowsRemoteInspection:]): (-[WKWebView _remoteInspectionNameOverride]): (-[WKWebView _setRemoteInspectionNameOverride:]): (-[WKWebView _addsVisitedLinks]): (-[WKWebView _setAddsVisitedLinks:]): (-[WKWebView _networkRequestsInProgress]): (layoutMilestones): (-[WKWebView _setObservedRenderingProgressEvents:]): (-[WKWebView _getMainResourceDataWithCompletionHandler:]): (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): (-[WKWebView _getContentsAsStringWithCompletionHandler:]): (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]): (-[WKWebView _getApplicationManifestWithCompletionHandler:]): (-[WKWebView _paginationMode]): (-[WKWebView _setPaginationMode:]): (-[WKWebView _paginationBehavesLikeColumns]): (-[WKWebView _setPaginationBehavesLikeColumns:]): (-[WKWebView _pageLength]): (-[WKWebView _setPageLength:]): (-[WKWebView _gapBetweenPages]): (-[WKWebView _setGapBetweenPages:]): (-[WKWebView _paginationLineGridEnabled]): (-[WKWebView _setPaginationLineGridEnabled:]): (-[WKWebView _pageCount]): (-[WKWebView _supportsTextZoom]): (-[WKWebView _textZoomFactor]): (-[WKWebView _setTextZoomFactor:]): (-[WKWebView _pageZoomFactor]): (-[WKWebView _setPageZoomFactor:]): (-[WKWebView _diagnosticLoggingDelegate]): (-[WKWebView _setDiagnosticLoggingDelegate:]): (-[WKWebView _findDelegate]): (-[WKWebView _setFindDelegate:]): (-[WKWebView _countStringMatches:options:maxCount:]): (-[WKWebView _findString:options:maxCount:]): (-[WKWebView _hideFindUI]): (-[WKWebView _saveBackForwardSnapshotForItem:]): (-[WKWebView _inputDelegate]): (-[WKWebView _setInputDelegate:]): (-[WKWebView _isDisplayingStandaloneImageDocument]): (-[WKWebView _isDisplayingStandaloneMediaDocument]): (-[WKWebView _isPlayingAudio]): (-[WKWebView _isShowingNavigationGestureSnapshot]): (-[WKWebView _layoutMode]): (-[WKWebView _setLayoutMode:]): (-[WKWebView _fixedLayoutSize]): (-[WKWebView _setFixedLayoutSize:]): (-[WKWebView _setBackgroundExtendsBeyondPage:]): (-[WKWebView _backgroundExtendsBeyondPage]): (-[WKWebView _viewScale]): (-[WKWebView _setViewScale:]): (-[WKWebView _setMinimumEffectiveDeviceWidth:]): (-[WKWebView _minimumEffectiveDeviceWidth]): (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]): (-[WKWebView _scrollPerformanceDataCollectionEnabled]): (-[WKWebView _scrollPerformanceData]): (-[WKWebView _allowsMediaDocumentInlinePlayback]): (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]): (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): (-[WKWebView _isInFullscreen]): (-[WKWebView _mediaCaptureState]): (-[WKWebView _setMediaCaptureEnabled:]): (-[WKWebView _mediaCaptureEnabled]): (-[WKWebView _setPageMuted:]): (-[WKWebView _removeDataDetectedLinks:]): (-[WKWebView _doAfterNextPresentationUpdate:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]): (toAPIScrollbarStyle): Deleted. (toCoreScrollbarStyle): Deleted. (deviceOrientationForUIInterfaceOrientation): Deleted. (deviceOrientation): Deleted. (-[WKWebView setFrame:]): Deleted. (-[WKWebView setBounds:]): Deleted. (-[WKWebView layoutSubviews]): Deleted. (-[WKWebView _isShowingVideoPictureInPicture]): Deleted. (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]): Deleted. (-[WKWebView _incrementFocusPreservationCount]): Deleted. (-[WKWebView _decrementFocusPreservationCount]): Deleted. (-[WKWebView _resetFocusPreservationCount]): Deleted. (-[WKWebView _isRetainingActiveFocusedState]): Deleted. (-[WKWebView _effectiveAppearanceIsDark]): Deleted. (-[WKWebView _effectiveUserInterfaceLevelIsElevated]): Deleted. (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]): Deleted. (-[WKWebView _dragInteractionPolicy]): Deleted. (-[WKWebView _setDragInteractionPolicy:]): Deleted. (-[WKWebView _populateArchivedSubviews:]): Deleted. (-[WKWebView _isBackground]): Deleted. (-[WKWebView browsingContextController]): Deleted. (-[WKWebView becomeFirstResponder]): Deleted. (-[WKWebView canBecomeFirstResponder]): Deleted. (-[WKWebView resignFirstResponder]): Deleted. (-[WKWebView canPerformAction:withSender:]): Deleted. (-[WKWebView targetForAction:withSender:]): Deleted. (-[WKWebView willFinishIgnoringCalloutBarFadeAfterPerformingAction]): Deleted. (floorToDevicePixel): Deleted. (pointsEqualInDevicePixels): Deleted. (roundScrollViewContentSize): Deleted. (-[WKWebView _currentContentView]): Deleted. (-[WKWebView _contentProviderRegistry]): Deleted. (-[WKWebView _selectionGranularity]): Deleted. (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Deleted. (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]): Deleted. (-[WKWebView _handleKeyUIEvent:]): Deleted. (-[WKWebView _willInvokeUIScrollViewDelegateCallback]): Deleted. (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): Deleted. (contentZoomScale): Deleted. (baseScrollViewBackgroundColor): Deleted. (scrollViewBackgroundColor): Deleted. (-[WKWebView _updateScrollViewBackground]): Deleted. (-[WKWebView _videoControlsManagerDidChange]): Deleted. (-[WKWebView _initialContentOffsetForScrollView]): Deleted. (-[WKWebView _contentOffsetAdjustedForObscuredInset:]): Deleted. (-[WKWebView _effectiveObscuredInsetEdgesAffectedBySafeArea]): Deleted. (-[WKWebView _computedObscuredInset]): Deleted. (-[WKWebView _computedContentInset]): Deleted. (-[WKWebView _computedUnobscuredSafeAreaInset]): Deleted. (-[WKWebView _processWillSwapOrDidExit]): Deleted. (-[WKWebView _processWillSwap]): Deleted. (-[WKWebView _processDidExit]): Deleted. (-[WKWebView _didRelaunchProcess]): Deleted. (-[WKWebView _didCommitLoadForMainFrame]): Deleted. (contentOffsetBoundedInValidRange): Deleted. (changeContentOffsetBoundedInValidRange): Deleted. (-[WKWebView visibleRectInViewCoordinates]): Deleted. (areEssentiallyEqualAsFloat): Deleted. (-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]): Deleted. (-[WKWebView _didCommitLayerTree:]): Deleted. (-[WKWebView _layerTreeCommitComplete]): Deleted. (-[WKWebView _couldNotRestorePageState]): Deleted. (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): Deleted. (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): Deleted. (-[WKWebView _takeViewSnapshot]): Deleted. (-[WKWebView _zoomToPoint:atScale:animated:]): Deleted. (-[WKWebView _zoomToRect:atScale:origin:animated:]): Deleted. (constrainContentOffset): Deleted. (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]): Deleted. (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]): Deleted. (-[WKWebView _zoomOutWithOrigin:animated:]): Deleted. (-[WKWebView _zoomToInitialScaleWithOrigin:animated:]): Deleted. (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted. (-[WKWebView _initialScaleFactor]): Deleted. (-[WKWebView _contentZoomScale]): Deleted. (-[WKWebView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]): Deleted. (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]): Deleted. (-[WKWebView didMoveToWindow]): Deleted. (-[WKWebView _setOpaqueInternal:]): Deleted. (-[WKWebView setOpaque:]): Deleted. (-[WKWebView setBackgroundColor:]): Deleted. (-[WKWebView _allowsDoubleTapGestures]): Deleted. (-[WKWebView _stylusTapGestureShouldCreateEditableImage]): Deleted. (-[WKWebView usesStandardContentView]): Deleted. (-[WKWebView scrollView:contentSizeForZoomScale:withProposedSize:]): Deleted. (-[WKWebView viewForZoomingInScrollView:]): Deleted. (-[WKWebView scrollViewWillBeginZooming:withView:]): Deleted. (-[WKWebView scrollViewWillBeginDragging:]): Deleted. (-[WKWebView _didFinishScrolling]): Deleted. (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted. (-[WKWebView scrollViewDidEndDragging:willDecelerate:]): Deleted. (-[WKWebView scrollViewDidEndDecelerating:]): Deleted. (-[WKWebView scrollViewDidScrollToTop:]): Deleted. (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Deleted. (-[WKWebView scrollViewDidScroll:]): Deleted. (-[WKWebView scrollViewDidZoom:]): Deleted. (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): Deleted. (-[WKWebView scrollViewDidEndScrollingAnimation:]): Deleted. (-[WKWebView _scrollViewDidInterruptDecelerating:]): Deleted. (-[WKWebView _enclosingViewForExposedRectComputation]): Deleted. (-[WKWebView _visibleRectInEnclosingView:]): Deleted. (-[WKWebView _visibleContentRect]): Deleted. (-[WKWebView _didScroll]): Deleted. (-[WKWebView _enclosingScrollerScrollingEnded:]): Deleted. (-[WKWebView _scrollViewSystemContentInset]): Deleted. (-[WKWebView activeViewLayoutSize:]): Deleted. (-[WKWebView _dispatchSetViewLayoutSize:]): Deleted. (-[WKWebView _dispatchSetMaximumUnobscuredSize:]): Deleted. (-[WKWebView _dispatchSetDeviceOrientation:]): Deleted. (-[WKWebView _frameOrBoundsChanged]): Deleted. (-[WKWebView _contentRectForUserInteraction]): Deleted. (-[WKWebView _scrollViewIsRubberBanding]): Deleted. (-[WKWebView safeAreaInsetsDidChange]): Deleted. (-[WKWebView _scheduleVisibleContentRectUpdate]): Deleted. (-[WKWebView _scrollViewIsInStableState:]): Deleted. (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): Deleted. (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): Deleted. (scrollViewCanScroll): Deleted. (-[WKWebView _contentBoundsExtendedForRubberbandingWithScale:]): Deleted. (-[WKWebView _updateVisibleContentRects]): Deleted. (-[WKWebView _didStartProvisionalLoadForMainFrame]): Deleted. (activeMaximumUnobscuredSize): Deleted. (activeOrientation): Deleted. (-[WKWebView _cancelAnimatedResize]): Deleted. (-[WKWebView _didCompleteAnimatedResize]): Deleted. (-[WKWebView _didFinishLoadForMainFrame]): Deleted. (-[WKWebView _didFailLoadForMainFrame]): Deleted. (-[WKWebView _didSameDocumentNavigationForMainFrame:]): Deleted. (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]): Deleted. (-[WKWebView _shouldUpdateKeyboardWithInfo:]): Deleted. (-[WKWebView _keyboardWillChangeFrame:]): Deleted. (-[WKWebView _keyboardDidChangeFrame:]): Deleted. (-[WKWebView _keyboardWillShow:]): Deleted. (-[WKWebView _keyboardDidShow:]): Deleted. (-[WKWebView _keyboardWillHide:]): Deleted. (-[WKWebView _windowDidRotate:]): Deleted. (-[WKWebView _contentSizeCategoryDidChange:]): Deleted. (-[WKWebView _contentSizeCategory]): Deleted. (-[WKWebView _accessibilitySettingsDidChange:]): Deleted. (-[WKWebView _isNavigationSwipeGestureRecognizer:]): Deleted. (-[WKWebView _navigationGestureDidBegin]): Deleted. (-[WKWebView _navigationGestureDidEnd]): Deleted. (-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]): Deleted. (-[WKWebView _hidePasswordView]): Deleted. (-[WKWebView _passwordView]): Deleted. (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): Deleted. (-[WKWebView _setAvoidsUnsafeArea:]): Deleted. (-[WKWebView _haveSetObscuredInsets]): Deleted. (-[WKWebView acceptsFirstResponder]): Deleted. (-[WKWebView viewWillStartLiveResize]): Deleted. (-[WKWebView viewDidEndLiveResize]): Deleted. (-[WKWebView isFlipped]): Deleted. (-[WKWebView intrinsicContentSize]): Deleted. (-[WKWebView prepareContentInRect:]): Deleted. (-[WKWebView setFrameSize:]): Deleted. (-[WKWebView _web_grantDOMPasteAccess]): Deleted. (-[WKWebView _prepareForImmediateActionAnimation]): Deleted. (-[WKWebView _cancelImmediateActionAnimation]): Deleted. (-[WKWebView _completeImmediateActionAnimation]): Deleted. (-[WKWebView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): Deleted. (-[WKWebView writeSelectionToPasteboard:types:]): Deleted. (-[WKWebView centerSelectionInVisibleArea:]): Deleted. (-[WKWebView validRequestorForSendType:returnType:]): Deleted. (-[WKWebView readSelectionFromPasteboard:]): Deleted. (-[WKWebView changeFont:]): Deleted. (-[WKWebView changeColor:]): Deleted. (-[WKWebView changeAttributes:]): Deleted. (-[WKWebView startSpeaking:]): Deleted. (-[WKWebView stopSpeaking:]): Deleted. (-[WKWebView showGuessPanel:]): Deleted. (-[WKWebView checkSpelling:]): Deleted. (-[WKWebView changeSpelling:]): Deleted. (-[WKWebView toggleContinuousSpellChecking:]): Deleted. (-[WKWebView isGrammarCheckingEnabled]): Deleted. (-[WKWebView setGrammarCheckingEnabled:]): Deleted. (-[WKWebView toggleGrammarChecking:]): Deleted. (-[WKWebView toggleAutomaticSpellingCorrection:]): Deleted. (-[WKWebView orderFrontSubstitutionsPanel:]): Deleted. (-[WKWebView toggleSmartInsertDelete:]): Deleted. (-[WKWebView isAutomaticQuoteSubstitutionEnabled]): Deleted. (-[WKWebView setAutomaticQuoteSubstitutionEnabled:]): Deleted. (-[WKWebView toggleAutomaticQuoteSubstitution:]): Deleted. (-[WKWebView isAutomaticDashSubstitutionEnabled]): Deleted. (-[WKWebView setAutomaticDashSubstitutionEnabled:]): Deleted. (-[WKWebView toggleAutomaticDashSubstitution:]): Deleted. (-[WKWebView isAutomaticLinkDetectionEnabled]): Deleted. (-[WKWebView setAutomaticLinkDetectionEnabled:]): Deleted. (-[WKWebView toggleAutomaticLinkDetection:]): Deleted. (-[WKWebView isAutomaticTextReplacementEnabled]): Deleted. (-[WKWebView setAutomaticTextReplacementEnabled:]): Deleted. (-[WKWebView toggleAutomaticTextReplacement:]): Deleted. (-[WKWebView uppercaseWord:]): Deleted. (-[WKWebView lowercaseWord:]): Deleted. (-[WKWebView capitalizeWord:]): Deleted. (-[WKWebView _wantsKeyDownForEvent:]): Deleted. (-[WKWebView scrollWheel:]): Deleted. (-[WKWebView swipeWithEvent:]): Deleted. (-[WKWebView mouseMoved:]): Deleted. (-[WKWebView mouseDown:]): Deleted. (-[WKWebView mouseUp:]): Deleted. (-[WKWebView mouseDragged:]): Deleted. (-[WKWebView mouseEntered:]): Deleted. (-[WKWebView mouseExited:]): Deleted. (-[WKWebView otherMouseDown:]): Deleted. (-[WKWebView otherMouseDragged:]): Deleted. (-[WKWebView otherMouseUp:]): Deleted. (-[WKWebView rightMouseDown:]): Deleted. (-[WKWebView rightMouseDragged:]): Deleted. (-[WKWebView rightMouseUp:]): Deleted. (-[WKWebView pressureChangeWithEvent:]): Deleted. (-[WKWebView acceptsFirstMouse:]): Deleted. (-[WKWebView shouldDelayWindowOrderingForEvent:]): Deleted. (-[WKWebView doCommandBySelector:]): Deleted. (-[WKWebView insertText:]): Deleted. (-[WKWebView insertText:replacementRange:]): Deleted. (-[WKWebView inputContext]): Deleted. (-[WKWebView performKeyEquivalent:]): Deleted. (-[WKWebView keyUp:]): Deleted. (-[WKWebView keyDown:]): Deleted. (-[WKWebView flagsChanged:]): Deleted. (-[WKWebView setMarkedText:selectedRange:replacementRange:]): Deleted. (-[WKWebView unmarkText]): Deleted. (-[WKWebView selectedRange]): Deleted. (-[WKWebView hasMarkedText]): Deleted. (-[WKWebView markedRange]): Deleted. (-[WKWebView attributedSubstringForProposedRange:actualRange:]): Deleted. (-[WKWebView characterIndexForPoint:]): Deleted. (-[WKWebView typingAttributesWithCompletionHandler:]): Deleted. (-[WKWebView firstRectForCharacterRange:actualRange:]): Deleted. (-[WKWebView selectedRangeWithCompletionHandler:]): Deleted. (-[WKWebView markedRangeWithCompletionHandler:]): Deleted. (-[WKWebView hasMarkedTextWithCompletionHandler:]): Deleted. (-[WKWebView attributedSubstringForProposedRange:completionHandler:]): Deleted. (-[WKWebView firstRectForCharacterRange:completionHandler:]): Deleted. (-[WKWebView characterIndexForPoint:completionHandler:]): Deleted. (-[WKWebView validAttributesForMarkedText]): Deleted. (-[WKWebView draggedImage:endedAt:operation:]): Deleted. (-[WKWebView draggingEntered:]): Deleted. (-[WKWebView draggingUpdated:]): Deleted. (-[WKWebView draggingExited:]): Deleted. (-[WKWebView prepareForDragOperation:]): Deleted. (-[WKWebView performDragOperation:]): Deleted. (-[WKWebView _hitTest:dragTypes:]): Deleted. (-[WKWebView _windowResizeMouseLocationIsInVisibleScrollerThumb:]): Deleted. (-[WKWebView viewWillMoveToWindow:]): Deleted. (-[WKWebView viewDidMoveToWindow]): Deleted. (-[WKWebView drawRect:]): Deleted. (-[WKWebView isOpaque]): Deleted. (-[WKWebView mouseDownCanMoveWindow]): Deleted. (-[WKWebView viewDidHide]): Deleted. (-[WKWebView viewDidUnhide]): Deleted. (-[WKWebView viewDidChangeBackingProperties]): Deleted. (-[WKWebView _activeSpaceDidChange:]): Deleted. (-[WKWebView accessibilityFocusedUIElement]): Deleted. (-[WKWebView accessibilityHitTest:]): Deleted. (-[WKWebView accessibilityAttributeValue:]): Deleted. (-[WKWebView accessibilityAttributeValue:forParameter:]): Deleted. (-[WKWebView hitTest:]): Deleted. (-[WKWebView conversationIdentifier]): Deleted. (-[WKWebView quickLookWithEvent:]): Deleted. (-[WKWebView addTrackingRect:owner:userData:assumeInside:]): Deleted. (-[WKWebView _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]): Deleted. (-[WKWebView _addTrackingRects:owner:userDataList:assumeInsideList:trackingNums:count:]): Deleted. (-[WKWebView removeTrackingRect:]): Deleted. (-[WKWebView _removeTrackingRects:count:]): Deleted. (-[WKWebView view:stringForToolTip:point:userData:]): Deleted. (-[WKWebView pasteboardChangedOwner:]): Deleted. (-[WKWebView pasteboard:provideDataForType:]): Deleted. (-[WKWebView namesOfPromisedFilesDroppedAtDestination:]): Deleted. (-[WKWebView wantsUpdateLayer]): Deleted. (-[WKWebView updateLayer]): Deleted. (-[WKWebView smartMagnifyWithEvent:]): Deleted. (-[WKWebView magnifyWithEvent:]): Deleted. (-[WKWebView rotateWithEvent:]): Deleted. (-[WKWebView _usePlatformFindUI]): Deleted. (-[WKWebView _setUsePlatformFindUI:]): Deleted. (-[WKWebView _ensureTextFinderClient]): Deleted. (-[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]): Deleted. (-[WKWebView replaceMatches:withString:inSelectionOnly:resultCollector:]): Deleted. (-[WKWebView scrollFindMatchToVisible:]): Deleted. (-[WKWebView documentContainerView]): Deleted. (-[WKWebView getSelectedText:]): Deleted. (-[WKWebView selectFindMatch:completionHandler:]): Deleted. (-[WKWebView _web_superInputContext]): Deleted. (-[WKWebView _web_superQuickLookWithEvent:]): Deleted. (-[WKWebView _web_superSwipeWithEvent:]): Deleted. (-[WKWebView _web_superMagnifyWithEvent:]): Deleted. (-[WKWebView _web_superSmartMagnifyWithEvent:]): Deleted. (-[WKWebView _web_superRemoveTrackingRect:]): Deleted. (-[WKWebView _web_superAccessibilityAttributeValue:]): Deleted. (-[WKWebView _web_superDoCommandBySelector:]): Deleted. (-[WKWebView _web_superPerformKeyEquivalent:]): Deleted. (-[WKWebView _web_superKeyDown:]): Deleted. (-[WKWebView _web_superHitTest:]): Deleted. (-[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]): Deleted. (-[WKWebView _web_prepareForImmediateActionAnimation]): Deleted. (-[WKWebView _web_cancelImmediateActionAnimation]): Deleted. (-[WKWebView _web_completeImmediateActionAnimation]): Deleted. (-[WKWebView _web_didChangeContentSize:]): Deleted. (-[WKWebView _web_dragDestinationActionForDraggingInfo:]): Deleted. (-[WKWebView _web_didPerformDragOperation:]): Deleted. (-[WKWebView _web_dismissContentRelativeChildWindows]): Deleted. (-[WKWebView _web_dismissContentRelativeChildWindowsWithAnimation:]): Deleted. (-[WKWebView _web_editorStateDidChange]): Deleted. (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]): Deleted. (-[WKWebView filePromiseProvider:fileNameForType:]): Deleted. (-[WKWebView filePromiseProvider:writePromiseToURL:completionHandler:]): Deleted. (-[WKWebView draggingSession:sourceOperationMaskForDraggingContext:]): Deleted. (-[WKWebView draggingSession:endedAtPoint:operation:]): Deleted. (-[WKWebView makeTouchBar]): Deleted. (-[WKWebView candidateListTouchBarItem]): Deleted. (-[WKWebView _web_didAddMediaControlsManager:]): Deleted. (-[WKWebView _web_didRemoveMediaControlsManager]): Deleted. (-[WKWebView _interactWithMediaControlsForTesting]): Deleted. (-[WKWebView _useSystemAppearance]): Deleted. (-[WKWebView _setUseSystemAppearance:]): Deleted. (-[WKWebView _pageRefForTransitionToWKWebView]): Deleted. (-[WKWebView _canChangeFrameLayout:]): Deleted. (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): Deleted. (-[WKWebView _ignoresNonWheelEvents]): Deleted. (-[WKWebView _setIgnoresNonWheelEvents:]): Deleted. (-[WKWebView _hasActiveVideoForControlsManager]): Deleted. (-[WKWebView _dismissContentRelativeChildWindows]): Deleted. (-[WKWebView _gestureEventWasNotHandledByWebCore:]): Deleted. (-[WKWebView _disableFrameSizeUpdates]): Deleted. (-[WKWebView _enableFrameSizeUpdates]): Deleted. (-[WKWebView _beginDeferringViewInWindowChanges]): Deleted. (-[WKWebView _endDeferringViewInWindowChanges]): Deleted. (-[WKWebView _endDeferringViewInWindowChangesSync]): Deleted. (-[WKWebView _fullScreenPlaceholderView]): Deleted. (-[WKWebView _fullScreenWindow]): Deleted. (-[WKWebView _underlayColor]): Deleted. (-[WKWebView _setUnderlayColor:]): Deleted. (-[WKWebView _setCustomSwipeViews:]): Deleted. (-[WKWebView _setCustomSwipeViewsTopContentInset:]): Deleted. (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): Deleted. (-[WKWebView _setFrame:andScrollBy:]): Deleted. (-[WKWebView _setTotalHeightOfBanners:]): Deleted. (-[WKWebView _totalHeightOfBanners]): Deleted. (-[WKWebView _setShouldSuppressFirstResponderChanges:]): Deleted. (-[WKWebView _setFont:sender:]): Deleted. (-[WKWebView _setFontSize:sender:]): Deleted. (-[WKWebView _setTextColor:sender:]): Deleted. (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): Deleted. (-[WKWebView _contentVisibleRect]): Deleted. (-[WKWebView _convertPointFromContentsToView:]): Deleted. (-[WKWebView _convertPointFromViewToContents:]): Deleted. (-[WKWebView didStartFormControlInteraction]): Deleted. (-[WKWebView didEndFormControlInteraction]): Deleted. (-[WKWebView _uiTextCaretRect]): Deleted. (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): Deleted. (-[WKWebView _accessibilityStoreSelection]): Deleted. (-[WKWebView _accessibilityClearSelection]): Deleted. (-[WKWebView _contentViewIsFirstResponder]): Deleted. (-[WKWebView _retainActiveFocusedState]): Deleted. (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): Deleted. (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): Deleted. (-[WKWebView _dataDetectionResults]): Deleted. (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): Deleted. (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): Deleted. (-[WKWebView _safeBrowsingWarning]): Deleted. (-[WKWebView _doAfterNextStablePresentationUpdate:]): Deleted. (-[WKWebView _detectDataWithTypes:completionHandler:]): Deleted. (-[WKWebView removeFromSuperview]): Deleted. (-[WKWebView _minimumLayoutSizeOverride]): Deleted. (-[WKWebView _setViewLayoutSizeOverride:]): Deleted. (-[WKWebView _obscuredInsets]): Deleted. (-[WKWebView _setObscuredInsets:]): Deleted. (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): Deleted. (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): Deleted. (-[WKWebView _unobscuredSafeAreaInsets]): Deleted. (-[WKWebView _setUnobscuredSafeAreaInsets:]): Deleted. (-[WKWebView _safeAreaShouldAffectObscuredInsets]): Deleted. (-[WKWebView _setInterfaceOrientationOverride:]): Deleted. (-[WKWebView _interfaceOrientationOverride]): Deleted. (-[WKWebView _clearInterfaceOrientationOverride]): Deleted. (-[WKWebView _maximumUnobscuredSizeOverride]): Deleted. (-[WKWebView _setMaximumUnobscuredSizeOverride:]): Deleted. (-[WKWebView _setAllowsViewportShrinkToFit:]): Deleted. (-[WKWebView _allowsViewportShrinkToFit]): Deleted. (-[WKWebView _beginInteractiveObscuredInsetsChange]): Deleted. (-[WKWebView _endInteractiveObscuredInsetsChange]): Deleted. (-[WKWebView _hideContentUntilNextUpdate]): Deleted. (-[WKWebView _beginAnimatedResizeWithUpdates:]): Deleted. (-[WKWebView _endAnimatedResize]): Deleted. (-[WKWebView _resizeWhileHidingContentWithUpdates:]): Deleted. (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]): Deleted. (-[WKWebView _setOverlaidAccessoryViewsInset:]): Deleted. (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Deleted. (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): Deleted. (-[WKWebView _clearOverrideLayoutParameters]): Deleted. (viewportArgumentsFromDictionary): Deleted. (-[WKWebView _overrideViewportWithArguments:]): Deleted. (-[WKWebView _viewForFindUI]): Deleted. (-[WKWebView _isDisplayingPDF]): Deleted. (-[WKWebView _dataForDisplayedPDF]): Deleted. (-[WKWebView _suggestedFilenameForDisplayedPDF]): Deleted. (-[WKWebView _webViewPrintFormatter]): Deleted. (toUserInterfaceLayoutDirection): Deleted. (-[WKWebView setSemanticContentAttribute:]): Deleted. (-[WKWebView _drawsBackground]): Deleted. (-[WKWebView _setDrawsBackground:]): Deleted. (-[WKWebView _backgroundColor]): Deleted. (-[WKWebView _setBackgroundColor:]): Deleted. (-[WKWebView _setDrawsTransparentBackground:]): Deleted. (-[WKWebView _inspectorAttachmentView]): Deleted. (-[WKWebView _setInspectorAttachmentView:]): Deleted. (-[WKWebView _setOverlayScrollbarStyle:]): Deleted. (-[WKWebView _overlayScrollbarStyle]): Deleted. (-[WKWebView _windowOcclusionDetectionEnabled]): Deleted. (-[WKWebView _setWindowOcclusionDetectionEnabled:]): Deleted. (-[WKWebView shareSheetDidDismiss:]): Deleted. (-[WKWebView _setOverrideDeviceScaleFactor:]): Deleted. (-[WKWebView _overrideDeviceScaleFactor]): Deleted. (-[WKWebView _setTopContentInset:]): Deleted. (-[WKWebView _topContentInset]): Deleted. (-[WKWebView _pageExtendedBackgroundColor]): Deleted. (-[WKWebView _pinnedState]): Deleted. (-[WKWebView _rubberBandingEnabled]): Deleted. (-[WKWebView _setRubberBandingEnabled:]): Deleted. (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]): Deleted. (-[WKWebView _setAutomaticallyAdjustsContentInsets:]): Deleted. (-[WKWebView _automaticallyAdjustsContentInsets]): Deleted. (-[WKWebView _minimumLayoutWidth]): Deleted. (-[WKWebView _setMinimumLayoutWidth:]): Deleted. (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]): Deleted. (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]): Deleted. (-[WKWebView _alwaysShowsHorizontalScroller]): Deleted. (-[WKWebView _setAlwaysShowsHorizontalScroller:]): Deleted. (-[WKWebView _alwaysShowsVerticalScroller]): Deleted. (-[WKWebView _setAlwaysShowsVerticalScroller:]): Deleted. (-[WKWebView _printOperationWithPrintInfo:]): Deleted. (-[WKWebView _printOperationWithPrintInfo:forFrame:]): Deleted. (-[WKWebView setUserInterfaceLayoutDirection:]): Deleted. (-[WKWebView _wantsMediaPlaybackControlsView]): Deleted. (-[WKWebView _setWantsMediaPlaybackControlsView:]): Deleted. (-[WKWebView _mediaPlaybackControlsView]): Deleted. (-[WKWebView _addMediaPlaybackControlsView:]): Deleted. (-[WKWebView _removeMediaPlaybackControlsView]): Deleted. (-[WKWebView _prepareForMoveToWindow:completionHandler:]): Deleted. (-[WKWebView _setThumbnailView:]): Deleted. (-[WKWebView _thumbnailView]): Deleted. (-[WKWebView _setIgnoresAllEvents:]): Deleted. (-[WKWebView _ignoresAllEvents]): Deleted. (-[WKWebView _spellCheckerDocumentTag]): Deleted. (-[WKWebView hasFullScreenWindowController]): Deleted. (-[WKWebView closeFullScreenWindowController]): Deleted. (-[WKWebView fullScreenWindowController]): Deleted. (-[WKWebView validateUserInterfaceItem:]): Deleted. (-[WKWebView goBack:]): Deleted. (-[WKWebView goForward:]): Deleted. (-[WKWebView reload:]): Deleted. (-[WKWebView reloadFromOrigin:]): Deleted. (-[WKWebView stopLoading:]): Deleted. (-[WKWebView _printFormatterClass]): Deleted. (-[WKWebView _printProvider]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: * UIProcess/API/ios/WKWebViewIOS.h: Copied from Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h. * UIProcess/API/ios/WKWebViewIOS.mm: Added. (deviceOrientationForUIInterfaceOrientation): (deviceOrientation): (-[WKWebView setFrame:]): (-[WKWebView setBounds:]): (-[WKWebView layoutSubviews]): (-[WKWebView _isShowingVideoPictureInPicture]): (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]): (-[WKWebView _incrementFocusPreservationCount]): (-[WKWebView _decrementFocusPreservationCount]): (-[WKWebView _resetFocusPreservationCount]): (-[WKWebView _isRetainingActiveFocusedState]): (-[WKWebView _effectiveAppearanceIsDark]): (-[WKWebView _effectiveUserInterfaceLevelIsElevated]): (-[WKWebView _populateArchivedSubviews:]): (-[WKWebView _isBackground]): (-[WKWebView browsingContextController]): (-[WKWebView becomeFirstResponder]): (-[WKWebView canBecomeFirstResponder]): (-[WKWebView resignFirstResponder]): (-[WKWebView canPerformAction:withSender:]): (-[WKWebView targetForAction:withSender:]): (-[WKWebView willFinishIgnoringCalloutBarFadeAfterPerformingAction]): (floorToDevicePixel): (pointsEqualInDevicePixels): (roundScrollViewContentSize): (-[WKWebView _currentContentView]): (-[WKWebView _contentProviderRegistry]): (-[WKWebView _selectionGranularity]): (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]): (-[WKWebView _handleKeyUIEvent:]): (-[WKWebView _willInvokeUIScrollViewDelegateCallback]): (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): (contentZoomScale): (baseScrollViewBackgroundColor): (scrollViewBackgroundColor): (-[WKWebView _updateScrollViewBackground]): (-[WKWebView _videoControlsManagerDidChange]): (-[WKWebView _initialContentOffsetForScrollView]): (-[WKWebView _contentOffsetAdjustedForObscuredInset:]): (-[WKWebView _effectiveObscuredInsetEdgesAffectedBySafeArea]): (-[WKWebView _computedObscuredInset]): (-[WKWebView _computedContentInset]): (-[WKWebView _computedUnobscuredSafeAreaInset]): (-[WKWebView _processWillSwapOrDidExit]): (-[WKWebView _processWillSwap]): (-[WKWebView _processDidExit]): (-[WKWebView _didRelaunchProcess]): (-[WKWebView _didCommitLoadForMainFrame]): (contentOffsetBoundedInValidRange): (changeContentOffsetBoundedInValidRange): (-[WKWebView visibleRectInViewCoordinates]): (areEssentiallyEqualAsFloat): (-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]): (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _layerTreeCommitComplete]): (-[WKWebView _couldNotRestorePageState]): (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): (-[WKWebView _takeViewSnapshot]): (-[WKWebView _zoomToPoint:atScale:animated:]): (-[WKWebView _zoomToRect:atScale:origin:animated:]): (constrainContentOffset): (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]): (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]): (-[WKWebView _zoomOutWithOrigin:animated:]): (-[WKWebView _zoomToInitialScaleWithOrigin:animated:]): (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): (-[WKWebView _initialScaleFactor]): (-[WKWebView _contentZoomScale]): (-[WKWebView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]): (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]): (-[WKWebView didMoveToWindow]): (-[WKWebView _setOpaqueInternal:]): (-[WKWebView setOpaque:]): (-[WKWebView setBackgroundColor:]): (-[WKWebView _allowsDoubleTapGestures]): (-[WKWebView _stylusTapGestureShouldCreateEditableImage]): (-[WKWebView usesStandardContentView]): (-[WKWebView scrollView:contentSizeForZoomScale:withProposedSize:]): (-[WKWebView viewForZoomingInScrollView:]): (-[WKWebView scrollViewWillBeginZooming:withView:]): (-[WKWebView scrollViewWillBeginDragging:]): (-[WKWebView _didFinishScrolling]): (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): (-[WKWebView scrollViewDidEndDragging:willDecelerate:]): (-[WKWebView scrollViewDidEndDecelerating:]): (-[WKWebView scrollViewDidScrollToTop:]): (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): (-[WKWebView scrollViewDidScroll:]): (-[WKWebView scrollViewDidZoom:]): (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): (-[WKWebView scrollViewDidEndScrollingAnimation:]): (-[WKWebView _scrollViewDidInterruptDecelerating:]): (-[WKWebView _visibleRectInEnclosingView:]): (-[WKWebView _visibleContentRect]): (-[WKWebView _didScroll]): (-[WKWebView _enclosingScrollerScrollingEnded:]): (-[WKWebView _scrollViewSystemContentInset]): (-[WKWebView activeViewLayoutSize:]): (-[WKWebView _dispatchSetViewLayoutSize:]): (-[WKWebView _dispatchSetMaximumUnobscuredSize:]): (-[WKWebView _dispatchSetDeviceOrientation:]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _contentRectForUserInteraction]): (-[WKWebView _scrollViewIsRubberBanding]): (-[WKWebView safeAreaInsetsDidChange]): (-[WKWebView _scheduleVisibleContentRectUpdate]): (-[WKWebView _scrollViewIsInStableState:]): (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): (scrollViewCanScroll): (-[WKWebView _contentBoundsExtendedForRubberbandingWithScale:]): (-[WKWebView _updateVisibleContentRects]): (-[WKWebView _didStartProvisionalLoadForMainFrame]): (activeMaximumUnobscuredSize): (activeOrientation): (-[WKWebView _cancelAnimatedResize]): (-[WKWebView _didCompleteAnimatedResize]): (-[WKWebView _didFinishLoadForMainFrame]): (-[WKWebView _didFailLoadForMainFrame]): (-[WKWebView _didSameDocumentNavigationForMainFrame:]): (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]): (-[WKWebView _shouldUpdateKeyboardWithInfo:]): (-[WKWebView _keyboardWillChangeFrame:]): (-[WKWebView _keyboardDidChangeFrame:]): (-[WKWebView _keyboardWillShow:]): (-[WKWebView _keyboardDidShow:]): (-[WKWebView _keyboardWillHide:]): (-[WKWebView _windowDidRotate:]): (-[WKWebView _contentSizeCategoryDidChange:]): (-[WKWebView _accessibilitySettingsDidChange:]): (-[WKWebView _contentSizeCategory]): (-[WKWebView _isNavigationSwipeGestureRecognizer:]): (-[WKWebView _navigationGestureDidBegin]): (-[WKWebView _navigationGestureDidEnd]): (-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]): (-[WKWebView _hidePasswordView]): (-[WKWebView _passwordView]): (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): (-[WKWebView _setAvoidsUnsafeArea:]): (-[WKWebView _haveSetObscuredInsets]): (-[WKWebView removeFromSuperview]): (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]): (toUserInterfaceLayoutDirection): (-[WKWebView setSemanticContentAttribute:]): (-[WKWebView _contentVisibleRect]): (-[WKWebView _minimumLayoutSizeOverride]): (-[WKWebView _setViewLayoutSizeOverride:]): (-[WKWebView _maximumUnobscuredSizeOverride]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _obscuredInsets]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): (-[WKWebView _unobscuredSafeAreaInsets]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _safeAreaShouldAffectObscuredInsets]): (-[WKWebView _enclosingViewForExposedRectComputation]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _interfaceOrientationOverride]): (-[WKWebView _clearInterfaceOrientationOverride]): (-[WKWebView _setAllowsViewportShrinkToFit:]): (-[WKWebView _allowsViewportShrinkToFit]): (-[WKWebView _isDisplayingPDF]): (-[WKWebView _dataForDisplayedPDF]): (-[WKWebView _suggestedFilenameForDisplayedPDF]): (-[WKWebView _webViewPrintFormatter]): (-[WKWebView _dragInteractionPolicy]): (-[WKWebView _setDragInteractionPolicy:]): (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]): (-[WKWebView _contentViewIsFirstResponder]): (-[WKWebView _uiTextCaretRect]): (-[WKWebView _safeBrowsingWarning]): (-[WKWebView _convertPointFromContentsToView:]): (-[WKWebView _convertPointFromViewToContents:]): (-[WKWebView _doAfterNextStablePresentationUpdate:]): (-[WKWebView _setFont:sender:]): (-[WKWebView _setFontSize:sender:]): (-[WKWebView _setTextColor:sender:]): (-[WKWebView _detectDataWithTypes:completionHandler:]): (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): (-[WKWebView didStartFormControlInteraction]): (-[WKWebView didEndFormControlInteraction]): (-[WKWebView _beginInteractiveObscuredInsetsChange]): (-[WKWebView _endInteractiveObscuredInsetsChange]): (-[WKWebView _hideContentUntilNextUpdate]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _resizeWhileHidingContentWithUpdates:]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): (-[WKWebView _clearOverrideLayoutParameters]): (viewportArgumentsFromDictionary): (-[WKWebView _overrideViewportWithArguments:]): (-[WKWebView _viewForFindUI]): (-[WKWebView _setOverlaidAccessoryViewsInset:]): (-[WKWebView _retainActiveFocusedState]): (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): (-[WKWebView _dataDetectionResults]): (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): (-[WKWebView _accessibilityStoreSelection]): (-[WKWebView _accessibilityClearSelection]): (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView hasFullScreenWindowController]): (-[WKWebView closeFullScreenWindowController]): (-[WKWebView fullScreenWindowController]): (-[WKWebView _printFormatterClass]): (-[WKWebView _printProvider]): * UIProcess/API/ios/WKWebViewTestingIOS.mm: * UIProcess/API/mac/WKView.mm: (toCoreScrollbarStyle): Deleted. (toAPIScrollbarStyle): Deleted. * UIProcess/API/mac/WKWebViewMac.h: Added. * UIProcess/API/mac/WKWebViewMac.mm: Added. (toAPIScrollbarStyle): (toCoreScrollbarStyle): (-[WKWebView acceptsFirstResponder]): (-[WKWebView becomeFirstResponder]): (-[WKWebView resignFirstResponder]): (-[WKWebView viewWillStartLiveResize]): (-[WKWebView viewDidEndLiveResize]): (-[WKWebView isFlipped]): (-[WKWebView intrinsicContentSize]): (-[WKWebView prepareContentInRect:]): (-[WKWebView setFrameSize:]): (-[WKWebView setUserInterfaceLayoutDirection:]): (-[WKWebView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): (-[WKWebView writeSelectionToPasteboard:types:]): (-[WKWebView centerSelectionInVisibleArea:]): (-[WKWebView validRequestorForSendType:returnType:]): (-[WKWebView readSelectionFromPasteboard:]): (-[WKWebView changeFont:]): (-[WKWebView changeColor:]): (-[WKWebView changeAttributes:]): (-[WKWebView startSpeaking:]): (-[WKWebView stopSpeaking:]): (-[WKWebView showGuessPanel:]): (-[WKWebView checkSpelling:]): (-[WKWebView changeSpelling:]): (-[WKWebView toggleContinuousSpellChecking:]): (-[WKWebView isGrammarCheckingEnabled]): (-[WKWebView setGrammarCheckingEnabled:]): (-[WKWebView toggleGrammarChecking:]): (-[WKWebView toggleAutomaticSpellingCorrection:]): (-[WKWebView orderFrontSubstitutionsPanel:]): (-[WKWebView toggleSmartInsertDelete:]): (-[WKWebView isAutomaticQuoteSubstitutionEnabled]): (-[WKWebView setAutomaticQuoteSubstitutionEnabled:]): (-[WKWebView toggleAutomaticQuoteSubstitution:]): (-[WKWebView isAutomaticDashSubstitutionEnabled]): (-[WKWebView setAutomaticDashSubstitutionEnabled:]): (-[WKWebView toggleAutomaticDashSubstitution:]): (-[WKWebView isAutomaticLinkDetectionEnabled]): (-[WKWebView setAutomaticLinkDetectionEnabled:]): (-[WKWebView toggleAutomaticLinkDetection:]): (-[WKWebView isAutomaticTextReplacementEnabled]): (-[WKWebView setAutomaticTextReplacementEnabled:]): (-[WKWebView toggleAutomaticTextReplacement:]): (-[WKWebView uppercaseWord:]): (-[WKWebView lowercaseWord:]): (-[WKWebView capitalizeWord:]): (-[WKWebView _wantsKeyDownForEvent:]): (-[WKWebView scrollWheel:]): (-[WKWebView swipeWithEvent:]): (-[WKWebView mouseMoved:]): (-[WKWebView mouseDown:]): (-[WKWebView mouseUp:]): (-[WKWebView mouseDragged:]): (-[WKWebView mouseEntered:]): (-[WKWebView mouseExited:]): (-[WKWebView otherMouseDown:]): (-[WKWebView otherMouseDragged:]): (-[WKWebView otherMouseUp:]): (-[WKWebView rightMouseDown:]): (-[WKWebView rightMouseDragged:]): (-[WKWebView rightMouseUp:]): (-[WKWebView pressureChangeWithEvent:]): (-[WKWebView acceptsFirstMouse:]): (-[WKWebView shouldDelayWindowOrderingForEvent:]): (-[WKWebView doCommandBySelector:]): (-[WKWebView inputContext]): (-[WKWebView performKeyEquivalent:]): (-[WKWebView keyUp:]): (-[WKWebView keyDown:]): (-[WKWebView flagsChanged:]): (-[WKWebView setMarkedText:selectedRange:replacementRange:]): (-[WKWebView unmarkText]): (-[WKWebView selectedRange]): (-[WKWebView hasMarkedText]): (-[WKWebView markedRange]): (-[WKWebView attributedSubstringForProposedRange:actualRange:]): (-[WKWebView characterIndexForPoint:]): (-[WKWebView typingAttributesWithCompletionHandler:]): (-[WKWebView firstRectForCharacterRange:actualRange:]): (-[WKWebView selectedRangeWithCompletionHandler:]): (-[WKWebView markedRangeWithCompletionHandler:]): (-[WKWebView hasMarkedTextWithCompletionHandler:]): (-[WKWebView attributedSubstringForProposedRange:completionHandler:]): (-[WKWebView firstRectForCharacterRange:completionHandler:]): (-[WKWebView characterIndexForPoint:completionHandler:]): (-[WKWebView validAttributesForMarkedText]): (-[WKWebView draggedImage:endedAt:operation:]): (-[WKWebView draggingEntered:]): (-[WKWebView draggingUpdated:]): (-[WKWebView draggingExited:]): (-[WKWebView prepareForDragOperation:]): (-[WKWebView performDragOperation:]): (-[WKWebView _hitTest:dragTypes:]): (-[WKWebView _windowResizeMouseLocationIsInVisibleScrollerThumb:]): (-[WKWebView viewWillMoveToWindow:]): (-[WKWebView viewDidMoveToWindow]): (-[WKWebView drawRect:]): (-[WKWebView isOpaque]): (-[WKWebView mouseDownCanMoveWindow]): (-[WKWebView viewDidHide]): (-[WKWebView viewDidUnhide]): (-[WKWebView viewDidChangeBackingProperties]): (-[WKWebView _activeSpaceDidChange:]): (-[WKWebView accessibilityFocusedUIElement]): (-[WKWebView accessibilityHitTest:]): (-[WKWebView accessibilityAttributeValue:]): (-[WKWebView accessibilityAttributeValue:forParameter:]): (-[WKWebView hitTest:]): (-[WKWebView conversationIdentifier]): (-[WKWebView quickLookWithEvent:]): (-[WKWebView addTrackingRect:owner:userData:assumeInside:]): (-[WKWebView _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]): (-[WKWebView _addTrackingRects:owner:userDataList:assumeInsideList:trackingNums:count:]): (-[WKWebView removeTrackingRect:]): (-[WKWebView _removeTrackingRects:count:]): (-[WKWebView view:stringForToolTip:point:userData:]): (-[WKWebView pasteboardChangedOwner:]): (-[WKWebView pasteboard:provideDataForType:]): (-[WKWebView namesOfPromisedFilesDroppedAtDestination:]): (-[WKWebView wantsUpdateLayer]): (-[WKWebView updateLayer]): (-[WKWebView smartMagnifyWithEvent:]): (-[WKWebView magnifyWithEvent:]): (-[WKWebView rotateWithEvent:]): (-[WKWebView _ensureTextFinderClient]): (-[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]): (-[WKWebView replaceMatches:withString:inSelectionOnly:resultCollector:]): (-[WKWebView scrollFindMatchToVisible:]): (-[WKWebView documentContainerView]): (-[WKWebView getSelectedText:]): (-[WKWebView selectFindMatch:completionHandler:]): (-[WKWebView filePromiseProvider:fileNameForType:]): (-[WKWebView filePromiseProvider:writePromiseToURL:completionHandler:]): (-[WKWebView draggingSession:sourceOperationMaskForDraggingContext:]): (-[WKWebView draggingSession:endedAtPoint:operation:]): (-[WKWebView _prepareForImmediateActionAnimation]): (-[WKWebView _cancelImmediateActionAnimation]): (-[WKWebView _completeImmediateActionAnimation]): (-[WKWebView _setDrawsTransparentBackground:]): (-[WKWebView shareSheetDidDismiss:]): (-[WKWebView makeTouchBar]): (-[WKWebView candidateListTouchBarItem]): (-[WKWebView _web_didAddMediaControlsManager:]): (-[WKWebView _web_didRemoveMediaControlsManager]): (-[WKWebView _interactWithMediaControlsForTesting]): (-[WKWebView validateUserInterfaceItem:]): (-[WKWebView goBack:]): (-[WKWebView goForward:]): (-[WKWebView reload:]): (-[WKWebView reloadFromOrigin:]): (-[WKWebView stopLoading:]): (-[WKWebView _web_superInputContext]): (-[WKWebView _web_superQuickLookWithEvent:]): (-[WKWebView _web_superSwipeWithEvent:]): (-[WKWebView _web_superMagnifyWithEvent:]): (-[WKWebView _web_superSmartMagnifyWithEvent:]): (-[WKWebView _web_superRemoveTrackingRect:]): (-[WKWebView _web_superAccessibilityAttributeValue:]): (-[WKWebView _web_superDoCommandBySelector:]): (-[WKWebView _web_superPerformKeyEquivalent:]): (-[WKWebView _web_superKeyDown:]): (-[WKWebView _web_superHitTest:]): (-[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]): (-[WKWebView _web_prepareForImmediateActionAnimation]): (-[WKWebView _web_cancelImmediateActionAnimation]): (-[WKWebView _web_completeImmediateActionAnimation]): (-[WKWebView _web_didChangeContentSize:]): (-[WKWebView _web_dragDestinationActionForDraggingInfo:]): (-[WKWebView _web_didPerformDragOperation:]): (-[WKWebView _web_dismissContentRelativeChildWindows]): (-[WKWebView _web_dismissContentRelativeChildWindowsWithAnimation:]): (-[WKWebView _web_editorStateDidChange]): (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]): (-[WKWebView _web_grantDOMPasteAccess]): (-[WKWebView _takeFindStringFromSelectionInternal:]): (-[WKWebView insertText:]): (-[WKWebView insertText:replacementRange:]): (-[WKWebView _pageRefForTransitionToWKWebView]): (-[WKWebView _hasActiveVideoForControlsManager]): (-[WKWebView _ignoresNonWheelEvents]): (-[WKWebView _setIgnoresNonWheelEvents:]): (-[WKWebView _safeBrowsingWarning]): (-[WKWebView _pinnedState]): (-[WKWebView _rubberBandingEnabled]): (-[WKWebView _setRubberBandingEnabled:]): (-[WKWebView _pageExtendedBackgroundColor]): (-[WKWebView _backgroundColor]): (-[WKWebView _setBackgroundColor:]): (-[WKWebView _underlayColor]): (-[WKWebView _setUnderlayColor:]): (-[WKWebView _setTotalHeightOfBanners:]): (-[WKWebView _totalHeightOfBanners]): (-[WKWebView _drawsBackground]): (-[WKWebView _setDrawsBackground:]): (-[WKWebView _setTopContentInset:]): (-[WKWebView _topContentInset]): (-[WKWebView _setAutomaticallyAdjustsContentInsets:]): (-[WKWebView _automaticallyAdjustsContentInsets]): (-[WKWebView _setOverrideDeviceScaleFactor:]): (-[WKWebView _overrideDeviceScaleFactor]): (-[WKWebView _windowOcclusionDetectionEnabled]): (-[WKWebView _setWindowOcclusionDetectionEnabled:]): (-[WKWebView _spellCheckerDocumentTag]): (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]): (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]): (-[WKWebView _minimumLayoutWidth]): (-[WKWebView _setMinimumLayoutWidth:]): (-[WKWebView _alwaysShowsHorizontalScroller]): (-[WKWebView _setAlwaysShowsHorizontalScroller:]): (-[WKWebView _alwaysShowsVerticalScroller]): (-[WKWebView _setAlwaysShowsVerticalScroller:]): (-[WKWebView _useSystemAppearance]): (-[WKWebView _setUseSystemAppearance:]): (-[WKWebView _setOverlayScrollbarStyle:]): (-[WKWebView _overlayScrollbarStyle]): (-[WKWebView _inspectorAttachmentView]): (-[WKWebView _setInspectorAttachmentView:]): (-[WKWebView _setThumbnailView:]): (-[WKWebView _thumbnailView]): (-[WKWebView _setIgnoresAllEvents:]): (-[WKWebView _ignoresAllEvents]): (-[WKWebView _usePlatformFindUI]): (-[WKWebView _setUsePlatformFindUI:]): (-[WKWebView _setShouldSuppressFirstResponderChanges:]): (-[WKWebView _canChangeFrameLayout:]): (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): (-[WKWebView _dismissContentRelativeChildWindows]): (-[WKWebView _setFrame:andScrollBy:]): (-[WKWebView _gestureEventWasNotHandledByWebCore:]): (-[WKWebView _disableFrameSizeUpdates]): (-[WKWebView _enableFrameSizeUpdates]): (-[WKWebView _beginDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChangesSync]): (-[WKWebView _setCustomSwipeViews:]): (-[WKWebView _setCustomSwipeViewsTopContentInset:]): (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView _fullScreenWindow]): (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]): (-[WKWebView _printOperationWithPrintInfo:]): (-[WKWebView _printOperationWithPrintInfo:forFrame:]): (-[WKWebView _wantsMediaPlaybackControlsView]): (-[WKWebView _setWantsMediaPlaybackControlsView:]): (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): (-[WKWebView _removeMediaPlaybackControlsView]): (-[WKWebView _prepareForMoveToWindow:completionHandler:]): * UIProcess/API/mac/WKWebViewTestingMac.mm: * UIProcess/ios/PageClientImplIOS.mm: * UIProcess/ios/WKContentView.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/WKPDFView.mm: * UIProcess/ios/WKScrollView.mm: * UIProcess/ios/WKSystemPreviewView.mm: * WebKit.xcodeproj/project.pbxproj: 2019-12-14 David Kilzer Add release assert for selectedIndex in WebKit::WebPopupMenu::show() Reviewed by Wenson Hsieh. * WebProcess/WebCoreSupport/WebPopupMenu.cpp: (WebKit::WebPopupMenu::show): - Add release assert to check for valid `selectedIndex` to fix the bug. - Rename `index` parameter to `selectedIndex`. * WebProcess/WebCoreSupport/WebPopupMenu.h: (WebKit::WebPopupMenu::show): - Rename `index` parameter to `selectedIndex`. 2019-12-13 Brady Eidson Refactor ScriptController's proliferation of ExceptionDetails*. https://bugs.webkit.org/show_bug.cgi?id=205151 Reviewed by Alex Christensen. * UIProcess/API/C/WKPage.cpp: (WKPageRunJavaScriptInMainFrame): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): (WebKit::WebPageProxy::runJavaScriptInFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performJavaScriptURLRequest): * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp: (WebKit::WebInspectorFrontendAPIDispatcher::evaluateOrQueueExpression): (WebKit::WebInspectorFrontendAPIDispatcher::evaluateQueuedExpressions): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScript): 2019-12-13 Eric Carlson Add remote media player message to load and play https://bugs.webkit.org/show_bug.cgi?id=205220 Reviewed by Jer Noble. Add WP -> GPU process messages: PrepareForPlayback, Load, CancelLoad, Play, Pause, SetVolume, and SetMuted Add GPUP -> WP message: PlaybackStateChanged * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::RemoteMediaPlayerManagerProxy): (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer): (WebKit::RemoteMediaPlayerManagerProxy::deleteMediaPlayer): (WebKit::RemoteMediaPlayerManagerProxy::prepareForPlayback): (WebKit::RemoteMediaPlayerManagerProxy::load): (WebKit::RemoteMediaPlayerManagerProxy::cancelLoad): (WebKit::RemoteMediaPlayerManagerProxy::play): (WebKit::RemoteMediaPlayerManagerProxy::pause): (WebKit::RemoteMediaPlayerManagerProxy::setVolume): (WebKit::RemoteMediaPlayerManagerProxy::setMuted): (WebKit::RemoteMediaPlayerManagerProxy::logChannel const): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: (WebKit::RemoteMediaPlayerManagerProxy::gpuConnectionToWebProcess const): (WebKit::RemoteMediaPlayerManagerProxy::webProcessConnection const): Deleted. * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy): (WebKit::RemoteMediaPlayerProxy::load): (WebKit::RemoteMediaPlayerProxy::prepareForPlayback): (WebKit::RemoteMediaPlayerProxy::cancelLoad): (WebKit::RemoteMediaPlayerProxy::play): (WebKit::RemoteMediaPlayerProxy::pause): (WebKit::RemoteMediaPlayerProxy::setVolume): (WebKit::RemoteMediaPlayerProxy::setMuted): (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkStateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerReadyStateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerVolumeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMuteChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerTimeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDurationChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRateChanged): * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/GPUProcessConnection.cpp: (WebKit::GPUProcessConnection::didReceiveMessage): * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::prepareForPlayback): (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): (WebKit::MediaPlayerPrivateRemote::cancelLoad): (WebKit::MediaPlayerPrivateRemote::play): (WebKit::MediaPlayerPrivateRemote::pause): (WebKit::MediaPlayerPrivateRemote::setVolumeDouble): (WebKit::MediaPlayerPrivateRemote::setMuted): (WebKit::MediaPlayerPrivateRemote::muteChanged): (WebKit::MediaPlayerPrivateRemote::timeChanged): (WebKit::MediaPlayerPrivateRemote::playbackStateChanged): (WebKit::MediaPlayerPrivateRemote::paused const): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::RemoteMediaPlayerManager): (WebKit::RemoteMediaPlayerManager::~RemoteMediaPlayerManager): (WebKit::RemoteMediaPlayerManager::playbackStateChanged): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromWebProcess): * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: 2019-12-13 Chris Dumez [macOS] Swipe gesture snapshot stays too long if provisional load has not started yet when endSwipeGesture() is called https://bugs.webkit.org/show_bug.cgi?id=205206 Reviewed by Tim Horton. Swipe gesture snapshot stays too long if provisional load has not started yet when endSwipeGesture() is called on macOS. This is because the SnapshotRemovalTracker::eventOccurred() calls get ignored while the SnapshotRemovalTracker is paused and the SnapshotRemovalTracker only gets unpaused once the provisional load has started. The idea is that we should ignore any events from a previous navigation. However, the SwipeGestureEnd event is a UI-side event fired by the ViewGestureController itself, so there is reason to ignore it. Since we ask the WebContent process to do the load in willEndSwipeGesture(), it is possible that the provisional load has not started yet by the time endSwipeGesture() is called. In such case, the SwipeGestureEnd event would get ignored and we would keep the snapshot until the timeout. * UIProcess/ViewGestureController.cpp: (WebKit::stopWaitingForEvent): (WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred): (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent): Deleted. * UIProcess/ViewGestureController.h: 2019-12-13 David Kilzer Add MESSAGE_CHECK() for selectedIndex in Messages::WebPageProxy::ShowPopupMenu Reviewed by Chris Dumez. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::showPopupMenu): Add MESSAGE_CHECK() to validate the `selectedIndex` parameter, which must be -1 to select no items, or a valid zero-based index into `items`. 2019-12-13 Alex Christensen Allow cross-origin requests to WKURLSchemeHandlers https://bugs.webkit.org/show_bug.cgi?id=205198 Reviewed by Brady Eidson. Covered by an API test. * UIProcess/API/Cocoa/WKURLSchemeTask.h: Document the requirements for cross-origin requests. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::registerURLSchemeHandler): When we register a scheme handler, allow cross origin resources for that scheme. This will make the check in DocumentThreadableLoader::checkURLSchemeAsCORSEnabled allow the request to get to the WKURLSchemeHandler. The resposne must still have CORS header fields in order for the data to get to the web content, like CORS with HTTP. 2019-12-13 Wenson Hsieh Implement encoding/decoding for DisplayList::DrawNativeImage https://bugs.webkit.org/show_bug.cgi?id=205200 Reviewed by Simon Fraser. Add helper functions to encode and decode NativeImagePtr (RetainPtr on Cocoa platforms). This mirrors the implementation of encoding and decoding for WebCore::Image, which create and draws into ShareableBitmap, and send a handle to the data over IPC. * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeImage): (IPC::decodeImage): (IPC::encodeNativeImage): (IPC::decodeNativeImage): Additionally make Image and NativeImagePtr encoding and decoding helpers fail quickly in the case where the ShareableBitmap failed to create a graphics context by having the encoder indicate whether a graphics context was created, and having the decoder fail if the graphics context could not be created. (IPC::encodeOptionalNativeImage): (IPC::decodeOptionalNativeImage): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: 2019-12-13 Per Arne Vollan [iOS] Deny mach lookup access to "*.apple-extension-service" in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=205134 Reviewed by Brent Fulgham. Remove mach lookup access to "*.apple-extension-service" in the sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-13 youenn fablet Help debugging flaky http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html https://bugs.webkit.org/show_bug.cgi?id=205209 Reviewed by Chris Dumez. Add a bunch of asserts that no pending activity is happening in the Cache Storage backend is happening when querying the backend representation, which is a debug tool. No change of behavior. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::representation): * NetworkProcess/cache/CacheStorageEngineCache.h: (WebKit::CacheStorage::Cache::hasPendingOpeningCallbacks const): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::appendRepresentation const): 2019-12-13 Kate Cheney Create WebKit API calls for ITP Data https://bugs.webkit.org/show_bug.cgi?id=204932 Reviewed by Alex Christensen. This patch exposes ITP data captured in the network process through the Objective C API using two new classes: _WKResourceLoadStatisticsFirstParty and _WKResourceLoadStatisticsThirdParty. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ensureThirdPartyDataForSpecificFirstPartyDomain): (WebKit::getThirdPartyDataForSpecificFirstPartyDomains): (WebKit::ResourceLoadStatisticsMemoryStore::aggregatedThirdPartyData const): * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: Updated mentions of ThirdPartyData to include the WebResourceLoadStatisticsStore:: class specifier after relocating ThirdPartyData. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::aggregatedThirdPartyData): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Updated the data to be sent via completion handler from WebResourceLoadStatisticsStore so that calls to aggregatedThirdPartyData() are happening on a background thread. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/APIResourceLoadStatisticsFirstParty.h: Added. * UIProcess/API/APIResourceLoadStatisticsThirdParty.h: Added. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _getResourceLoadStatisticsDataSummary:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h: Added. * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.mm: Added. (-[_WKResourceLoadStatisticsFirstParty dealloc]): (-[_WKResourceLoadStatisticsFirstParty firstPartyDomain]): (-[_WKResourceLoadStatisticsFirstParty storageAccess]): (-[_WKResourceLoadStatisticsFirstParty _apiObject]): * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstPartyInternal.h: Added. * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h: Added. * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.mm: Added. (-[_WKResourceLoadStatisticsThirdParty dealloc]): (-[_WKResourceLoadStatisticsThirdParty thirdPartyDomain]): (-[_WKResourceLoadStatisticsThirdParty underFirstParties]): (-[_WKResourceLoadStatisticsThirdParty _apiObject]): * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdPartyInternal.h: Added. _WKResourceLoadStatisticsFirstParty and _WKResourceLoadStatisticsThirdParty represent first and third party domains respectively which hold ITP data and are strongly typed to ensure the correct data is being exposed via API. The function and parameter names for storage access specify "third party" because each WKITPFirstParty holds data relevent to a specific third party and storage access would not make sense in just a first party context. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::getResourceLoadStatisticsDataSummary): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getResourceLoadStatisticsDataSummary): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit.xcodeproj/project.pbxproj: 2019-12-13 Eric Carlson Add infrastructure needed for playing media player in the GPU process https://bugs.webkit.org/show_bug.cgi?id=205094 Reviewed by Youenn Fablet. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): (WebKit::GPUConnectionToWebProcess::~GPUConnectionToWebProcess): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: Added. (WebKit::nullLogger): (WebKit::RemoteMediaPlayerManagerProxy::PlayerProxy::PlayerProxy): (WebKit::RemoteMediaPlayerManagerProxy::PlayerProxy::~PlayerProxy): (WebKit::RemoteMediaPlayerManagerProxy::RemoteMediaPlayerManagerProxy): (WebKit::RemoteMediaPlayerManagerProxy::~RemoteMediaPlayerManagerProxy): (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer): (WebKit::RemoteMediaPlayerManagerProxy::getSupportedTypes): (WebKit::RemoteMediaPlayerManagerProxy::supportsType): (WebKit::RemoteMediaPlayerManagerProxy::originsInMediaCache): (WebKit::RemoteMediaPlayerManagerProxy::clearMediaCache): (WebKit::RemoteMediaPlayerManagerProxy::clearMediaCacheForOrigins): (WebKit::RemoteMediaPlayerManagerProxy::supportsKeySystem): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: Added. (WebKit::RemoteMediaPlayerManagerProxy::webProcessConnection const): (WebKit::RemoteMediaPlayerManagerProxy::didReceiveMessageFromWebProcess): (WebKit::RemoteMediaPlayerManagerProxy::didReceiveSyncMessageFromWebProcess): * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: Added. * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: Added. (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): (WebKit::MediaPlayerPrivateRemote::load): (WebKit::MediaPlayerPrivateRemote::cancelLoad): (WebKit::MediaPlayerPrivateRemote::prepareToPlay): (WebKit::MediaPlayerPrivateRemote::platformLayer const): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenLayer): (WebKit::MediaPlayerPrivateRemote::updateVideoFullscreenInlineImage): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenMode): (WebKit::MediaPlayerPrivateRemote::videoFullscreenStandbyChanged): (WebKit::MediaPlayerPrivateRemote::accessLog const): (WebKit::MediaPlayerPrivateRemote::errorLog const): (WebKit::MediaPlayerPrivateRemote::platformErrorCode const): (WebKit::MediaPlayerPrivateRemote::play): (WebKit::MediaPlayerPrivateRemote::pause): (WebKit::MediaPlayerPrivateRemote::setBufferingPolicy): (WebKit::MediaPlayerPrivateRemote::supportsPictureInPicture const): (WebKit::MediaPlayerPrivateRemote::supportsFullscreen const): (WebKit::MediaPlayerPrivateRemote::supportsScanning const): (WebKit::MediaPlayerPrivateRemote::requiresImmediateCompositing const): (WebKit::MediaPlayerPrivateRemote::canSaveMediaData const): (WebKit::MediaPlayerPrivateRemote::naturalSize const): (WebKit::MediaPlayerPrivateRemote::hasVideo const): (WebKit::MediaPlayerPrivateRemote::hasAudio const): (WebKit::MediaPlayerPrivateRemote::setVisible): (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::durationMediaTime const): (WebKit::MediaPlayerPrivateRemote::currentMediaTime const): (WebKit::MediaPlayerPrivateRemote::getStartDate const): (WebKit::MediaPlayerPrivateRemote::seek): (WebKit::MediaPlayerPrivateRemote::seekWithTolerance): (WebKit::MediaPlayerPrivateRemote::seeking const): (WebKit::MediaPlayerPrivateRemote::startTime const): (WebKit::MediaPlayerPrivateRemote::setRateDouble): (WebKit::MediaPlayerPrivateRemote::rate const): (WebKit::MediaPlayerPrivateRemote::setPreservesPitch): (WebKit::MediaPlayerPrivateRemote::paused const): (WebKit::MediaPlayerPrivateRemote::setVolumeDouble): (WebKit::MediaPlayerPrivateRemote::setMuted): (WebKit::MediaPlayerPrivateRemote::hasClosedCaptions const): (WebKit::MediaPlayerPrivateRemote::setClosedCaptionsVisible): (WebKit::MediaPlayerPrivateRemote::maxFastForwardRate const): (WebKit::MediaPlayerPrivateRemote::minFastReverseRate const): (WebKit::MediaPlayerPrivateRemote::networkState const): (WebKit::MediaPlayerPrivateRemote::readyState const): (WebKit::MediaPlayerPrivateRemote::seekable const): (WebKit::MediaPlayerPrivateRemote::buffered const): (WebKit::MediaPlayerPrivateRemote::maxMediaTimeSeekable const): (WebKit::MediaPlayerPrivateRemote::minMediaTimeSeekable const): (WebKit::MediaPlayerPrivateRemote::seekableTimeRangesLastModifiedTime const): (WebKit::MediaPlayerPrivateRemote::liveUpdateInterval const): (WebKit::MediaPlayerPrivateRemote::totalBytes const): (WebKit::MediaPlayerPrivateRemote::didLoadingProgress const): (WebKit::MediaPlayerPrivateRemote::setSize): (WebKit::MediaPlayerPrivateRemote::paint): (WebKit::MediaPlayerPrivateRemote::paintCurrentFrameInContext): (WebKit::MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture): (WebKit::MediaPlayerPrivateRemote::nativeImageForCurrentTime): (WebKit::MediaPlayerPrivateRemote::setPreload): (WebKit::MediaPlayerPrivateRemote::hasAvailableVideoFrame const): (WebKit::MediaPlayerPrivateRemote::canLoadPoster const): (WebKit::MediaPlayerPrivateRemote::setPoster): (WebKit::MediaPlayerPrivateRemote::enterFullscreen): (WebKit::MediaPlayerPrivateRemote::exitFullscreen): (WebKit::MediaPlayerPrivateRemote::wirelessPlaybackTargetName const): (WebKit::MediaPlayerPrivateRemote::wirelessPlaybackTargetType const): (WebKit::MediaPlayerPrivateRemote::wirelessVideoPlaybackDisabled const): (WebKit::MediaPlayerPrivateRemote::setWirelessVideoPlaybackDisabled): (WebKit::MediaPlayerPrivateRemote::canPlayToWirelessPlaybackTarget const): (WebKit::MediaPlayerPrivateRemote::isCurrentPlaybackTargetWireless const): (WebKit::MediaPlayerPrivateRemote::setWirelessPlaybackTarget): (WebKit::MediaPlayerPrivateRemote::setShouldPlayToPlaybackTarget): (WebKit::MediaPlayerPrivateRemote::canEnterFullscreen const): (WebKit::MediaPlayerPrivateRemote::supportsAcceleratedRendering const): (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged): (WebKit::MediaPlayerPrivateRemote::shouldMaintainAspectRatio const): (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio): (WebKit::MediaPlayerPrivateRemote::hasSingleSecurityOrigin const): (WebKit::MediaPlayerPrivateRemote::didPassCORSAccessCheck const): (WebKit::MediaPlayerPrivateRemote::wouldTaintOrigin const): (WebKit::MediaPlayerPrivateRemote::movieLoadType const): (WebKit::MediaPlayerPrivateRemote::prepareForRendering): (WebKit::MediaPlayerPrivateRemote::mediaTimeForTimeValue const): (WebKit::MediaPlayerPrivateRemote::maximumDurationToCacheMediaTime const): (WebKit::MediaPlayerPrivateRemote::decodedFrameCount const): (WebKit::MediaPlayerPrivateRemote::droppedFrameCount const): (WebKit::MediaPlayerPrivateRemote::audioDecodedByteCount const): (WebKit::MediaPlayerPrivateRemote::videoDecodedByteCount const): (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode): (WebKit::MediaPlayerPrivateRemote::engineDescription const): (WebKit::MediaPlayerPrivateRemote::audioSourceProvider): (WebKit::MediaPlayerPrivateRemote::createSession): (WebKit::MediaPlayerPrivateRemote::setCDMSession): (WebKit::MediaPlayerPrivateRemote::keyAdded): (WebKit::MediaPlayerPrivateRemote::cdmInstanceAttached): (WebKit::MediaPlayerPrivateRemote::cdmInstanceDetached): (WebKit::MediaPlayerPrivateRemote::attemptToDecryptWithInstance): (WebKit::MediaPlayerPrivateRemote::waitingForKey const): (WebKit::MediaPlayerPrivateRemote::requiresTextTrackRepresentation const): (WebKit::MediaPlayerPrivateRemote::setTextTrackRepresentation): (WebKit::MediaPlayerPrivateRemote::syncTextTrackBounds): (WebKit::MediaPlayerPrivateRemote::tracksChanged): (WebKit::MediaPlayerPrivateRemote::simulateAudioInterruption): (WebKit::MediaPlayerPrivateRemote::beginSimulatedHDCPError): (WebKit::MediaPlayerPrivateRemote::endSimulatedHDCPError): (WebKit::MediaPlayerPrivateRemote::languageOfPrimaryAudioTrack const): (WebKit::MediaPlayerPrivateRemote::extraMemoryCost const): (WebKit::MediaPlayerPrivateRemote::fileSize const): (WebKit::MediaPlayerPrivateRemote::ended const): (WebKit::MediaPlayerPrivateRemote::videoPlaybackQualityMetrics): (WebKit::MediaPlayerPrivateRemote::notifyTrackModeChanged): (WebKit::MediaPlayerPrivateRemote::notifyActiveSourceBuffersChanged): (WebKit::MediaPlayerPrivateRemote::setShouldDisableSleep): (WebKit::MediaPlayerPrivateRemote::applicationWillResignActive): (WebKit::MediaPlayerPrivateRemote::applicationDidBecomeActive): (WebKit::MediaPlayerPrivateRemote::performTaskAtMediaTime): (WebKit::MediaPlayerPrivateRemote::shouldIgnoreIntrinsicSize): (WebKit::MediaPlayerPrivateRemote::logChannel const): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: Added. * WebProcess/GPU/media/MediaPlayerPrivateRemoteIdentifier.h: Added. * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: Added. (WebKit::MediaPlayerRemoteFactory::MediaPlayerRemoteFactory): (WebKit::RemoteMediaPlayerManager::RemoteMediaPlayerManager): (WebKit::RemoteMediaPlayerManager::~RemoteMediaPlayerManager): (WebKit::RemoteMediaPlayerManager::supplementName): (WebKit::RemoteMediaPlayerManager::initialize): (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): (WebKit::RemoteMediaPlayerManager::getSupportedTypes): (WebKit::RemoteMediaPlayerManager::supportsTypeAndCodecs): (WebKit::RemoteMediaPlayerManager::supportsKeySystem): (WebKit::RemoteMediaPlayerManager::originsInMediaCache): (WebKit::RemoteMediaPlayerManager::clearMediaCache): (WebKit::RemoteMediaPlayerManager::clearMediaCacheForOrigins): (WebKit::RemoteMediaPlayerManager::networkStateChanged): (WebKit::RemoteMediaPlayerManager::updatePreferences): (WebKit::RemoteMediaPlayerManager::gpuProcessConnection const): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: Added. * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebProcess.cpp: 2019-12-13 Jim Mason [GTK] WebKitGTK build hangs on g-ir-scanner https://bugs.webkit.org/show_bug.cgi?id=204715 This patch fixes the static initialization order problem introduced by Bug 204503. The patch replaces the static data members with statics that are constructed only upon first access (i.e., the 'construct on first use' idiom). Reviewed by Carlos Garcia Campos. * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::messageHandlers): (WebKit::RemoteInspectorClient::RemoteInspectorClient): * UIProcess/glib/RemoteInspectorClient.h: 2019-12-13 Per Arne Vollan [iOS] The AGX compiler service is incorrectly listed as a global name in sandbox https://bugs.webkit.org/show_bug.cgi?id=205189 Reviewed by Brent Fulgham. It should be a XPC service name. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-12 Simon Fraser Minor WKWebView.mm code rearrangement https://bugs.webkit.org/show_bug.cgi?id=205129 Reviewed by Tim Horton. Throw in some more #pragma marks and move some functions around, with the goal of having the implementation order mostly follow header order, and grouping related functions. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pageForTesting]): (-[WKWebView _page]): (-[WKWebView urlSchemeHandlerForURLScheme:]): (+[WKWebView handlesURLScheme:]): (-[WKWebView _resolutionForShareSheetImmediateCompletionForTesting]): (-[WKWebView createPDFWithConfiguration:completionHandler:]): (-[WKWebView createWebArchiveDataWithCompletionHandler:]): (toFindOptions): (-[WKWebView findString:withConfiguration:completionHandler:]): (-[WKWebView setMediaType:]): (-[WKWebView mediaType]): (-[WKWebView layoutSubviews]): (-[WKWebView scrollView]): (-[WKWebView _isShowingVideoPictureInPicture]): (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]): (-[WKWebView _incrementFocusPreservationCount]): (-[WKWebView _decrementFocusPreservationCount]): (-[WKWebView _resetFocusPreservationCount]): (-[WKWebView _isRetainingActiveFocusedState]): (-[WKWebView _effectiveAppearanceIsDark]): (-[WKWebView _effectiveUserInterfaceLevelIsElevated]): (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]): (-[WKWebView _dragInteractionPolicy]): (-[WKWebView _setDragInteractionPolicy:]): (-[WKWebView _populateArchivedSubviews:]): (-[WKWebView _isBackground]): (-[WKWebView _setShouldSuppressFirstResponderChanges:]): (-[WKWebView _retainActiveFocusedState]): (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): (-[WKWebView _dataDetectionResults]): (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): (-[WKWebView _viewportSizeForCSSViewportUnits]): (-[WKWebView _setViewportSizeForCSSViewportUnits:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm: Unified sources build fix (seen while doing other stuff). 2019-12-12 Simon Fraser Move WKWebView code related to testing to new files, with new private "for testing" headers. https://bugs.webkit.org/show_bug.cgi?id=205021 Reviewed by Tim Horton. Move testing-only SPI to new private headers to discourage first parties from using them by mistake. Move test-only code to new files to reduce the size of WKWebView.mm. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]): (-[WKWebView _prepareForImmediateActionAnimation]): (-[WKWebView _cancelImmediateActionAnimation]): (-[WKWebView _completeImmediateActionAnimation]): (-[WKWebView _useSystemAppearance]): (-[WKWebView _setUseSystemAppearance:]): (-[WKWebView _pageRefForTransitionToWKWebView]): (-[WKWebView _canChangeFrameLayout:]): (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): (-[WKWebView _ignoresNonWheelEvents]): (-[WKWebView _setIgnoresNonWheelEvents:]): (-[WKWebView _hasActiveVideoForControlsManager]): (-[WKWebView _dismissContentRelativeChildWindows]): (-[WKWebView _gestureEventWasNotHandledByWebCore:]): (-[WKWebView _disableFrameSizeUpdates]): (-[WKWebView _enableFrameSizeUpdates]): (-[WKWebView _beginDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChangesSync]): (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView _fullScreenWindow]): (-[WKWebView _underlayColor]): (-[WKWebView _setUnderlayColor:]): (-[WKWebView _setCustomSwipeViews:]): (-[WKWebView _setCustomSwipeViewsTopContentInset:]): (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): (-[WKWebView _setFrame:andScrollBy:]): (-[WKWebView _setTotalHeightOfBanners:]): (-[WKWebView _totalHeightOfBanners]): (-[WKWebView _setFont:sender:]): (-[WKWebView _setFontSize:sender:]): (-[WKWebView _setTextColor:sender:]): (-[WKWebView inputAccessoryView]): (-[WKWebView inputView]): (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): (-[WKWebView _contentVisibleRect]): (-[WKWebView _convertPointFromContentsToView:]): (-[WKWebView _convertPointFromViewToContents:]): (-[WKWebView didStartFormControlInteraction]): (-[WKWebView didEndFormControlInteraction]): (-[WKWebView _uiTextCaretRect]): (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): (-[WKWebView _accessibilityStoreSelection]): (-[WKWebView _accessibilityClearSelection]): (-[WKWebView _contentViewIsFirstResponder]): (-[WKWebView _inspector]): (-[WKWebView _mainFrame]): (-[WKWebView _isEditable]): (-[WKWebView _setEditable:]): (-[WKWebView _executeEditCommand:argument:completion:]): (-[WKWebView _textManipulationDelegate]): (-[WKWebView _setTextManipulationDelegate:]): (-[WKWebView _startTextManipulationsWithConfiguration:completion:]): (-[WKWebView _completeTextManipulation:completion:]): (-[WKWebView _takeFindStringFromSelection:]): (+[WKWebView _stringForFind]): (+[WKWebView _setStringForFind:]): (-[WKWebView _remoteObjectRegistry]): (-[WKWebView _handle]): (-[WKWebView _observedRenderingProgressEvents]): (-[WKWebView _historyDelegate]): (-[WKWebView _setHistoryDelegate:]): (-[WKWebView _updateMediaPlaybackControlsManager]): (-[WKWebView _canTogglePictureInPicture]): (-[WKWebView _isPictureInPictureActive]): (-[WKWebView _togglePictureInPicture]): (-[WKWebView _closeAllMediaPresentations]): (-[WKWebView _stopMediaCapture]): (-[WKWebView _stopAllMediaPlayback]): (-[WKWebView _suspendAllMediaPlayback]): (-[WKWebView _resumeAllMediaPlayback]): (-[WKWebView _unreachableURL]): (-[WKWebView _mainFrameURL]): (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]): (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]): (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): (-[WKWebView _certificateChain]): (-[WKWebView _committedURL]): (-[WKWebView _MIMEType]): (-[WKWebView _userAgent]): (-[WKWebView _applicationNameForUserAgent]): (-[WKWebView _setApplicationNameForUserAgent:]): (-[WKWebView _customUserAgent]): (-[WKWebView _setCustomUserAgent:]): (-[WKWebView _setUserContentExtensionsEnabled:]): (-[WKWebView _userContentExtensionsEnabled]): (-[WKWebView _webProcessIdentifier]): (-[WKWebView _provisionalWebProcessIdentifier]): (-[WKWebView _killWebContentProcess]): (-[WKWebView _safeBrowsingWarning]): (-[WKWebView _reloadWithoutContentBlockers]): (-[WKWebView _reloadExpiredOnly]): (-[WKWebView _killWebContentProcessAndResetState]): (-[WKWebView _convertRectFromRootViewCoordinates:]): (-[WKWebView _convertRectToRootViewCoordinates:]): (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): (-[WKWebView _focusTextInputContext:completionHandler:]): (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]): (-[WKWebView _setShouldSuppressFirstResponderChanges:]): (-[WKWebView _retainActiveFocusedState]): (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): (-[WKWebView _dataDetectionResults]): (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): (-[WKWebView inputAssistantItem]): (-[WKWebView _sessionStateData]): (-[WKWebView _sessionState]): (-[WKWebView _sessionStateWithFilter:]): (-[WKWebView _restoreFromSessionStateData:]): (-[WKWebView _restoreSessionState:andNavigate:]): (-[WKWebView _close]): (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]): (-[WKWebView _attachmentForIdentifier:]): (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]): (+[WKWebView _handlesSafeBrowsing]): (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]): (+[WKWebView _confirmMalwareSentinel]): (+[WKWebView _visitUnsafeWebsiteSentinel]): (-[WKWebView _isJITEnabled:]): (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]): (-[WKWebView _updateWebsitePolicies:]): (-[WKWebView _allowsRemoteInspection]): (-[WKWebView _setAllowsRemoteInspection:]): (-[WKWebView _remoteInspectionNameOverride]): (-[WKWebView _setRemoteInspectionNameOverride:]): (-[WKWebView _addsVisitedLinks]): (-[WKWebView _setAddsVisitedLinks:]): (-[WKWebView _networkRequestsInProgress]): (layoutMilestones): (-[WKWebView _setObservedRenderingProgressEvents:]): (-[WKWebView _getMainResourceDataWithCompletionHandler:]): (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): (-[WKWebView _getContentsAsStringWithCompletionHandler:]): (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]): (-[WKWebView _getApplicationManifestWithCompletionHandler:]): (-[WKWebView _paginationMode]): (-[WKWebView _setPaginationMode:]): (-[WKWebView _paginationBehavesLikeColumns]): (-[WKWebView _setPaginationBehavesLikeColumns:]): (-[WKWebView _pageLength]): (-[WKWebView _setPageLength:]): (-[WKWebView _gapBetweenPages]): (-[WKWebView _setGapBetweenPages:]): (-[WKWebView _paginationLineGridEnabled]): (-[WKWebView _setPaginationLineGridEnabled:]): (-[WKWebView _pageCount]): (-[WKWebView _supportsTextZoom]): (-[WKWebView _textZoomFactor]): (-[WKWebView _setTextZoomFactor:]): (-[WKWebView setPageZoom:]): (-[WKWebView pageZoom]): (-[WKWebView _pageZoomFactor]): (-[WKWebView _setPageZoomFactor:]): (-[WKWebView _diagnosticLoggingDelegate]): (-[WKWebView _setDiagnosticLoggingDelegate:]): (-[WKWebView _findDelegate]): (-[WKWebView _setFindDelegate:]): (toFindOptions): (-[WKWebView _countStringMatches:options:maxCount:]): (-[WKWebView _findString:options:maxCount:]): (-[WKWebView _hideFindUI]): (-[WKWebView _saveBackForwardSnapshotForItem:]): (-[WKWebView _inputDelegate]): (-[WKWebView _setInputDelegate:]): (-[WKWebView _isDisplayingStandaloneImageDocument]): (-[WKWebView _isDisplayingStandaloneMediaDocument]): (-[WKWebView _isPlayingAudio]): (-[WKWebView _isShowingNavigationGestureSnapshot]): (-[WKWebView _layoutMode]): (-[WKWebView _setLayoutMode:]): (-[WKWebView _fixedLayoutSize]): (-[WKWebView _setFixedLayoutSize:]): (-[WKWebView _setBackgroundExtendsBeyondPage:]): (-[WKWebView _backgroundExtendsBeyondPage]): (-[WKWebView _viewScale]): (-[WKWebView _setViewScale:]): (-[WKWebView _setMinimumEffectiveDeviceWidth:]): (-[WKWebView _minimumEffectiveDeviceWidth]): (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]): (-[WKWebView _scrollPerformanceDataCollectionEnabled]): (-[WKWebView _scrollPerformanceData]): (-[WKWebView _allowsMediaDocumentInlinePlayback]): (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]): (-[WKWebView _webProcessIsResponsive]): (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): (-[WKWebView _isInFullscreen]): (-[WKWebView _mediaCaptureState]): (-[WKWebView _setMediaCaptureEnabled:]): (-[WKWebView _mediaCaptureEnabled]): (-[WKWebView _setPageMuted:]): (-[WKWebView _removeDataDetectedLinks:]): (-[WKWebView _doAfterNextPresentationUpdate:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]): (-[WKWebView _doAfterNextStablePresentationUpdate:]): (-[WKWebView _detectDataWithTypes:completionHandler:]): (-[WKWebView removeFromSuperview]): (-[WKWebView _minimumLayoutSizeOverride]): (-[WKWebView _setViewLayoutSizeOverride:]): (-[WKWebView _obscuredInsets]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): (-[WKWebView _unobscuredSafeAreaInsets]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _safeAreaShouldAffectObscuredInsets]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _interfaceOrientationOverride]): (-[WKWebView _clearInterfaceOrientationOverride]): (-[WKWebView _maximumUnobscuredSizeOverride]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _setAllowsViewportShrinkToFit:]): (-[WKWebView _allowsViewportShrinkToFit]): (-[WKWebView _beginInteractiveObscuredInsetsChange]): (-[WKWebView _endInteractiveObscuredInsetsChange]): (-[WKWebView _hideContentUntilNextUpdate]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _resizeWhileHidingContentWithUpdates:]): (-[WKWebView _setOverlaidAccessoryViewsInset:]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): (-[WKWebView _clearOverrideLayoutParameters]): (viewportArgumentsFromDictionary): (-[WKWebView _overrideViewportWithArguments:]): (-[WKWebView _viewForFindUI]): (-[WKWebView _isDisplayingPDF]): (-[WKWebView _dataForDisplayedPDF]): (-[WKWebView _suggestedFilenameForDisplayedPDF]): (-[WKWebView _webViewPrintFormatter]): (toUserInterfaceLayoutDirection): (-[WKWebView setSemanticContentAttribute:]): (-[WKWebView _drawsBackground]): (-[WKWebView _setDrawsBackground:]): (-[WKWebView _backgroundColor]): (-[WKWebView _setBackgroundColor:]): (-[WKWebView _setDrawsTransparentBackground:]): (-[WKWebView _inspectorAttachmentView]): (-[WKWebView _setInspectorAttachmentView:]): (-[WKWebView _setOverlayScrollbarStyle:]): (-[WKWebView _overlayScrollbarStyle]): (-[WKWebView _windowOcclusionDetectionEnabled]): (-[WKWebView _setWindowOcclusionDetectionEnabled:]): (-[WKWebView shareSheetDidDismiss:]): (-[WKWebView _setOverrideDeviceScaleFactor:]): (-[WKWebView _overrideDeviceScaleFactor]): (-[WKWebView _setTopContentInset:]): (-[WKWebView _topContentInset]): (-[WKWebView _pageExtendedBackgroundColor]): (-[WKWebView _pinnedState]): (-[WKWebView _rubberBandingEnabled]): (-[WKWebView _setRubberBandingEnabled:]): (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]): (-[WKWebView _setAutomaticallyAdjustsContentInsets:]): (-[WKWebView _automaticallyAdjustsContentInsets]): (-[WKWebView _minimumLayoutWidth]): (-[WKWebView _setMinimumLayoutWidth:]): (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]): (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]): (-[WKWebView _alwaysShowsHorizontalScroller]): (-[WKWebView _setAlwaysShowsHorizontalScroller:]): (-[WKWebView _alwaysShowsVerticalScroller]): (-[WKWebView _setAlwaysShowsVerticalScroller:]): (-[WKWebView _printOperationWithPrintInfo:]): (-[WKWebView _printOperationWithPrintInfo:forFrame:]): (-[WKWebView setUserInterfaceLayoutDirection:]): (-[WKWebView _wantsMediaPlaybackControlsView]): (-[WKWebView _setWantsMediaPlaybackControlsView:]): (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): (-[WKWebView _removeMediaPlaybackControlsView]): (-[WKWebView _prepareForMoveToWindow:completionHandler:]): (-[WKWebView _setThumbnailView:]): (-[WKWebView _thumbnailView]): (-[WKWebView _setIgnoresAllEvents:]): (-[WKWebView _ignoresAllEvents]): (-[WKWebView _spellCheckerDocumentTag]): (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): Deleted. (-[WKWebView _contentsOfUserInterfaceItem:]): Deleted. (-[WKWebView _setDeviceOrientationUserPermissionHandlerForTesting:]): Deleted. (-[WKWebView keyboardAccessoryBarNext]): Deleted. (-[WKWebView keyboardAccessoryBarPrevious]): Deleted. (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): Deleted. (-[WKWebView dismissFormAccessoryView]): Deleted. (-[WKWebView _dismissFilePicker]): Deleted. (-[WKWebView setTimePickerValueToHour:minute:]): Deleted. (-[WKWebView selectFormAccessoryPickerRow:]): Deleted. (-[WKWebView selectFormPopoverTitle]): Deleted. (-[WKWebView textContentTypeForTesting]): Deleted. (-[WKWebView formInputLabel]): Deleted. (-[WKWebView _didShowContextMenu]): Deleted. (-[WKWebView _didDismissContextMenu]): Deleted. (-[WKWebView _inputViewBounds]): Deleted. (-[WKWebView _uiTextSelectionRects]): Deleted. (-[WKWebView _scrollingTreeAsText]): Deleted. (-[WKWebView _stableStateOverride]): Deleted. (-[WKWebView _propertiesOfLayerWithID:]): Deleted. (-[WKWebView _doAfterResettingSingleTapGesture:]): Deleted. (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): Deleted. (-[WKWebView _requestControlledElementID]): Deleted. (-[WKWebView _handleControlledElementIDResponse:]): Deleted. (-[WKWebView _handleAcceptedCandidate:]): Deleted. (-[WKWebView _didHandleAcceptedCandidate]): Deleted. (-[WKWebView _didUpdateCandidateListVisibility:]): Deleted. (-[WKWebView _forceRequestCandidates]): Deleted. (-[WKWebView _shouldRequestCandidates]): Deleted. (-[WKWebView _insertText:replacementRange:]): Deleted. (-[WKWebView _candidateRect]): Deleted. (-[WKWebView viewDidChangeEffectiveAppearance]): Deleted. (-[WKWebView _setHeaderBannerHeight:]): Deleted. (-[WKWebView _setFooterBannerHeight:]): Deleted. (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted. (-[WKWebView _activeMenu]): Deleted. (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Deleted. (-[WKWebView _setPageScale:withOrigin:]): Deleted. (-[WKWebView _pageScale]): Deleted. (-[WKWebView _scrollingUpdatesDisabledForTesting]): Deleted. (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): Deleted. (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): Deleted. (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): Deleted. (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): Deleted. (-[WKWebView _dragCaretRect]): Deleted. (-[WKWebView _simulateLongPressActionAtLocation:]): Deleted. (-[WKWebView _simulateTextEntered:]): Deleted. (-[WKWebView _dynamicUserInterfaceTraitDidChange]): Deleted. (-[WKWebView _beginBackSwipeForTesting]): Deleted. (-[WKWebView _completeBackSwipeForTesting]): Deleted. (-[WKWebView _setDefersLoadingForTesting:]): Deleted. (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): Deleted. (-[WKWebView _hasInspectorFrontend]): Deleted. (-[WKWebView _processWillSuspendImminentlyForTesting]): Deleted. (-[WKWebView _processDidResumeForTesting]): Deleted. (-[WKWebView _setAssertionStateForTesting:]): Deleted. (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): Deleted. (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): Deleted. (-[WKWebView _denyNextUserMediaRequest]): Deleted. (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: Added. * UIProcess/API/Cocoa/WKWebViewTesting.mm: Added. (-[WKWebView _setPageScale:withOrigin:]): (-[WKWebView _pageScale]): (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): (-[WKWebView _contentsOfUserInterfaceItem:]): (-[WKWebView _requestActiveNowPlayingSessionInfo:]): (-[WKWebView _scrollingUpdatesDisabledForTesting]): (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): (-[WKWebView _beginBackSwipeForTesting]): (-[WKWebView _completeBackSwipeForTesting]): (-[WKWebView _setDefersLoadingForTesting:]): (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): (-[WKWebView _hasInspectorFrontend]): (-[WKWebView _processWillSuspendImminentlyForTesting]): (-[WKWebView _processDidResumeForTesting]): (-[WKWebView _setAssertionStateForTesting:]): (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): (-[WKWebView _denyNextUserMediaRequest]): * UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h: Added. * UIProcess/API/ios/WKWebViewTestingIOS.mm: Added. (-[WKWebView keyboardAccessoryBarNext]): (-[WKWebView keyboardAccessoryBarPrevious]): (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): (-[WKWebView dismissFormAccessoryView]): (-[WKWebView _dismissFilePicker]): (-[WKWebView setTimePickerValueToHour:minute:]): (-[WKWebView selectFormAccessoryPickerRow:]): (-[WKWebView selectFormPopoverTitle]): (-[WKWebView textContentTypeForTesting]): (-[WKWebView formInputLabel]): (-[WKWebView _didShowContextMenu]): (-[WKWebView _didDismissContextMenu]): (-[WKWebView _inputViewBounds]): (-[WKWebView _uiTextSelectionRects]): (-[WKWebView _scrollingTreeAsText]): (-[WKWebView _stableStateOverride]): (-[WKWebView _propertiesOfLayerWithID:]): (-[WKWebView _doAfterResettingSingleTapGesture:]): (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): (-[WKWebView _dragCaretRect]): (-[WKWebView _simulateLongPressActionAtLocation:]): (-[WKWebView _simulateTextEntered:]): (-[WKWebView _dynamicUserInterfaceTraitDidChange]): (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): (-[WKWebView _setDeviceOrientationUserPermissionHandlerForTesting:]): * UIProcess/API/mac/WKWebViewPrivateForTestingMac.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/InteractionDeadlockAfterCrash.mm. * UIProcess/API/mac/WKWebViewTestingMac.mm: Added. (-[WKWebView _requestControlledElementID]): (-[WKWebView _handleControlledElementIDResponse:]): (-[WKWebView _handleAcceptedCandidate:]): (-[WKWebView _didHandleAcceptedCandidate]): (-[WKWebView _didUpdateCandidateListVisibility:]): (-[WKWebView _forceRequestCandidates]): (-[WKWebView _shouldRequestCandidates]): (-[WKWebView _insertText:replacementRange:]): (-[WKWebView _candidateRect]): (-[WKWebView viewDidChangeEffectiveAppearance]): (-[WKWebView _setHeaderBannerHeight:]): (-[WKWebView _setFooterBannerHeight:]): (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): (-[WKWebView _activeMenu]): * UIProcess/Cocoa/PageClientImplCocoa.mm: * UIProcess/ios/PageClientImplIOS.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/WKMouseGestureRecognizer.h: * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: * UIProcess/mac/PageClientImplMac.mm: * UIProcess/mac/WKFullScreenWindowController.h: * WebKit.xcodeproj/project.pbxproj: 2019-12-12 Per Arne Vollan [iOS] Add sandbox telemetry to mach lookup rules in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=205175 Reviewed by Brent Fulgham. We have already added telemetry to many mach lookup rules, but some were missing telemetry. No new tests, no behavior change. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-12 Sihui Liu IndexedDB: make WebIDBServer a MessageReceiver to replace WebIDBConnection https://bugs.webkit.org/show_bug.cgi?id=205145 Reviewed by Alex Christensen. Work towards . Move message handling from WebIDBConnectionToClient to WebIDBServer. Also, WebIDBConnectionClient now is owned by WebIDBServer instead of NetworkConnectionToWebProcess. No behavior change. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient): (WebKit::WebIDBConnectionToClient::messageSenderConnection const): (WebKit::WebIDBConnectionToClient::idbServer): Deleted. (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): Deleted. (WebKit::WebIDBConnectionToClient::deleteDatabase): Deleted. (WebKit::WebIDBConnectionToClient::openDatabase): Deleted. (WebKit::WebIDBConnectionToClient::abortTransaction): Deleted. (WebKit::WebIDBConnectionToClient::commitTransaction): Deleted. (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction): Deleted. (WebKit::WebIDBConnectionToClient::createObjectStore): Deleted. (WebKit::WebIDBConnectionToClient::deleteObjectStore): Deleted. (WebKit::WebIDBConnectionToClient::renameObjectStore): Deleted. (WebKit::WebIDBConnectionToClient::clearObjectStore): Deleted. (WebKit::WebIDBConnectionToClient::createIndex): Deleted. (WebKit::WebIDBConnectionToClient::deleteIndex): Deleted. (WebKit::WebIDBConnectionToClient::renameIndex): Deleted. (WebKit::WebIDBConnectionToClient::putOrAdd): Deleted. (WebKit::WebIDBConnectionToClient::getRecord): Deleted. (WebKit::WebIDBConnectionToClient::getAllRecords): Deleted. (WebKit::WebIDBConnectionToClient::getCount): Deleted. (WebKit::WebIDBConnectionToClient::deleteRecord): Deleted. (WebKit::WebIDBConnectionToClient::openCursor): Deleted. (WebKit::WebIDBConnectionToClient::iterateCursor): Deleted. (WebKit::WebIDBConnectionToClient::establishTransaction): Deleted. (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose): Deleted. (WebKit::WebIDBConnectionToClient::databaseConnectionClosed): Deleted. (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded): Deleted. (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent): Deleted. (WebKit::WebIDBConnectionToClient::openDBRequestCancelled): Deleted. (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer): Deleted. (WebKit::WebIDBConnectionToClient::getAllDatabaseNames): Deleted. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::getAllDatabaseNames): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): * NetworkProcess/IndexedDB/WebIDBServer.h: * NetworkProcess/IndexedDB/WebIDBServer.messages.in: Renamed from Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::didClose): (WebKit::NetworkConnectionToWebProcess::findNetworkActivityTracker): (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer): Deleted. NetworkConnectionToWebProcess::establishIDBConnectionToServer was used to ensure WebIDBConnectionToCilent member exists in NetworkConnectionToWebProcess. Now WebIDBConnectionToCilent is created in WebIDBServer::addConnection(when NetworkConnectionToWebProcess is created), so we don't need the message to do initialization. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): (WebKit::NetworkProcess::connectionToWebProcessClosed): * NetworkProcess/NetworkProcess.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): (WebKit::WebIDBConnectionToServer::deleteDatabase): (WebKit::WebIDBConnectionToServer::openDatabase): (WebKit::WebIDBConnectionToServer::abortTransaction): (WebKit::WebIDBConnectionToServer::commitTransaction): (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBConnectionToServer::createObjectStore): (WebKit::WebIDBConnectionToServer::deleteObjectStore): (WebKit::WebIDBConnectionToServer::renameObjectStore): (WebKit::WebIDBConnectionToServer::clearObjectStore): (WebKit::WebIDBConnectionToServer::createIndex): (WebKit::WebIDBConnectionToServer::deleteIndex): (WebKit::WebIDBConnectionToServer::renameIndex): (WebKit::WebIDBConnectionToServer::putOrAdd): (WebKit::WebIDBConnectionToServer::getRecord): (WebKit::WebIDBConnectionToServer::getAllRecords): (WebKit::WebIDBConnectionToServer::getCount): (WebKit::WebIDBConnectionToServer::deleteRecord): (WebKit::WebIDBConnectionToServer::openCursor): (WebKit::WebIDBConnectionToServer::iterateCursor): (WebKit::WebIDBConnectionToServer::establishTransaction): (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose): (WebKit::WebIDBConnectionToServer::databaseConnectionClosed): (WebKit::WebIDBConnectionToServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent): (WebKit::WebIDBConnectionToServer::openDBRequestCancelled): (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer): (WebKit::WebIDBConnectionToServer::getAllDatabaseNames): 2019-12-12 Chris Dumez Regression(r253394) swipe/basic-cached-back-swipe.html is timing out on iOS https://bugs.webkit.org/show_bug.cgi?id=205173 Reviewed by Tim Horton. Test test was calling beginSimulatedSwipeInDirectionForTesting / completeSimulatedSwipeInDirectionForTesting on the ViewGestureController. This was causing beginSwipeGesture() and endSwipeGesture() but not willEndSwipeGesture(). This was causing the timeout since willEndSwipeGesture() now actually triggers the load. This patch also gets rid of the SnapshotRemovalTracker::SwipeAnimationEnd. We don't really need it since we already wait for SnapshotRemovalTracker::RepaintAfterNavigation and we won't repaint until the swipe animation is over (due to the layer tree being frozen during the swipe animation). The SwipeAnimationEnd was causing trouble because the provisional load may not have started yet by the time endSwipeGesture() is called, which means that the call to eventOccurred(SwipeAnimationEnd) would get ignored because the SnapshotRemovalTracker is still paused (it gets unpaused when the provisional load actually starts). * UIProcess/ViewGestureController.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::willEndSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): 2019-12-12 Alex Christensen NetworkDataTaskCocoa and NetworkSessionCocoa should use public methods instead of being friends https://bugs.webkit.org/show_bug.cgi?id=204242 Reviewed by Chris Dumez. This makes them stay good abstractions, and probably could make a good meme about not having any friends. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): * NetworkProcess/cocoa/NetworkSessionCocoa.h: 2019-12-12 Per Arne Vollan [iOS] Deny mach lookup access to content filter service in the WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=205077 Reviewed by Brent Fulgham. Mach lookup access to the content filter service in the WebContent process is only needed if [WebFilterEvaluator isManagedSession] evaluates to true. If this is the case, issue the needed mach lookup sandbox extension to the WebContent process, where it will be consumed. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-12 Carlos Garcia Campos WebDriver: tests is_element_enabled/enabled.py::test_fieldset_disabled_descendant are failing https://bugs.webkit.org/show_bug.cgi?id=204700 Reviewed by Carlos Alberto Lopez Perez. Add ElementEnabled atom to easily implement is element enabled command. * UIProcess/Automation/atoms/ElementEnabled.js: Added. (isEnabled.isDisabledAttributeSupported): (isEnabled.findParent): (isEnabled): 2019-12-11 Jiewen Tan Unreviewed, a nit after r253366 * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: Change the parameter type of the completion handler from NSData to NSString. 2019-12-11 Daniel Bates Remove unused Frame parameter from moveByGranularityRespectingWordBoundary() and take const VisiblePosition& https://bugs.webkit.org/show_bug.cgi?id=205137 Reviewed by Wenson Hsieh. moveByGranularityRespectingWordBoundary() never makes use of the passed Frame and does not mutate the passed VisiblePosition. So, do not accept the former and take the latter as a const lvalue reference. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::moveByGranularityRespectingWordBoundary): (WebKit::WebPage::requestDocumentEditingContext): 2019-12-11 Daniel Bates UIWKDocumentContext returns 0 character rects when caret is at beginning or end of text https://bugs.webkit.org/show_bug.cgi?id=205135 Reviewed by Wenson Hsieh. When the specified position to move from is at the beginning or end of the text then return the position of the beginning or end of the nearest word based on the specified direction. Currently we always return the null position. As a result we do not compute a valid character range to convert to rectangles. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::moveByGranularityRespectingWordBoundary): 2019-12-11 Jiewen Tan [WebAuthn] Combine AuthenticatorResponse and PublicKeyCredentialData https://bugs.webkit.org/show_bug.cgi?id=190783 Reviewed by Brent Fulgham. Code in WebKit are changed to use AuthenticatorResponse and its subtypes. * UIProcess/WebAuthentication/Authenticator.h: * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::respondReceived): (WebKit::AuthenticatorManager::invokePendingCompletionHandler): * UIProcess/WebAuthentication/AuthenticatorManager.h: * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested): (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const): (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived): * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived): (WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived): * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: 2019-12-11 Truitt Savell Unreviewed, rolling out r253376. Broke internal builds Reverted changeset: "Move WKWebView code related to testing to new files, with their own headers, and stop exposing test-only functions as SPI." https://bugs.webkit.org/show_bug.cgi?id=205021 https://trac.webkit.org/changeset/253376 2019-12-11 Chris Dumez There should be no user-noticeable delay when closing a tab https://bugs.webkit.org/show_bug.cgi?id=205069 Reviewed by Ryosuke Niwa. There should be no user-noticeable delay when closing a tab. To achieve this, use a timeout of 50ms for doing the IPC handshake with the WebContent process, instead of 500ms. * UIProcess/WebPageProxy.cpp: 2019-12-11 Chris Dumez [iOS] Issue load sooner on swipe back/forward navigation https://bugs.webkit.org/show_bug.cgi?id=205127 Reviewed by Tim Horton. Issue load sooner on swipe back/forward navigation on iOS. We were waiting until the end of the swipe animation to issue the load. We now issue the load as soon as the user lifts the finger off the screen and thus commits to navigating. This results in improved perceived performance when swiping back/forward to navigate. * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame): (WebKit::ViewGestureController::willEndSwipeGesture): * UIProcess/ViewGestureController.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::willEndSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): 2019-12-11 Sihui Liu IndexedDB: Introduce WebIDBServer class https://bugs.webkit.org/show_bug.cgi?id=205095 Reviewed by Alex Christensen. Work towards . WebIDBServer currently is just a wrapper of WebCore::IDBServer. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::idbServer): * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: * NetworkProcess/IndexedDB/WebIDBServer.cpp: Added. (WebKit::WebIDBServer::create): (WebKit::WebIDBServer::WebIDBServer): (WebKit::WebIDBServer::registerConnection): (WebKit::WebIDBServer::unregisterConnection): (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::suspend): (WebKit::WebIDBServer::resume): (WebKit::WebIDBServer::openDatabase): (WebKit::WebIDBServer::deleteDatabase): (WebKit::WebIDBServer::abortTransaction): (WebKit::WebIDBServer::commitTransaction): (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBServer::createObjectStore): (WebKit::WebIDBServer::deleteObjectStore): (WebKit::WebIDBServer::renameObjectStore): (WebKit::WebIDBServer::clearObjectStore): (WebKit::WebIDBServer::createIndex): (WebKit::WebIDBServer::deleteIndex): (WebKit::WebIDBServer::renameIndex): (WebKit::WebIDBServer::putOrAdd): (WebKit::WebIDBServer::getRecord): (WebKit::WebIDBServer::getAllRecords): (WebKit::WebIDBServer::getCount): (WebKit::WebIDBServer::deleteRecord): (WebKit::WebIDBServer::openCursor): (WebKit::WebIDBServer::iterateCursor): (WebKit::WebIDBServer::establishTransaction): (WebKit::WebIDBServer::databaseConnectionPendingClose): (WebKit::WebIDBServer::databaseConnectionClosed): (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBServer::didFireVersionChangeEvent): (WebKit::WebIDBServer::openDBRequestCancelled): (WebKit::WebIDBServer::getAllDatabaseNames): (WebKit::WebIDBServer::confirmDidCloseFromServer): * NetworkProcess/IndexedDB/WebIDBServer.h: Added. * NetworkProcess/NetworkProcess.cpp: replace WebCore::IDBServer with WebIDBServer. (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::resume): (WebKit::NetworkProcess::createWebIDBServer): (WebKit::NetworkProcess::webIDBServer): (WebKit::NetworkProcess::createIDBServer): Deleted. (WebKit::NetworkProcess::idbServer): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::requestSpace): * Sources.txt: * WebKit.xcodeproj/project.pbxproj: 2019-12-11 Don Olmstead [CMake] Add HarfBuzz targets https://bugs.webkit.org/show_bug.cgi?id=205042 Reviewed by Konstantin Tokarev. Use the HarfBuzz targets directly instead of HARFBUZZ_LIBRARIES and HARFBUZZ_INCLUDE_DIRS. * PlatformGTK.cmake: * PlatformWPE.cmake: 2019-12-11 Jiewen Tan Unreviewed, a nit after r253366 * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: Improve the naming of the new SPI a bit. 2019-12-11 Wenson Hsieh Make incremental builds faster after modifying DisplayListItems.h https://bugs.webkit.org/show_bug.cgi?id=205032 Reviewed by Tim Horton. Include DisplayListItems.h directly, since these need to know about the actual display list items (and how to encode or decode them). * GPUProcess/GPUConnectionToWebProcess.h: 2019-12-10 Simon Fraser Move WKWebView code related to testing to new files, with their own headers, and stop exposing test-only functions as SPI. https://bugs.webkit.org/show_bug.cgi?id=205021 Reviewed by Tim Horton. Stop exposing WKWebView (WKTesting) as SPI, because everyone added SPI here by mistake, and internal clients kept using testing SPI. Instead, move testing-only functions to internal headers that are not present in the built framework, and move to WKWebView (WKPrivate) properties and functions that webkit clients rely on. Add WKWebViewTesting/WKWebViewTestingMac/WKWebViewTestingIOS for test-only code. WKWebViewTesting* headers are copied to a "WebKitTestSupport" directory in the Products directory, and WTR/DRT and TestWebKitAPI get header search paths to find the headers there. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]): (-[WKWebView _prepareForImmediateActionAnimation]): (-[WKWebView _cancelImmediateActionAnimation]): (-[WKWebView _completeImmediateActionAnimation]): (-[WKWebView _useSystemAppearance]): (-[WKWebView _setUseSystemAppearance:]): (-[WKWebView _pageRefForTransitionToWKWebView]): (-[WKWebView _canChangeFrameLayout:]): (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): (-[WKWebView _ignoresNonWheelEvents]): (-[WKWebView _setIgnoresNonWheelEvents:]): (-[WKWebView _hasActiveVideoForControlsManager]): (-[WKWebView _dismissContentRelativeChildWindows]): (-[WKWebView _gestureEventWasNotHandledByWebCore:]): (-[WKWebView _disableFrameSizeUpdates]): (-[WKWebView _enableFrameSizeUpdates]): (-[WKWebView _beginDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChangesSync]): (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView _fullScreenWindow]): (-[WKWebView _underlayColor]): (-[WKWebView _setUnderlayColor:]): (-[WKWebView _setCustomSwipeViews:]): (-[WKWebView _setCustomSwipeViewsTopContentInset:]): (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): (-[WKWebView _setFrame:andScrollBy:]): (-[WKWebView _setTotalHeightOfBanners:]): (-[WKWebView _totalHeightOfBanners]): (-[WKWebView _setFont:sender:]): (-[WKWebView _setFontSize:sender:]): (-[WKWebView _setTextColor:sender:]): (-[WKWebView inputAccessoryView]): (-[WKWebView inputView]): (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): (-[WKWebView _contentVisibleRect]): (-[WKWebView _convertPointFromContentsToView:]): (-[WKWebView _convertPointFromViewToContents:]): (-[WKWebView didStartFormControlInteraction]): (-[WKWebView didEndFormControlInteraction]): (-[WKWebView _uiTextCaretRect]): (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): (-[WKWebView _accessibilityStoreSelection]): (-[WKWebView _accessibilityClearSelection]): (-[WKWebView _contentViewIsFirstResponder]): (-[WKWebView _inspector]): (-[WKWebView _mainFrame]): (-[WKWebView _isEditable]): (-[WKWebView _setEditable:]): (-[WKWebView _executeEditCommand:argument:completion:]): (-[WKWebView _textManipulationDelegate]): (-[WKWebView _setTextManipulationDelegate:]): (-[WKWebView _startTextManipulationsWithConfiguration:completion:]): (-[WKWebView _completeTextManipulation:completion:]): (-[WKWebView _takeFindStringFromSelection:]): (+[WKWebView _stringForFind]): (+[WKWebView _setStringForFind:]): (-[WKWebView _remoteObjectRegistry]): (-[WKWebView _handle]): (-[WKWebView _observedRenderingProgressEvents]): (-[WKWebView _historyDelegate]): (-[WKWebView _setHistoryDelegate:]): (-[WKWebView _updateMediaPlaybackControlsManager]): (-[WKWebView _canTogglePictureInPicture]): (-[WKWebView _isPictureInPictureActive]): (-[WKWebView _togglePictureInPicture]): (-[WKWebView _closeAllMediaPresentations]): (-[WKWebView _stopMediaCapture]): (-[WKWebView _stopAllMediaPlayback]): (-[WKWebView _suspendAllMediaPlayback]): (-[WKWebView _resumeAllMediaPlayback]): (-[WKWebView _unreachableURL]): (-[WKWebView _mainFrameURL]): (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]): (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]): (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): (-[WKWebView _certificateChain]): (-[WKWebView _committedURL]): (-[WKWebView _MIMEType]): (-[WKWebView _userAgent]): (-[WKWebView _applicationNameForUserAgent]): (-[WKWebView _setApplicationNameForUserAgent:]): (-[WKWebView _customUserAgent]): (-[WKWebView _setCustomUserAgent:]): (-[WKWebView _setUserContentExtensionsEnabled:]): (-[WKWebView _userContentExtensionsEnabled]): (-[WKWebView _webProcessIdentifier]): (-[WKWebView _provisionalWebProcessIdentifier]): (-[WKWebView _killWebContentProcess]): (-[WKWebView _safeBrowsingWarning]): (-[WKWebView _reloadWithoutContentBlockers]): (-[WKWebView _reloadExpiredOnly]): (-[WKWebView _killWebContentProcessAndResetState]): (-[WKWebView _convertRectFromRootViewCoordinates:]): (-[WKWebView _convertRectToRootViewCoordinates:]): (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): (-[WKWebView _focusTextInputContext:completionHandler:]): (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]): (-[WKWebView _setShouldSuppressFirstResponderChanges:]): (-[WKWebView _retainActiveFocusedState]): (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): (-[WKWebView _dataDetectionResults]): (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): (-[WKWebView inputAssistantItem]): (-[WKWebView _sessionStateData]): (-[WKWebView _sessionState]): (-[WKWebView _sessionStateWithFilter:]): (-[WKWebView _restoreFromSessionStateData:]): (-[WKWebView _restoreSessionState:andNavigate:]): (-[WKWebView _close]): (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]): (-[WKWebView _attachmentForIdentifier:]): (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]): (+[WKWebView _handlesSafeBrowsing]): (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]): (+[WKWebView _confirmMalwareSentinel]): (+[WKWebView _visitUnsafeWebsiteSentinel]): (-[WKWebView _isJITEnabled:]): (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]): (-[WKWebView _updateWebsitePolicies:]): (-[WKWebView _allowsRemoteInspection]): (-[WKWebView _setAllowsRemoteInspection:]): (-[WKWebView _remoteInspectionNameOverride]): (-[WKWebView _setRemoteInspectionNameOverride:]): (-[WKWebView _addsVisitedLinks]): (-[WKWebView _setAddsVisitedLinks:]): (-[WKWebView _networkRequestsInProgress]): (layoutMilestones): (-[WKWebView _setObservedRenderingProgressEvents:]): (-[WKWebView _getMainResourceDataWithCompletionHandler:]): (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): (-[WKWebView _getContentsAsStringWithCompletionHandler:]): (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]): (-[WKWebView _getApplicationManifestWithCompletionHandler:]): (-[WKWebView _paginationMode]): (-[WKWebView _setPaginationMode:]): (-[WKWebView _paginationBehavesLikeColumns]): (-[WKWebView _setPaginationBehavesLikeColumns:]): (-[WKWebView _pageLength]): (-[WKWebView _setPageLength:]): (-[WKWebView _gapBetweenPages]): (-[WKWebView _setGapBetweenPages:]): (-[WKWebView _paginationLineGridEnabled]): (-[WKWebView _setPaginationLineGridEnabled:]): (-[WKWebView _pageCount]): (-[WKWebView _supportsTextZoom]): (-[WKWebView _textZoomFactor]): (-[WKWebView _setTextZoomFactor:]): (-[WKWebView setPageZoom:]): (-[WKWebView pageZoom]): (-[WKWebView _pageZoomFactor]): (-[WKWebView _setPageZoomFactor:]): (-[WKWebView _diagnosticLoggingDelegate]): (-[WKWebView _setDiagnosticLoggingDelegate:]): (-[WKWebView _findDelegate]): (-[WKWebView _setFindDelegate:]): (toFindOptions): (-[WKWebView _countStringMatches:options:maxCount:]): (-[WKWebView _findString:options:maxCount:]): (-[WKWebView _hideFindUI]): (-[WKWebView _saveBackForwardSnapshotForItem:]): (-[WKWebView _inputDelegate]): (-[WKWebView _setInputDelegate:]): (-[WKWebView _isDisplayingStandaloneImageDocument]): (-[WKWebView _isDisplayingStandaloneMediaDocument]): (-[WKWebView _isPlayingAudio]): (-[WKWebView _isShowingNavigationGestureSnapshot]): (-[WKWebView _layoutMode]): (-[WKWebView _setLayoutMode:]): (-[WKWebView _fixedLayoutSize]): (-[WKWebView _setFixedLayoutSize:]): (-[WKWebView _setBackgroundExtendsBeyondPage:]): (-[WKWebView _backgroundExtendsBeyondPage]): (-[WKWebView _viewScale]): (-[WKWebView _setViewScale:]): (-[WKWebView _setMinimumEffectiveDeviceWidth:]): (-[WKWebView _minimumEffectiveDeviceWidth]): (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]): (-[WKWebView _scrollPerformanceDataCollectionEnabled]): (-[WKWebView _scrollPerformanceData]): (-[WKWebView _allowsMediaDocumentInlinePlayback]): (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]): (-[WKWebView _webProcessIsResponsive]): (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): (-[WKWebView _isInFullscreen]): (-[WKWebView _mediaCaptureState]): (-[WKWebView _setMediaCaptureEnabled:]): (-[WKWebView _mediaCaptureEnabled]): (-[WKWebView _setPageMuted:]): (-[WKWebView _removeDataDetectedLinks:]): (-[WKWebView _doAfterNextPresentationUpdate:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]): (-[WKWebView _doAfterNextStablePresentationUpdate:]): (-[WKWebView _detectDataWithTypes:completionHandler:]): (-[WKWebView removeFromSuperview]): (-[WKWebView _minimumLayoutSizeOverride]): (-[WKWebView _setViewLayoutSizeOverride:]): (-[WKWebView _obscuredInsets]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): (-[WKWebView _unobscuredSafeAreaInsets]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _safeAreaShouldAffectObscuredInsets]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _interfaceOrientationOverride]): (-[WKWebView _clearInterfaceOrientationOverride]): (-[WKWebView _maximumUnobscuredSizeOverride]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _setAllowsViewportShrinkToFit:]): (-[WKWebView _allowsViewportShrinkToFit]): (-[WKWebView _beginInteractiveObscuredInsetsChange]): (-[WKWebView _endInteractiveObscuredInsetsChange]): (-[WKWebView _hideContentUntilNextUpdate]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _resizeWhileHidingContentWithUpdates:]): (-[WKWebView _setOverlaidAccessoryViewsInset:]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): (-[WKWebView _clearOverrideLayoutParameters]): (viewportArgumentsFromDictionary): (-[WKWebView _overrideViewportWithArguments:]): (-[WKWebView _viewForFindUI]): (-[WKWebView _isDisplayingPDF]): (-[WKWebView _dataForDisplayedPDF]): (-[WKWebView _suggestedFilenameForDisplayedPDF]): (-[WKWebView _webViewPrintFormatter]): (toUserInterfaceLayoutDirection): (-[WKWebView setSemanticContentAttribute:]): (-[WKWebView _drawsBackground]): (-[WKWebView _setDrawsBackground:]): (-[WKWebView _backgroundColor]): (-[WKWebView _setBackgroundColor:]): (-[WKWebView _setDrawsTransparentBackground:]): (-[WKWebView _inspectorAttachmentView]): (-[WKWebView _setInspectorAttachmentView:]): (-[WKWebView _setOverlayScrollbarStyle:]): (-[WKWebView _overlayScrollbarStyle]): (-[WKWebView _windowOcclusionDetectionEnabled]): (-[WKWebView _setWindowOcclusionDetectionEnabled:]): (-[WKWebView shareSheetDidDismiss:]): (-[WKWebView _setOverrideDeviceScaleFactor:]): (-[WKWebView _overrideDeviceScaleFactor]): (-[WKWebView _setTopContentInset:]): (-[WKWebView _topContentInset]): (-[WKWebView _pageExtendedBackgroundColor]): (-[WKWebView _pinnedState]): (-[WKWebView _rubberBandingEnabled]): (-[WKWebView _setRubberBandingEnabled:]): (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]): (-[WKWebView _setAutomaticallyAdjustsContentInsets:]): (-[WKWebView _automaticallyAdjustsContentInsets]): (-[WKWebView _minimumLayoutWidth]): (-[WKWebView _setMinimumLayoutWidth:]): (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]): (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]): (-[WKWebView _alwaysShowsHorizontalScroller]): (-[WKWebView _setAlwaysShowsHorizontalScroller:]): (-[WKWebView _alwaysShowsVerticalScroller]): (-[WKWebView _setAlwaysShowsVerticalScroller:]): (-[WKWebView _printOperationWithPrintInfo:]): (-[WKWebView _printOperationWithPrintInfo:forFrame:]): (-[WKWebView setUserInterfaceLayoutDirection:]): (-[WKWebView _wantsMediaPlaybackControlsView]): (-[WKWebView _setWantsMediaPlaybackControlsView:]): (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): (-[WKWebView _removeMediaPlaybackControlsView]): (-[WKWebView _prepareForMoveToWindow:completionHandler:]): (-[WKWebView _setThumbnailView:]): (-[WKWebView _thumbnailView]): (-[WKWebView _setIgnoresAllEvents:]): (-[WKWebView _ignoresAllEvents]): (-[WKWebView _spellCheckerDocumentTag]): (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): Deleted. (-[WKWebView _contentsOfUserInterfaceItem:]): Deleted. (-[WKWebView keyboardAccessoryBarNext]): Deleted. (-[WKWebView keyboardAccessoryBarPrevious]): Deleted. (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): Deleted. (-[WKWebView dismissFormAccessoryView]): Deleted. (-[WKWebView _dismissFilePicker]): Deleted. (-[WKWebView setTimePickerValueToHour:minute:]): Deleted. (-[WKWebView selectFormAccessoryPickerRow:]): Deleted. (-[WKWebView selectFormPopoverTitle]): Deleted. (-[WKWebView textContentTypeForTesting]): Deleted. (-[WKWebView formInputLabel]): Deleted. (-[WKWebView _didShowContextMenu]): Deleted. (-[WKWebView _didDismissContextMenu]): Deleted. (-[WKWebView _inputViewBounds]): Deleted. (-[WKWebView _uiTextSelectionRects]): Deleted. (-[WKWebView _scrollingTreeAsText]): Deleted. (-[WKWebView _stableStateOverride]): Deleted. (-[WKWebView _propertiesOfLayerWithID:]): Deleted. (-[WKWebView _doAfterResettingSingleTapGesture:]): Deleted. (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): Deleted. (-[WKWebView _requestControlledElementID]): Deleted. (-[WKWebView _handleControlledElementIDResponse:]): Deleted. (-[WKWebView _handleAcceptedCandidate:]): Deleted. (-[WKWebView _didHandleAcceptedCandidate]): Deleted. (-[WKWebView _didUpdateCandidateListVisibility:]): Deleted. (-[WKWebView _forceRequestCandidates]): Deleted. (-[WKWebView _shouldRequestCandidates]): Deleted. (-[WKWebView _insertText:replacementRange:]): Deleted. (-[WKWebView _candidateRect]): Deleted. (-[WKWebView viewDidChangeEffectiveAppearance]): Deleted. (-[WKWebView _setHeaderBannerHeight:]): Deleted. (-[WKWebView _setFooterBannerHeight:]): Deleted. (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted. (-[WKWebView _activeMenu]): Deleted. (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Deleted. (-[WKWebView _setPageScale:withOrigin:]): Deleted. (-[WKWebView _pageScale]): Deleted. (-[WKWebView _scrollingUpdatesDisabledForTesting]): Deleted. (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): Deleted. (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): Deleted. (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): Deleted. (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): Deleted. (-[WKWebView _dragCaretRect]): Deleted. (-[WKWebView _simulateLongPressActionAtLocation:]): Deleted. (-[WKWebView _simulateTextEntered:]): Deleted. (-[WKWebView _dynamicUserInterfaceTraitDidChange]): Deleted. (-[WKWebView _beginBackSwipeForTesting]): Deleted. (-[WKWebView _completeBackSwipeForTesting]): Deleted. (-[WKWebView _setDefersLoadingForTesting:]): Deleted. (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): Deleted. (-[WKWebView _hasInspectorFrontend]): Deleted. (-[WKWebView _processWillSuspendImminentlyForTesting]): Deleted. (-[WKWebView _processDidResumeForTesting]): Deleted. (-[WKWebView _setAssertionStateForTesting:]): Deleted. (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): Deleted. (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): Deleted. (-[WKWebView _denyNextUserMediaRequest]): Deleted. (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewTesting.h: Added. * UIProcess/API/Cocoa/WKWebViewTesting.mm: Added. (-[WKWebView _setPageScale:withOrigin:]): (-[WKWebView _pageScale]): (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): (-[WKWebView _contentsOfUserInterfaceItem:]): (-[WKWebView _requestActiveNowPlayingSessionInfo:]): (-[WKWebView _scrollingUpdatesDisabledForTesting]): (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): (-[WKWebView _beginBackSwipeForTesting]): (-[WKWebView _completeBackSwipeForTesting]): (-[WKWebView _setDefersLoadingForTesting:]): (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): (-[WKWebView _hasInspectorFrontend]): (-[WKWebView _processWillSuspendImminentlyForTesting]): (-[WKWebView _processDidResumeForTesting]): (-[WKWebView _setAssertionStateForTesting:]): (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): (-[WKWebView _denyNextUserMediaRequest]): * UIProcess/API/ios/WKWebViewTestingIOS.h: Added. * UIProcess/API/ios/WKWebViewTestingIOS.mm: Added. (-[WKWebView keyboardAccessoryBarNext]): (-[WKWebView keyboardAccessoryBarPrevious]): (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): (-[WKWebView dismissFormAccessoryView]): (-[WKWebView _dismissFilePicker]): (-[WKWebView setTimePickerValueToHour:minute:]): (-[WKWebView selectFormAccessoryPickerRow:]): (-[WKWebView selectFormPopoverTitle]): (-[WKWebView textContentTypeForTesting]): (-[WKWebView formInputLabel]): (-[WKWebView _didShowContextMenu]): (-[WKWebView _didDismissContextMenu]): (-[WKWebView _inputViewBounds]): (-[WKWebView _uiTextSelectionRects]): (-[WKWebView _scrollingTreeAsText]): (-[WKWebView _stableStateOverride]): (-[WKWebView _propertiesOfLayerWithID:]): (-[WKWebView _doAfterResettingSingleTapGesture:]): (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): (-[WKWebView _dragCaretRect]): (-[WKWebView _simulateLongPressActionAtLocation:]): (-[WKWebView _simulateTextEntered:]): (-[WKWebView _dynamicUserInterfaceTraitDidChange]): (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): * UIProcess/API/mac/WKWebViewTestingMac.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/InteractionDeadlockAfterCrash.mm. * UIProcess/API/mac/WKWebViewTestingMac.mm: Added. (-[WKWebView _requestControlledElementID]): (-[WKWebView _handleControlledElementIDResponse:]): (-[WKWebView _handleAcceptedCandidate:]): (-[WKWebView _didHandleAcceptedCandidate]): (-[WKWebView _didUpdateCandidateListVisibility:]): (-[WKWebView _forceRequestCandidates]): (-[WKWebView _shouldRequestCandidates]): (-[WKWebView _insertText:replacementRange:]): (-[WKWebView _candidateRect]): (-[WKWebView viewDidChangeEffectiveAppearance]): (-[WKWebView _setHeaderBannerHeight:]): (-[WKWebView _setFooterBannerHeight:]): (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): (-[WKWebView _activeMenu]): * UIProcess/Cocoa/PageClientImplCocoa.mm: * UIProcess/ios/PageClientImplIOS.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/WKMouseGestureRecognizer.h: * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: * UIProcess/mac/PageClientImplMac.mm: * UIProcess/mac/WKFullScreenWindowController.h: * WebKit.xcodeproj/project.pbxproj: 2019-12-11 Chris Dumez Unreviewed iOS build fix after r253343. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2019-12-11 Jiewen Tan [WebAuthn] Implement dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support https://bugs.webkit.org/show_bug.cgi?id=205100 Reviewed by Brent Fulgham. This patch implements dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support. CTAP PIN is a way for authenticators to be able to do user verification by asking clients/users for a pre-set PIN. Here is the spec: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN In order to support this, WebKit needs to interacts with UIClients to ask users to enter the PINs. Therefore, a new set of SPI is needed. Here is the proposed SPI for WebKit to ask Safari for the PIN: @protocol _WKWebAuthenticationPanelDelegate @optional ... - (void)panel:(_WKWebAuthenticationPanel *)panel requestPINWithRetries:(NSUInteger)retries completionHandler:(void (^)(NSData *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); ... @end Retries is the number of retires before the authenticator getting blocked, which is a state that only factory reset can save the authenticator. UIClients can have a threshold and WARN users loudly when the threshold is reached. A byte array that is less than or equal to 63 bytes is expected to return to the passed completion handler. Otherwise, the completion handler will bail out. For error handling: typedef NS_ENUM(NSInteger, _WKWebAuthenticationPanelUpdate) { ... _WKWebAuthenticationPanelUpdatePINBlocked, _WKWebAuthenticationPanelUpdatePINAuthBlocked, _WKWebAuthenticationPanelUpdatePINInvalid, } WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); The above three error will be passed to UIClients via updateWebAuthenticationPanel SPI. _WKWebAuthenticationPanelUpdatePINBlocked means the authenticator is dead. A factory reset is needed. _WKWebAuthenticationPanelUpdatePINAuthBlocked means 3 consecutive mismatches. The authenticator will need to be reconnected. _WKWebAuthenticationPanelUpdatePINInvalid means a wrong PIN is provided. This will often be followed with another requestPINWithRetries delegate call. Here is the spec for the error: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#using-pinToken-in-authenticatorMakeCredential. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: 2019-12-10 Chris Dumez [macOS] Issue load sooner on swipe back/forward navigation https://bugs.webkit.org/show_bug.cgi?id=205087 Reviewed by Tim Horton. Issue load sooner on swipe back/forward navigation on macOS. We were waiting until the end of the swipe animation to issue the load. We now issue the load as soon as the user lifts the finger off the screen and thus commits to navigating. This results in improved perceived performance when swiping back/forward to navigate. This patch does not take care of iOS because the ViewGestureController logic is different on that platform. There is no reason we shouldn't be able to do the same optimization on iOS too though. To achieve the behavior change on macOS, the following was done: - Issue the load in ViewGestureController::willEndSwipeGesture() instead of ViewGestureController::endSwipeGesture(). - Add a new SnapshotRemovalTracker::Event::SwipeAnimationEnd event and wait for this event before taking away the snapshot. This makes sure we do not take away the swipe snapshot until the swipe animation is actually over (now that we start the navigation during the animation, instead of after). - To make sure that layer being swiped away stays the same until the end of the animation, I added a new SwipeAnimation reason for freezing the layer tree. At the beginning of the animation, the UIProcess sends a FreezeLayerTreeDueToSwipeAnimation IPC to the WebProcess to add this layer tree freeze reason. At the end of the animation, the UIProcess sends the UnfreezeLayerTreeDueToSwipeAnimation IPC to remove this freeze reason. Without this change, the layer being swiped away would sometimes start showing the destination site being loaded before the end of the animation. On cross-process navigation, not freezing the layer tree would cause the swipe animation to get interrupted when we have something to paint in the new process before the end of the swipe animation. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::initializeWebPage): * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription): (WebKit::ViewGestureController::willEndSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): * UIProcess/ViewGestureController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::commitProvisionalPage): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isLayerTreeFrozenDueToSwipeAnimation const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::freezeLayerTreeDueToSwipeAnimation): (WebKit::WebPage::unfreezeLayerTreeDueToSwipeAnimation): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-12-10 Fujii Hironori [Win] Fix MSVC warning C4701: potentially uninitialized local variable 'x' used https://bugs.webkit.org/show_bug.cgi?id=205052 Reviewed by Don Olmstead. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const): * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const): Zero-initialized local variables. 2019-12-10 Per Arne Vollan [iOS] Calls to the device motion API should be done in the UI process https://bugs.webkit.org/show_bug.cgi?id=204770 Reviewed by Brent Fulgham. The class WebDeviceOrientationUpdateProviderProxy will handle messages to start and stop updating device motion in the UI process. Also, add a message to update the device motion in the WebContent process. In the UI process, the device motion API is called through the already existing WebCoreMotionManager class. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.messages.in: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.mm: (WebKit::WebDeviceOrientationUpdateProviderProxy::startUpdatingDeviceMotion): (WebKit::WebDeviceOrientationUpdateProviderProxy::stopUpdatingDeviceMotion): (WebKit::WebDeviceOrientationUpdateProviderProxy::motionChanged): * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp: (WebKit::WebDeviceOrientationUpdateProvider::startUpdatingDeviceOrientation): (WebKit::WebDeviceOrientationUpdateProvider::stopUpdatingDeviceOrientation): (WebKit::WebDeviceOrientationUpdateProvider::startUpdatingDeviceMotion): (WebKit::WebDeviceOrientationUpdateProvider::stopUpdatingDeviceMotion): (WebKit::WebDeviceOrientationUpdateProvider::deviceOrientationChanged): (WebKit::WebDeviceOrientationUpdateProvider::deviceMotionChanged): (WebKit::WebDeviceOrientationUpdateProvider::startUpdating): Deleted. (WebKit::WebDeviceOrientationUpdateProvider::stopUpdating): Deleted. * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h: * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.messages.in: 2019-12-10 Chris Dumez Unreviewed, drop debug assertion in InspectorTargetProxy::didCommitProvisionalTarget() that is hitting after r253337 r253337 causes the ProvisionalPageProxy to get destroyed a little bit early, before didCommitProvisionalTarget() is called. didCommitProvisionalTarget() had an assertion that isProvisional() returns true, which merely checked that the ProvisionalPageProxy is still alive before nulling out its WeakPtr. * UIProcess/InspectorTargetProxy.cpp: (WebKit::InspectorTargetProxy::didCommitProvisionalTarget): 2019-12-10 Per Arne Vollan [iOS] Deny mach lookup access to network extension services in the WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=203929 Reviewed by Brent Fulgham. Mach lookup access to network extension services in the WebContent process is only needed if NEFilterSource.filterRequired is true. If this is the case, issue the needed mach lookup sandbox extensions to the WebContent process, where they will be consumed. Eventually, all the content filtering code should be moved to the Networking process, but since this is a bigger undertaking, we can issue extensions in the meantime to strengthen the sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): * WebProcess/com.apple.WebProcess.sb.in: 2019-12-10 Chris Dumez Leverage the fact that WebPageProxy subclasses IPC::MessageSender to simplify IPC sending code https://bugs.webkit.org/show_bug.cgi?id=205065 Reviewed by Alex Christensen. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::switchToBrowsingContext): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): (WebKit::WebAutomationSession::resolveChildFrameHandle): (WebKit::WebAutomationSession::resolveParentFrameHandle): (WebKit::WebAutomationSession::computeElementLayout): (WebKit::WebAutomationSession::selectOptionElement): (WebKit::WebAutomationSession::setFilesForInputFileUpload): (WebKit::WebAutomationSession::getAllCookies): (WebKit::WebAutomationSession::deleteSingleCookie): (WebKit::WebAutomationSession::takeScreenshot): * UIProcess/RemoteWebInspectorProxy.cpp: (WebKit::RemoteWebInspectorProxy::load): (WebKit::RemoteWebInspectorProxy::sendMessageToFrontend): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::unapply): (WebKit::WebEditCommandProxy::reapply): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::loadURL): (WebKit::WebFrameProxy::loadData): (WebKit::WebFrameProxy::stopLoading const): * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::sendMessageToFrontend): (WebKit::WebInspectorProxy::connect): (WebKit::WebInspectorProxy::close): (WebKit::WebInspectorProxy::updateForNewPageProcess): (WebKit::WebInspectorProxy::setFrontendConnection): (WebKit::WebInspectorProxy::showConsole): (WebKit::WebInspectorProxy::showResources): (WebKit::WebInspectorProxy::showMainResourceForFrame): (WebKit::WebInspectorProxy::attach): (WebKit::WebInspectorProxy::detach): (WebKit::WebInspectorProxy::togglePageProfiling): (WebKit::WebInspectorProxy::toggleElementSelection): (WebKit::WebInspectorProxy::openLocalInspectorFrontend): (WebKit::WebInspectorProxy::open): (WebKit::WebInspectorProxy::closeFrontendPageAndWindow): (WebKit::WebInspectorProxy::attachAvailabilityChanged): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setUIClient): (WebKit::WebPageProxy::setIconLoadingClient): (WebKit::WebPageProxy::launchProcessForReload): (WebKit::WebPageProxy::launchProcessWithItem): (WebKit::WebPageProxy::initializeWebPage): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadAlternateHTML): (WebKit::WebPageProxy::loadWebArchiveData): (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPageProxy::stopLoading): (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::tryRestoreScrollPosition): (WebKit::WebPageProxy::setControlledByAutomation): (WebKit::WebPageProxy::setIndicating): (WebKit::WebPageProxy::setBackgroundColor): (WebKit::WebPageProxy::setTopContentInset): (WebKit::WebPageProxy::setUnderlayColor): (WebKit::WebPageProxy::viewWillStartLiveResize): (WebKit::WebPageProxy::viewWillEndLiveResize): (WebKit::WebPageProxy::viewDidEnterWindow): (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::layerHostingModeDidChange): (WebKit::WebPageProxy::setInitialFocus): (WebKit::WebPageProxy::clearSelection): (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement): (WebKit::WebPageProxy::validateCommand): (WebKit::WebPageProxy::increaseListLevel): (WebKit::WebPageProxy::decreaseListLevel): (WebKit::WebPageProxy::changeListType): (WebKit::WebPageProxy::setBaseWritingDirection): (WebKit::WebPageProxy::setNeedsFontAttributes): (WebKit::WebPageProxy::scheduleFullEditorStateUpdate): (WebKit::WebPageProxy::selectAll): (WebKit::WebPageProxy::executeEditCommand): (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart): (WebKit::WebPageProxy::setEditable): (WebKit::WebPageProxy::performDragControllerAction): (WebKit::WebPageProxy::dragEnded): (WebKit::WebPageProxy::didStartDrag): (WebKit::WebPageProxy::dragCancelled): (WebKit::WebPageProxy::processNextQueuedMouseEvent): (WebKit::WebPageProxy::sendWheelEvent): (WebKit::WebPageProxy::handleKeyboardEvent): (WebKit::WebPageProxy::handleGestureEvent): (WebKit::WebPageProxy::handlePreventableTouchEvent): (WebKit::WebPageProxy::resetPotentialTapSecurityOrigin): (WebKit::WebPageProxy::handleUnpreventableTouchEvent): (WebKit::WebPageProxy::handleTouchEvent): (WebKit::WebPageProxy::cancelPointer): (WebKit::WebPageProxy::touchWithIdentifierWasRemoved): (WebKit::WebPageProxy::scrollBy): (WebKit::WebPageProxy::centerSelectionInVisibleArea): (WebKit::WebPageProxy::commitProvisionalPage): (WebKit::WebPageProxy::setUserAgent): (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations): (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations): (WebKit::WebPageProxy::setCustomTextEncodingName): (WebKit::WebPageProxy::restoreFromSessionState): (WebKit::WebPageProxy::setTextZoomFactor): (WebKit::WebPageProxy::setPageZoomFactor): (WebKit::WebPageProxy::setPageAndTextZoomFactors): (WebKit::WebPageProxy::scalePage): (WebKit::WebPageProxy::scalePageInViewCoordinates): (WebKit::WebPageProxy::scaleView): (WebKit::WebPageProxy::windowScreenDidChange): (WebKit::WebPageProxy::accessibilitySettingsDidChange): (WebKit::WebPageProxy::setUseFixedLayout): (WebKit::WebPageProxy::setFixedLayoutSize): (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller): (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller): (WebKit::WebPageProxy::listenForLayoutMilestones): (WebKit::WebPageProxy::setSuppressScrollbarAnimations): (WebKit::WebPageProxy::setEnableVerticalRubberBanding): (WebKit::WebPageProxy::setEnableHorizontalRubberBanding): (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage): (WebKit::WebPageProxy::setPaginationMode): (WebKit::WebPageProxy::setPaginationBehavesLikeColumns): (WebKit::WebPageProxy::setPageLength): (WebKit::WebPageProxy::setGapBetweenPages): (WebKit::WebPageProxy::setPaginationLineGridEnabled): (WebKit::WebPageProxy::findStringMatches): (WebKit::WebPageProxy::findString): (WebKit::WebPageProxy::getImageForFindMatch): (WebKit::WebPageProxy::selectFindMatch): (WebKit::WebPageProxy::indicateFindMatch): (WebKit::WebPageProxy::hideFindUI): (WebKit::WebPageProxy::countStringMatches): (WebKit::WebPageProxy::replaceMatches): (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): (WebKit::WebPageProxy::runJavaScriptInFrame): (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): (WebKit::WebPageProxy::getSourceForFrame): (WebKit::WebPageProxy::getContentsAsString): (WebKit::WebPageProxy::getBytecodeProfile): (WebKit::WebPageProxy::getSamplingProfilerOutput): (WebKit::WebPageProxy::getContentsAsMHTMLData): (WebKit::WebPageProxy::getSelectionOrContentsAsString): (WebKit::WebPageProxy::getSelectionAsWebArchiveData): (WebKit::WebPageProxy::getMainResourceDataOfFrame): (WebKit::WebPageProxy::getResourceDataFromFrame): (WebKit::WebPageProxy::getWebArchiveOfFrame): (WebKit::WebPageProxy::forceRepaint): (WebKit::WebPageProxy::preferencesDidChange): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::willSubmitForm): (WebKit::WebPageProxy::showShareSheet): (WebKit::WebPageProxy::setMediaVolume): (WebKit::WebPageProxy::setMuted): (WebKit::WebPageProxy::stopMediaCapture): (WebKit::WebPageProxy::stopAllMediaPlayback): (WebKit::WebPageProxy::suspendAllMediaPlayback): (WebKit::WebPageProxy::resumeAllMediaPlayback): (WebKit::WebPageProxy::handleMediaEvent): * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformSave): 2019-12-10 Chris Dumez Gyroscope (DeviceMotion related) permission cannot be requested in WKWebView unless the client app sets a WKUIDelegate https://bugs.webkit.org/show_bug.cgi?id=203287 Reviewed by Alex Christensen. Device orientation / motion events permission dialog would not be shown unless the client app set a WKUIDelegate on the WKWebView, even though we do not need this WKUIDelegate to show the prompt. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _deviceOrientationUserPermissionHandler]): (-[WKWebView _setDeviceOrientationUserPermissionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess): * UIProcess/Cocoa/WKOrientationAccessAlert.mm: (WebKit::presentOrientationAccessAlert): 2019-12-10 Chris Dumez Unreviewed, drop bad assertion in PreconnectTask::willSendRedirectedRequest() PreconnectTask::willSendRedirectedRequest() may get called in case of HSTS redirect, so the ASSERT_NOT_REACHED() is wrong. * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::willSendRedirectedRequest): 2019-12-10 Commit Queue Unreviewed, rolling out r253212. https://bugs.webkit.org/show_bug.cgi?id=205074 ' REGRESSION (253212): Safari does not load local html file, base system Safari does not load RecoveryInformation.html' (Requested by nham on #webkit). Reverted changeset: "Drop support for NSURLCache callbacks in NetworkProcess" https://bugs.webkit.org/show_bug.cgi?id=203344 https://trac.webkit.org/changeset/253212 2019-12-10 Chris Dumez [WK2][iOS] Visibility propagation view is not properly updated when navigating cross-process https://bugs.webkit.org/show_bug.cgi?id=205028 Reviewed by Tim Horton. Make sure we keep the contextIDForVisibilityPropagation on the ProvisionalPageProxy / SuspendedPageProxy objects and update WebPageProxy::m_contextIDForVisibilityPropagation whenever we commit a provisional page. Also update ProvisionalPageProxy to listen for the WebPageProxy::DidCreateContextForVisibilityPropagation IPC so that it can update m_contextIDForVisibilityPropagation once the WebPage is created in the provisional WebProcess (which creates the visibility propagation view). * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::didCreateContextForVisibilityPropagation): (WebKit::ProvisionalPageProxy::didReceiveMessage): * UIProcess/ProvisionalPageProxy.h: (WebKit::ProvisionalPageProxy::contextIDForVisibilityPropagation const): * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::SuspendedPageProxy): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::swapToProvisionalPage): (WebKit::WebPageProxy::commitProvisionalPage): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::swapToWebProcess): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _setupVisibilityPropagationView]): (-[WKContentView _removeVisibilityPropagationView]): 2019-12-10 Chris Dumez Regression(r253277) ASSERTION FAILED: !parameters.request.httpBody() in NetworkConnectionToWebProcess::preconnectTo() https://bugs.webkit.org/show_bug.cgi?id=205030 Reviewed by Antti Koivisto. Instead of using the full request as preconnect request, create a simple one that contains only the destination URL. This avoids sending a request body unnecessarily over IPC, which was the cause of the assertion. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2019-12-10 Chris Dumez Make preconnectTo()'s completionHandler optional https://bugs.webkit.org/show_bug.cgi?id=205011 Reviewed by Antti Koivisto. Make preconnectTo()'s completionHandler optional, so that the network process does not unnecessarily send an IPC back if the client is not interested. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::preconnectTo): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::preconnectTo): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2019-12-09 Eric Carlson Rename media in the GPU process preference https://bugs.webkit.org/show_bug.cgi?id=205013 Reviewed by Tim Horton. * Shared/WebPreferences.yaml: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2019-12-09 Truitt Savell Unreviewed, rolling out r253299. Casued 30+ imported/ test failures on Mac wk2 Reverted changeset: "Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler" https://bugs.webkit.org/show_bug.cgi?id=204713 https://trac.webkit.org/changeset/253299 2019-12-09 Chris Dumez Regression(r249329) ViewGestureController::requestRenderTreeSizeNotificationIfNeeded() sometimes uses wrong webPageID for IPC https://bugs.webkit.org/show_bug.cgi?id=205012 Reviewed by Tim Horton. * UIProcess/InspectorTargetProxy.cpp: (WebKit::InspectorTargetProxy::connect): (WebKit::InspectorTargetProxy::disconnect): (WebKit::InspectorTargetProxy::sendMessageToTargetBackend): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::initializeWebPage): (WebKit::ProvisionalPageProxy::goToBackForwardItem): (WebKit::ProvisionalPageProxy::messageSenderConnection const): (WebKit::ProvisionalPageProxy::messageSenderDestinationID const): * UIProcess/ProvisionalPageProxy.h: * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::SuspendedPageProxy): (WebKit::SuspendedPageProxy::unsuspend): (WebKit::SuspendedPageProxy::close): (WebKit::SuspendedPageProxy::messageSenderConnection const): (WebKit::SuspendedPageProxy::messageSenderDestinationID const): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): Have SuspendedPageProxy & ProvisionalPageProxy subclass IPC::MessageSender so that we can call send() on them without having to pass in a PageIdentifier. Passing a PageIdentifier was error-prone. * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded): When there was a provisonal page proxy, we would properly send the IPC to the provisional page's process but would use the wrong PageIdentifier for the IPC. We would use the identifier of the committed WebPage instead of the one of the provisional WebPage. 2019-12-09 Wenson Hsieh Finish encoding/decoding support for DisplayList::SetState https://bugs.webkit.org/show_bug.cgi?id=205018 Reviewed by Tim Horton. Replaces WebCore::DisplayList::ImageHandle with just WebCore::ImageHandle. See WebCore ChangeLog for more details. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: 2019-12-09 Said Abou-Hallawa Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler https://bugs.webkit.org/show_bug.cgi?id=204713 Reviewed by Simon Fraser. Create an IPC message on the DrawingArea to send a message from the WebProcess to the UIProcess to setPreferredFramesPerSecond of the DisplayRefreshMonitor. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]): (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond): Set the preferredFramesPerSecond of the CADisplayLink. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond): Delegate the call to RemoteLayerTreeDrawingArea. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond): Send the IPC message from the WebProcess to the UIProcess. 2019-12-09 youenn fablet NetworkResourceLoader should consume its sandbox extensions when starting a fetch through service worker https://bugs.webkit.org/show_bug.cgi?id=204883 Reviewed by Alex Christensen. Consume sandbox extensions in network process before sending fetch task to service worker. This makes sure network process can send proper sandbox extensions to the service worker and it also ensures it will have the necessary rights to access the file if the fetch task is not handled by service worker. Test: http/wpt/service-workers/file-upload.html * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::consumeSandboxExtensionsIfNeeded): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::startFetch): 2019-12-09 Wenson Hsieh Unreviewed, fix the macCatalyst build after r253267 * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]): 2019-12-09 Alex Christensen Re-disable TLS1.0 and TLS1.1 by default https://bugs.webkit.org/show_bug.cgi?id=204922 Reviewed by Youenn Fablet. Covered by updated API tests. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2019-12-09 Chris Dumez Unreviewed, fix debug assertion for ApplePay API tests on iOS after r253277. Disable server preconnect if the load will be handled by the LegacyCustomProtocolManager. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::preconnectTo): 2019-12-09 youenn fablet Add an option to capture audio in GPU process https://bugs.webkit.org/show_bug.cgi?id=205007 Reviewed by Eric Carlson. Add a flag to make audio capture in GPU process. In WebProcess, if trying to capture through GPUProcess, send back an error since this is not implemented. * Shared/WebPreferences.yaml: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetCaptureAudioInGPUProcessEnabled): (WKPreferencesGetCaptureAudioInGPUProcessEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::createWebPage): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::initialize): (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource): * WebProcess/cocoa/UserMediaCaptureManager.h: (WebKit::UserMediaCaptureManager::AudioFactory::setShouldCaptureInGPUProcess): 2019-12-08 Wenson Hsieh Move WebCore::Path encoders and decoders into WebCore from WebCoreArgumentCoders https://bugs.webkit.org/show_bug.cgi?id=204993 Reviewed by Tim Horton. Remove Encoder/Decoder support for WebCore::Path. * Shared/WebCoreArgumentCoders.cpp: (IPC::pathEncodeApplierFunction): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: 2019-12-08 Chris Dumez Preconnect to server as early as possible in WebPage::LoadRequest https://bugs.webkit.org/show_bug.cgi?id=204992 Reviewed by Antti Koivisto. Preconnect to server as early as possible in WebPage::LoadRequest. This avoids delaying the connection to the server until after the policy check and is a ~1.3% progression on PLT5 on both macOS and iOS. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::preconnectTo): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2019-12-08 youenn fablet Support different resolutions for video tracks captured from UIProcess https://bugs.webkit.org/show_bug.cgi?id=204945 Reviewed by Eric Carlson. Change video capture in uiprocess to an experimental flag. Add support for remote video source cloning by sending some IPC to UIProcess and cloning the source there. This triggers IPC for both cloning and cloned sources but this allows to do resizing in UIProcess instead of WebProcess. We thus disable video capture resizing in WebProcess. * Shared/WebPreferences.yaml: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::SourceProxy::start): (WebKit::UserMediaCaptureManagerProxy::SourceProxy::stop): (WebKit::UserMediaCaptureManagerProxy::SourceProxy::requestToEnd): (WebKit::UserMediaCaptureManagerProxy::SourceProxy::preventSourceFromStopping): (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::startProducingData): (WebKit::UserMediaCaptureManagerProxy::stopProducingData): (WebKit::UserMediaCaptureManagerProxy::clone): (WebKit::UserMediaCaptureManagerProxy::requestToEnd): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::sourceID const): (WebKit::UserMediaCaptureManager::Source::settings const): (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): (WebKit::UserMediaCaptureManager::Source::requestToEnd): (WebKit::UserMediaCaptureManager::Source::stopBeingObserved): (WebKit::UserMediaCaptureManager::cloneSource): (WebKit::UserMediaCaptureManager::cloneVideoSource): (WebKit::UserMediaCaptureManager::requestToEnd): (WebKit::UserMediaCaptureManager::VideoFactory::setVideoCapturePageState): * WebProcess/cocoa/UserMediaCaptureManager.h: 2019-12-08 youenn fablet Tighten Mac sandbox by removing microphone access https://bugs.webkit.org/show_bug.cgi?id=204939 Reviewed by Brent Fulgham. No change of behavior, we do audio capture in UIProcess. * WebProcess/com.apple.WebProcess.sb.in: 2019-12-08 youenn fablet Add logging to NetworkRTCMonitor https://bugs.webkit.org/show_bug.cgi?id=204850 Reviewed by Eric Carlson. Add logging and send IPC message back to WebProcess even if monitoring is stopped. No observable change of behavior. * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): (WebKit::NetworkRTCMonitor::stopUpdating): (WebKit::NetworkRTCMonitor::onNetworksChanged): 2019-12-07 Said Abou-Hallawa Make ColorSpace an enum class https://bugs.webkit.org/show_bug.cgi?id=204970 Reviewed by Sam Weinig. * Shared/WebCoreArgumentCoders.h: 2019-12-07 Wenson Hsieh [iOS] WKWebView touch event gesture recognition should not block the application process main thread when possible https://bugs.webkit.org/show_bug.cgi?id=204664 Reviewed by Tim Horton. Adds a mechanism that allows some sync touch events on iOS to be sent asynchronously. To do this, we use the deferring gesture mechanism introduced in trac.webkit.org/r253005 to defer all gestures under WKContentView (and WebKit-owned scroll views) when a touch starts, such that they will not recognize until we know that the page has either prevented default or not (assuming that the touch was over an active listener). See below for more details. Tests: fast/events/touch/ios/prevent-default-on-touch-start-with-slow-event-listener.html fast/events/touch/ios/scroll-on-touch-start-with-slow-event-listener.html * UIProcess/GenericCallback.h: * UIProcess/PageClient.h: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: (-[WKChildScrollView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]): (-[WKChildScrollView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]): Implement gesture recognizer delegate hooks to add dynamic failure requirements between a child scroll view's gestures and the new deferring gesture recognizers on WKContentView. This allows pan gestures over a scrollable container to hold off on recognizing while the deferring gesture recognizer has not failed yet. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handlePreventableTouchEvent): (WebKit::WebPageProxy::handleUnpreventableTouchEvent): Rename handleTouchEventSynchronously and handleTouchEventAsynchronously to handlePreventableTouchEvent and handleUnpreventableTouchEvent, respectively. Instead of always sending touchstart events that may prevent native gestures synchronously, we may now go through the same `EventDispatcher::TouchEvent` codepath used when dispatching touch events in passive tracking regions. However, in the case of preventable touchstarts, we additionally store a completion callback that is invoked after the touch event has been handled by the page; we then either un-defer or prevent native gestures here (depending on whether the page prevented default) by calling PageClient::doneDeferringNativeGestures. Non-touchstart events are still dispatched synchronously, to ensure that calling preventDefault() on touchmove and touchend continue to prevent default gestures from recognizing. (WebKit::WebPageProxy::boolCallback): (WebKit::WebPageProxy::handleTouchEventSynchronously): Deleted. (WebKit::WebPageProxy::handleTouchEventAsynchronously): Deleted. See above. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isHandlingPreventableTouchStart const): This is used in WKContentView to determine whether deferring gestures need to remain active after the touch ends. See below for more detail. * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::doneDeferringNativeGestures): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[UIGestureRecognizer _wk_cancel]): (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): Add and remove the new deferring gesture recognizers here. (-[WKContentView _webTouchEventsRecognized:]): (-[WKContentView _webTouchEvent:preventsNativeGestures:]): (-[WKContentView _doneDeferringNativeGestures:]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView ensurePositionInformationIsUpToDate:]): Drive-by fix: add a missing hasRunningProcess check that causes a flaky assertion under `AuxiliaryProcessProxy::connection()` in layout tests. (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]): (-[WKContentView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]): Add dynamic failure requirements between WKContentView's gestures (including all text interaction, context menu, and drag and drop gestures) and the new deferring gesture recognizers. (-[WKContentView _didStartProvisionalLoadForMainFrame]): Force the two-finger double tap gesture recognizer to reset when loading a new page. Without this, the layout test fast/events/ios/click-event-while-editing-node.html will rarely fail when run after a test that dispatches a two-finger tap, such as fast/events/ios/click-event-two-finger-single-tap-meta-key.html. This is because the new deferring gestures will temporarily unite multi-finger tap gestures with one-finger double tap gestures in the same subgraph when performing a tap gesture with more than one finger. This means that there's a 300 ms delay before a normal single tap can be recognized again, which (without forcing the two-finger double tap to reset) would cause a subsequent test that loads in under 300 ms and attempts to send a tap to fail. (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesAfterBeginningTouchesWithEvent:]): Avoid deferring native gestures if the scroll view is decelerating; this matches behavior of the web touch event gesture recognizer. (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesAfterEndingTouchesWithEvent:]): Normally, after -touchesEnded:withEvent:, we stop deferring native gesture recognizers by failing the deferring gestures. However, if we're still waiting for a response from the web process, then let -_doneDeferringNativeGestures: handle this instead. (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]): (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesWithEvent:]): Deleted. Renamed to -shouldDeferGesturesAfterBeginningTouchesWithEvent:. * UIProcess/ios/WKDeferringGestureRecognizer.h: * UIProcess/ios/WKDeferringGestureRecognizer.mm: (-[WKDeferringGestureRecognizer touchesBegan:withEvent:]): (-[WKDeferringGestureRecognizer touchesEnded:withEvent:]): Override this and add a new delegate hook to determine whether we want the deferring gesture recognizer to immediately fail when touches end. It's important to override this and transition to failure state in this case, since not doing so could mean that the deferring gestures stay in Possible state forever; this may lead to the gesture subgraph containing these deferring gestures being unable to reset, since it's waiting for the deferring gesture to either fail or end. * UIProcess/ios/WKScrollView.mm: (-[WKScrollView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]): (-[WKScrollView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]): Defer more scroll view gestures. * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::touchEvent): Add an optional CallbackID parameter to this IPC message. If a callback ID is given, then we avoid coalescing the touch event. To implement this, we additionally refactor the queued touch events map to contain lists of > pairs; if a queued touch event has a corresponding CallbackID, then we fire the callback corresponding to the ID, indicating whether the touch event was handled by the page. * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/EventDispatcher.messages.in: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dispatchAsynchronousTouchEvents): 2019-12-07 David Quesada REGRESSION(r253231): Debug assertion failures under ~WebDeviceOrientationUpdateProvider(Proxy) https://bugs.webkit.org/show_bug.cgi?id=204977 rdar://problem/57724251 Reviewed by Per Arne Vollan. In the UI process, have the WebPageProxy swap out its WebDeviceOrientationUpdateProviderProxy whenever it connects to a new process, instead of creating one on construction and holding onto it for the rest of the WebPageProxy lifetime. The …UpdateProviderProxy assumes that its page will have the same ID at the time of registering as a message receiver and later unregistering, but the page ID could change if the WebPageProxy swaps web processes. Using a new instance per web page ID ensures that the updater is always able to successfully remove itself as a message receiver when deallocating. In the Web process, ~WebDeviceOrientationUpdateProvider() should remove itself as a message receiver specifically for its page ID, rather than as a global message receiver. No new tests -- existing tests (at least the ProcessSwap API tests) revealed the regression. * UIProcess/WebPageProxy.cpp: (WebKit::m_tryCloseTimeoutTimer): (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::resetState): (WebKit::m_webDeviceOrientationUpdateProviderProxy): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h: * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp: (WebKit::WebDeviceOrientationUpdateProvider::WebDeviceOrientationUpdateProvider): (WebKit::WebDeviceOrientationUpdateProvider::~WebDeviceOrientationUpdateProvider): * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h: 2019-12-07 Tim Horton Implement encoding for DrawImage and DrawRoundedRect display list items https://bugs.webkit.org/show_bug.cgi?id=204881 Reviewed by Simon Fraser. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: 2019-12-06 Commit Queue Unreviewed, rolling out r253218. https://bugs.webkit.org/show_bug.cgi?id=204968 Broke the build (Requested by ap on #webkit). Reverted changeset: "Remove various .order files." https://bugs.webkit.org/show_bug.cgi?id=204959 https://trac.webkit.org/changeset/253218 2019-12-06 Chris Dumez [IPC] MESSAGE_CHECK() parameters for AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPCs https://bugs.webkit.org/show_bug.cgi?id=204962 Reviewed by Ryosuke Niwa. MESSAGE_CHECK() parameters for AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPCs. Those parameters are used as keys in HashMaps. * UIProcess/Plugins/PlugInAutoStartProvider.cpp: (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider): (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash): (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest): (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction): * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addPlugInAutoStartOriginHash): (WebKit::WebProcessProxy::plugInDidReceiveUserInteraction): 2019-12-06 Per Arne Vollan [iOS] Calls to device orientation API should be done in the UI process https://bugs.webkit.org/show_bug.cgi?id=204720 Reviewed by Alex Christensen. Add a new class, WebDeviceOrientationUpdateProviderProxy, to handle messages to start and stop updating device orientation in the UI process. Also, add a message to update the device orientation in the WebContent process. In the UI process, the device orientation API is called through the already existing WebCoreMotionManager class. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * UIProcess/WebPageProxy.cpp: (WebKit::m_webDeviceOrientationUpdateProviderProxy): (WebKit::m_resetRecentCrashCountTimer): Deleted. * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2019-12-06 Chris Dumez Reduce timeout for page to handle beforeunload events when trying to close a page https://bugs.webkit.org/show_bug.cgi?id=204950 Reviewed by Ryosuke Niwa. Reduce timeout for page to handle beforeunload events when trying to close a page. It would previously take up to 3 seconds to actually close a tab after the user would click on the "X" to close it. This is because we would wait for the page to fire and handle the beforeunload events and only give up after 3 seconds. This patch reduces this timeout to something more reasonable from a user standpoint (500ms). * UIProcess/WebPageProxy.cpp: (WebKit::m_tryCloseTimeoutTimer): (WebKit::WebPageProxy::tryClose): (WebKit::WebPageProxy::tryCloseTimedOut): (WebKit::WebPageProxy::closePage): (WebKit::m_resetRecentCrashCountTimer): Deleted. * UIProcess/WebPageProxy.h: 2019-12-06 Jonathan Bedard Python 3: Add support in webkitpy.test https://bugs.webkit.org/show_bug.cgi?id=204952 Reviewed by Stephanie Lewis. Tested by test-webkitpy. * Scripts/webkit/messages_unittest.py: Use Python 2/3 compatible StringIO. 2019-12-06 Keith Miller Remove various .order files. https://bugs.webkit.org/show_bug.cgi?id=204959 Reviewed by Yusuke Suzuki. These files are all super out of date and likely don't do anything anymore. The signatures of the functions have changed thus the mangled name has changed. * mac/WebKit2.order: Removed. 2019-12-06 Dan Bernstein Address * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView valueForUndefinedKey:]): Added a newline. 2019-12-06 Benjamin Nham Drop support for NSURLCache callbacks in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=203344 Reviewed by Alex Christensen. Remove the NSURLSession caching policy callback in NetworkProcess. It's no longer necessary since we don't use NSURLCache in NetworkProcess (https://bugs.webkit.org/show_bug.cgi?id=185990). * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]): Deleted. 2019-12-05 Chris Dumez Stop using reserveCapacity() / reserveInitialCapacity() in IPC decoders https://bugs.webkit.org/show_bug.cgi?id=204930 Reviewed by Ryosuke Niwa. This is IPC hardening since the size we use to reserve the capacity is encoded over IPC and cannot be trusted in some cases. * Platform/IPC/ArgumentCoders.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder>>::decode): 2019-12-06 youenn fablet Protect WebRTC network monitoring to wait forever in edge cases https://bugs.webkit.org/show_bug.cgi?id=204846 Reviewed by Eric Carlson. We were limiting the number of IPC message sent to network process by only sending the start monitoring event for the first client. The issue is that, if network process crashes for instance while having not yet given the list of networks, all clients will be hanging waiting for the completion of network list. We are now sending an IPC message for every client and the network process will ignore the ones that are not useful. In addition, in case of network process crash, we send a signal that network list has changed to make sure clients will never hang. They might still fail connecting, which is ok since network process crashed. Test: webrtc/datachannel/gather-candidates-networkprocess-crash.html * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): * NetworkProcess/webrtc/NetworkRTCMonitor.h: * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in: * WebProcess/Network/webrtc/LibWebRTCNetwork.h: (WebKit::LibWebRTCNetwork::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::WebRTCMonitor::StartUpdating): (WebKit::WebRTCMonitor::StopUpdating): (WebKit::WebRTCMonitor::networksChanged): (WebKit::WebRTCMonitor::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): 2019-12-06 youenn fablet Output libwebrtc logging from Network Process as release logging https://bugs.webkit.org/show_bug.cgi?id=204853 Reviewed by Eric Carlson. This will help debugging WebRTC networking issues. No observable change of behavior. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::doReleaseLogging): (WebKit::NetworkRTCProvider::NetworkRTCProvider): 2019-12-05 Yousuke Kimoto [WinCairo] Improve Inspectable Target Page to adapt a long title and URL https://bugs.webkit.org/show_bug.cgi?id=204874 Reviewed by Fujii Hironori. Add some CSS atributes to make such long titles and URLs fit the width of a window size. Then "Inspector" button is shown at the visible area. No new tests, since there is no change in behavior. * UIProcess/socket/RemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::platformStartTask): 2019-12-05 Fujii Hironori [WebKit] Fix compilation warnings for MSVC https://bugs.webkit.org/show_bug.cgi?id=204661 Reviewed by Don Olmstead. No behavior changes. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::makeDescription): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::cleanup): * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: (WebKit::NetworkCache::IOChannel::IOChannel): * Shared/API/c/WKSharedAPICast.h: (WebKit::toAPI): (WebKit::toDiagnosticLoggingResultType): * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::didReceiveData): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::registerAttachmentIdentifier): 2019-12-05 Brian Burg [Cocoa] _WKInspector uses wrong WKWebView in -setDiagnosticLoggingDelegate: https://bugs.webkit.org/show_bug.cgi?id=204928 Reviewed by Timothy Hatcher. I feel like I've made this mistake before. To make the right thing more obvious, add a property named inspectorWebView that returns the Inspector WKWebView. * UIProcess/API/Cocoa/_WKInspector.mm: (-[_WKInspector inspectorWebView]): (-[_WKInspector _setDiagnosticLoggingDelegate:]): * UIProcess/WebInspectorProxy.h: (WebKit::WebInspectorProxy::inspectorPage const): 2019-12-05 Chris Dumez Use sendWithAsyncReply() for WebPage::TryClose IPC https://bugs.webkit.org/show_bug.cgi?id=204926 Reviewed by Alex Christensen. Use sendWithAsyncReply() for WebPage::TryClose IPC, instead of 2 separate IPCs. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::closeBrowsingContext): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::tryClose): (WebKit::WebPageProxy::closePage): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::tryClose): (WebKit::WebPage::sendClose): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-12-05 John Wilander Resource Load Statistics (experimental): Add fast mode for non-cookie website data deletion https://bugs.webkit.org/show_bug.cgi?id=204858 Reviewed by Alex Christensen. The purpose of this change is to allow for dedicated testing of the change in https://trac.webkit.org/changeset/253082/webkit. Waiting seven days just isn't a good starting point. This change adds two internal flags: - "Live-On Testing" with a one hour timeout instead of seven days. - "Repro Testing" with an instant timeout (bar ITP's regular delays) instead of seven days. The change also makes sure that hasHadUnexpiredRecentUserInteraction() in ResourceLoadStatisticsDatabaseStore and ResourceLoadStatisticsMemoryStore only age out the user interaction timestamp if the OperatingDatesWindow is Long so that we don't age out timestamps early with the shorter OperatingDatesWindows. This change changes the default value of IsFirstPartyWebsiteDataRemovalEnabled to true. These internal flags should be removed once testing is complete: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const): (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const): * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const): * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode): * NetworkProcess/NetworkProcess.messages.in: * Shared/WebPreferences.yaml: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2019-12-05 Chris Dumez Optimize IPC::Connection::SyncMessageState methods https://bugs.webkit.org/show_bug.cgi?id=204890 Reviewed by Alex Christensen. Optimize IPC::Connection::SyncMessageState methods. We are seeing lock contention on some (app launch) benchmarks, resulting in the main thread yielding for 10ms. * Platform/IPC/Connection.cpp: (IPC::Connection::SyncMessageState): Make constructor private since this is a singleton class. (IPC::Connection::ConnectionAndIncomingMessage): Add convenience dispatch() method. (IPC::Connection::SyncMessageState::processIncomingMessage): Drop the lock as early as possible, *before* calling RunLoop::main().dispatch(). (IPC::Connection::SyncMessageState::dispatchMessages): Drop allowedConnection parameter and simplify the code a lot as a result. Only dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() needed the pass an allowedConnection but having dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() call dispatchMessages() was inefficient since it would cause us to grab the lock in dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() to update m_didScheduleDispatchMessagesWorkSet, then release it, then grab the lock again in dispatchMessages() for m_messagesToDispatchWhileWaitingForSyncReply. (IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection): Grab the lock only once to update m_didScheduleDispatchMessagesWorkSet and m_messagesToDispatchWhileWaitingForSyncReply, instead of doing it in 2 separate steps, each one taking the lock. (IPC::Connection::waitForMessage): (IPC::Connection::waitForSyncReply): (IPC::Connection::dispatchSyncMessage): stop passing a null allowedConnection when calling dispatchMessages(). 2019-12-05 Chris Dumez PageConfiguration::dragClient should use a smart pointer https://bugs.webkit.org/show_bug.cgi?id=204816 Reviewed by Alex Christensen. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2019-12-05 Chris Dumez [IPC] Fail BackForwardItemIdentifier decoding if the decoded integer is not a valid ID https://bugs.webkit.org/show_bug.cgi?id=204920 Reviewed by Ryosuke Niwa. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willGoToBackForwardListItem): (WebKit::WebPageProxy::backForwardGoToItemShared): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::updateBackForwardItem): 2019-12-05 Sihui Liu Move InProcessIDBServer to WebKitLegacy https://bugs.webkit.org/show_bug.cgi?id=204896 Reviewed by Brady Eidson. * WebProcess/Databases/WebDatabaseProvider.h: 2019-12-05 Sihui Liu Add ThreadMessageReceiver to IPC::Connection https://bugs.webkit.org/show_bug.cgi?id=204908 Reviewed by Brady Eidson. ThreadMesageReceiver is similar to WorkQueueMessageReceiver, but it should handle messages (dispatched from IPC thread) on a specific thread, while WorkQueueMessageReceiver may handle messages on different threads. * Platform/IPC/Connection.cpp: (IPC::Connection::addThreadMessageReceiver): (IPC::Connection::removeThreadMessageReceiver): (IPC::Connection::dispatchThreadMessageReceiverMessage): (IPC::Connection::processIncomingMessage): (IPC::Connection::dispatchMessageToThreadReceiver): * Platform/IPC/Connection.h: (IPC::Connection::ThreadMessageReceiver::dispatchToThread): 2019-12-05 Chris Dumez MESSAGE_CHECK BackForwardItemIdentifier on incoming IPC from the WebProcess https://bugs.webkit.org/show_bug.cgi?id=204899 Reviewed by Ryosuke Niwa. MESSAGE_CHECK BackForwardItemIdentifier on incoming IPC from the WebProcess. This is important since we use this identifier to look up the WebBackForwardListItem in a HashMap, and looking up a bad ID could corrupt said HashMap. * Shared/WebBackForwardListItem.cpp: Make sure the WebBackForwardListItem is always constructed and destroyed on the main thread, to avoid corrupting the allItems() HashMap. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willGoToBackForwardListItem): (WebKit::WebPageProxy::backForwardGoToItemShared): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::updateBackForwardItem): 2019-12-05 Kate Cheney [MSVC] WebResourceLoadStatisticsStore.h is reporting warning C4804: '/': unsafe use of type 'bool' in operation https://bugs.webkit.org/show_bug.cgi?id=204870 Reviewed by Darin Adler. This patch converts storageAccessGranted to a char since makeString() does not explicitly accept bool types. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: (WebKit::ThirdPartyDataForSpecificFirstParty::toString const): 2019-12-05 Philippe Normand [GLib] Display GStreamer version in about:gpu page Rubber-stamped by Carlos Garcia Campos. * UIProcess/API/glib/WebKitProtocolHandler.cpp: (WebKit::WebKitProtocolHandler::handleGPU): 2019-12-05 youenn fablet inspector/page/overrideSetting-MockCaptureDevicesEnabled.html is failing after removal of internals.setMockMediaCaptureDevicesEnabled API https://bugs.webkit.org/show_bug.cgi?id=204849 Reviewed by Eric Carlson. Synchronize the center with the preferences when the value might be updated. Add API to check which center is used in UIProcess. * UIProcess/API/C/WKPage.cpp: (WKPageIsMockRealtimeMediaSourceCenterEnabled): * UIProcess/API/C/WKPagePrivate.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): (WebKit::UserMediaPermissionRequestManagerProxy::setMockCaptureDevicesEnabledOverride): * UIProcess/UserMediaPermissionRequestManagerProxy.h: (WebKit::UserMediaPermissionRequestManagerProxy::setMockCaptureDevicesEnabledOverride): Deleted. 2019-12-04 Joonghun Park Unreviewed. Remove build warnings below since r253025. warning: unused variable ‘iter’ [-Wunused-variable] warning: unused variable ‘isNewEntry’ [-Wunused-variable] No new tests, no new behavioral changes. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::addSessionStorageQuotaManager): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager): 2019-12-04 Chris Dumez IPC messages may get processed out of order in some cases https://bugs.webkit.org/show_bug.cgi?id=204864 Reviewed by Ryosuke Niwa. IPC messages may get processed out of order in some cases. Connection::SyncMessageState::dispatchMessages() puts messages it did not process back at the end of the queue, instead of the beginning. This means that messages added to the queue while Connection::SyncMessageState::dispatchMessages() was running will incorrectly run *before* the ones dispatchMessages() did not process. * Platform/IPC/Connection.cpp: (IPC::Connection::SyncMessageState::dispatchMessages): 2019-12-04 Chris Dumez PageConfiguration::progressTrackerClient should use a smart pointer https://bugs.webkit.org/show_bug.cgi?id=204854 Reviewed by Alex Christensen. * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp: (WebKit::WebProgressTrackerClient::progressTrackerDestroyed): Deleted. * WebProcess/WebCoreSupport/WebProgressTrackerClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2019-12-04 Tim Horton Fix the iOS build * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: Added. * WebKit.xcodeproj/project.pbxproj: 2019-12-04 Per Arne Vollan Unreviewed fix for failure to create sandbox extension on macOS after r253011. This should be iOS only. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest): * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2019-12-04 Per Arne Vollan [iOS] The UI process should issue mach sandbox extension to "com.apple.AGXCompilerService" https://bugs.webkit.org/show_bug.cgi?id=203915 Reviewed by Brent Fulgham. Only a few iPad models need access to "com.apple.AGXCompilerService” in the WebContent process. The UI process should issue this mach extension for these iPad models. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::deviceHasAGXCompilerService): (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-04 Kate Cheney Expose basic ITP data from the database for future API/SPI use https://bugs.webkit.org/show_bug.cgi?id=203432 Reviewed John Wilander. Tests: http/tests/resourceLoadStatistics/user-interface-data-no-storage-access-database.html http/tests/resourceLoadStatistics/user-interface-data-no-storage-access.html http/tests/storageAccess/user-interface-data-with-storage-access-database.html http/tests/storageAccess/user-interface-data-with-storage-access.html Adds the ability to collect sorted ITP data for displaying in a user interface. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): Added new queries to the database store to check for storage access in the database and aggregate topFrames with the same subframe/subresource so easily create the struct for collecting data for the UI. (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const): Fixed an incorrect function name in the error message. (WebKit::ResourceLoadStatisticsDatabaseStore::joinSubStatisticsForSorting): Renamed unclear SQL variable names and added a bind parameter to specify whether resource is prevalent or not, which allows this function to be used to collect sorted ITP data for the UI. (WebKit::ResourceLoadStatisticsDatabaseStore::getFirstPartyDataForDomain const): (WebKit::ResourceLoadStatisticsDatabaseStore::gatherDataForUserInterface const): (WebKit::buildQueryStartAndEnd): (WebKit::getMedianOfPrevalentResourcesWithUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::getTopPrevelentResourceDaysSinceUI const): (WebKit::getMedianOfPrevalentResourceWithoutUserInteraction): (WebKit::getNumberOfPrevalentResourcesInTopResources): Changed sql query variable names to make them more clear and added a new bind parameter to allow for more general use of substatistic sorting query. (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess const): (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics const): Combined UI data with dumpResourceLoadStatistics() data to keep the testing aspect of this patch simpler. (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Since mostRecentUserInteractionTime changes with each test run, I updated the dumping to report only if it was in the last 24 hours as opposed to reporting an actual time. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ensureFirstPartyStatistic): (WebKit::getFirstPartyDataForDomain): (WebKit::hasBeenThirdParty): (WebKit::ResourceLoadStatisticsMemoryStore::gatherDataForUserInterface const): (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics): * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::gatherDataForUserInterface): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: (WebKit::FirstPartyData::toString const): (WebKit::FirstPartyData::operator== const): (WebKit::ThirdPartyData::toString const): (WebKit::ThirdPartyData::operator< const): The toString methods allow the structs to be printed for testing purposes. The equals methods allow the return vectors to use appendIfNotContains. 2019-12-04 Simon Fraser Minor RemoteLayerTree logging cleanup https://bugs.webkit.org/show_bug.cgi?id=204865 Reviewed by Tim Horton. Have the ::description() methods return Strings like everything else does. Use LOG_WITH_STREAM() so we don't call description() unless the log channel is on. * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::dump const): (WebKit::RemoteLayerTreeTransaction::description const): * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingCoordinatorTransaction::description const): (WebKit::RemoteScrollingCoordinatorTransaction::dump const): * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 2019-12-04 Louie Livon-Bemel Add exclusion rule for text manipulation SPI to exclude based on element class https://bugs.webkit.org/show_bug.cgi?id=204754 Reviewed by Ryosuke Niwa. Give clients another option for adding an exclusion for text manipulation; allow them to exclude based on an element having a certain class. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _startTextManipulationsWithConfiguration:completion:]): If the rule doesn't have an attribute but does have a class name, treat it as a ClassRule exclusion. * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.h: Add an initializer for excluding based on a class name. Also add a getter for the className. * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.mm: (-[_WKTextManipulationExclusionRule initExclusion:forClass:]): (-[_WKTextManipulationExclusionRule className]): 2019-12-04 Kenneth Russell Enable WebGL's ASTC extension all the time https://bugs.webkit.org/show_bug.cgi?id=202836 Reviewed by Dean Jackson. Remove the run-time flag - no longer necessary. * Shared/WebPreferences.yaml: 2019-12-04 youenn fablet WebProcessPool::terminateServiceWorkerProcess should be renamed terminateServiceWorkers https://bugs.webkit.org/show_bug.cgi?id=204792 Reviewed by Chris Dumez. Make use of disableServiceWorkers in terminateServiceWorkers as we might need to handle the case of a service worker in a process containing a page. Renaming API accordingly. Covered by existing tests. * UIProcess/API/C/WKContext.cpp: (WKContextTerminateServiceWorkers): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _terminateServiceWorkers]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::updateServiceWorkerUserAgent): (WebKit::WebProcessPool::terminateNetworkProcess): (WebKit::WebProcessPool::terminateServiceWorkers): (WebKit::WebProcessPool::updateProcessAssertions): (WebKit::WebProcessPool::isServiceWorkerPageID const): * UIProcess/WebProcessPool.h: 2019-12-04 youenn fablet Move soft update handling to network process https://bugs.webkit.org/show_bug.cgi?id=204678 Reviewed by Chris Dumez. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::swServerForSession): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::addSoftUpdateLoader): (WebKit::NetworkSession::removeSoftUpdateLoader): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): (WebKit::ServiceWorkerFetchTask::softUpdateIfNeeded): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: Added. (WebKit::ServiceWorkerSoftUpdateLoader::start): (WebKit::ServiceWorkerSoftUpdateLoader::ServiceWorkerSoftUpdateLoader): (WebKit::ServiceWorkerSoftUpdateLoader::~ServiceWorkerSoftUpdateLoader): (WebKit::ServiceWorkerSoftUpdateLoader::fail): (WebKit::ServiceWorkerSoftUpdateLoader::loadWithCacheEntry): (WebKit::ServiceWorkerSoftUpdateLoader::loadFromNetwork): (WebKit::ServiceWorkerSoftUpdateLoader::willSendRedirectedRequest): (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveResponse): (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveBuffer): (WebKit::ServiceWorkerSoftUpdateLoader::didFinishLoading): (WebKit::ServiceWorkerSoftUpdateLoader::didFailLoading): (WebKit::ServiceWorkerSoftUpdateLoader::didComplete): * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: Added. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::createFetchTask): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2019-12-04 Tim Horton Introduce a GPU process https://bugs.webkit.org/show_bug.cgi?id=204343 Reviewed by Simon Fraser. Add a GPU process. This process is destined to be used as a proxy between WebKit and the underlying graphics mechanisms; in the case of the Cocoa ports, it will specifically gate access to IOKit and a few media-related daemons. In this patch, the process is a UI-process singleton; the WebKit client application gets a single GPU process for all rendering, regardless of the number of Web Content processes, process pools, or web views. For now, it is just a shell of a process; functionality will be added in future patches! * Configurations/FeatureDefines.xcconfig: Add ENABLE(GPU_PROCESS). * Configurations/GPUService.xcconfig: Added. * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-OSX.plist: Added. * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist: Added. * GPUProcess/EntryPoint/Cocoa/XPCService/GPUServiceEntryPoint.mm: Added. * Shared/AuxiliaryProcess.h: * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h: * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: * Platform/ExtraPrivateSymbolsForTAPI.h: * Shared/mac/AuxiliaryProcessMac.mm: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * Configurations/WebKit.xcconfig: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::getLaunchOptions): * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): (WebKit::shouldLeakBoost): Add a new target for the XPC service, and do the paperwork to launch it. * GPUProcess/GPUConnectionToWebProcess.cpp: Added. * GPUProcess/GPUConnectionToWebProcess.h: Added. * GPUProcess/GPUConnectionToWebProcess.messages.in: Added. On the GPU process side, the incoming connection from the Web Content process. * GPUProcess/GPUProcess.cpp: Added. * GPUProcess/GPUProcess.h: Added. * GPUProcess/GPUProcess.messages.in: Added. * GPUProcess/GPUProcessCreationParameters.cpp: Added. * GPUProcess/GPUProcessCreationParameters.h: Added. * GPUProcess/cocoa/GPUProcessCocoa.mm: Added. * GPUProcess/ios/GPUProcessIOS.mm: Added. * GPUProcess/mac/GPUProcessMac.mm: Added. Add the shell of the GPU process. Mostly stolen from the Networking process. * UIProcess/GPU/GPUProcessProxy.cpp: Added. (WebKit::GPUProcessProxy::singleton): (WebKit::GPUProcessProxy::GPUProcessProxy): (WebKit::GPUProcessProxy::~GPUProcessProxy): (WebKit::GPUProcessProxy::getLaunchOptions): (WebKit::GPUProcessProxy::connectionWillOpen): (WebKit::GPUProcessProxy::processWillShutDown): (WebKit::GPUProcessProxy::getGPUProcessConnection): (WebKit::GPUProcessProxy::openGPUProcessConnection): (WebKit::GPUProcessProxy::gpuProcessCrashed): (WebKit::GPUProcessProxy::didReceiveMessage): (WebKit::GPUProcessProxy::didReceiveSyncMessage): (WebKit::GPUProcessProxy::didClose): (WebKit::GPUProcessProxy::didReceiveInvalidMessage): (WebKit::GPUProcessProxy::didFinishLaunching): (WebKit::GPUProcessProxy::updateProcessAssertion): * UIProcess/GPU/GPUProcessProxy.h: Added. * UIProcess/GPU/GPUProcessProxy.messages.in: Added. On the UI process side, the GPUProcessProxy is the singleton that owns the GPU process for the process. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: Added. This sandbox profile is copied from the Web Content process. We will cut it down in the future, but this is a sensible starting point, since the code that is moving to the GPU process is code that currently lives in the Web Content process. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::updateProcessAssertion): Fix a logging typo I stumbled upon. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getGPUProcessConnection): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getGPUProcessConnection): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: Add a message from Web->UI to retrieve the GPU process connection. In the future, we should send this along with the Web Content process initialization message, but this mechanism doesn't exist yet. * WebProcess/GPU/GPUProcessConnection.cpp: Added. (WebKit::GPUProcessConnection::GPUProcessConnection): (WebKit::GPUProcessConnection::~GPUProcessConnection): (WebKit::GPUProcessConnection::didReceiveMessage): (WebKit::GPUProcessConnection::didReceiveSyncMessage): (WebKit::GPUProcessConnection::didClose): (WebKit::GPUProcessConnection::didReceiveInvalidMessage): * WebProcess/GPU/GPUProcessConnection.h: Added. (WebKit::GPUProcessConnection::create): (WebKit::GPUProcessConnection::connection): * WebProcess/GPU/GPUProcessConnection.messages.in: Added. * WebProcess/GPU/GPUProcessConnectionInfo.h: Added. (WebKit::GPUProcessConnectionInfo::identifier): (WebKit::GPUProcessConnectionInfo::releaseIdentifier): (WebKit::GPUProcessConnectionInfo::encode const): (WebKit::GPUProcessConnectionInfo::decode): In the Web Content process, GPUProcessConnection is the process-wide connection to the GPU process. All pages in a given Web Content process use the same connection to talk to the singleton GPU process. * WebProcess/WebProcess.cpp: (WebKit::getGPUProcessConnection): (WebKit::WebProcess::ensureGPUProcessConnection): (WebKit::WebProcess::gpuProcessConnectionClosed): * WebProcess/WebProcess.h: (WebKit::WebProcess::existingGPUProcessConnection): In the Web Content process, make it possible for clients to retrieve the GPU process connection. 2019-12-04 Yury Semikhatsky Web Inspector: allow inspector to pause provisional page load and restore its state https://bugs.webkit.org/show_bug.cgi?id=204170 Reviewed by Devin Rousso. Provisional page loading can be deffered if inspector front-end is connected. This allows to configure inspector backend in the provisional page before load request is sent. If inspector front-end is not connected provisional loading will conitinue exactly as before. Tests: http/tests/inspector/target/pause-on-inline-debugger-statement.html http/tests/inspector/target/provisional-load-cancels-previous-load.html * UIProcess/InspectorTargetProxy.cpp: (WebKit::InspectorTargetProxy::disconnect): * UIProcess/WebPageInspectorController.cpp: (WebKit::WebPageInspectorController::shouldPauseLoading const): (WebKit::WebPageInspectorController::setContinueLoadingCallback): * UIProcess/WebPageInspectorController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): 2019-12-03 Megan Gardner Add disabled highlight API skeleton https://bugs.webkit.org/show_bug.cgi?id=204809 Reviewed by Ryosuke Niwa. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetHighlightAPIEnabled): (WKPreferencesGetHighlightAPIEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2019-12-03 Ryosuke Niwa Replace customJavaScriptUserAgentAsSiteSpecificQuirks with customUserAgentAsSiteSpecificQuirks https://bugs.webkit.org/show_bug.cgi?id=204824 Reviewed by Brent Fulgham. This patch replaces _WKWebsitePolicies's customJavaScriptUserAgentAsSiteSpecificQuirks with customUserAgentAsSiteSpecificQuirks and makes it apply to network requests as well as JS API. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): (WebKit::WebsitePoliciesData::applyToDocumentLoader): * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.cpp: (API::WebsitePolicies::copy const): (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: (-[WKWebpagePreferences _setCustomUserAgentAsSiteSpecificQuirks:]): Renamed from _setCustomJavaScriptUserAgentAsSiteSpecificQuirks. (-[WKWebpagePreferences _customUserAgentAsSiteSpecificQuirks]): Renamed from _customJavaScriptUserAgentAsSiteSpecificQuirks. * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setCustomUserAgentAsSiteSpecificQuirks:]): Renamed from setCustomJavaScriptUserAgentAsSiteSpecificQuirks. (-[_WKWebsitePolicies customUserAgentAsSiteSpecificQuirks]): Renamed from customJavaScriptUserAgentAsSiteSpecificQuirks. 2019-12-03 Andres Gonzalez Focus tracking support in the accessibility isolatedtree. https://bugs.webkit.org/show_bug.cgi?id=204535 Reviewed by Chris Fleizach. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKAccessibilityFocusedObject): 2019-12-03 John Wilander Resource Load Statistics (experimental): Delete non-cookie website data after 7 days of no user interaction https://bugs.webkit.org/show_bug.cgi?id=204779 Reviewed by Alex Christensen. Trackers are continuing to move cross-site tracking IDs into first-party storage. This change ages out script-writable non-cookie website data in alignment with the 7-day cap on client-side cookies. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor const): Now makes use of the set WebCore::FirstPartyWebsiteDataRemovalMode. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const): Now makes use of the set WebCore::FirstPartyWebsiteDataRemovalMode. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: (WebKit::ResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode): (WebKit::ResourceLoadStatisticsStore::firstPartyWebsiteDataRemovalMode const): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setFirstPartyWebsiteDataRemovalModeForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): (WebKit::NetworkSession::recreateResourceLoadStatisticStore): (WebKit::NetworkSession::forwardResourceLoadStatisticsSettings): New convenience function to avoid code duplication in NetworkSession::setResourceLoadStatisticsEnabled() and NetworkSession::forwardResourceLoadStatisticsSettings(). * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Scripts/webkit/messages.py: Makes sure the WebCore::FirstPartyWebsiteDataRemovalMode is found in WebCore/NetworkStorageSession.h. * Shared/WebPreferences.yaml: New experimental feature, off by default. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting): (WKWebsiteDataStoreStatisticsResetToConsistentState): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setFirstPartyWebsiteDataRemovalModeForTesting): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-12-03 Chris Dumez [iOS] Unable to interact with the view after a back swipe until lifting the finger off the screen https://bugs.webkit.org/show_bug.cgi?id=204821 Reviewed by Tim Horton. If you swipe back on iOS and then put your finger on the screen before the view gesture snapshot is taken down, your gestures will not be recognized, even after the snapshot is taken down, until after you lift your finger off the screen and back on. This makes MobileSafari look more unresponsive than it needs to be. To address the issue, disable user interactions for the snapshot view, so that interactions go through to the actual view underneath. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): 2019-12-03 Chris Dumez Use a 3 second timeout for the view gesture snapshot on macOS https://bugs.webkit.org/show_bug.cgi?id=204818 Reviewed by Tim Horton. Use a 3 second timeout for the view gesture snapshot on macOS, for consistency with iOS. It used to be 5 seconds on macOS. * UIProcess/ViewGestureController.cpp: 2019-12-03 Chris Dumez REGRESSION (r252778): ASSERT(!m_networkLoad); in ~SpeculativeLoad() https://bugs.webkit.org/show_bug.cgi?id=204813 Reviewed by Antti Koivisto. After r252778, SpeculativeLoadManager::revalidateSubresource() may delay the revalidation until we receive the response for the main resource. We can hit the assertion in the SpeculativeLoad destructor if a speculative revalidation for the SAME resource gets scheduled while we're waiting for the main resource response. When we eventually receive the main resource response, we would call revalidateSubresource() again, which would create a SpeculativeLoad and try to add it to m_pendingPreloads. Because m_pendingPreloads would already contain a preload for this same resource, the SpeculativeLoad would not get added to the map and it would get destroyed right away, before completing (thus hitting the assert). This unnecessary creation of the SpeculativeLoad is inefficient and it is thus best to avoid it. To address the issue, when we receive the response, we now make sure that m_pendingPreloads does not already contain a preload for this resource before calling revalidateSubresource() again, similarly to what was already done at the beginning of SpeculativeLoadManager::preloadEntry(). No new tests, unknown how to reproduce. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource): 2019-12-03 Eric Carlson Add a runtime setting for media in the GPU process https://bugs.webkit.org/show_bug.cgi?id=204801 Reviewed by Jer Noble. * Shared/WebPreferences.yaml: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2019-12-03 Per Arne Vollan Unreviewed assertion fix for older macOS versions after r253011. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest): * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2019-12-03 Antoine Quint [Web Animations] Add a runtime flag for Web Animations composite operations https://bugs.webkit.org/show_bug.cgi?id=204718 Reviewed by Dean Jackson. * Shared/WebPreferences.yaml: 2019-12-03 Youenn Fablet UserMediaCaptureManager should have independent capture factories https://bugs.webkit.org/show_bug.cgi?id=204786 Reviewed by Eric Carlson. Refactor the code to make UserMediaCaptureManager have 3 different factories. This allows having 3 potential active sources which are used on iOS. We cannot test right now on iOS as audio capture in UIProcess is not yet ready. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::Source): (WebKit::UserMediaCaptureManager::Source::~Source): (WebKit::UserMediaCaptureManager::UserMediaCaptureManager): (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager): (WebKit::UserMediaCaptureManager::initialize): (WebKit::UserMediaCaptureManager::createCaptureSource): (WebKit::UserMediaCaptureManager::AudioFactory::setAudioCapturePageState): (WebKit::UserMediaCaptureManager::VideoFactory::setVideoCapturePageState): (WebKit::UserMediaCaptureManager::setAudioCapturePageState): Deleted. (WebKit::UserMediaCaptureManager::setVideoCapturePageState): Deleted. * WebProcess/cocoa/UserMediaCaptureManager.h: (WebKit::UserMediaCaptureManager::AudioFactory::AudioFactory): (WebKit::UserMediaCaptureManager::VideoFactory::VideoFactory): (WebKit::UserMediaCaptureManager::DisplayFactory::DisplayFactory): 2019-12-03 Chris Dumez PageConfiguration::pluginClient should use a smart pointer https://bugs.webkit.org/show_bug.cgi?id=204780 Reviewed by Anders Carlsson. * WebProcess/WebCoreSupport/WebPlugInClient.cpp: * WebProcess/WebCoreSupport/WebPlugInClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2019-12-03 Chris Dumez PageConfiguration::alternativeTextClient should use a smart pointer https://bugs.webkit.org/show_bug.cgi?id=204777 Reviewed by Anders Carlsson. * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp: (WebKit::WebAlternativeTextClient::pageDestroyed): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2019-12-03 Kate Cheney Activate the SQLite database as an on-by-default feature https://bugs.webkit.org/show_bug.cgi?id=204774 Reviewed by Brent Fulgham. The flag to use the ITP Database backend should be set to true by default. * Shared/WebPreferences.yaml: 2019-12-03 youenn fablet Add support for camera rotation when capturing in UIProcess https://bugs.webkit.org/show_bug.cgi?id=204750 Reviewed by Eric Carlson. Make UserMediaCaptureManagerProxy have an OrientationNotifier. It is updated by each web page of the web process being notified of a device orientation change. Whenever a rotation happens, UIProcess sources are now notified to correctly compute the frame rotations. Covered by existing tests. * UIProcess/API/C/WKPage.cpp: (WKPageSetMockCameraOrientation): * UIProcess/API/C/WKPagePrivate.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::setOrientation): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setOrientationForMediaCapture): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::userMediaCaptureManagerProxy): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::setDeviceOrientation): 2019-12-03 Antti Koivisto [LFC][Integration] Shorten feature flag name https://bugs.webkit.org/show_bug.cgi?id=204788 Reviewed by Sam Weinig. * Shared/WebPreferences.yaml: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2019-12-03 youenn fablet Expose WKWebView API to stop ongoing capture https://bugs.webkit.org/show_bug.cgi?id=204787 Reviewed by Eric Carlson. Covered by API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _stopMediaCapture]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2019-12-03 youenn fablet [Cocoa] Run camera capture in UIProcess by default in layout tests https://bugs.webkit.org/show_bug.cgi?id=204512 Reviewed by Eric Carlson. * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willCreateMediaStream): Do not send sandbox extensions in case capture happens in UIProcess. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::~Source): (WebKit::UserMediaCaptureManager::createCaptureSource): Register/unregister sources as active/unactive sources to the factory. 2019-12-03 Carlos Garcia Campos WebDriver: handle elements of type file in send keys command https://bugs.webkit.org/show_bug.cgi?id=188514 Reviewed by Brian Burg. Add setFilesForInputFileUpload method to Automation. It's like setFilesToSelectForFileUpload, but it works differently, so I'm keeping both to not break safaridriver. The new one simply sends the file list to the web process to be set on the input element, instead of saving the file list, wait for the driver to trigger the open panel, intercept and complete the open panel request and send a dismiss open panel event to the driver. * UIProcess/Automation/Automation.json: Add setFilesForInputFileUpload. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::setFilesForInputFileUpload): Send SetFilesForInputFileUpload message to the web process. * UIProcess/Automation/WebAutomationSession.h: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload): Create a FileList with the received paths and call HTMLInputElement::setFiles() on the given element. * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SetFilesForInputFileUpload message. 2019-12-03 Carlos Garcia Campos WebDriver: most of the clear tests are failing https://bugs.webkit.org/show_bug.cgi?id=180404 Reviewed by Brian Burg. Update the FormElementClear atom to follow the spec. * UIProcess/Automation/atoms/FormElementClear.js: (isEditable): (isResettableElementEmpty): 2019-12-03 Carlos Garcia Campos [PSON] Tooltips from previous page shown on new page https://bugs.webkit.org/show_bug.cgi?id=204735 Reviewed by Chris Dumez. The problem is that WebPage (in the web process) is caching the tooltip text to avoid sending IPC messages when the tooltip didn't change. When a new web process is used for the same web view, the tooltip text doesn't really change (it's always null) until a new one is set. The setToolTip message is always sent right after the MouseDidMoveOverElement, and they both depend on the same hit test result, so we can include the tooltip text as part of the WebHitTestResultData struct passed to MouseDidMoveOverElement and remove the SetToolTip message. Since the UI process is already caching the tooltip, we can simply notify the page client when it changes. * Shared/WebHitTestResultData.cpp: (WebKit::WebHitTestResultData::WebHitTestResultData): Initialize toolTipText. (WebKit::WebHitTestResultData::encode const): Encode toolTipText. (WebKit::WebHitTestResultData::decode): Decode toolTipText. * Shared/WebHitTestResultData.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::mouseDidMoveOverElement): Call setToolTip() after notifying the UI client about the mouse move. (WebKit::WebPageProxy::setToolTip): Return early if tooltip didn't change. (WebKit::WebPageProxy::resetState): Use setToolTip() to ensure the page client is notified about the change. * UIProcess/WebPageProxy.messages.in: Remove SetToolTip message. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::mouseDidMoveOverElement): Pass tooltip text to WebHitTestResultData constructor. * WebProcess/WebCoreSupport/WebChromeClient.h: 2019-12-02 Sihui Liu Cross-thread version StorageQuotaManager https://bugs.webkit.org/show_bug.cgi?id=203971 Reviewed by Chris Dumez. * NetworkProcess/NetworkProcess.cpp: Introduce class SessionStorageQuotaManager to manage all StorageQuotaManagers of the same session. (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::addSessionStorageQuotaManager): (WebKit::NetworkProcess::removeSessionStorageQuotaManager): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::createIDBServer): (WebKit::NetworkProcess::addIndexedDatabaseSession): (WebKit::NetworkProcess::setSessionStorageQuotaManagerIDBRootPath): (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting): (WebKit::NetworkProcess::resetQuota): (WebKit::NetworkProcess::storageQuotaManager): (WebKit::NetworkProcess::initializeStorageQuota): Deleted. (WebKit::NetworkProcess::clearStorageQuota): Deleted. (): Deleted. (WebKit::NetworkProcess::initializeQuotaUsers): Deleted. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::SessionStorageQuotaManager::SessionStorageQuotaManager): (WebKit::NetworkProcess::SessionStorageQuotaManager::defaultQuota const): (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager): (WebKit::NetworkProcess::SessionStorageQuotaManager::existingStorageQuotaManagers): (WebKit::NetworkProcess::SessionStorageQuotaManager::cacheRootPath const): (WebKit::NetworkProcess::SessionStorageQuotaManager::setIDBRootPath): (WebKit::NetworkProcess::SessionStorageQuotaManager::idbRootPath const): (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const): Deleted. (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas): Deleted. (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin): Deleted. * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::getDirectorySize): (WebKit::CacheStorage::Engine::diskUsage): static function to get the disk usage of CacheStorage given CacheStorage root directory. (WebKit::CacheStorage::Engine::requestSpace): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::initializeQuotaUser): Deleted. * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::remove): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::create): (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::~Caches): (WebKit::CacheStorage::Caches::updateSizeFile): (WebKit::CacheStorage::Caches::initializeSize): (WebKit::CacheStorage::Caches::clear): (WebKit::CacheStorage::Caches::requestSpace): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::whenInitialized): Deleted. (WebKit::CacheStorage::Caches::resetSpaceUsed): Deleted. * NetworkProcess/cache/CacheStorageEngineCaches.h: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: Add a cacheStorageDirectory parameter so we know the direcotry of CacheStorage when we start using WebsiteDataStore. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreResetQuota): * UIProcess/API/C/WKWebsiteDataStoreRef.h: Add a C API for reseting quota in TestRunner. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::resetQuota): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): (WebKit::WebsiteDataStore::resetQuota): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-12-02 Per Arne Vollan [iOS] Create sandbox extension for "com.apple.tccd" https://bugs.webkit.org/show_bug.cgi?id=204367 Reviewed by Eric Carlson. When camera or microphone access has been granted by the user, have the UI process create a sandbox extension for "com.apple.tccd", and send it to the WebContent process. Also make sure the extension is created only once for each WebContent process. Add telemetry to the tccd rule in the sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-12-02 Louie Livon-Bemel Add helper methods for description and equality to text manipulation SPI https://bugs.webkit.org/show_bug.cgi?id=204758 Reviewed by Wenson Hsieh. I originally added some category methods to _WKTextManipulationItem and _WKTextManipulationToken within Safari to make working with these classes easier. However it makes more sense to just move these methods into the main class. One method is for checking if two instances are equal (including identifiers) and optionally checking if the content itself is equal. The other methods are for debug descriptions for lldb, and a method to get a description that preserves privacy; when logging the instance, the content of the webpage should be redacted. Tests: Tests are added as API tests. * UIProcess/API/Cocoa/_WKTextManipulationItem.h: - Assume everything is non-null unless otherwise specified. - Allow the identifier to be nil, but not the array of tokens. - Add a method to check the equality to another item, optionally including a check for the content of each token being equal. - Add a -debugDescription method that includes the content of tokens for use in lldb. This NSObject declaration is marked optional, so redeclare it here. - No need to add a -description declaration since it exists on NSObject already. * UIProcess/API/Cocoa/_WKTextManipulationItem.mm: (-[_WKTextManipulationItem isEqual:]): The standard NSObject equality check should call our method with equal content. (-[_WKTextManipulationItem isEqualToTextManipulationItem:includingContentEquality:]): - If the other item is nil, the identifiers aren't equal or the number of tokens are mismatched, these items aren't equal. - Just to be safe, only iterate the smaller of the token arrays so we don't crash. - Check if each token is equal, passing along the `includingContentEquality` parameter. (-[_WKTextManipulationItem description]): The general description should not include the webpage content. (-[_WKTextManipulationItem debugDescription]): Include the webpage content, since this is for lldb. (-[_WKTextManipulationItem _descriptionPreservingPrivacy:]): Include the standard description format, and each token on its own line. If we're including the content then use `token.debugDescription`. * UIProcess/API/Cocoa/_WKTextManipulationToken.h: - Also assume everything is non-null. - Identifier and Content can be nil. - Declare a -debugDescription method. - Declare a method to check equality, with or without the content. * UIProcess/API/Cocoa/_WKTextManipulationToken.mm: (isEqualOrBothNil): Helper that checks equality but considers two nil values to be equal as well. (-[_WKTextManipulationToken isEqual:]): The standard NSObject equality check should call our method with equal content. (-[_WKTextManipulationToken isEqualToTextManipulationToken:includingContentEquality:]): Check that the exclusions are equal, the identifiers are equal (considering two nils to be equal), and the content if necessary. (-[_WKTextManipulationToken description]): (-[_WKTextManipulationToken debugDescription]): (-[_WKTextManipulationToken _descriptionPreservingPrivacy:]): If we're preserving privacy, log the content length rather than the content string itself. 2019-12-02 Wenson Hsieh [iOS] Introduce a gesture recognizer that can be used to defer recognition of other gestures https://bugs.webkit.org/show_bug.cgi?id=204748 Reviewed by Tim Horton. Introduces WKDeferringGestureRecognizer, which is similar to UIKit's _UIRelationshipGestureRecognizer. In a future patch, this will be added to WKContentView to prevent platform gestures (pinching, panning, single/double taps, etc.) from recognizing when dispatching a preventable touch event to the page. Additionally renames a member variable on WKContentView, in preparation for making touch gesture recognition asynchronous. No new tests, since there is no change in behavior yet. * SourcesCocoa.txt: Add the new file. * UIProcess/ios/WKContentViewInteraction.h: Add a couple of (currently unused) deferring gesture recognizers. These will be added to WKContentView in a future patch. There are two deferring gestures here (one for "immediately resettable" gestures and another for gestures for which the reset is "deferred" -- i.e., multi-tap gestures); this prevents a single deferring gesture from connecting the entire gesture subgraph under WKWebView through failure dependencies. This would result in various usability issues, such as being unable to perform a pan gesture to scroll WKScrollView if a tap was recognized within the last 300 ms, since all gestures would need to wait until every double and triple- tap gesture under WKWebView has failed. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView _webTouchEventsRecognized:]): Rename _canSendTouchEventsAsynchronously to _touchEventsCanPreventNativeGestures in preparation for adding a codepath for fully asynchronous touch event dispatch; we also flip the conditional in any places where _canSendTouchEventsAsynchronously was previously set or read. (-[WKContentView _webTouchEvent:preventsNativeGestures:]): (-[WKContentView scrollViewWillStartPanOrPinchGesture]): (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]): (-[WKContentView gestureRecognizer:isInterruptingMomentumScrollingWithEvent:]): (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesWithEvent:]): (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]): Implement WKDeferringGestureRecognizerDelegate. (-[WKContentView shouldIgnoreWebTouch]): Deleted. Drive-by fix: remove this unnecessary method implementation, and the related FIXME. * UIProcess/ios/WKDeferringGestureRecognizer.h: Added. * UIProcess/ios/WKDeferringGestureRecognizer.mm: Added. (-[WKDeferringGestureRecognizer initWithDeferringGestureDelegate:]): (-[WKDeferringGestureRecognizer deferringGestureDelegate]): (-[WKDeferringGestureRecognizer touchesBegan:withEvent:]): Unless the touch is interrupts momentum scrolling, WKDeferringGestureRecognizer should transition to Possible state when starting a touch. Later, -setDefaultPrevented: is invoked, which will either transition the deferring gesture recognizer to Failed state (thereby allowing native gestures to begin), or Ended state (preventing other native gestures). (-[WKDeferringGestureRecognizer touchesCancelled:withEvent:]): (-[WKDeferringGestureRecognizer setDefaultPrevented:]): (-[WKDeferringGestureRecognizer canBePreventedByGestureRecognizer:]): Return NO here to prevent certain platform gestures (e.g. scroll view panning) from causing the deferring gesture to Failed state, when these gestures attempt to transition from Possible to Began state. (-[WKDeferringGestureRecognizer shouldDeferGestureRecognizer:]): * WebKit.xcodeproj/project.pbxproj: 2019-12-02 Yoshiaki Jitsukawa ResponsivenessTimer mistakenly restarts immediately https://bugs.webkit.org/show_bug.cgi?id=204659 Reviewed by Chris Dumez. * UIProcess/ResponsivenessTimer.cpp: (WebKit::ResponsivenessTimer::timerFired): Give startOneShot() a positive number timeout. 2019-12-02 Carlos Garcia Campos [GTK][PSON] Crash in NetworkProcessProxy::openNetworkProcessConnection https://bugs.webkit.org/show_bug.cgi?id=204703 Reviewed by Michael Catanzaro. Stop sending a message to all web process to prefetch DNS for a hostname. All web processes then send a messaage to their network process to prefetch the DNS. Instead, send a message directly to the network process. * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_prefetch_dns): * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: 2019-12-01 Fujii Hironori [Win] Retrieve all following WM_CHAR events at the beginning of processing WM_KEYDOWN event https://bugs.webkit.org/show_bug.cgi?id=204694 Reviewed by Ross Kirsling. In Windows ports, WM_KEYDOWN dispatches keydown event, and WM_CHAR dispatches keypress event. If a keydown event is canceled by calling preventDefault, the following corresponding keypress events shouldn't be dispatched. WebKit1 implemented it by removing WM_CHAR events if the keydown event is consumed. However, WebKit2 can't do so because WebKit2 processes key events asynchronously. Thus, retrieve all following WM_CHAR events, and dispatch them after processing the keydown and if it is not consumed. In addition to that, retrieving following WM_CHAR events is needed to fix Bug 204672 because the events are needed for 'key' property of keydown KeyboardEvent for dead key combination. Gecko and Chromium also implements 'key' property in the same approach. Test: Covered by existing fast/events/inputText-never-fired-on-keydown-cancel.html and fast/events/keydown-keypress-preventDefault.html * Shared/NativeWebKeyboardEvent.h: Added m_pendingCharEvents as Vector. (WebKit::NativeWebKeyboardEvent::pendingCharEvents const): * Shared/win/NativeWebKeyboardEventWin.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): * UIProcess/WebPageProxy.h: * UIProcess/win/WebPageProxyWin.cpp: (WebKit::WebPageProxy::dispatchPendingCharEvents): * UIProcess/win/WebView.cpp: (WebKit::WebView::onKeyEvent): 2019-11-30 Tim Horton Make CompositeOperator and BlendMode encodable https://bugs.webkit.org/show_bug.cgi?id=204722 Reviewed by Eric Carlson. * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::BackingStore::incorporateUpdate): * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::paint): (WebKit::PluginProxy::update): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::drawRect): 2019-11-30 Tim Horton Reimplement some PlatformCALayer methods using GraphicsContext instead of CGContextRef https://bugs.webkit.org/show_bug.cgi?id=204698 Reviewed by Sam Weinig. * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): (WebKit::RemoteLayerBackingStore::enumerateRectsBeingDrawn): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::enumerateRectsBeingDrawn): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: 2019-11-27 Antoine Quint [Web Animations] Enable WebAnimationsCSSIntegrationEnabled by default https://bugs.webkit.org/show_bug.cgi?id=204650 Reviewed by Dean Jackson. * Shared/WebPreferences.yaml: 2019-11-28 Fujii Hironori Remove ENABLE_KEYBOARD_CODE_ATTRIBUTE and ENABLE_KEYBOARD_KEY_ATTRIBUTE macros https://bugs.webkit.org/show_bug.cgi?id=204666 No behavior change. * Configurations/FeatureDefines.xcconfig: * Shared/WebEvent.h: (WebKit::WebKeyboardEvent::unmodifiedText const): (WebKit::WebKeyboardEvent::key const): (WebKit::WebKeyboardEvent::code const): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): (WebKit::WebKeyboardEvent::encode const): (WebKit::WebKeyboardEvent::decode): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::generateSyntheticEditingCommand): 2019-11-27 Philippe Normand [GTK][WebInspector] Use CString to store exported data https://bugs.webkit.org/show_bug.cgi?id=204623 Reviewed by Carlos Garcia Campos. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformSave): Use a CString for copy-on-write assignment. 2019-11-27 Alejandro G. Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.3 release * wpe/NEWS: Add release notes for 2.27.3. 2019-11-27 Carlos Garcia Campos [GTK] WebDriver: moving toplevel windows is not supported under wayland https://bugs.webkit.org/show_bug.cgi?id=204614 Reviewed by Alejandro G. Castro. So we can stop trying and simply ignore the requests to move the window. * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::windowConfigureEventCallback): Ensure we only move or resize when actually required and reduce the time we wait for configure events to 200ms (1 second was too long). 2019-11-26 Antti Koivisto [LFC][Render tree] Add LFC line layout path to RenderBlockFlow https://bugs.webkit.org/show_bug.cgi?id=204613 Reviewed by Zalan Bujtas. * Shared/WebPreferences.yaml: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2019-11-26 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.3 release * gtk/NEWS: Add release notes for 2.27.3. 2019-11-26 Carlos Garcia Campos REGRESSION(2.27.2): [GTK] Incognito mode is broken under flatpak https://bugs.webkit.org/show_bug.cgi?id=203460 Reviewed by Youenn Fablet. The problem is that in ephemeral sessions the base disk cache directory is null, and Storage::open() ends up building a cache path with only the version part (/Version n). For some reason g_mkdir_with_parents() doesn't return -1 in flatpak when it fails to create the directory due to write permission, like in this case. But the network process ends up crashing later trying to open a directory that doesn't exist. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): Do not create the cache if networkCacheDirectory is null. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::open): Add an ASSERT to ensure we don't receive a null baseCachePath. 2019-11-25 Yusuke Suzuki [JSC] InternalFunction should be non-destructible https://bugs.webkit.org/show_bug.cgi?id=204556 Reviewed by Mark Lam. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::JSNPMethod::subspaceForImpl): 2019-11-25 Wenson Hsieh [macOS] Dragged images are only available as .tiff when dropping onto macCatalyst apps https://bugs.webkit.org/show_bug.cgi?id=204598 Reviewed by Tim Horton. On macOS, writing dragged images to the pasteboard only as file promises is mostly sufficient for the purposes of dropping into Finder, Photos, and other apps. However, when dropping into a macCatalyst app, the contents of NSPasteboard will only contain a file URL, which most Catalyst apps aren't able to handle. The only other valid image representation that is written to the pasteboard in this case is "public.tiff", which loses fidelity in the case of animated GIFs. Instead, if the dragged image has a corresponding UTI and corresponding decoded image data, declare the UTI when writing promised data to the pasteboard, and later provide data for the UTI, if the drop destination asks, by using the promised image's data. Test: DragAndDropTests.ProvideImageDataAsTypeIdentifiers * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setPromisedDataForImage): (WebKit::WebViewImpl::provideDataForPasteboard): 2019-11-25 Fujii Hironori [Win] Update KeyboardEvent as per the latest specification https://bugs.webkit.org/show_bug.cgi?id=202183 Reviewed by Ross Kirsling. * Shared/WebEvent.h: * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): * Shared/win/WebEventFactory.cpp: (WebKit::windowsKeyNames): (WebKit::WebEventFactory::createWebKeyboardEvent): 2019-11-25 ChangSeok Oh [GTK] Check EGL image extension by using native gl API in AcceleratedBackingStoreWayland https://bugs.webkit.org/show_bug.cgi?id=204446 Reviewed by Carlos Garcia Campos. This change is part of efforts bringing ANGLE backend for WebGL to the gtk port. When ANGLE WebGL is enabled, we face a dilemma of choosing either Extensions3DANGLE or Extensions3DOpenGL in AcceleratedBackingStoreWayland.cpp. Since they cannot coexist, we chose Extensions3DANGLE even if what we really want is Extensions3DOepnGL. We address this problem by directly checking egl image extension availability via native GL API rather than relying on Extensions3D* classes in the file. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::isEGLImageAvailable): (WebKit::AcceleratedBackingStoreWayland::checkRequirements): 2019-11-25 Youenn Fablet Crash in WebCore::ServiceWorkerRegistrationKey::hash() const https://bugs.webkit.org/show_bug.cgi?id=204497 Reviewed by Alex Christensen. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::scheduleJobInServer): Add a release assert to be able to further debug the crash. 2019-11-23 John Wilander Resource Load Statistics: Allow multiple third-party cookie blocking settings https://bugs.webkit.org/show_bug.cgi?id=204389 Reviewed by Brent Fulgham. This change make the third-party cookie blocking setting go from a boolean to the new enum WebCore::ThirdPartyCookieBlockingMode with three different settings. Functions and member variables are renamed accordingly. The reason for supporting three different modes is that what is now named OnlyAccordingToPerDomainPolicy is shipping, AllOnSitesWithoutUserInteraction is in beta, and All is behind an experimental flag. The change also updates the test API to map the TestRunner call to the enum. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction): Now makes use of a completion handler and updates the cookie blocking state. (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::areAllThirdPartyCookiesBlockedUnder): New convenience function to check the cookie blocking status per first-party domain. (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess): Restructured the code to make it very clear that the logic is the same as the corresponding function in ResourceLoadStatisticsMemoryStore. Can no longer be const since it calls areAllThirdPartyCookiesBlockedUnder() which in turn calls hasHadUserInteraction() and that function may clear user interaction data. (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess const): Deleted. See comment above on the non-const version of this function. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::areAllThirdPartyCookiesBlockedUnder): New convenience function to check the cookie blocking status per first-party domain. (WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess): Restructured the code to make it very clear that the logic is the same as the corresponding function in ResourceLoadStatisticsDatabaseStore. Can no longer be const since it calls areAllThirdPartyCookiesBlockedUnder() which in turn calls hasHadUserInteraction() and that function may clear user interaction data. (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess): (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess): (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction): Now makes use of a completion handler and updates the cookie blocking state. (WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess const): Deleted. See comment above on the non-const version of this function. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: (WebKit::ResourceLoadStatisticsStore::setThirdPartyCookieBlockingMode): (WebKit::ResourceLoadStatisticsStore::thirdPartyCookieBlockingMode const): (WebKit::ResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled): Deleted. (WebKit::ResourceLoadStatisticsStore::isThirdPartyCookieBlockingEnabled const): Deleted. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setThirdPartyCookieBlockingMode): (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): Now forwards the completion handler. (WebKit::WebResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled): Deleted. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: The SetShouldBlockThirdPartyCookiesForTesting message now uses an enum instead of a boolean. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): Now forwards the enum value instead of a boolean. (WebKit::NetworkSession::recreateResourceLoadStatisticStore): Now makes sure the cookie blocking setting is forwarded to the recreated store. (WebKit::NetworkSession::setThirdPartyCookieBlockingMode): (WebKit::NetworkSession::setIsThirdPartyCookieBlockingEnabled): Deleted. * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): Support for the new enum. * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Scripts/webkit/messages.py: Tells the IPC code generator where to find WebCore::ThirdPartyCookieBlockingMode. * Shared/WebPreferences.yaml: Flipped the IsThirdPartyCookieBlockingEnabled flag to on by default. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting): (WKWebsiteDataStoreStatisticsResetToConsistentState): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Makes use of the enum in the NetworkSessionCreationParameters. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-11-23 Commit Queue Unreviewed, rolling out r252805. https://bugs.webkit.org/show_bug.cgi?id=204553 Caused test failures and ASan crashes (Requested by ap on #webkit). Reverted changeset: "Cross-thread version StorageQuotaManager" https://bugs.webkit.org/show_bug.cgi?id=203971 https://trac.webkit.org/changeset/252805 2019-11-22 Alex Christensen Unreviewed, rolling out r252796. Turns out my reverting earlier today wasn't so necessary after all. This is effectively re-landing r250422. Reverted changeset: "Revert r250422" https://bugs.webkit.org/show_bug.cgi?id=202285 https://trac.webkit.org/changeset/252796 2019-11-22 Alex Christensen Unreviewed, rolling out r252798. Turns out my reverting earlier today wasn't so necessary after all. This is effectively re-landing r250421. Reverted changeset: "Revert r250421" https://bugs.webkit.org/show_bug.cgi?id=202290 https://trac.webkit.org/changeset/252798 2019-11-22 Kate Cheney ITP Database crashes if table schema is not correct https://bugs.webkit.org/show_bug.cgi?id=204458 Reviewed by Brent Fulgham. ITP database was crashing if the table schema wasn't correct. This should instead be handled by re-opening a new database with a correct schema to allow for future schema updates. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::isCorrectTableSchema): (WebKit::ResourceLoadStatisticsDatabaseStore::openAndDropOldDatabaseIfNecessary): * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: 2019-11-22 Chris Dumez Simplify VisitedLinkStore process registration logic https://bugs.webkit.org/show_bug.cgi?id=204472 Reviewed by Geoffrey Garen. Simplify VisitedLinkStore process registration logic: 1. WebProcessProxy objects no longer delay their registration with the VisitedLinkStore until after they are done launching. There is no need to do this because AuxiliaxyProcessProxy::send() will correctly queue the IPC message if the process is not done launching when the VisitedLinkStore tries to send its IPC. 2. Switch VisitedLinkStore to using a WeakHashSet to store the WebProcessProxy object pointers. This is safer and this also makes it so that the WebProcessProxy no longer need to unregister themselves when shutting down. Note that AuxiliaxyProcessProxy::send() properly discards IPC messages to a terminated process anyway. * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::~VisitedLinkStore): (WebKit::VisitedLinkStore::addProcess): (WebKit::VisitedLinkStore::removeProcess): (WebKit::VisitedLinkStore::removeAll): (WebKit::VisitedLinkStore::didInvalidateSharedMemory): (WebKit::VisitedLinkStore::didUpdateSharedStringHashes): * UIProcess/VisitedLinkStore.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shutDown): (WebKit::WebProcessProxy::addVisitedLinkStoreUser): (WebKit::WebProcessProxy::didFinishLaunching): 2019-11-22 Chris Dumez [iOS] Copy assertions before iterating over them in _notifyAssertionsOfImminentSuspension https://bugs.webkit.org/show_bug.cgi?id=204524 Reviewed by Alexey Proskuryakov. Copy assertions before iterating over them in _notifyAssertionsOfImminentSuspension and use WeakPtr to make sure the assertions are still alive before calling uiAssertionWillExpireImminently() on them. It is common for process assertions to get released when uiAssertionWillExpireImminently() gets called, which would remove them from the _assertionsNeedingBackgroundTask vector we were iterating on. * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]): 2019-11-22 Alex Christensen Null check callback in NetworkConnectionToWebProcess::didDeliverMessagePortMessages https://bugs.webkit.org/show_bug.cgi?id=204460 Reviewed by Chris Dumez. When the network process crashes during a message port connection establishment, a web process may have an identifier that becomes stale. In this case, we should not crash again. No test because this only happens during a rare race condition after a network process crash, but the radar shows records of this happening. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didDeliverMessagePortMessages): 2019-11-22 Sihui Liu Cross-thread version StorageQuotaManager https://bugs.webkit.org/show_bug.cgi?id=203971 Reviewed by Chris Dumez. * NetworkProcess/NetworkProcess.cpp: Introduce class SessionStorageQuotaManager to manage all StorageQuotaManagers of the same session. (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::addSessionStorageQuotaManager): (WebKit::NetworkProcess::removeSessionStorageQuotaManager): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::createIDBServer): (WebKit::NetworkProcess::addIndexedDatabaseSession): (WebKit::NetworkProcess::setSessionStorageQuotaManagerIDBRootPath): (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting): (WebKit::NetworkProcess::resetQuota): (WebKit::NetworkProcess::storageQuotaManager): (WebKit::NetworkProcess::initializeStorageQuota): Deleted. (WebKit::NetworkProcess::clearStorageQuota): Deleted. (): Deleted. (WebKit::NetworkProcess::initializeQuotaUsers): Deleted. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::SessionStorageQuotaManager::SessionStorageQuotaManager): (WebKit::NetworkProcess::SessionStorageQuotaManager::defaultQuota const): (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager): (WebKit::NetworkProcess::SessionStorageQuotaManager::existingStorageQuotaManagers): (WebKit::NetworkProcess::SessionStorageQuotaManager::cacheRootPath const): (WebKit::NetworkProcess::SessionStorageQuotaManager::setIDBRootPath): (WebKit::NetworkProcess::SessionStorageQuotaManager::idbRootPath const): (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const): Deleted. (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas): Deleted. (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin): Deleted. * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::getDirectorySize): (WebKit::CacheStorage::Engine::diskUsage): static function to get the disk usage of CacheStorage given CacheStorage root directory. (WebKit::CacheStorage::Engine::requestSpace): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::initializeQuotaUser): Deleted. * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::remove): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::create): (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::~Caches): (WebKit::CacheStorage::Caches::updateSizeFile): (WebKit::CacheStorage::Caches::initializeSize): (WebKit::CacheStorage::Caches::clear): (WebKit::CacheStorage::Caches::requestSpace): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::whenInitialized): Deleted. (WebKit::CacheStorage::Caches::resetSpaceUsed): Deleted. * NetworkProcess/cache/CacheStorageEngineCaches.h: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: Add a cacheStorageDirectory parameter so we know the direcotry of CacheStorage when we start using WebsiteDataStore. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreResetQuota): * UIProcess/API/C/WKWebsiteDataStoreRef.h: Add a C API for reseting quota in TestRunner. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::resetQuota): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): (WebKit::WebsiteDataStore::resetQuota): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-11-22 Alex Christensen Revert r250421 https://bugs.webkit.org/show_bug.cgi?id=202290 This is needed for rdar://problem/56760896 I left the soup parts of the original change untouched, which leaves speculative validation on for soup ports. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContext.cpp: (WKContextSetDiskCacheSpeculativeValidationEnabled): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration diskCacheSpeculativeValidationEnabled]): (-[_WKProcessPoolConfiguration setDiskCacheSpeculativeValidationEnabled:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2019-11-22 Alex Christensen Revert r250422 https://bugs.webkit.org/show_bug.cgi?id=202285 This is needed for rdar://problem/56760896 * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation const): * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): * UIProcess/API/C/WKContext.cpp: (WKContextSetCanHandleHTTPSServerTrustEvaluation): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation): * UIProcess/WebProcessPool.h: 2019-11-22 Conrad Shultz Remove -[_WKThumbnailView usesSnapshot/setUsesSnapshot:] https://bugs.webkit.org/show_bug.cgi?id=150099 Reviewed by Tim Horton. Remove some unused, no-op SPI. While we're here, remove a couple unneeded explicit property syntheses. * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView setUsesSnapshot:]): Deleted. (-[_WKThumbnailView usesSnapshot]): Deleted. 2019-11-22 Chris Dumez Speculative loading sometimes happens too early and is missing login cookies https://bugs.webkit.org/show_bug.cgi?id=204305 Reviewed by Antti Koivisto. Speculative loads were issued before receiving the response from the main resource. However, the main resource may set important cookies that are thus missing from the speculative requests. To address the issue we now delay speculative loads for first-party subresources until we've received the response from the main resource. To avoid regressing PLT, we still warm up the first-party subresources from disk right away and preconnect to the server. No new tests, extended existing test. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didReceiveMainResourceResponse): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::didReceiveMainResourceResponse const): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::markMainResourceResponseAsReceived): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::addPostMainResourceResponseTask): (WebKit::NetworkCache::SpeculativeLoadManager::shouldRegisterLoad): (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad): (WebKit::NetworkCache::SpeculativeLoadManager::registerMainResourceLoadResponse): (WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource): (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h: * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: (WebKit::NetworkCache::SubresourceInfo::isFirstParty const): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h: 2019-11-22 Carlos Garcia Campos [GTK][WPE] RemoteInspector: use sockets instead of DBus https://bugs.webkit.org/show_bug.cgi?id=204503 Reviewed by Žan Doberšek. Use GSockets API instead of DBus. * Platform/IPC/Connection.h: * SourcesGTK.txt: Remove GSocketMonitor that has been moved to WTF. * SourcesWPE.txt: Ditto. * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::RemoteInspectorClient): (WebKit::RemoteInspectorClient::~RemoteInspectorClient): (WebKit::RemoteInspectorClient::setupConnection): (WebKit::RemoteInspectorClient::connectionDidClose): (WebKit::RemoteInspectorClient::inspect): (WebKit::RemoteInspectorClient::sendMessageToBackend): (WebKit::RemoteInspectorClient::closeFromFrontend): * UIProcess/glib/RemoteInspectorClient.h: 2019-11-21 Jer Noble Experimental support for HDR media query https://bugs.webkit.org/show_bug.cgi?id=204422 Reviewed by Eric Carlson. Notify the WebContent process of updated screen properties when the screen's color space changes. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (-[WKWindowVisibilityObserver startObserving:]): (-[WKWindowVisibilityObserver stopObserving:]): (-[WKWindowVisibilityObserver _screenDidChangeColorSpace:]): (WebKit::WebViewImpl::screenDidChangeColorSpace): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::screenPropertiesDidChange): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setScreenProperties): 2019-11-21 Brian Burg Unreviewed, sort WebKit's project file after changes in r252702 and r252637. * WebKit.xcodeproj/project.pbxproj: 2019-11-21 Sihui Liu Crash in com.apple.WebKit.WebContent at WebKit: WebKit::StorageAreaMap::loadValuesIfNeeded https://bugs.webkit.org/show_bug.cgi?id=204459 Reviewed by Geoffrey Garen. If m_storageMapID can be null if connect() fails. * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::setItem): (WebKit::StorageAreaMap::removeItem): (WebKit::StorageAreaMap::clear): (WebKit::StorageAreaMap::loadValuesIfNeeded): 2019-11-21 Peng Liu Ignore the requests to enter/exit video fullscreen/picture-in-picture if the requesting mode is the same as the current mode https://bugs.webkit.org/show_bug.cgi?id=204461 Reviewed by Jer Noble. In enterVideoFullscreenForVideoElement() and exitVideoFullscreenForVideoElement(), we can ignore the request if the targeting mode is the same as the current one. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement): 2019-11-20 ChangSeok Oh [GTK] Add ANGLE backend to GTK port https://bugs.webkit.org/show_bug.cgi?id=199060 Reviewed by Žan Doberšek. * UIProcess/API/glib/WebKitProtocolHandler.cpp: Extention3DANGLE is used instead where ANGLE for WebGL is enabled. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: Append gl extensions for ANGLE. (WebKit::AcceleratedBackingStoreWayland::checkRequirements): 2019-11-20 Chris Dumez [iOS] Make sure WebContent process does not get suspended while it is holding a process assertion for the UIProcess https://bugs.webkit.org/show_bug.cgi?id=204418 Reviewed by Jer Noble. Make sure WebContent process does not get suspended while it is holding a process assertion for the UIProcess. We see this happening in sysdiagnoses, and it means the system ends up killing the WebContent process because it leaked a process assertion. * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): (WebKit::WebProcess::releaseProcessWasResumedAssertions): 2019-11-19 Brian Burg [Cocoa] Add _WKRemoteWebInspectorViewController SPI to set diagnostic logging delegate https://bugs.webkit.org/show_bug.cgi?id=204371 Reviewed by Devin Rousso. * UIProcess/WebInspectorProxy.h: * UIProcess/RemoteWebInspectorProxy.h: * UIProcess/RemoteWebInspectorProxy.cpp: (WebKit::RemoteWebInspectorProxy::setDiagnosticLoggingAvailable): Hook up the plumbing to forward this state change to the frontend. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewControllerPrivate.h: Added. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (-[_WKRemoteWebInspectorViewController _setDiagnosticLoggingDelegate:]): Add new SPI to set the diagnostic logging delegate. This is preferable to directly setting the delegate on the inspector WKWebView (via .webView._diagnosticLoggingDelegate), because the controller can notify the frontend that diagnostic logging is now available. * WebKit.xcodeproj/project.pbxproj: Add new header file and make it private. * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::setDiagnosticLoggingAvailable): Cache this value and use it for InspectorFrontendClient::diagnosticLoggingAvailable(). * WebProcess/WebPage/RemoteWebInspectorUI.messages.in: * WebProcess/WebPage/RemoteWebInspectorUI.h: * WebProcess/WebPage/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::setDiagnosticLoggingAvailable): Duplicate what is done for the local case. 2019-11-20 Jer Noble HTML5 audio .ended event not fired when app in background or phone screen is off https://bugs.webkit.org/show_bug.cgi?id=173332 Reviewed by Eric Carlson. When a WebPage goes from audible to inaudible, allow a short grace period before removing the activity token, to give the page a chance to (e.g.) move to the next item in a playlist before the process is suspended when in the background. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::updateThrottleState): (WebKit::WebPageProxy::clearAudibleActivity): * UIProcess/WebPageProxy.h: 2019-11-19 Chris Dumez Unreviewed, fix webkitpy failures after r252655. * Scripts/webkit/LegacyMessageReceiver-expected.cpp: (WebKit::WebPage::didReceiveWebPageMessage): (WebKit::WebPage::didReceiveSyncWebPageMessage): * Scripts/webkit/MessageReceiver-expected.cpp: (WebKit::WebPage::didReceiveMessage): (WebKit::WebPage::didReceiveSyncMessage): * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: (WebKit::WebPage::didReceiveMessage): (WebKit::WebPage::didReceiveSyncMessage): 2019-11-19 Chris Dumez Unreviewed mac catalyst build fix after r252655. * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.messages.in: 2019-11-19 Ross Kirsling Unreviewed non-unified build fixes. * WebProcess/WebPage/FindController.cpp: * WebProcess/WebPage/FindController.h: 2019-11-19 Chris Dumez Protect MessageReceivers when possible while they are processing incoming IPC messages https://bugs.webkit.org/show_bug.cgi?id=204377 Reviewed by Brady Eidson. Protect MessageReceiver while they are processing incoming IPC messages for extra safety. It is a common mistake to call client delegates as a result of an IPC, and failing to protect |this| while doing so. Client code can destroy |this| and we end up crashing. For MessageReceivers that are not RefCounted, they can use the "NotRefCounted" attribute in their messages.in file to opt out. * NetworkProcess/Cookies/WebCookieManager.messages.in: * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.messages.in: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * NetworkProcess/NetworkContentRuleListManager.messages.in: * NetworkProcess/NetworkSocketChannel.messages.in: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in: * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in: * NetworkProcess/webrtc/NetworkRTCSocket.messages.in: * PluginProcess/PluginControllerProxy.messages.in: * PluginProcess/PluginProcess.messages.in: * Scripts/webkit/messages.py: * Shared/API/Cocoa/RemoteObjectRegistry.messages.in: * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: * Shared/Authentication/AuthenticationManager.messages.in: * Shared/AuxiliaryProcess.messages.in: * Shared/Plugins/NPObjectMessageReceiver.messages.in: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * UIProcess/DrawingAreaProxy.messages.in: * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.messages.in: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/ViewGestureController.messages.in: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: * UIProcess/WebFullScreenManagerProxy.messages.in: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/ios/SmartMagnificationController.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: * WebProcess/Geolocation/WebGeolocationManager.messages.in: * WebProcess/Network/webrtc/WebMDNSRegister.messages.in: * WebProcess/Network/webrtc/WebRTCMonitor.messages.in: * WebProcess/Network/webrtc/WebRTCResolver.messages.in: * WebProcess/Network/webrtc/WebRTCSocket.messages.in: * WebProcess/Notifications/WebNotificationManager.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/ViewGestureGeometryCollector.messages.in: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.messages.in: 2019-11-19 Per Arne Vollan [iOS] Fix sysctl-read sandbox violation https://bugs.webkit.org/show_bug.cgi?id=204358 Reviewed by Brent Fulgham. The WebContent sandbox should allow sysctl-read of "kern.hostname", "kern.osrelease", and "kern.version". * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-19 John Wilander Resource Load Statistics: Count third-party script loads under top frame https://bugs.webkit.org/show_bug.cgi?id=204262 Reviewed by Alex Christensen. Third-party scripts running in the first-party context are a significant privacy and security risk. This change captures the number of such script loads which will allow ITP to take action. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): (WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices): (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema): (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships): (WebKit::ResourceLoadStatisticsDatabaseStore::getSubStatisticStatement): Addition of the new category TopFrameLoadedThirdPartyScripts. (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString): Removed the lastSeen output since it may differ between test runs. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: Bumped statisticsModelVersion to 17. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Encoding and decoding of the new category topFrameLoadedThirdPartyScripts. * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp: (WebKit::WebResourceLoadObserver::logSubresourceLoading): Now takes an additional enum parameter FetchDestinationIsScriptLike which is used to detect third-party script-like loads (script, worker, or service worker) from third-parties. If one is detected, it is stored in the new topFrameLoadedThirdPartyScripts category. * WebProcess/WebCoreSupport/WebResourceLoadObserver.h: 2019-11-19 Brian Burg [Cocoa] Add _WKInspector SPI to set diagnostic logging delegate for a local Web Inspector https://bugs.webkit.org/show_bug.cgi?id=204323 Reviewed by Devin Rousso. Testing this end-to-end isn't quite possible yet because WebInspectorUI does not yet send any dummy diagnostic events that we can use for testing purposes. * WebKit.xcodeproj/project.pbxproj: * UIProcess/API/Cocoa/_WKInspectorInternal.h: Fix include. * UIProcess/API/Cocoa/_WKInspectorPrivate.h: Added. * UIProcess/API/Cocoa/_WKInspector.mm: Fix include. (-[_WKInspector _setDiagnosticLoggingDelegate:]): Allow clients to set the diagnosticLoggingDelegate directly on _WKInspector. The implementation forwards this setter to the Inspector's WKWebView and notifies the frontend that diagnostic logging availability did change. * UIProcess/WebInspectorProxy.h: * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::setDiagnosticLoggingAvailable): Plumbing. * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::setDiagnosticLoggingAvailable): * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebInspectorUI.messages.in: More plumbing. 2019-11-19 Chris Dumez Make sendWithAsyncReply() safe to call from any thread https://bugs.webkit.org/show_bug.cgi?id=204355 Reviewed by Alex Christensen. Make sendWithAsyncReply() safe to call from any thread, similarly to the regular send(). Also start using it in WebProcess::processTaskStateDidChange() now that it is safe. * Platform/IPC/Connection.cpp: (IPC::asyncReplyHandlerMapLock): (IPC::asyncReplyHandlerMap): (IPC::nextAsyncReplyHandlerID): (IPC::addAsyncReplyHandler): (IPC::clearAsyncReplyHandlers): (IPC::CompletionHandler const): Deleted. (WebKit::WebProcessProxy::WeakOrStrongPtr::operator* const): Deleted. (WebKit::WebProcessProxy::WeakOrStrongPtr::operator bool const): Deleted. (WebKit::WebProcessProxy::WeakOrStrongPtr::updateStrongReference): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): (WebKit::WebProcess::parentProcessDidHandleProcessWasResumed): Deleted. 2019-11-19 Megan Gardner Unreviwed build fix for older bots. * Platform/spi/ios/UIKitSPI.h: 2019-11-19 Brian Burg [Cocoa] Add WKUIDelegate SPI to inform clients when a _WKInspector attaches to a WKWebView https://bugs.webkit.org/show_bug.cgi?id=204300 Reviewed by Devin Rousso. Add a new UI delegate method to notify clients when local Web Inspector is about to be loaded. This can be triggered by -[_WKInspector show] in the Cocoa API, or via the WebCore-controlled Inspect context menu item. The client can then configure Web Inspector using delegates or by setting _WKInspector properties. Covered by new API test WebKit.DidNotifyWhenInspectorAttached. * UIProcess/API/APIUIClient.h: (API::UIClient::didAttachInspector): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didAttachInspector): * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::openLocalInspectorFrontend): 2019-11-18 John Wilander Check if ITP is on before applying third-party cookie blocking https://bugs.webkit.org/show_bug.cgi?id=204322 Reviewed by Chris Dumez and Alexey Proskuryakov. This change makes sure WebCore::NetworkStorageSession knows whether ITP is on or off and checks that first thing in WebCore::NetworkStorageSession::shouldBlockCookies(). This check was never needed before since if ITP was off, there would be no classified domains and thus the function would always return false. However, https://trac.webkit.org/changeset/251353/webkit introduced full third-party cookie blocking for websites without user interaction and that rule is checked before checking domain classification. The effect was unconditional third-party cookie blocking if ITP is off. This changes fixes that bug. Note that this patch already landed as branch-specific in https://trac.webkit.org/changeset/252549/webkit * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): Now tells WebCore::NetworkStorageSession the status of ITP. 2019-11-18 David Kilzer IPC::Decoder should use nullptr as invalid value Reviewed by Brent Fulgham. Covered by existing tests. * Platform/IPC/Decoder.cpp: (IPC::alignedBufferIsLargeEnoughToContain): Add bufferStart parameter to add beginning bounds check now that m_bufferPos uses nullptr for an invalid value. (IPC::Decoder::alignBufferPosition): Update to pass m_buffer to IPC::alignedBufferIsLargeEnoughToContain(). (IPC::Decoder::bufferIsLargeEnoughToContain const): Ditto. * Platform/IPC/Decoder.h: (IPC::Decoder::isInvalid const): Add beginning bounds check now that m_bufferPos uses nullptr for an invalid value. (IPC::Decoder::markInvalid): Make nullptr the invalid value for m_bufferPos. 2019-11-18 Andres Gonzalez Run AccessibilityController::rootElement on secondary thread to simulate HIServices during LayoutTests. https://bugs.webkit.org/show_bug.cgi?id=204226 Reviewed by Chris Fleizach. Added WKAccessibilityCanUseSecondaryAXThread to support WTR::AccessibilityController spawning of a secondary thread to simulate execution of isolated tree code. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKAccessibilityCanUseSecondaryAXThread): * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: 2019-11-18 Chris Dumez Promote main thread assertions related to sendWithAsyncReply() to be release assertions https://bugs.webkit.org/show_bug.cgi?id=204298 Reviewed by Wenson Hsieh. Promote main thread assertions related to sendWithAsyncReply() to be release assertions, to help identify threading bugs such as . * Platform/IPC/Connection.cpp: (IPC::addAsyncReplyHandler): (IPC::clearAsyncReplyHandlers): (IPC::CompletionHandler Fix assertion in layout test after r252492. https://bugs.webkit.org/show_bug.cgi?id=204199 There is still a case in a test where there is no frame identifier, so keep the status quo. This is a partial revert of r252492. This fixes layout test http/tests/navigation/window-open-redirect-and-remove-opener.html * Shared/FrameInfoData.cpp: (WebKit::FrameInfoData::decode): * Shared/FrameInfoData.h: * UIProcess/API/APIFrameInfo.cpp: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::createNewPage): 2019-11-18 Alex Christensen Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available https://bugs.webkit.org/show_bug.cgi?id=204159 Reviewed by Darin Adler. * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController _EVOrganizationName]): 2019-11-18 Darin Adler WKWebView.mediaType is nullable, not null_resettable https://bugs.webkit.org/show_bug.cgi?id=204297 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.h: Use nullable for mediaType since this property returns a null value when the media type is not being overridden. 2019-11-18 Carlos Garcia Campos Automation: scrollIntoView should do nothing if element is visible https://bugs.webkit.org/show_bug.cgi?id=204194 Reviewed by Carlos Alberto Lopez Perez. "To scroll into view an element perform the following steps only if the element is not already in view" https://w3c.github.io/webdriver/#dfn-scrolls-into-view Fixes: imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[9] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[8] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[7] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[6] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[5] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[4] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[3] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[2] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[1] * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::computeElementLayout): Use scrollIntoViewIfNotVisible instead of scrollIntoViewIfNeeded. 2019-11-17 Alexey Proskuryakov Better build fix attempt after r252434. We do need this variant, it was a mistake to claim that it's "old". * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm: (WebKit::decidePolicyForGeolocationRequestFromOrigin): 2019-11-17 Alexey Proskuryakov Build fix attempt after r252434. This variant of decidePolicyForGeolocationRequestFromOrigin doesn't exist in UIKit. Removing dead code, but someone needs to take a look at what the original intent here was. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm: (WebKit::decidePolicyForGeolocationRequestFromOrigin): 2019-11-16 Wenson Hsieh REGRESSION (r243606): Interacting with date and time pickers hangs the UI process on watchOS https://bugs.webkit.org/show_bug.cgi?id=204280 Reviewed by Chris Dumez. After r243606, interacting with date and time inputs on watchOS hangs the UI process indefinitely while attempting to create an input peripheral (WKFormInputControl) for the date or time picker. This is because, in the process of setting up a new WKDateTimePicker, we call into +[UIKeyboard defaultSizeForInterfaceOrientation:] which hangs when attempting to fetch the current UIKit keyboard layout type. To address this, we simply avoid setting _inputPeripheral on watchOS, as we did prior to r243606. Covered by the existing layout test fast/forms/watchos/time-picker-value-change.html, which currently times out. * UIProcess/ios/WKContentViewInteraction.mm: (createInputPeripheralWithView): 2019-11-16 Wenson Hsieh [iOS] [UIWKDocumentContext] Add the ability to request all marked text rects https://bugs.webkit.org/show_bug.cgi?id=204278 Reviewed by Tim Horton. Add support for a new UIWKDocumentRequest option to request character rects for each character in the marked text range. Unless UIWKDocumentRequestRects is additionally specified (in which case we'll return rects for every single character in the editable root anyways), this option will ensure that all characters in the composition range (which should match -[UIWKDocumentContext markedTextRange]) will have known character rects that can be retrieved using -[UIWKDocumentContext enumerateLayoutRects:] (or one of the other helper methods that utilize -enumerateLayoutRects:). Test: WebKit.DocumentEditingContextWithMarkedText * Platform/spi/ios/UIKitSPI.h: Add a staging declaration for the new option. * Shared/DocumentEditingContext.h: * UIProcess/ios/WKContentViewInteraction.mm: (toWebDocumentRequestOptions): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDocumentEditingContext): Refactor logic that uses CharacterIterator to find rects for each character range into a lambda function, and use this lambda function to handle UIWKDocumentRequestRects and the new UIWKDocumentRequestMarkedTextRects. The marked text range is relative to the start of the context before the selection. 2019-11-15 Eric Carlson Don't use AVCapture on watchOS and tvOS https://bugs.webkit.org/show_bug.cgi?id=204254 Reviewed by Youenn Fablet. * Configurations/FeatureDefines.xcconfig: 2019-11-15 Myles C. Maxfield [Apple] Enable variation fonts on all Apple platforms https://bugs.webkit.org/show_bug.cgi?id=198100 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2019-11-15 Chris Dumez Add more release logging for network load restarts https://bugs.webkit.org/show_bug.cgi?id=204234 Reviewed by Youenn Fablet. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::restartNetworkLoad): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): 2019-11-15 Per Arne Vollan [iOS] Fix sysctl-read sandbox violation https://bugs.webkit.org/show_bug.cgi?id=204238 Reviewed by Brent Fulgham. There is missing a rule for reading a specific sysctl property in the WebContent process on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-15 Benjamin Nham Add SPI to clear web process cache https://bugs.webkit.org/show_bug.cgi?id=204210 Reviewed by Chris Dumez. This adds an SPI to clear cached web processes. The intended use case is to add a lukewarm mode to Mac PLT5 in which web pages load in a new WebProcess and load resources from the disk cache. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _clearWebProcessCache]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: (-[WKProcessPool _clearWebProcessCache]): 2019-11-15 Per Arne Vollan [iOS] Fix sandbox violation in the WebContent process related to WebRTC audio captures https://bugs.webkit.org/show_bug.cgi?id=204240 Reviewed by Brent Fulgham. The WebContent process needs access to read a new audio related preference domain. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-15 Alex Christensen Reduce structure copies when creating an API::FrameInfo https://bugs.webkit.org/show_bug.cgi?id=204199 Reviewed by Brady Eidson. Use WTFMove and references where possible. This is cleanup needed for a future patch. * Shared/FrameInfoData.cpp: (WebKit::FrameInfoData::decode): * Shared/FrameInfoData.h: * UIProcess/API/APIFrameInfo.cpp: (API::FrameInfo::create): (API::FrameInfo::FrameInfo): (API::FrameInfo::~FrameInfo): Deleted. (API::FrameInfo::clearPage): Deleted. * UIProcess/API/APIFrameInfo.h: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didFailProvisionalLoadInSubframeWithError): * UIProcess/API/APIUIClient.h: (API::UIClient::runJavaScriptAlert): (API::UIClient::runJavaScriptConfirm): (API::UIClient::runJavaScriptPrompt): (API::UIClient::runBeforeUnloadConfirmPanel): (API::UIClient::runOpenPanel): (API::UIClient::runWebAuthenticationPanel): * UIProcess/API/C/WKFrame.cpp: (WKFrameCreateFrameInfo): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): (WKPageSetPageNavigationClient): * UIProcess/API/Cocoa/WKFrameInfo.mm: (-[WKFrameInfo webView]): * UIProcess/API/Cocoa/WKUserContentController.mm: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::didFailProvisionalLoadInSubframeWithError): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::runJavaScriptAlert): (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): (WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest): (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel): (WebKit::UIDelegate::UIClient::runOpenPanel): (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::decidePolicyForResponse): * UIProcess/ProvisionalPageProxy.h: * UIProcess/UserContent/WebScriptMessageHandler.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::didPostMessage): * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::runPanel): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponse): (WebKit::WebPageProxy::decidePolicyForResponseShared): (WebKit::WebPageProxy::createNewPage): (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): (WebKit::WebPageProxy::runOpenPanel): * UIProcess/WebPageProxy.h: 2019-11-15 Chris Dumez Regression(r244361) iOS: Layout test http/tests/quicklook/rtf-document-domain-is-empty-string.html is crashing https://bugs.webkit.org/show_bug.cgi?id=204205 Reviewed by Alex Christensen. In this test, NSHTMLWriter ends up creating a WebArchive providing file:///index.html as URL. The page's script then calls document.open(), which triggers a DidExplicitOpenForFrame() IPC to the UIProcess with this URL. This trips our MESSAGE_CHECK_URL() check in the UIProcess when this path is not within the WebContent process' sandbox, and we kill the WebContent process. To address the issue, this patch replaces the MESSAGE_CHECK_URL() with an if check and an early return so that we ignore the IPC if the URL does not make sense, without actually terminating the WebContent process. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didExplicitOpenForFrame): 2019-11-12 Youenn Fablet Update libwebrtc to M78 https://bugs.webkit.org/show_bug.cgi?id=203897 Reviewed by Eric Carlson. Update include paths. Update according API change to client TCP socket creation and network monitor. * NetworkProcess/webrtc/LibWebRTCSocketClient.h: * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createClientTCPSocket): * NetworkProcess/webrtc/NetworkRTCProvider.h: * NetworkProcess/webrtc/NetworkRTCProvider.mm: * NetworkProcess/webrtc/NetworkRTCSocket.h: * Shared/RTCPacketOptions.h: * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::RTCSocketFactory::CreateClientTcpSocket): * WebProcess/Network/webrtc/LibWebRTCResolver.h: * WebProcess/Network/webrtc/LibWebRTCSocket.h: * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::createClientTcpSocket): * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h: * WebProcess/Network/webrtc/WebRTCMonitor.cpp: * WebProcess/Network/webrtc/WebRTCMonitor.h: 2019-11-14 Alex Christensen Make NetworkResourceLoader::didReceiveResponse more straightforward after r244700 https://bugs.webkit.org/show_bug.cgi?id=204134 Reviewed by Youenn Fablet. If m_isKeptAlive is true, we do not want to receive any HTTP body. Rather than storing the CompletionHandler and relying on the destructor to call it, just call it. No change in behavior. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): 2019-11-14 Chris Dumez [iOS] Crash under WebProcess::processTaskStateDidChange(WebKit::ProcessTaskStateObserver::TaskState) https://bugs.webkit.org/show_bug.cgi?id=204177 Reviewed by Jer Noble. Delay creating the ProcessTaskStateObserver until the WebProcess's connection to its parent had been initialized. This is necessary because ProcessTaskStateObserver may call WebProcess::processTaskStateDidChange() on a background thread, which will deference the IPC connection. * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::WebProcess::~WebProcess): (WebKit::WebProcess::initializeConnection): (WebKit::m_taskStateObserver): Deleted. * WebProcess/WebProcess.h: 2019-11-14 Brady Eidson Summary: WKWebView is missing an equivalent to WebKit 1's API to set the media style. and https://bugs.webkit.org/show_bug.cgi?id=203974 Reviewed by Alex Christensen. Covered by new API test. This is basically: - Expose a read/write property on WKWebView. - Pipe the new media type to the WebProcess. - Force a style recalc. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setMediaType:]): (-[WKWebView mediaType]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setOverriddenMediaType): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::overriddenMediaType const): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::overrideMediaType const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setOverriddenMediaType): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::overriddenMediaType const): * WebProcess/WebPage/WebPage.messages.in: 2019-11-14 Brady Eidson pageZoom/setPageZoom: should not be in a Mac-only part of WKWebView.mm https://bugs.webkit.org/show_bug.cgi?id=204128 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setPageZoom:]): (-[WKWebView pageZoom]): 2019-11-13 Per Arne Vollan REGRESSION: WKWebView navigation fails when navigating from about:blank https://bugs.webkit.org/show_bug.cgi?id=203852 Reviewed by Brent Fulgham. Previously, WebPageProxy::loadFile would unconditionally create a sandbox extension for the resource directory URL. Currently, this method is calling WebPageProxy::maybeInitializeSandboxExtension to create a sandbox extension if needed. The sandbox extension for the resource URL is not created if the WebContent process already has assumed access to the resource URL, which is the case when loading the same file for the second time. The sandbox extension still needs to be issued in this case, since the WebContent process is revoking its extension when the load is done. This patch restore the original behaviour by adding a flag to WebPageProxy::maybeInitializeSandboxExtension to indicate whether the method should check if the process already has assumed access. API test: WKWebView.LoadRelativeFileURL * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::loadFile): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shouldSendPendingMessage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequestWaitingForProcessLaunch): (WebKit::WebPage::loadRequestWaitingForPID): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-11-13 Myles C. Maxfield [Mac] Fix build https://bugs.webkit.org/show_bug.cgi?id=204136 Reviewed by Alex Christensen. Remove deprecation warnings. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error): (WebKit::initializeCocoaOverrides): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView changeFont:]): (-[WKWebView changeColor:]): (-[WKWebView view:stringForToolTip:point:userData:]): (-[WKWebView pasteboardChangedOwner:]): (-[WKWebView pasteboard:provideDataForType:]): * UIProcess/API/mac/WKView.mm: (-[WKView changeFont:]): (-[WKView view:stringForToolTip:point:userData:]): (-[WKView pasteboardChangedOwner:]): (-[WKView pasteboard:provideDataForType:]): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::launchApplicationAtURL): (WebKit::PluginProcessProxy::openFile): * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: (-[WKDataListSuggestionView setBackgroundStyle:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication): (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication): 2019-11-13 Megan Gardner Cleanup old UIKit Staging https://bugs.webkit.org/show_bug.cgi?id=204130 Reviewed by Wenson Hsieh. Not new tests - linking only. * Platform/spi/ios/UIKitSPI.h: Removing old staging code that should be unnecessary now. 2019-11-13 Per Arne Vollan [iOS] Cannot open camera from websites https://bugs.webkit.org/show_bug.cgi?id=204168 Reviewed by Jer Noble. The sandbox is blocking a required service. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-13 Benjamin Nham VeryHigh priority loads are actually loading at VeryLow priority https://bugs.webkit.org/show_bug.cgi?id=203423 Reviewed by Antti Koivisto. There are two issues with the way we translate ResourceLoadPriority to CFURLRequestPriority: 1. We call _CFNetworkHTTPConnectionCacheSetLimit and set 1 too few priority levels. This means VeryHigh priority loads are actually out of bounds, which causes CFNetwork to set the priority level back to 0 in HTTPConnectionCacheEntry::_prepareNewRequest. After this patch we'll call _CFNetworkHTTPConnectionCacheSetLimit with the correct number of levels. 2. _CFNetworkHTTPConnectionCacheSetLimit doesn't work for NSURLSession right now (), so we have to map to the default number of CFURLRequestPriority levels, which is 4. Right now we have 5 ResourceLoadPriority levels, so there will be some aliasing involved. After this patch VeryLow gets a priority of -1 and Low gets a priority of 0, but due to the aforementioned clamping behavior both VeryLow and Low will effectively both have a CFURLRequestPriority of 0. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::initializeNetworkSettings): 2019-11-13 Youenn Fablet Remove timer to stop service worker process https://bugs.webkit.org/show_bug.cgi?id=204118 Reviewed by Alex Christensen. Removal of a timer that is never get activated. No change of behavior. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): * UIProcess/WebProcessPool.h: 2019-11-13 Youenn Fablet Take service worker assertions based on client processes assertion states https://bugs.webkit.org/show_bug.cgi?id=204119 Reviewed by Chris Dumez. Compute in network process which processes contain clients for service workers of a given process. WebSWServerConnection implements it and sends update to UIProcess/WebProcessProxy. WebProcessProxy keeps for each service worker process a set of client web processes. WebProcessProxy now computes the service worker process assertion based on this set. Add some private APIs to set process assertions/get service worker process assertion states. Covered by new API test. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): (WebKit::WebSWServerConnection::unregisterServiceWorkerClient): (WebKit::WebSWServerConnection::contextConnectionCreated): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::webProcessIdentifier const): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setAssertionStateForTesting:]): (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::registerWebProcessToServiceWorkerProcess): (WebKit::NetworkProcessProxy::unregisterWebProcessToServiceWorkerProcess): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::updateProcessAssertions): (WebKit::WebProcessPool::hasServiceWorkerForegroundActivityForTesting const): (WebKit::WebProcessPool::hasServiceWorkerBackgroundActivityForTesting const): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::updateServiceWorkerProcessAssertion): (WebKit::WebProcessProxy::registerWebProcessToServiceWorkerProcess): (WebKit::WebProcessProxy::unregisterWebProcessToServiceWorkerProcess): (WebKit::WebProcessProxy::hasServiceWorkerForegroundActivityForTesting const): (WebKit::WebProcessProxy::hasServiceWorkerBackgroundActivityForTesting const): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::setAssertionStateForTesting): 2019-11-13 Andres Gonzalez AXObjectCache::rootObject should generate the isolated tree. https://bugs.webkit.org/show_bug.cgi?id=204131 Reviewed by Chris Fleizach. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]): (-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]): Became a member of AXObjectCache. (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]): Deleted. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityHitTest:]): 2019-11-13 Youenn Fablet [ iOS ]: Layout Test http/tests/IndexedDB/storage-limit-1.https.html is a Flaky Failure https://bugs.webkit.org/show_bug.cgi?id=203275 Reviewed by Alex Christensen. Fix flakiness by clearing the storage of each cache when the cache is being cleared. This ensures that the storage salt gets recreated if needed. To further improve repeatability, make sure that initialize based tasks happen after clear tasks are complete. For that purpose, add a clear task counter and append initialize callbacks to a Vector if counter is not zero. Increment counter at clear task creation and decrement counter at completion time. If counter is back to 0, we can safely process the pending clear tasks. Covered by unflaked test. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::~Engine): (WebKit::CacheStorage::Engine::initialize): (WebKit::CacheStorage::CompletionHandler Rollout(r251358) Causes load hangs https://bugs.webkit.org/show_bug.cgi?id=204158 Unreviewed, revert r251358 because it causes load hangs. * Platform/spi/Cocoa/SecItemSPI.h: Removed. * Shared/mac/SecItemRequestData.cpp: (WebKit::SecItemRequestData::decode): * Shared/mac/SecItemRequestData.h: * WebKit.xcodeproj/project.pbxproj: 2019-11-13 Philippe Normand Unreviewed, fix build for ServiceWorkers disabled * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::enableServiceWorkers): 2019-11-13 Rob Buis Support stale-while-revalidate cache strategy https://bugs.webkit.org/show_bug.cgi?id=201461 Reviewed by Youenn Fablet. Add a new UseDecision value AsyncRevalidate for async revalidation. This is used when the retrieved cache entry is a stale-while-revalidate response [1]. In case of AsyncRevalidate, a check is made to see if there is a current async revalidation ongoing for the entry, if not one is started. Regardless, the stale entry is returned, until either the async revalidation ends successfully or at the moment when the response expires for real. [1] https://fetch.spec.whatwg.org/#concept-stale-while-revalidate-response * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::isStaleWhileRevalidateEnabled const): * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cache/AsyncRevalidation.cpp: Added. (WebKit::NetworkCache::constructRevalidationRequest): (WebKit::NetworkCache::AsyncRevalidation::staleWhileRevalidateEnding): (WebKit::NetworkCache::AsyncRevalidation::AsyncRevalidation): * NetworkProcess/cache/AsyncRevalidation.h: Added. (WebKit::NetworkCache::AsyncRevalidation::load const): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::responseNeedsRevalidation): (WebKit::NetworkCache::makeUseDecision): (WebKit::NetworkCache::makeStoreDecision): (WebKit::NetworkCache::Cache::startAsyncRevalidationIfNeeded): (WebKit::NetworkCache::Cache::retrieve): (WebKit::NetworkCache::responseHasExpired): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::dumpHTTPHeadersDiff): (WebKit::NetworkCache::requestsHeadersMatch): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::dumpHTTPHeadersDiff): Deleted. (WebKit::NetworkCache::requestsHeadersMatch): Deleted. * Sources.txt: * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp: (WKWebsiteDataStoreConfigurationGetStaleWhileRevalidateEnabled): (WKWebsiteDataStoreConfigurationSetStaleWhileRevalidateEnabled): * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy const): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::staleWhileRevalidateEnabled const): (WebKit::WebsiteDataStoreConfiguration::setStaleWhileRevalidateEnabled): * WebKit.xcodeproj/project.pbxproj: 2019-11-12 Simon Fraser Convert CSSPrimitiveValue::UnitType to an enum class, and cleanup https://bugs.webkit.org/show_bug.cgi?id=204101 Reviewed by Antti Koivisto. Move CSSPrimitiveValue::UnitType to a standalone enum class CSSUnitType, and CSSPrimitiveVallue::UnitCategory to CSSUnitCategory; these are going to more extensive use in calc() and in the CSS OM. * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::updateGeometry): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::updateGeometry): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::updateGeometry): 2019-11-12 Sihui Liu Add size file for CacheStorage https://bugs.webkit.org/show_bug.cgi?id=204027 Reviewed by Youenn Fablet. Keep the CacheStorage size in a separate file so that we can get that value without waiting for Engine to initialize and read caches from disk. No behavior change as the file is not in use now. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): (WebKit::CacheStorage::Engine::deleteDirectoryRecursivelyOnBackgroundThread): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::cachesSizeFilename): (WebKit::CacheStorage::Caches::updateSizeFile): (WebKit::CacheStorage::Caches::initializeSize): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::resetSpaceUsed): * NetworkProcess/cache/CacheStorageEngineCaches.h: 2019-11-12 Wenson Hsieh [iOS] WKWebView does not respect system spellchecking preference https://bugs.webkit.org/show_bug.cgi?id=204100 Reviewed by Tim Horton. Implements a platform hook on iOS (-setContinuousSpellCheckingEnabled:) to allow UIKit to inform us when the system spellchecking preference changes, and adds logic to propagate these changes to the web process. See below for more details. Test: editing/spelling/toggle-spellchecking.html * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add testing SPI to enable or disable continuous spellchecking, for both iOS and macOS. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setContinuousSpellCheckingEnabled): * UIProcess/TextChecker.h: * UIProcess/gtk/TextCheckerGtk.cpp: (WebKit::TextChecker::setContinuousSpellCheckingEnabled): * UIProcess/ios/TextCheckerIOS.mm: (WebKit::TextChecker::setContinuousSpellCheckingEnabled): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView setContinuousSpellCheckingEnabled:]): Implement this method to handle changes to the system spellchecking preference. This hook is also used by legacy WebKit on iOS to turn spellchecking on or off. If the value of the preference changed, we additionally notify the web process. In the future, we should consider refactoring TextCheckerState to be per-web view and per-page, since Cocoa platform APIs would allow for different WKWebViews to have different spell checking preferences. * UIProcess/mac/TextCheckerMac.mm: (WebKit::TextChecker::setContinuousSpellCheckingEnabled): * UIProcess/win/TextCheckerWin.cpp: (WebKit::TextChecker::setContinuousSpellCheckingEnabled): * UIProcess/wpe/TextCheckerWPE.cpp: (WebKit::TextChecker::setContinuousSpellCheckingEnabled): Adjusted setContinuousSpellCheckingEnabled to return whether or not the continuous spellchecking state changed. 2019-11-12 Truitt Savell Unreviewed, rolling out r252351. casued 50+ crashes on Mac and iOS wk2 debug Reverted changeset: "Add size file for CacheStorage" https://bugs.webkit.org/show_bug.cgi?id=204027 https://trac.webkit.org/changeset/252351 2019-11-12 Alex Christensen Revert remainder of r251676 https://bugs.webkit.org/show_bug.cgi?id=203066 * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::globalCTDataConnectionServiceType): (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType): (WebKit::NetworkSessionCocoa::dataConnectionServiceType const): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]): (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): 2019-11-12 Megan Gardner Rename _textSelectionAssistant to _textInteractionAssistant to reflect the only class it can now represent https://bugs.webkit.org/show_bug.cgi?id=204103 Reviewed by Wenson Hsieh. No new tests - rename only. Now that UIWKSelectionAssistant is no longer, the _textSelectionAssistant can only be a UIWKTextInteractionAssistant. There is enough confusion around all the selection and interaction assistants, renaming this should alleviate some of that confusion. * UIProcess/ios/WKContentView.mm: (-[WKContentView _didExitStableState]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView becomeFirstResponderForWebView]): (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]): (-[WKContentView _scrollingNodeScrollingWillBegin]): (-[WKContentView _scrollingNodeScrollingDidEnd]): (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _uiTextSelectionRects]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView setUpTextSelectionAssistant]): (-[WKContentView _willStartScrollingOrZooming]): (-[WKContentView _didEndScrollingOrZooming]): (-[WKContentView _lookupForWebView:]): (-[WKContentView _shareForWebView:]): (-[WKContentView _addShortcutForWebView:]): (-[WKContentView _promptForReplaceForWebView:]): (-[WKContentView _transliterateChineseForWebView:]): (-[WKContentView tintColorDidChange]): (-[WKContentView _didHideMenu:]): (-[WKContentView selectForWebView:]): (-[WKContentView selectAllForWebView:]): (-[WKContentView _showTextStyleOptionsForWebView:]): (-[WKContentView _showDictionary:]): (-[WKContentView interactionAssistant]): (-[WKContentView _showKeyboard]): (-[WKContentView _hideKeyboard]): (-[WKContentView _updateChangedSelection:]): (-[WKContentView _startSuppressingSelectionAssistantForReason:]): (-[WKContentView _stopSuppressingSelectionAssistantForReason:]): (-[WKContentView _restoreCalloutBarIfNeeded]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): 2019-11-12 Carlos Alberto Lopez Perez [GTK][WPE] Support Pointer Events https://bugs.webkit.org/show_bug.cgi?id=202789 Reviewed by Carlos Garcia Campos. Covered by existing tests. * UIProcess/PageClient.h: Add a ifdef for platform COCOA on two function declarations that depend on the UIGestureRecognizer ObjC type. This is not needed for GTK/WPE code. 2019-11-12 Alex Christensen Revert part of r251676 https://bugs.webkit.org/show_bug.cgi?id=203066 * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2019-11-12 Carlos Alberto Lopez Perez [GTK][WPE] Enable CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190710 Reviewed by Don Olmstead. Enable the runtime feature by default on GTK/WPE when building with experimental features enabled. Covered by existing tests. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: 2019-11-12 Carlos Garcia Campos [GTK] WebDriver: implement new window command https://bugs.webkit.org/show_bug.cgi?id=203994 Reviewed by Carlos Alberto Lopez Perez. Add new API to support new window command. The WebKitAutomationSession::create-web-view signal can now receive a detail that can be "window" or "tab". Applications can use that to decide whether to add the new webview to a new window or tab. WebKitWebView has a new construct only property automation-presentation-type, which is an enum that can be either window or tab value. Appplications should use the new property when creating the web view for automation to indicate whether the web view was added to a new window or tab. * UIProcess/API/glib/WebKitAutomationSession.cpp: (webkit_automation_session_class_init): * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewSetProperty): (webkitWebViewGetProperty): (webkit_web_view_class_init): (webkit_web_view_get_automation_presentation_type): * UIProcess/API/gtk/WebKitAutomationSession.h: * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: 2019-11-12 Carlos Garcia Campos REGRESSION(r250707): [GTK] UIClient::setWindowFrame only works the first time https://bugs.webkit.org/show_bug.cgi?id=204068 Reviewed by Adrian Perez de Castro. This is because we are connecting to configure-event of parent window, but not returning FALSE from the callback to propagate the event. * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::windowConfigureEventCallback): Make it boolean and return FALSE. 2019-11-11 Alex Christensen Add SPI to access a WebsiteDataStore without instantiating it, and its configuration https://bugs.webkit.org/show_bug.cgi?id=204089 Reviewed by Tim Horton. Calling WKWebViewConfiguration.websiteDataStore instantiates the default data store. We need a way to query if it has been set but not instantiate anything if it hasn't. We also need a way to access the configuration used to create a WKWebsiteDataStore like we do with WKWebView. These have been requested to fix and I think they're a good idea in general. Covered by API tests. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _websiteDataStoreIfExists]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _setDelegate:]): (-[WKWebsiteDataStore set_delegate:]): (-[WKWebsiteDataStore _configuration]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy const): (WebKit::WebsiteDataStoreConfiguration::copy): Deleted. * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: 2019-11-11 Sihui Liu Add size file for CacheStorage https://bugs.webkit.org/show_bug.cgi?id=204027 Reviewed by Youenn Fablet. Keep the CacheStorage size in a separate file so that we can get that value without waiting for Engine to initialize and read caches from disk. No behavior change as the file is not in use now. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::cachesSizeFilename): (WebKit::CacheStorage::Caches::updateSizeFile): (WebKit::CacheStorage::Caches::initializeSize): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::resetSpaceUsed): * NetworkProcess/cache/CacheStorageEngineCaches.h: 2019-11-11 Youenn Fablet Fail cross-origin redirection loads in case of CORS with redirection URLs having credentials https://bugs.webkit.org/show_bug.cgi?id=204036 Reviewed by Alex Christensen. Implement https://fetch.spec.whatwg.org/#http-redirect-fetch steps 7 and 8. Covered by updated tests. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkRedirection): 2019-11-11 Per Arne Vollan [iOS] Unable to view .pages files https://bugs.webkit.org/show_bug.cgi?id=204076 Reviewed by Brent Fulgham. This is caused by a syscall being blocked by the sandbox. The syscall was previously unused in the WebContent process. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-11 Carlos Garcia Campos WebDriver: implement proxy support https://bugs.webkit.org/show_bug.cgi?id=180408 Reviewed by Carlos Alberto Lopez Perez. * UIProcess/API/glib/WebKitAutomationSession.cpp: (parseProxyCapabilities): Parse the proxy settings from capabilities. (webkitAutomationSessionCreate): Set the proxy settings received from capabilities. 2019-11-10 David Kilzer StorageManagerSet.m_storageAreas should use weak pointers to StorageArea Reviewed by Geoffrey Garen. * NetworkProcess/WebStorage/StorageArea.h: (class WebKit::StorageArea): - Inherit from CanMakeWeakPtr. * NetworkProcess/WebStorage/StorageManagerSet.cpp: (WebKit::StorageManagerSet::removeConnection): (WebKit::StorageManagerSet::waitUntilSyncingLocalStorageFinished): (WebKit::StorageManagerSet::connectToLocalStorageArea): (WebKit::StorageManagerSet::connectToTransientLocalStorageArea): (WebKit::StorageManagerSet::connectToSessionStorageArea): (WebKit::StorageManagerSet::disconnectFromStorageArea): (WebKit::StorageManagerSet::getValues): Initialize `quotaError` stack value since it is not guaranteed to be set. (WebKit::StorageManagerSet::setItem): (WebKit::StorageManagerSet::removeItem): (WebKit::StorageManagerSet::clear): - Use makeWeakPtr() to add StorageArea pointers to m_storageAreas. - Use `const auto&` to store WeakPtr values from m_storageAreas. - Add nullptr checks before using WeakPtr values. * NetworkProcess/WebStorage/StorageManagerSet.h: (WebKit::StorageManagerSet::m_storageAreas): - Use WeakPtr. 2019-11-09 Dean Jackson Clicky Orbing support.apple.com categories shows a PNG instead of the web page preview, tapping loads image asset only instead of web page https://bugs.webkit.org/show_bug.cgi?id=204037 Reviewed by Simon Fraser. When Safari adopted the ContextMenu API they began providing a PreviewViewController that showed the image rather than the link, for the case of . This could be fixed in Safari, but I noticed that we actually tell the delegate that the type of the activated element is an image, which is why they treat it as such. It's not clear that because the image also has a link attached, a client should defer to the link. Instead, I think it makes more sense to identify this as a link, because that is the more important information in this API. While here I also changed the logic to make sure we call the API if both the API and SPI are available. New ContextMenus and WKRequestActivatedElementInfo API tests. * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: Identify as a link if you have a link. (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:userInfo:]): * UIProcess/ios/WKContentViewInteraction.mm: Look for the API before the SPI. (-[WKContentView continueContextMenuInteraction:]): 2019-11-08 Brady Eidson WKWebView Find-in-page API. and https://bugs.webkit.org/show_bug.cgi?id=203872 Reviewed by Tim Horton. Covered by API tests. - Promote _findString: - Add a completion handler for it. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKFindConfiguration.h: Added. * UIProcess/API/Cocoa/WKFindConfiguration.mm: Added. (-[WKFindConfiguration init]): (-[WKFindConfiguration copyWithZone:]): * UIProcess/API/Cocoa/WKFindResult.h: Added. * UIProcess/API/Cocoa/WKFindResult.mm: Added. (-[WKFindResult init]): (-[WKFindResult _initWithMatchFound:]): (-[WKFindResult copyWithZone:]): * UIProcess/API/Cocoa/WKFindResultInternal.h: Added. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (toFindOptions): (-[WKWebView findString:withConfiguration:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h: * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::findString): (WebKit::WebPageProxy::findStringCallback): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::findString): * WebProcess/WebPage/FindController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::findString): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-11-08 Jiewen Tan [WebAuthn] Add quirk needed to support legacy Google NFC Titan security keys https://bugs.webkit.org/show_bug.cgi?id=204024 Reviewed by Brent Fulgham. Some legacy U2F keys such as Google T1 Titan don't understand the FIDO applet command. Instead, they are configured to only have the FIDO applet. Therefore, when the above command fails, we use U2F_VERSION command to double check if the connected tag can actually speak U2F, indicating we are interacting with one of these legacy keys. * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: (WebKit::fido::compareVersion): (WebKit::fido::trySelectFidoApplet): (WebKit::NfcConnection::transact const): (WebKit::NfcConnection::didDetectTags): 2019-11-08 Jonathan Bedard Unreviewed, rolling out r252260. Breaks half of API tests Reverted changeset: "Make DownloadID an ObjectIdentifier" https://bugs.webkit.org/show_bug.cgi?id=203962 https://trac.webkit.org/changeset/252260 2019-11-08 Antti Koivisto Use separate cache directory for development WebKit on Mac https://bugs.webkit.org/show_bug.cgi?id=204015 Reviewed by Youenn Fablet. Replace the NetworkCache::lastStableVersion scheme with a completely separate directory. This way potential bugs in development WebKit can't end up affecting system WebKit cache. This also removes the need to keep lastStableVersion updated. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::makeCachePath): Add '/Development' to cache path if this is not system WebKit. (WebKit::NetworkCache::Storage::open): (WebKit::NetworkCache::Storage::deleteOldVersions): No need to avoid deleting lastStableVersion anymore. * NetworkProcess/cache/NetworkCacheStorage.h: 2019-11-08 Per Arne Vollan [macOS] [iOS] Add logging and telemetry to mach lookup rules https://bugs.webkit.org/show_bug.cgi?id=203999 Reviewed by Brent Fulgham. Add logging and telemetry to help determine if mach lookups to a set of services can be denied in the WebContent process. No new tests, since this only adds logging and telemetry. * WebProcess/com.apple.WebProcess.sb.in: 2019-11-08 Alex Christensen Make DownloadID an ObjectIdentifier https://bugs.webkit.org/show_bug.cgi?id=203962 Reviewed by Youenn Fablet. Also deprecate the unused WKDownloadGetID because this identifier is internal. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::Download): (WebKit::Download::didReceiveData): (WebKit::Download::didFinish): (WebKit::Download::didFail): (WebKit::Download::didCancel): (WebKit::Download::messageSenderDestinationID const): * NetworkProcess/Downloads/DownloadID.h: (WebKit::DownloadID::DownloadID): Deleted. (WebKit::DownloadID::operator== const): Deleted. (WebKit::DownloadID::operator!= const): Deleted. (WebKit::DownloadID::downloadID const): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (WTF::DownloadIDHash::hash): Deleted. (WTF::DownloadIDHash::equal): Deleted. (WTF::HashTraits::emptyValue): Deleted. (WTF::HashTraits::constructDeletedValue): Deleted. (WTF::HashTraits::isDeletedValue): Deleted. * NetworkProcess/Downloads/DownloadMonitor.cpp: (WebKit::DownloadMonitor::applicationWillEnterForeground): (WebKit::DownloadMonitor::applicationDidEnterBackground): (WebKit::DownloadMonitor::timerFired): * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::messageSenderDestinationID const): * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTask::setPendingDownloadID): (WebKit::NetworkDataTask::isDownload const): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::pendingDownloadCanceled): (WebKit::NetworkProcess::findPendingDownloadLocation): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::convertToDownload): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]): (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]): (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge): * Scripts/webkit/messages.py: * Shared/Authentication/AuthenticationManager.h: * UIProcess/API/C/WKDownload.cpp: (WKDownloadGetID): * UIProcess/API/C/WKDownload.h: * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::DownloadProxy): (WebKit::generateDownloadID): Deleted. * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Downloads/DownloadProxyMap.cpp: (WebKit::DownloadProxyMap::createDownloadProxy): (WebKit::DownloadProxyMap::downloadFinished): (WebKit::DownloadProxyMap::invalidate): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::startDownload): (WebKit::WebFrame::convertMainResourceLoadToDownload): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.h: 2019-11-08 Alex Christensen Fix flaky tests in http/tests/cache/disk-cache https://bugs.webkit.org/show_bug.cgi?id=203822 Reviewed by Youenn Fablet. Right now tests that set the cache model do so using a race condition. I think this will fix the flakyness we've observed. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setCacheModelSynchronouslyForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetCacheModelSynchronouslyForTesting): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setCacheModelSynchronouslyForTesting): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setCacheModelSynchronouslyForTesting): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-11-08 Alex Christensen Revert some changes accidentally committed with r252257 https://bugs.webkit.org/show_bug.cgi?id=202178 * UIProcess/API/C/WKContextPrivate.h: 2019-11-08 Alex Christensen Move schemes for SchemeRegistry from WebProcessPool to LegacyGlobalSettings https://bugs.webkit.org/show_bug.cgi?id=202178 Reviewed by Youenn Fablet. The current users of the SPI to set these only have one WebProcessPool, so they intend these settings to be global. Moving them to LegacyGlobalSettings allows me to make a NetworkProcessProxy without a WebProcessPool and not regress existing functionality. I move only the four sets of schemes needed to launch a NetworkProcess to remove the dependency the NetworkProcess has on the WebProcessPool. * UIProcess/LegacyGlobalSettings.h: (WebKit::LegacyGlobalSettings::schemesToRegisterAsSecure): (WebKit::LegacyGlobalSettings::registerURLSchemeAsSecure): (WebKit::LegacyGlobalSettings::schemesToRegisterAsBypassingContentSecurityPolicy): (WebKit::LegacyGlobalSettings::registerURLSchemeAsBypassingContentSecurityPolicy): (WebKit::LegacyGlobalSettings::schemesToRegisterAsLocal): (WebKit::LegacyGlobalSettings::registerURLSchemeAsLocal): (WebKit::LegacyGlobalSettings::schemesToRegisterAsNoAccess): (WebKit::LegacyGlobalSettings::registerURLSchemeAsNoAccess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::registerURLSchemeAsSecure): (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy): (WebKit::WebProcessPool::registerURLSchemeAsLocal): (WebKit::WebProcessPool::registerURLSchemeAsNoAccess): * UIProcess/WebProcessPool.h: 2019-11-08 Daniel Bates Add WebKit Legacy SPI to retrieve editable elements in rect https://bugs.webkit.org/show_bug.cgi?id=204006 Reviewed by Wenson Hsieh. Write WebPage::textInputContextsInRect() in terms of Page::editableElementsInRect(). Also make use of Element::clientRect() instead of elementRectInRootViewCoordinates(), which duplicates what the former does. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::textInputContextsInRect): Write in terms of Page::editableElementsInRect(). (WebKit::WebPage::contextForElement const): Use Element::clientRect() which does what elementRectInRootViewCoordinates() does. (WebKit::elementRectInRootViewCoordinates): Deleted. (WebKit::isEditableTextInputElement): Deleted. 2019-11-06 Jiewen Tan [WebAuthn] Return NotAllowedError immediately for UI cancellations https://bugs.webkit.org/show_bug.cgi?id=203937 Reviewed by Brent Fulgham. NotAllowedError representing UI cancellations should be returned to sites immediately such that sites could show appropriate error page immediately. Covered by existing tests. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::cancelRequest): (WebKit::AuthenticatorManager::clearState): (WebKit::AuthenticatorManager::resetState): Deleted. * UIProcess/WebAuthentication/AuthenticatorManager.h: 2019-11-08 Carlos Garcia Campos [GTK] Add pointer lock permission request API https://bugs.webkit.org/show_bug.cgi?id=203896 Reviewed by Adrian Perez de Castro. Add a WebKitPointerLockPermissionRequest class to handle pointer lock permissions. * PlatformGTK.cmake: * SourcesGTK.txt: * UIProcess/API/glib/WebKitPointerLockPermissionRequest.cpp: Added. (webkitPointerLockPermissionRequestAllow): (webkitPointerLockPermissionRequestDeny): (webkit_permission_request_interface_init): (webkitPointerLockPermissionRequestDispose): (webkit_pointer_lock_permission_request_class_init): (webkitPointerLockPermissionRequestCreate): (webkitPointerLockPermissionRequestDidLosePointerLock): * UIProcess/API/glib/WebKitPointerLockPermissionRequestPrivate.h: Added. * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::~UIClient): * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewPermissionRequest): (webkitWebViewDenyPointerLockRequest): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitPointerLockPermissionRequest.h: Added. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: 2019-11-07 Tim Horton Remove an unused icon resource https://bugs.webkit.org/show_bug.cgi?id=203983 Reviewed by Wenson Hsieh. * Resources/mac/mediaIcon.pdf: Removed. * WebKit.xcodeproj/project.pbxproj: This file has not been used in years. 2019-11-07 Per Arne Vollan [iOS] Add logging and telemetry to more mach lookup rules https://bugs.webkit.org/show_bug.cgi?id=203978 Reviewed by Brent Fulgham. Add logging and telemetry to help determine if mach lookup of these services can be denied in the WebContent process. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-07 Alex Christensen Re-enable NSURLSession isolation after r252116 https://bugs.webkit.org/show_bug.cgi?id=203934 Reviewed by Chris Dumez. r252116 was a rollout of r248640, which introduced cases where data tasks from different NSURLSessions which can have the same task identifiers were put into the same maps. This key collision caused data from the wrong tasks to be sent to NetworkResourceLoader, causing rare and strange loading bugs. In order to prevent insertion into wrong maps again, I made a new abstraction, SessionWrapper, which wraps a NSURLSession, its delegate, and all maps that are scoped to that NSURLSession. Along the way I found a few other places where we had made similar mistakes. Covered by an API test which would've failed before r252116 because it exercises the key collision condition, and by tests which were skipped in r252116 and I now unskipped. * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate initWithSessionWrapper:withCredentials:]): (-[WKNetworkSessionDelegate sessionInvalidated]): (-[WKNetworkSessionDelegate existingTask:]): (-[WKNetworkSessionDelegate sessionCocoa]): (-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]): (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]): (processServerTrustEvaluation): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]): (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]): (-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): (-[WKNetworkSessionDelegate existingWebSocketTask:]): (WebKit::SessionWrapper::initialize): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::NetworkSessionCocoa::initializeEphemeralStatelessSession): (WebKit::NetworkSessionCocoa::sessionWrapperForTask): (WebKit::NetworkSessionCocoa::isolatedSession): (WebKit::NetworkSessionCocoa::invalidateAndCancel): (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge): (WebKit::NetworkSessionCocoa::createWebSocketTask): (WebKit::NetworkSessionCocoa::addWebSocketTask): (WebKit::NetworkSessionCocoa::removeWebSocketTask): (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]): Deleted. (WebKit::NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession): Deleted. (WebKit::NetworkSessionCocoa::session): Deleted. (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): Deleted. (WebKit::NetworkSessionCocoa::downloadTaskWithResumeData): Deleted. (WebKit::NetworkSessionCocoa::addDownloadID): Deleted. (WebKit::NetworkSessionCocoa::downloadID): Deleted. (WebKit::NetworkSessionCocoa::takeDownloadID): Deleted. (WebKit::NetworkSessionCocoa::webSocketDataTaskForIdentifier): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _logUserInteraction:completionHandler:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: 2019-11-07 Peng Liu ASSERTION FAILED: m_clientCounts.contains(contextId) in WebKit::VideoFullscreenManagerProxy::removeClientForContext(uint64_t) https://bugs.webkit.org/show_bug.cgi?id=203918 Reviewed by Jer Noble. Postpone the transition to exit fullscreen of a video element before the previous transition of fullscreen mode change is completed. Fix a flakey layout test (media/video-autoplay.html). No new test is needed. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement): 2019-11-07 Carlos Garcia Campos WebDriver: correctly handle errors when focusing element before sending key events https://bugs.webkit.org/show_bug.cgi?id=203945 Reviewed by Carlos Alberto Lopez Perez. Handle ElementNotInteractable JavaScript exception to generate the appropriate Automation error. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): 2019-11-06 Eric Liang AX: WKWebView does not shift Accessibility Focus for Catalyst (203798) https://bugs.webkit.org/show_bug.cgi?id=203798 Reviewed by Chris Fleizach. Added the code to register/unregister remote UI Process identifier on the host app. This is used so that the host app can appear as the sender for notifications sent from its web processes. Unfortunately this has to be done in WebKit: in accessibility bundles the swizzled code is not called because of bundle loading time. Added AppKit softlink for Mac catalyst. * SourcesCocoa.txt: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/ios/AppKitSoftLink.h: Added. * UIProcess/ios/AppKitSoftLink.mm: Added. * UIProcess/ios/ViewGestureControllerIOS.mm: (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]): * UIProcess/ios/WKContentView.mm: (-[WKContentView _updateRemoteAccessibilityRegistration:]): (-[WKContentView _accessibilityRegisterUIProcessTokens]): (-[WKContentView _processDidExit]): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: * WebProcess/WebPage/mac/WebPageMac.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2019-11-06 Keith Rollin Update availability annotations to match the macOS 10.15 and iOS 13.0 GM SDKs https://bugs.webkit.org/show_bug.cgi?id=202243 Reviewed by Brent Fulgham. Changed WK_MAC_TBA and WK_IOS_TBA to 10.15 and 13.0, respectively, in all declarations that appear in the GM SDKs. * Configurations/WebKit.xcconfig: * Shared/API/Cocoa/WKMain.h: * UIProcess/API/Cocoa/NSAttributedString.h: * UIProcess/API/Cocoa/WKContextMenuElementInfo.h: * UIProcess/API/Cocoa/WKError.h: * UIProcess/API/Cocoa/WKErrorPrivate.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * UIProcess/API/Cocoa/WKNavigationDelegate.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKPreviewActionItem.h: * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h: * UIProcess/API/Cocoa/WKPreviewElementInfo.h: * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKSnapshotConfiguration.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebpagePreferences.h: * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: * UIProcess/API/Cocoa/_WKContentRuleListAction.h: * UIProcess/API/Cocoa/_WKCustomHeaderFields.h: * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h: * UIProcess/API/Cocoa/_WKElementAction.h: * UIProcess/API/Cocoa/_WKInspectorWindow.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKTextInputContext.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/_WKTouchEventGenerator.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h: 2019-11-06 Antti Koivisto REGRESSION: [ iOS ] ( r251015 ) Layout Test fast/text/whitespace/pre-wrap-overflow-selection.html is flaky https://bugs.webkit.org/show_bug.cgi?id=203366 Reviewed by Simon Fraser. WKBundlePageForceRepaint may fail to do synchronous layer flush if there is a pending layer flush in-flight and waiting for completion message from UI process. Layer flush also flushes pending editor state so that doesn't get done either. This may cause randomness in test results. In this case the randomness is the switch between simple and complex line layout, triggered by editor state flush. The results between line layout paths are observably identical but produce slightly different render tree dumps. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageFlushPendingEditorStateUpdate): * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Add a function for forcing editor state flush, called from the test runner dump() function. 2019-11-06 Chris Dumez Unreviewed, fix watchOS build after r252011. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::startBackgroundActivityForFullscreenInput): 2019-11-06 Fujii Hironori WEBCORE_TESTSUPPORT_EXPORT should be used only for WebCoreTestSupport, not for WebCore https://bugs.webkit.org/show_bug.cgi?id=203876 Reviewed by Ross Kirsling. * config.h: Removed WEBCORE_TESTSUPPORT_EXPORT definition because it shouldn't be used in WebKit. 2019-11-06 Chris Dumez Unreviewed, rolling out r251907. Causes white flashing in some cases Reverted changeset: "Take down the gesture snapshot early when the back/forward cache is not leveraged" https://bugs.webkit.org/show_bug.cgi?id=203713 https://trac.webkit.org/changeset/251907 2019-11-06 Chris Dumez Make sure we never end up with NetworkDataTaskCocoa TaskIdentifier conflicts https://bugs.webkit.org/show_bug.cgi?id=203902 Reviewed by Antti Koivisto. Consolidate the all the code related to data task registration / lookup / unregistration in NetworkSessionCocoa and add a utility method (dataTaskMap()) to decide which data task map to use. This makes it less error-prone and unlikely that someone would update part of the code and fail to update the rest accordingly. I also converted the debug assertions into release ones so that we crash in case of id confusion instead of having a very bad and hard to diagnose bug like Bug 201822. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): (WebKit::NetworkSessionCocoa::registerDataTask): (WebKit::NetworkSessionCocoa::unregisterDataTask): 2019-11-06 Carlos Garcia Campos [GTK] Implement support for Pointer Lock API https://bugs.webkit.org/show_bug.cgi?id=202956 Reviewed by Carlos Alberto Lopez Perez. Add platform specific implementation of Pointer Lock for the GTK port. * PlatformGTK.cmake: Generate code for pointer-constraints and relative-pointer Wayland protocols. * Shared/NativeWebMouseEvent.h: Add optional mouse movement delta. * Shared/gtk/NativeWebMouseEventGtk.cpp: (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Pass movement delta to WebEventFactory::createWebMouseEvent(). * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebMouseEvent): Initialize deltaX and deltaY for motion events using the received delta. * Shared/gtk/WebEventFactory.h: Add optional mouse movement delta. * SourcesGTK.txt: Add new files to compilation. * UIProcess/API/glib/WebKitUIClient.cpp: Add implementation for requestPointerLock and didLosePointerLock. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRequestPointerLock): Call webkitWebViewBaseRequestPointerLock(). (webkitWebViewDidLosePointerLock): Call webkitWebViewBaseDidLosePointerLock(). * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseDispose): Unlock the pointer and release the PointerLockManager. (webkitWebViewBaseHandleMouseEvent): Initialize the mouse movement delta for motion events and save the current event. (webkitWebViewBaseMotionNotifyEvent): Let PointerLockManager handle motion events while pointer is locked. (webkitWebViewBaseRequestPointerLock): Create a PointerLockManager and request it to lock the pointer. (webkitWebViewBaseDidLosePointerLock): Request PointerLockManager to unlock the pointer. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/gtk/PointerLockManager.cpp: Added. (WebKit::PointerLockManager::create): (WebKit::PointerLockManager::PointerLockManager): (WebKit::PointerLockManager::~PointerLockManager): (WebKit::PointerLockManager::lock): (WebKit::PointerLockManager::unlock): (WebKit::PointerLockManager::handleMotion): * UIProcess/gtk/PointerLockManager.h: Added. (WebKit::PointerLockManager::didReceiveMotionEvent): * UIProcess/gtk/PointerLockManagerWayland.cpp: Added. (WebKit::PointerLockManagerWayland::PointerLockManagerWayland): (WebKit::PointerLockManagerWayland::~PointerLockManagerWayland): (WebKit::PointerLockManagerWayland::lock): (WebKit::PointerLockManagerWayland::unlock): * UIProcess/gtk/PointerLockManagerWayland.h: Added. * UIProcess/gtk/PointerLockManagerX11.cpp: Added. (WebKit::PointerLockManagerX11::PointerLockManagerX11): (WebKit::PointerLockManagerX11::didReceiveMotionEvent): * UIProcess/gtk/PointerLockManagerX11.h: Added. 2019-11-05 Chris Dumez [iOS] Scroll position does not get restored when doing a history navigation while the reader view is shown https://bugs.webkit.org/show_bug.cgi?id=203871 Reviewed by Tim Horton. Previously, attempts to restore the scroll position on the web view while it is being dynamically resized would get ignored. Instead, we now delay restoring the scroll position until after the view is resized. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): 2019-11-05 Kate Cheney Layout test website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=203706 Reviewed by Chris Dumez. No new tests, this change is tested by the existing resourceLoadStatistics tests. This test started flaking when a new memory store was being created between tests to maintain consistency. The call to grandfatherExistingWebsiteData from populateMemoryStoreFromDisk in the persistent storage was async, causing a race condition that led to occasional failures. Adding a completion handler and changing the callsite of populateMemoryStoreFromDisk should fix this problem. * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk): 2019-11-05 John Wilander Temporarily turn off NSURLSession isolation https://bugs.webkit.org/show_bug.cgi?id=201822 Reviewed by Chris Dumez. Existing tests skipped. Re-enabling it is tracked in rdar://problem/56921584. * NetworkProcess/cache/NetworkCacheStorage.h: Bumps the version to force a clean cache. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Skips setting needsIsolatedSession. 2019-11-05 Per Arne Vollan Eliminate mach lookup to cfprefsd on process startup https://bugs.webkit.org/show_bug.cgi?id=202866 Reviewed by Geoffrey Garen. Currently, the WebContent and Networking process is calling CFBundleGetValueForInfoDictionaryKey on startup to get the entry point function name into the WebKit bundle. This causes a mach lookup to cfprefsd which should be avoided. Instead, we can send the service name as part of the bootstrap message when the UI process is starting the process, and have the new process read this value from the message on startup to determine the name of the entry point. This is possibly also an improvement in launch time, since we avoid reading a value from Info.plist. * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-OSX.plist: * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist: * PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.64.Info.plist: * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceEventHandler): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist: 2019-11-05 Per Arne Vollan [iOS] Add logging and telemetry to mach services believed to be unused https://bugs.webkit.org/show_bug.cgi?id=203831 Reviewed by Geoffrey Garen. The sandbox rules for mach services believed to be unused should have logging and telemetry added to confirm whether the assumption is correct. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-05 Tuomas Karkkainen move CrashReporterClientSPI.h and parts of WKCrashReporter to WTF so it can be used in JavaScriptCore https://bugs.webkit.org/show_bug.cgi?id=203803 Reviewed by Saam Barati. No new tests added because functionality is not changing, code is only moved from WebKit to WTF. * Platform/cocoa/WKCrashReporter.mm: (WebKit::setCrashReportApplicationSpecificInformation): (WebKit::setCrashLogMessage): Deleted. * WebKit.xcodeproj/project.pbxproj: 2019-11-05 Wenson Hsieh Native text substitutions interfere with HTML options resulting in crash https://bugs.webkit.org/show_bug.cgi?id=203116 Reviewed by Tim Horton. On macOS, an NSTableView inside a separate window is used to render suggestions when showing a datalist. The crash happens when this table view is reloaded while clicking a datalist suggestion; that is, if -[NSTableView reloadData] is invoked after the user sends a platform MouseDown event on the table view cell but before the MouseUp is received, the selected row of the table view will be -1 when the action, `-selectedRow:`, is invoked. In this particular case, the table view reload is triggered as a result of hiding the autocorrection bubble on macOS, thereby committing the alternative text suggestion and changing the value of the text field via an editing command. To avoid crashing, we simply make `-selectedRow:` robust in the case where the index is invalid. Test: fast/forms/datalist/datalist-click-crash.html * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: (-[WKDataListSuggestionsController selectedRow:]): 2019-11-05 Sihui Liu REGRESSION (r250754): web page using IDBIndex doesn't load occasionally https://bugs.webkit.org/show_bug.cgi?id=203431 Reviewed by Brady Eidson. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent): * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: 2019-11-05 Fujii Hironori Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds https://bugs.webkit.org/show_bug.cgi?id=203362 * UIProcess/UserMediaPermissionRequestProxy.h: Enclosed isUserGesturePriviledged with #if ENABLE(MEDIA_STREAM). 2019-11-05 youenn fablet mp4 video element broken with service worker https://bugs.webkit.org/show_bug.cgi?id=184447 Reviewed by Chris Dumez. Make a response as range-requested as per https://fetch.spec.whatwg.org/#http-network-or-cache-fetch step 15. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkRedirection): (WebKit::NetworkLoadChecker::validateResponse): * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): 2019-11-05 youenn fablet Enforce user gesture for getUserMedia in case a previous getUserMedia call was denied https://bugs.webkit.org/show_bug.cgi?id=203362 Reviewed by Eric Carlson. In case the request has user gesture priviledge, do not look at denied request history. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::isUserGesturePriviledged const): 2019-11-04 Jiewen Tan [WebAuthn] Guard against unexpected -[_WKWebAuthenticationPanel cancel] https://bugs.webkit.org/show_bug.cgi?id=203830 Reviewed by Brent Fulgham . -[_WKWebAuthenticationPanel cancel] was only expected to be called on behalf of an explicit user cancel from the UI. However, clients may call it in different other unexpected scenarios as well. We should guard against that. To do so, two counter ways are implemented: 1) AuthenticatorManager::cancelRequest is changed to invoke the pending request if there is no GlobalFrameID. This case can only be reached via calling -[_WKWebAuthenticationPanel cancel] before AuthenticatorManager::cancelRequest. 2) WebAuthenticationPanelClient::updatePanel and WebAuthenticationPanelClient::dismissPanel will call delegate methods in the next run loop to prevent -[_WKWebAuthenticationPanel cancel] being called in the delegates. Covered by new API tests. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::cancelRequest): (WebKit::AuthenticatorManager::createService const): (WebKit::AuthenticatorManager::invokePendingCompletionHandler): * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: (WebKit::WebAuthenticationPanelClient::updatePanel const): (WebKit::WebAuthenticationPanelClient::dismissPanel const): 2019-11-04 Ross Kirsling Unreviewed fix for non-unified build. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/NetworkResourceLoader.cpp: * Shared/ServiceWorkerInitializationData.cpp: * UIProcess/API/APIAttachment.cpp: * WebProcess/Storage/WebServiceWorkerProvider.h: Add missing includes. 2019-11-04 Per Arne Vollan Fix crash caused by syscall sandbox violation https://bugs.webkit.org/show_bug.cgi?id=203826 Reviewed by Brent Fulgham. A new syscall needs to be allowed in the WebContent process' sandbox. * WebProcess/com.apple.WebProcess.sb.in: 2019-11-04 John Wilander Resource Load Statistics: Flush the shared ResourceLoadObserver when the webpage is closed by JavaScript https://bugs.webkit.org/show_bug.cgi?id=203623 Reviewed by Alex Christensen. This patch adds flushing of pending statistics when a window is closed by JavaScript, when a webpage is removed from the web process, and when the web process prepares to suspend. New API test added. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Now calls logTestingEvent() so that the test infrastructure can wait for updates. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _seedResourceLoadStatisticsForTestingWithFirstParty:thirdParty:shouldScheduleNotification:completionHandler:]): Test infrastructure to seed every web process' WebCore::ResourceLoadObserver with test data. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _clearResourceLoadStatistics:]): (-[WKWebsiteDataStore _isRegisteredAsSubresourceUnderFirstParty:thirdParty:completionHandler:]): Test infrastructure. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::seedResourceLoadStatisticsForTesting): Test infrastructure. * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder): Made sure the completion handler is called even if there is no network process. (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): Now tells all web processes to turn ITP on or off. * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp: (WebKit::WebResourceLoadObserver::~WebResourceLoadObserver): (WebKit::WebResourceLoadObserver::logSubresourceLoadingForTesting): Test infrastructure to seed the observer with test data. * WebProcess/WebCoreSupport/WebResourceLoadObserver.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setWebsiteDataStoreParameters): Now checks whether a shared observer already exists before setting one. (WebKit::WebProcess::removeWebPage): (WebKit::WebProcess::prepareToSuspend): These two functions now call WebProcess::flushResourceLoadStatistics(). (WebKit::WebProcess::setResourceLoadStatisticsEnabled): This function now sets the process' shared WebCore::ResourceLoadObserver if none exists. (WebKit::WebProcess::flushResourceLoadStatistics): This function tells the shared WebCore::ResourceLoadObserver to send any pending statistics to the central ITP store. (WebKit::WebProcess::seedResourceLoadStatisticsForTesting): Test infrastructure to seed the shared observer with test data. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2019-11-04 Chris Dumez [iOS][WK2] Simplify process assertion handling for the network process and service worker processes https://bugs.webkit.org/show_bug.cgi?id=203633 Reviewed by Alex Christensen. Simplify process assertion handling for the network process and service worker processes. In particular, the following changes were made: 1. Put the NetworkProcessProxy in charge of keeping the network process runnable instead of relying on the WebProcessPool to do it. 2. Put the WebProcessProxy in charge of keeping the web process runnable due to service worker activity, instead of relying on the WebProcessPool to do it. 3. Introduce a new Variant data type which can store a foreground activity, a background activity or no activity. This avoid having 2 separate and mutually-exclusive data members for foreground and background activities. 4. The new code is a bit more correct because it makes sure the the activity we're holding is valid, instead of simply checking that it has an activity. This means that if the process assertion was previously invalidated, we will now properly take a new activity, which will re-take a process assertion. This patch also reduces the #ifdefing for IOS_FAMILY, since ProcessThrottler and ProcessAssertion exist on all platforms. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::updateProcessAssertion): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::isValidBackgroundActivity): (WebKit::ProcessThrottler::isValidForegroundActivity): * UIProcess/ProcessThrottler.h: * UIProcess/WebProcessPool.cpp: (WebKit::m_backgroundWebProcessCounter): (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::networkProcessCrashed): (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::terminateNetworkProcess): (WebKit::WebProcessPool::updateProcessAssertions): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didSetAssertionState): (WebKit::WebProcessProxy::updateServiceWorkerProcessAssertion): (WebKit::WebProcessProxy::enableServiceWorkers): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::isStandaloneServiceWorkerProcess const): 2019-11-03 Jiewen Tan [WebAuthn] CtapAuthenticator::tryDowngrade should distinguish requestData().options https://bugs.webkit.org/show_bug.cgi?id=203771 Reviewed by Brent Fulgham. CtapAuthenticator::tryDowngrade assumes the request is a getAssertion request. This is true for most cases but not for Google's registration. For Google's registration, a quirk is implemented to use U2F commands for registration if GoogleLegacyAppIdSupportExtension asks us to do so. No tests given there is no way to simulate google.com in our test infrastructures. * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::tryDowngrade): 2019-11-03 Tim Horton WKWebView can get stuck blank (Web Content process thinks the app is backgrounded) https://bugs.webkit.org/show_bug.cgi?id=203774 Reviewed by Chris Dumez. With careful timing, if a WKWebView swaps out its content view in the background, the incoming view can fail to inform the Web Content process when the app comes to the foreground, leaving the layer tree frozen. This occurs because the last-sent state is stored per-WKApplicationStateTrackingView, and the content view is the WKApplicationStateTrackingView, so it is possible for e.g. a WKPDFView to be in the hierarchy, keeping the correct state, with an initialized-but-never-parented WKContentView hanging off the WKWebView. If it is never parented, WKContentView will think that the current application state is foreground (_lastObservedStateWasBackground is initialized to NO). If you go into the background with a WKPDFView as the current content view, it will inform the Web Content process that the application has backgrounded. If, still in the background, WKWebView swaps from the WKPDFView to the WKContentView, and then comes into the foreground, when we get the notification that the app came to the foreground, we will not forward it to the Web Content process, because WKContentView's _lastObservedStateWasBackground remains NO. To fix this, move _lastObservedStateWasBackground to WebPageProxy, so that it always tracks the most recently sent state, regardless of which content view is active. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::lastObservedStateWasBackground const): * UIProcess/ios/WKApplicationStateTrackingView.mm: (-[WKApplicationStateTrackingView willMoveToWindow:]): (-[WKApplicationStateTrackingView didMoveToWindow]): (-[WKApplicationStateTrackingView _applicationDidEnterBackground]): (-[WKApplicationStateTrackingView _applicationWillEnterForeground]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationDidEnterBackground): (WebKit::WebPageProxy::applicationWillEnterForeground): 2019-11-02 Devin Rousso Web Inspector: Add diagnostic logging for frontend feature usage https://bugs.webkit.org/show_bug.cgi?id=203579 Reviewed by Brian Burg. This patch enables diagnostic logging for the Web Inspector web process and adds the necessary `InspectorFrontendClient` plumbing to `WebInspectorUI`. Original patch by Matt Baker . * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::supportsDiagnosticLogging): Added. (WebKit::WebInspectorUI::logDagnosticEvent): Added. * WebProcess/WebPage/RemoteWebInspectorUI.h: * WebProcess/WebPage/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::supportsDiagnosticLogging): Added. (WebKit::RemoteWebInspectorUI::logDiagnosticEvent): Added. * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController configuration]): Default to enabling diagnostic logging for the Web Inspector frontend window. * Configurations/FeatureDefines.xcconfig: Add `ENABLE_INSPECTOR_TELEMETRY`, which is only enabled for macOS. 2019-11-01 Brady Eidson Promote "_getWebArchive" to API. and https://bugs.webkit.org/show_bug.cgi?id=203767 Reviewed by Andy Estes. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView createWebArchiveDataWithCompletionHandler:]): (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): 2019-11-01 Brady Eidson Rejigger WKWebArchive headers. https://bugs.webkit.org/show_bug.cgi?id=203648 Reviewed by Andy Estes. * Shared/API/c/mac/WKWebArchiveRef.cpp: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.cpp. (WKWebArchiveGetTypeID): (WKWebArchiveCreate): (WKWebArchiveCreateWithData): (WKWebArchiveCreateFromRange): (WKWebArchiveCopyMainResource): (WKWebArchiveCopySubresources): (WKWebArchiveCopySubframeArchives): (WKWebArchiveCopyData): * Shared/API/c/mac/WKWebArchiveRef.h: Copied from Source/WebKit/Shared/API/c/mac/WKWebArchive.h. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebArchive.h: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.h. * WebKit.xcodeproj/project.pbxproj: 2019-11-01 Eric Carlson Add experimental TextTrackCue API https://bugs.webkit.org/show_bug.cgi?id=203649 Reviewed by Jer Noble. * Shared/WebPreferences.yaml: 2019-11-01 Brian Burg REGRESSION(r248696): Element Click on Mac is adding an extra page topContentInsets to y-coordinate https://bugs.webkit.org/show_bug.cgi?id=203765 Reviewed by Devin Rousso. * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::WebAutomationSession::platformSimulateMouseInteraction): The topContentInsets is accounted for by rootViewToWindow(), so don't add it in manually. 2019-11-01 Per Arne Vollan Investigate if mach lookup access to *.apple-extension-service, *.viewservice, and com.apple.uikit.viewservice.* can be denied https://bugs.webkit.org/show_bug.cgi?id=203626 Reviewed by Alexey Proskuryakov. Modify the allow rule for these services to include the telemetry option. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-01 Peng Liu Turn on the Picture-in-Picture API feature by default https://bugs.webkit.org/show_bug.cgi?id=203725 Reviewed by Jer Noble. * Shared/WebPreferences.yaml: 2019-10-31 Chris Dumez Take down the gesture snapshot early when the back/forward cache is not leveraged https://bugs.webkit.org/show_bug.cgi?id=203713 Reviewed by Tim Horton. Take down the gesture snapshot as soon as the gesture is done when the back/forward cache is not leveraged. Otherwise, the snapshot may stay up for a long time (while we load, parse and restore scroll position) and it would look to the user as if the view was unresponsive. Showing the page slowly loading in such cases is less confusing as the user knows what's going on and is even able to interact with the partially loaded page. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::hasCachedWebPage const): * Shared/WebBackForwardListItem.h: * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::endSwipeGesture): * UIProcess/ViewGestureController.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::makeSnapshotBlank): (WebKit::ViewGestureController::endSwipeGesture): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::makeSnapshotBlank): 2019-10-31 Per Arne Vollan [iOS] Fix mach lookup sandbox violations in the Mail app https://bugs.webkit.org/show_bug.cgi?id=203697 Reviewed by Alexey Proskuryakov. Allow mach lookup to the services "com.apple.logd.events" and "com.apple.distributed_notifications@1v3", which are seen when running the Mail application. Also allow "com.apple.aggregated", which was previously allowed, and is showing up in reports. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-31 Tim Horton Turn on IOSurface support in the iOS Simulator https://bugs.webkit.org/show_bug.cgi?id=203026 Reviewed by Simon Fraser. * Configurations/WebKit.xcconfig: Always link IOSurface now that we always have it. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: Turn on Accelerated Drawing and Accelerated Drawing for Canvas by default. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot]): Don't use RGB10 if we don't have it. (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Don't use render server snapshotting in hidden windows, because it (correctly, but unhelpfully) cannot capture contents in that case. 2019-10-31 Dean Jackson REGRESSION (r251215): Mail failed to build https://bugs.webkit.org/show_bug.cgi?id=203700 Reviewed by Antoine Quint. Revert the private modulemap. It didn't include enough things and caused some internal builds to fail. We'll put it back with everything included sometime soon. * Configurations/WebKit.xcconfig: * Modules/OSX.modulemap: Renamed from Source/WebKit/Modules/macOS.modulemap. * Modules/iOS.private.modulemap: Removed. * Modules/macOS.private.modulemap: Removed. * Shared/API/Cocoa/WebKitPrivate.h: 2019-10-31 Alex Christensen Enable more features in Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=203699 Rubber-stamped by Tim Horton. * PlatformMac.cmake: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): 2019-10-31 Russell Epstein Unreviewed, rolling out r251861. Caused 50+ Layout Test Crashes Reverted changeset: "Use SecurityOriginData in NetworkProcess where possible without other changes" https://bugs.webkit.org/show_bug.cgi?id=203615 https://trac.webkit.org/changeset/251861 2019-10-31 Truitt Savell Unreviewed, rolling out r251854. Broke iOS build Reverted changeset: "Rejigger WKWebArchive headers." https://bugs.webkit.org/show_bug.cgi?id=203648 https://trac.webkit.org/changeset/251854 2019-10-31 Alex Christensen Remove unneeded HAVE_TIMINGDATAOPTIONS https://bugs.webkit.org/show_bug.cgi?id=202990 Reviewed by Brady Eidson. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 2019-10-31 Alex Christensen Use SecurityOriginData in NetworkProcess where possible without other changes https://bugs.webkit.org/show_bug.cgi?id=203615 Reviewed by Brady Eidson. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): 2019-10-31 Alex Christensen Expose more WKPreferences SPI https://bugs.webkit.org/show_bug.cgi?id=203631 Reviewed by Brady Eidson. I added a unit test for the one that can be easily tested. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setWebAudioEnabled:]): (-[WKPreferences _webAudioEnabled]): (-[WKPreferences _setAcceleratedCompositingEnabled:]): (-[WKPreferences _acceleratedCompositingEnabled]): (-[WKPreferences _setRequestAnimationFrameEnabled:]): (-[WKPreferences _requestAnimationFrameEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2019-10-31 Alex Christensen CMake build should make WebKit framework able to be used by Safari https://bugs.webkit.org/show_bug.cgi?id=203685 Rubber-stamped by Tim Horton. * PlatformMac.cmake: 2019-10-31 Brady Eidson Rejigger WKWebArchive headers. https://bugs.webkit.org/show_bug.cgi?id=203648 Reviewed by Andy Estes. * Shared/API/c/mac/WKWebArchiveRef.cpp: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.cpp. (WKWebArchiveGetTypeID): (WKWebArchiveCreate): (WKWebArchiveCreateWithData): (WKWebArchiveCreateFromRange): (WKWebArchiveCopyMainResource): (WKWebArchiveCopySubresources): (WKWebArchiveCopySubframeArchives): (WKWebArchiveCopyData): * Shared/API/c/mac/WKWebArchiveRef.h: Copied from Source/WebKit/Shared/API/c/mac/WKWebArchive.h. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebArchive.h: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.h. * WebKit.xcodeproj/project.pbxproj: 2019-10-31 Wenson Hsieh Add telemetry to test a potential cause of crashes under -[WKContentView _interpretKeyEvent:isCharEvent:] https://bugs.webkit.org/show_bug.cgi?id=203630 Reviewed by Simon Fraser. This iOS-specific crash occurs under `-_interpretKeyEvent:isCharEvent:`, when we first try to access WebEvent's properties with `event.keyboardFlags`. This suggests that between storing the WebEvent in WebPageProxy's m_keyEventQueue, and later receiving an InterpretKeyEvent sync IPC message in the UI process, something ends up overreleasing (or otherwise writing over or corrupting) the WebEvent. However, from code inspection, nothing appears to overrelease the WebEvent; an alternate possibility is that the API is somehow being invoked from a background thread, which would explain why the WebEvent may sometimes get destroyed too early. To try and detect this scenario (and avoid keeping any strong references to WebEvent at all), add an `os_log_fault` in case the API is being called on a background thread, and bail immediately. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView handleKeyWebEvent:withCompletionHandler:]): 2019-10-31 Miguel Gomez [CoordGraphics] Avoid painting backing stores for zero-opacity layers https://bugs.webkit.org/show_bug.cgi?id=184143 Reviewed by Žan Doberšek. Do not check whether a backingStore is required by a layer inside CoordinatedGraphicsScene. This decision is made by the appropriate CoordinatedGraphicsLayer and propagated to the scene by sending a valid or null Nicosia::BackingStore instance through the state. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::updateBackingStore): (WebKit::layerShouldHaveBackingStore): Deleted. 2019-10-30 Peng Liu [Picture-in-Picture Web API] Enable the support for iOS https://bugs.webkit.org/show_bug.cgi?id=202618 Reviewed by Jer Noble. Enable the Picture-in-Picture API support for iOS (iPad only). * Configurations/FeatureDefines.xcconfig: * WebProcess/cocoa/VideoFullscreenManager.mm: 2019-10-30 Alex Christensen Prevent Mac CMake build from bit rotting https://bugs.webkit.org/show_bug.cgi?id=203647 Rubber-stamped by Tim Horton. * NetworkProcess/NetworkProcess.cpp: (WebKit::m_messagePortChannelRegistry): * PlatformMac.cmake: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (-[_WKWebAuthenticationPanel delegate]): (-[_WKWebAuthenticationPanel setDelegate:]): * UIProcess/WebProcessProxy.cpp: 2019-10-30 Per Arne Vollan It should be possible to create a mach sandbox extension for the WebContent process before the audit token is known https://bugs.webkit.org/show_bug.cgi?id=203618 Reviewed by Brent Fulgham. Currently, we are only able to create a mach sandbox extension for the WebContent process if we know its audit token. It should be possible to create a mach extension without the audit token, since this is needed when we want to create extensions before the PID or audit token is known. These extensions are typically sent in the WebProcess creation parameters. No new tests, this is not a behavior change, but a patch in preparation for future patches. * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtensionImpl::sandboxExtensionForType): (WebKit::SandboxExtension::createHandleForMachLookup): (WebKit::SandboxExtension::createHandleForMachLookupByAuditToken): Deleted. * Shared/SandboxExtension.h: * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded): 2019-10-30 Per Arne Vollan Fix some sysctl read violations in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=203632 Reviewed by Brent Fulgham. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-30 Dean Jackson REGRESSION(r251568) If we didn't start a Service Worker, don't try talking to it https://bugs.webkit.org/show_bug.cgi?id=203639 Reviewed by Chris Dumez. Similar to the fix that introduced this regression, if the UI process does not have the entitlement to start a service worker, we should not try to load with one. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): If the parent process doesn't have a service worker, use the regular load path. 2019-10-30 Simon Fraser Turn Resize Observer on by default https://bugs.webkit.org/show_bug.cgi?id=203644 rdar://problem/56026799 Reviewed by Tim Horton. Change the defaultValue of Resize Observer to true. * Shared/WebPreferences.yaml: 2019-10-30 Per Arne Vollan Lookup to mach services with the WebKit extension should list the allowed services https://bugs.webkit.org/show_bug.cgi?id=203619 Reviewed by Alexey Proskuryakov. To tighten the mach lookup rule which allows lookup to services with the "com.apple.webkit.extension.mach" extension, all allowed services should be listed. Currently, we are only creating mach lookup extensions to "com.apple.iphone.axserver-systemwide", but more will come in the future. No new tests. Testing this requires UI interaction on the device to enable Accessibility. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-30 Alex Christensen WKContentRuleLists should block requests from service workers https://bugs.webkit.org/show_bug.cgi?id=201980 Reviewed by Chris Dumez. Test: http/tests/contentextensions/service-worker.https.html Also covered by an API test. * Shared/ServiceWorkerInitializationData.cpp: Added. (WebKit::ServiceWorkerInitializationData::encode const): (WebKit::ServiceWorkerInitializationData::decode): * Shared/ServiceWorkerInitializationData.h: Added. * Sources.txt: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::contentRuleListData): * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createForServiceWorkers): (WebKit::WebProcessProxy::establishServiceWorkerContext): (WebKit::contentRuleListsFromIdentifier): (WebKit::WebProcessProxy::enableServiceWorkers): * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection): (WebKit::m_userAgent): (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2019-10-30 Andres Gonzalez Create base class common to AccessibilityObject and AXIsolatedTreeNode. https://bugs.webkit.org/show_bug.cgi?id=203408 Reviewed by Chris Fleizach. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKAccessibilityRootObject): (WKAccessibilityFocusedObject): 2019-10-30 Chris Dumez Unreviewed, fix reversed assertion landed in r251778. * UIProcess/ProcessThrottler.h: (WebKit::ProcessThrottler::Activity::invalidate): 2019-10-30 Chris Dumez Unreviewed, fix WatchOS build after r251778. * UIProcess/WebProcessProxy.h: 2019-10-30 Chris Dumez WKFrameIsDisplayingMarkupDocument() should return true after a window.open/document.write https://bugs.webkit.org/show_bug.cgi?id=203587 Reviewed by Alex Christensen. When doing a document.open(), we were propagating the document's URL to the UIProcess but not its MIME type. WKFrameIsDisplayingMarkupDocument() was relying on this MIME type. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didExplicitOpen): * UIProcess/WebFrameProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didExplicitOpenForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2019-10-30 Chris Dumez REGRESSION (r238252): HTTP POST is losing application/x-www-form-urlencoded body if there's a redirect to different host https://bugs.webkit.org/show_bug.cgi?id=201950 Reviewed by Alex Christensen. The resource request body was getting lost on cross-site redirects. This was caused by the fact that a cross-site redirect would cause a process-swap and the request to start again from a new process. This would work fine if the request does not have a body. However, we have an optimization in place which avoids encoding the request body whenever it is sent over IPC. Because the WebResourceLoader::WillSendRequest IPC would not encode the request body, any decision to process swap as a result of this IPC (i.e. redirect) would cause the new request in the new process to be missing its body. To address the issue, we now make sure to pass the request body in the WillSendRequest IPC and reconsile the request with its body on the recipient side. Test: http/tests/misc/form-submit-file-cross-site-redirect.html * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: 2019-10-30 Jer Noble Enable Remote Playback API by default https://bugs.webkit.org/show_bug.cgi?id=203595 Reviewed by Eric Carlson. * Shared/WebPreferences.yaml: 2019-10-30 Chris Dumez [iOS] [WK2] Improve process assertion-related logging to help identify causes of leaked assertions https://bugs.webkit.org/show_bug.cgi?id=203438 Reviewed by Antti Koivisto. Improve process assertion-related logging to help identify causes of leaked assertions. Previously, whenever our code needed to prevent suspension of a child process due to some kind of activity, it would simply grab a "token" from the child process' ProcessThrottler. This, in-turn, would cause the ProcessThrottler to take the right kind of ProcessAssertion or release it when nobody holds any tokens any more. We frequently have issues where the UIProcess keeps its assertions around for too long after getting backgrounding. This causes the assertions to get invalidated and the UIProcess will usually suspend (albeit with a delay, which is bad for power). Sometimes though, we get killed because our invalidation handler does not get a chance to release the assertion in time. Finding out why we're keeping around assertions is currently very difficult because we cannot easily see in the logs who is still holding ProcessThrottler tokens. To make such debugging easier, clients now notify the ProcessThrottler when they start some activity and provide a user-readable description of the activity. The client then gets a ForegroundActivity or BackgroundActivity object instead of simply a token. As a result, we are now able to log when a given activity that prevents suspension begins and ends, with a user-friendly string. Also, when the assertion gets invalidated, it will invalidate all these pending activities and we'll see in the logs the name of the activities that were still going on upon invalidation. * Shared/API/Cocoa/RemoteObjectRegistry.h: (WebKit::RemoteObjectRegistry::backgroundActivity): * Shared/API/Cocoa/RemoteObjectRegistry.mm: (WebKit::RemoteObjectRegistry::sendInvocation): * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::takeActivityToken): (WebKit::DownloadClient::releaseActivityTokenIfNecessary): * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationState): (WebKit::NavigationState::releaseNetworkActivity): (WebKit::NavigationState::didChangeIsLoading): (WebKit::NavigationState::didSwapWebProcesses): * UIProcess/Cocoa/UIRemoteObjectRegistry.cpp: (WebKit::UIRemoteObjectRegistry::backgroundActivity): * UIProcess/Cocoa/UIRemoteObjectRegistry.h: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::processWasResumed): * UIProcess/GenericCallback.h: (WebKit::CallbackBase::CallbackBase): (WebKit::GenericCallback::create): (WebKit::GenericCallback::GenericCallback): (WebKit::CallbackMap::put): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): (WebKit::NetworkProcessProxy::didClose): (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles): (WebKit::NetworkProcessProxy::syncAllCookies): (WebKit::NetworkProcessProxy::didSyncAllCookies): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::ProcessThrottler): (WebKit::ProcessThrottler::~ProcessThrottler): (WebKit::ProcessThrottler::addActivity): (WebKit::ProcessThrottler::removeActivity): (WebKit::ProcessThrottler::invalidateAllActivities): (WebKit::ProcessThrottler::expectedAssertionState): (WebKit::ProcessThrottler::setAssertionState): (WebKit::ProcessThrottler::uiAssertionWillExpireImminently): * UIProcess/ProcessThrottler.h: (WebKit::ProcessThrottler::Activity::Activity): (WebKit::ProcessThrottler::Activity::~Activity): (WebKit::ProcessThrottler::Activity::isValid const): (WebKit::ProcessThrottler::Activity::invalidate): (WebKit::ProcessThrottler::shouldBeRunnable const): (WebKit::ProcessThrottler::foregroundActivity): (WebKit::ProcessThrottler::backgroundActivity): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): * UIProcess/ProvisionalPageProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::SuspendedPageProxy): (WebKit::SuspendedPageProxy::didProcessRequestToSuspend): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebBackForwardCacheEntry.cpp: (WebKit::WebBackForwardCacheEntry::~WebBackForwardCacheEntry): * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): (WebKit::WebCookieManagerProxy::deleteCookie): (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince): (WebKit::WebCookieManagerProxy::setCookies): (WebKit::WebCookieManagerProxy::getAllCookies): (WebKit::WebCookieManagerProxy::getCookies): (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::updateThrottleState): (WebKit::WebPageProxy::waitForDidUpdateActivityState): (WebKit::WebPageProxy::setInitialFocus): (WebKit::WebPageProxy::validateCommand): (WebKit::WebPageProxy::executeEditCommand): (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart): (WebKit::WebPageProxy::replaceMatches): (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): (WebKit::WebPageProxy::runJavaScriptInFrame): (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): (WebKit::WebPageProxy::getSourceForFrame): (WebKit::WebPageProxy::getContentsAsString): (WebKit::WebPageProxy::getBytecodeProfile): (WebKit::WebPageProxy::getSamplingProfilerOutput): (WebKit::WebPageProxy::getContentsAsMHTMLData): (WebKit::WebPageProxy::getSelectionOrContentsAsString): (WebKit::WebPageProxy::getSelectionAsWebArchiveData): (WebKit::WebPageProxy::getMainResourceDataOfFrame): (WebKit::WebPageProxy::getResourceDataFromFrame): (WebKit::WebPageProxy::getWebArchiveOfFrame): (WebKit::WebPageProxy::forceRepaint): (WebKit::WebPageProxy::resetStateAfterProcessExited): (WebKit::WebPageProxy::drawToPDF): (WebKit::WebPageProxy::getMarkedRangeAsync): (WebKit::WebPageProxy::getSelectedRangeAsync): (WebKit::WebPageProxy::characterIndexForPointAsync): (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): (WebKit::WebPageProxy::takeSnapshot): (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler): (WebKit::WebPageProxy::getLoadDecisionForIcon): (WebKit::WebPageProxy::insertAttachment): (WebKit::WebPageProxy::updateAttachmentAttributes): (WebKit::WebPageProxy::getApplicationManifest): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::updateProcessAssertions): (WebKit::WebProcessPool::reinstateNetworkProcessAssertionState): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shutDown): (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): (WebKit::WebProcessProxy::setIsHoldingLockedFiles): (WebKit::WebProcessProxy::startBackgroundActivityForFullscreenInput): (WebKit::WebProcessProxy::endBackgroundActivityForFullscreenInput): * UIProcess/WebProcessProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView presentViewControllerForCurrentFocusedElement]): (-[WKContentView dismissAllInputViewControllers:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::requestFocusedElementInformation): (WebKit::WebPageProxy::selectWithGesture): (WebKit::WebPageProxy::updateSelectionWithTouches): (WebKit::WebPageProxy::applyAutocorrection): (WebKit::WebPageProxy::selectTextWithGranularityAtPoint): (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection): (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection): (WebKit::WebPageProxy::selectPositionAtPoint): (WebKit::WebPageProxy::beginSelectionInDirection): (WebKit::WebPageProxy::updateSelectionWithExtentPoint): (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPageProxy::requestDictationContext): (WebKit::WebPageProxy::getSelectionContext): (WebKit::WebPageProxy::selectWithTwoTouches): (WebKit::WebPageProxy::applicationDidEnterBackground): (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset): (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText): (WebKit::WebPageProxy::moveSelectionByOffset): (WebKit::WebPageProxy::focusNextFocusedElement): (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF): 2019-10-30 Carlos Garcia Campos REGRESSION(2.27.2): [GTK] Overview item remove button broken https://bugs.webkit.org/show_bug.cgi?id=203461 Reviewed by Adrian Perez de Castro. This is a regression of the switch to new custom protocols implementation. Epiphany is passing NULL as content type of ephy-resource requests, in which case we should try to guess the mime type, but we are not doing it. * UIProcess/API/glib/WebKitURISchemeRequest.cpp: (webkitURISchemeRequestReadCallback): Use MIMETypeRegistry to guess the mime type when content type is nullptr, like NetworkDataTask does. 2019-10-29 Andy Estes [Quick Look] Clean up LegacyPreviewLoaderClients https://bugs.webkit.org/show_bug.cgi?id=203472 Reviewed by Brady Eidson. Replaced QuickLookDocumentData with ShareableResource. Removed messages WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame and WebPage::DidReceivePasswordForQuickLookDocument, replacing them with async message WebPageProxy::RequestPasswordForQuickLookDocumentInMainFrame. * Shared/ios/QuickLookDocumentData.cpp: Removed. * Shared/ios/QuickLookDocumentData.h: Removed. * SourcesCocoa.txt: * UIProcess/API/APILoaderClient.h: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame): * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::requestPasswordForQuickLookDocumentInMainFrame): (WebKit::ProvisionalPageProxy::didReceiveMessage): (WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Deleted. * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame): (WebKit::WebPageProxy::requestPasswordForQuickLookDocumentInMainFrame): (WebKit::WebPageProxy::requestPasswordForQuickLookDocumentInMainFrameShared): (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Deleted. (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared): Deleted. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp: (WebKit::WebPreviewLoaderClient::WebPreviewLoaderClient): (WebKit::WebPreviewLoaderClient::didReceiveBuffer): (WebKit::WebPreviewLoaderClient::didFinishLoading): (WebKit::WebPreviewLoaderClient::didFail): (WebKit::WebPreviewLoaderClient::didRequestPassword): (WebKit::passwordCallbacks): Deleted. (WebKit::WebPreviewLoaderClient::~WebPreviewLoaderClient): Deleted. (WebKit::WebPreviewLoaderClient::didReceiveDataArray): Deleted. (WebKit::WebPreviewLoaderClient::didReceivePassword): Deleted. * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::didStartLoadForQuickLookDocumentInMainFrame): (WebKit::WebPage::didFinishLoadForQuickLookDocumentInMainFrame): (WebKit::WebPage::requestPasswordForQuickLookDocumentInMainFrame): (WebKit::WebPage::didReceivePasswordForQuickLookDocument): Deleted. 2019-10-29 Jiewen Tan [WebAuthn] Add more information to _WKWebAuthenticationPanel https://bugs.webkit.org/show_bug.cgi?id=202561 Reviewed by Youenn Fablet and Brent Fulgham. This change adds transports and type to _WKWebAuthenticationPanel such that clients can know what transport the current ceremony demands and the type of the current ceremony. These extra information allow clients to give users more specific instructions to interact with authenticators. To pass transports to client, the way how them is collected is changed significantly: 1) The timing is moved to runPanel before the client delegate call. 2) NfcService::isAvailable is added for AuthenticatorManager to determine if NFC is available in the current device. 3) AuthenticatorManager::filterTransports is added to filter transports requested by RP to ones that are available. This process is handled by each service naturally before. 4) AuthenticatorManager::startRequest is now being splitted into AuthenticatorManager::handleRequest, AuthenticatorManager::runPanel and AuthenticatorManager::getTransports. To pass type to _WKWebAuthenticationPanel, ClientDataType is moved from WebCore::AuthenticatorCoordinator to WebCore::WebAuthenticationConstants in order to be reused to indicate the ceremony type. * UIProcess/API/APIWebAuthenticationPanel.cpp: (API::WebAuthenticationPanel::create): (API::WebAuthenticationPanel::WebAuthenticationPanel): * UIProcess/API/APIWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (-[_WKWebAuthenticationPanel relyingPartyID]): (wkWebAuthenticationTransport): (-[_WKWebAuthenticationPanel transports]): (wkWebAuthenticationType): (-[_WKWebAuthenticationPanel type]): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::WebCore::collectTransports): (WebKit::WebCore::getClientDataType): (WebKit::AuthenticatorManager::handleRequest): (WebKit::AuthenticatorManager::filterTransports const): (WebKit::AuthenticatorManager::startDiscovery): (WebKit::AuthenticatorManager::initTimeOutTimer): (WebKit::AuthenticatorManager::runPanel): (WebKit::AuthenticatorManager::getTransports const): (WebKit::AuthenticatorManager::respondReceivedInternal): Deleted. (WebKit::AuthenticatorManager::startRequest): Deleted. * UIProcess/WebAuthentication/AuthenticatorManager.h: (WebKit::AuthenticatorManager::respondReceivedInternal): * UIProcess/WebAuthentication/Cocoa/NfcService.h: * UIProcess/WebAuthentication/Cocoa/NfcService.mm: (WebKit::NfcService::isAvailable): (WebKit::NfcService::platformStartDiscovery): * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp: (WebKit::MockAuthenticatorManager::filterTransports const): * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h: 2019-10-29 Wenson Hsieh REGRESSION (r251693): [iOS] Unable to change selection in a focused element if the element's bounds change https://bugs.webkit.org/show_bug.cgi?id=203582 Reviewed by Tim Horton. The refactoring in r251693 broke the ability to change selection in an editable area by tapping in iOS Safari, in the case where the editable element's bounds change after focus. This is because the aforementioned change now compares position informations' element context against the focused element information's element context to check whether or not the position information request was inside the focused element. However, if the bounds of the focused element change in between the position information request and when the element is initially focused, the `operator==` comparison will fail, causing us to prevent text selection. To fix this, only check whether or not the two element contexts refer to the same element in the DOM by comparing page, document and element identifiers, but not the element's bounding rect. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]): (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): 2019-10-07 Jer Noble Implement the Remote Playback API. https://bugs.webkit.org/show_bug.cgi?id=162971 Reviewed by Youenn Fablet. Add a preference to enable the Remote Playback API. Pass the playbackTargetPickerWasDismissed() notification on to Page. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesGetRemotePlaybackEnabled): (WKPreferencesSetRemotePlaybackEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::playbackTargetPickerWasDismissed): * UIProcess/WebPageProxy.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::mockMediaPlaybackTargetPickerDismissPopup): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::playbackTargetPickerWasDismissed): 2019-10-29 Per Arne Vollan REGRESSION: WebContent getting killed due to syscall filter violation https://bugs.webkit.org/show_bug.cgi?id=203575 Reviewed by Alexey Proskuryakov. The sandbox profile on macOS needs to open up for a syscall. No new tests, covered by existing tests. * WebProcess/com.apple.WebProcess.sb.in: 2019-10-29 Brent Fulgham [iOS] Clean up sandbox to group similar rules together https://bugs.webkit.org/show_bug.cgi?id=203525 Reviewed by Per Arne Vollan. Clean up the sandbox rules by grouping rules by feature areas to make future editing easier. This change should have no impact on behavior. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-29 Myles C. Maxfield REGRESSION (r251413): Nightly build crashes on launch due to -[WKPreferences _setShouldAllowDesignSystemUIFonts:]: unrecognized selector https://bugs.webkit.org/show_bug.cgi?id=203549 Reviewed by Simon Fraser. r251413 deleted an SPI that new Safari stopped calling. However, old Safari continues to call it. The solution is just to add stub implementations so old Safari doesn't fail to link at runtime. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _shouldAllowDesignSystemUIFonts]): (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2019-10-27 Wenson Hsieh Add enterkeyhint support https://bugs.webkit.org/show_bug.cgi?id=189546 Reviewed by Tim Horton. This patch adds support for the enterkeyhint HTML attribute on iOS. Tests: EnterKeyHintTests.EnterKeyHintInContentEditableElement EnterKeyHintTests.EnterKeyHintInTextInput EnterKeyHintTests.EnterKeyHintInTextArea * Shared/FocusedElementInformation.cpp: (WebKit::FocusedElementInformation::encode const): (WebKit::FocusedElementInformation::decode): * Shared/FocusedElementInformation.h: Add a new flag to FocusedElementInformation to indicate the EnterKeyHint type that should be used when bringing up an input view for the focused element. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView textInputTraits]): Map the given EnterKeyHint type to a UIReturnKeyType. If an unsupported (i.e. "previous") or default EnterKeyHint value is used, then we fall back to existing behavior which deduces the default enterkeyhint value from the input type if the focused element is inside an actionable form; otherwise, we avoid setting any value for the `returnKeyType`, defaulting to `UIReturnKeyDefault`. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getFocusedElementInformation): 2019-10-29 Kate Cheney Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-database.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=203542#add_comment Reviewed by John Wilander. This test was a flaky failure due to its calling scheduleStatisticsProcessingRequestIfNecessary() after logging a cross site load with link decoration. This call is currently unecessary because this function is not yet used to classify resources, and is causing the test to execute a callback before it is ready. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: 2019-10-29 Truitt Savell Unreviewed, rolling out r251639. Caused flakey API failures for GetDisplayMediaTest.Constraints Reverted changeset: "Enforce user gesture for getUserMedia in case a previous getUserMedia call was denied" https://bugs.webkit.org/show_bug.cgi?id=203362 https://trac.webkit.org/changeset/251639 2019-10-29 Truitt Savell Unreviewed, rolling out r251646. Caused flakey API failures for GetDisplayMediaTest.Constraints Reverted changeset: "Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds" https://bugs.webkit.org/show_bug.cgi?id=203362 https://trac.webkit.org/changeset/251646 2019-10-29 Chris Dumez Unreviewed, rolling out r251594. Caused an API test failure Reverted changeset: "mp4 video element broken with service worker" https://bugs.webkit.org/show_bug.cgi?id=184447 https://trac.webkit.org/changeset/251594 2019-10-29 Chris Dumez Notification permissions are not remembered for origins without port https://bugs.webkit.org/show_bug.cgi?id=203537 Reviewed by Brady Eidson. When WKSecurityOriginCreate() gets called with a port that is invalid, then pass WTF::nullopt to construct the security origin instead of the invalid port. The issue is that the port for security origins is optional internally. However, our API (WKSecurityOriginGetPort() & WKSecurityOrigin.port) will return 0 when there is no port. As a result, clients such as Safari sometimes pass 0 as port to construct a new WKSecurityOriginRef(). This was causing issues with regards to notifications because Safari would construct origins whose string representation looks like "https://www.apple.com:0" and it would not match the "https://www.apple.com" we expect internally. * Shared/API/c/WKSecurityOriginRef.cpp: (WKSecurityOriginCreate): 2019-10-29 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.2 release * wpe/NEWS: Add release notes for 2.27.2. 2019-10-28 Wenson Hsieh Replace InteractionInformationAtPosition.nodeAtPositionIsFocusedElement with an element context https://bugs.webkit.org/show_bug.cgi?id=203498 Reviewed by Tim Horton. Refactors InteractionInformationAtPosition, such that it doesn't need a special flag to indicate whether there is a focused element at the position. This is a followup to webkit.org/b/203264; no new tests, as there should be no change in behavior. * Shared/FocusedElementInformation.cpp: (WebKit::FocusedElementInformation::encode const): (WebKit::FocusedElementInformation::decode): * Shared/FocusedElementInformation.h: Add an elementContext to FocusedElementInformation to represent the focused element; then, instead of checking whether there is a focused element underneath the request position, simply check that the position information's element context matches the FocusedElementInformation's element context. Additionally, rename elementRect in FocusedElementInformation to interactionRect, to draw a distinction between this rect and the new ElementContext's boundingRect. * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): Remove the nodeAtPositionIsFocusedElement flag. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]): (-[WKContentView _zoomToRevealFocusedElement]): (-[WKContentView _selectionClipRect]): (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): In various places that consult nodeAtPositionIsFocusedElement, instead check that the position information's hit-tested element context is the same as the focused element, via FocusedElementInformation. (-[WKContentView _didCommitLoadForMainFrame]): Nuke the cached position information data upon navigation; without this tweak, we will fail when running several iOS layout tests back-to-back, that tap in exactly the same location. (rectToRevealWhenZoomingToFocusedElement): (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]): (-[WKContentView _elementDidBlur]): (-[WKContentView rectForFocusedFormControlView:]): (-[WKContentView _didChangeFocusedElementRect:toRect:]): Deleted. Remove code to invalidate cached position information when changing the focused element rect. * UIProcess/ios/forms/WKFormPopover.mm: (-[WKRotatingPopover presentPopoverAnimated:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): (WebKit::WebPage::getFocusedElementInformation): 2019-10-28 Adrian Perez de Castro [GTK][WPE] Fix various non-unified build issues introduced since r251436 https://bugs.webkit.org/show_bug.cgi?id=203492 Reviewed by Alex Christensen and Mark Lam. * UIProcess/InspectorTargetProxy.h: Add forward declaration of ProvisionalPageProxy. * UIProcess/Plugins/PluginProcessProxy.cpp: Add missin inclusion of WebProcessProxyMessages.h * UIProcess/ProcessThrottler.cpp: Add missing inclusion of wtf/CompletionHandler.h * UIProcess/ProvisionalPageProxy.h: Add missing inclusion of WebCore/FrameIdentifier.h * UIProcess/WebPageInspectorController.h: Add missing inclusion of WebCore/PageIdentifier.h * WebProcess/WebPage/WebPageInspectorTargetController.cpp: Add missing inclusion of WebPageInspectorTargetFrontendChannel.h 2019-10-28 Per Arne Vollan [iOS] Fix sandbox violations https://bugs.webkit.org/show_bug.cgi?id=203505 Reviewed by Brent Fulgham. Running layout tests shows that allowing mach lookup is needed for a set of services which was previously denied. This patch add rules for allowing these services again. The service 'com.apple.logd.events' is still denied, since it has not been observed to be in use. No new tests, covered by existing tests. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-28 Alex Christensen Unreviewed, rolling out r251675. Broke some builds Reverted changeset: "Remove unused WKWebsiteDataStore setter SPI" https://bugs.webkit.org/show_bug.cgi?id=203114 https://trac.webkit.org/changeset/251675 2019-10-28 Wenson Hsieh Add bindings support for the enterkeyhint HTML attribute https://bugs.webkit.org/show_bug.cgi?id=203440 Reviewed by Ryosuke Niwa. Add a new runtime switch for the enterkeyhint attribute, and enable it by default on macOS and iOS. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: 2019-10-28 Alex Christensen Remove unused _WKProcessPoolConfiguration SPI https://bugs.webkit.org/show_bug.cgi?id=203066 Reviewed by Youenn Fablet. After rdar://problem/56260478 this is not used, so away it goes! * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): Deleted. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::globalCTDataConnectionServiceType): Deleted. (WebKit::NetworkSessionCocoa::ctDataConnectionServiceType const): Deleted. (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType): Deleted. * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm: (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorCTDataConnectionServiceType): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): Deleted. (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): Deleted. (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]): Deleted. (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]): Deleted. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): 2019-10-28 Alex Christensen Remove unused WKWebsiteDataStore setter SPI https://bugs.webkit.org/show_bug.cgi?id=203114 Reviewed by Anders Carlsson. They have been replaced by _WKWebsiteDataStoreConfiguration SPI which was adopted in rdar://problem/56349165 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]): Deleted. (-[WKWebsiteDataStore _boundInterfaceIdentifier]): Deleted. (-[WKWebsiteDataStore _setAllowsCellularAccess:]): Deleted. (-[WKWebsiteDataStore _allowsCellularAccess]): Deleted. (-[WKWebsiteDataStore _setProxyConfiguration:]): Deleted. (-[WKWebsiteDataStore _proxyConfiguration]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier): Deleted. (WebKit::WebsiteDataStore::setAllowsCellularAccess): Deleted. (WebKit::WebsiteDataStore::setProxyConfiguration): Deleted. 2019-10-28 Brady Eidson Expose _printOperationWithPrintInfo: SPI as API and https://bugs.webkit.org/show_bug.cgi?id=203496 Reviewed by Andy Estes. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView printOperationWithPrintInfo:]): (-[WKWebView _printOperationWithPrintInfo:]): 2019-10-28 Kate Cheney Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=203491 Reviewed by Chris Dumez. No new tests, this change is tested by the existing resourceLoadStatistics tests. This test started flaking when a new memory store was being created between tests to maintain consistency. The call to grandfatherExistingWebsiteData from populateMemoryStoreFromDisk in the persistent storage was async, causing a race condition that led to occasional failures. Adding a completion handler and changing the callsite of populateMemoryStoreFromDisk should fix this problem. * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): The persistent store in the databaseEnabled case was never being used and is unnecessary. (WebKit::WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk): Since persistent storage only exists when using the memory store, populateMemoryStoreFromDisk should check if m_persistentStorage has been initialized. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setUseITPDatabase): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): (WebKit::NetworkSession::recreateResourceLoadStatisticStore): * NetworkProcess/NetworkSession.h: 2019-10-28 Wenson Hsieh [iOS] 3 editing/pasteboard/smart-paste-paragraph-* tests are flaky https://bugs.webkit.org/show_bug.cgi?id=203264 Reviewed by Tim Horton. Fixes several flaky layout tests that exercise a corner case in our logic for caching position information responses in the UI process. When focusing an element via a tap, we send a position information request for the tap location in -_webTouchEventsRecognized:. After the web process computes the information and hands it back to the UI process, we cache this in WKContentView's _positionInformation. However, at the time of computing the request, the tapped element has not been focused yet, so the value of the position information's nodeAtPositionIsFocusedElement flag is false. After the tap is recognized, we'll then focus the element, such that if a subsequent position information request were to arrive at the same location, it would have a nodeAtPositionIsFocusedElement flag set to true. In this state, if the user taps _exactly_ at the same location again, UIKit (through text interaction gestures) will ask us for information at the same point; we will end up using the cached information, for which nodeAtPositionIsFocusedElement is false, causing us to incorrectly prevent the text interaction. In this particular case, we fail to select text via a double tap gesture. To address this, we invalidate the cached position information in the UI process whenever the focused element rect changes (e.g. when the focused element changes); the only exception to this is when the previously cached position information was not over the focused element, and the new focused element rect is empty, in which case the value of nodeAtPositionIsFocusedElement is guaranteed to have not changed. While this may potentially leads to an additional synchronous position information request when tapping at the same location after focusing an element, this is very difficult to achieve in practice, since the tap location would need to be _exactly_ at the same location. No new test, since this is exercised by existing flaky layout tests. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]): (-[WKContentView _elementDidBlur]): Also, add a FIXME about how we clear out surprisingly little of _focusedElementInformation when blurring the focused element. (-[WKContentView _didChangeFocusedElementRect:toRect:]): 2019-10-28 John Wilander Storage Access API: Make the API work with the experimental 3rd-party cookie blocking https://bugs.webkit.org/show_bug.cgi?id=203428 Reviewed by Alex Christensen. Tests: http/tests/storageAccess/deny-due-to-no-interaction-under-general-third-party-cookie-blocking.html http/tests/storageAccess/grant-with-prompt-under-general-third-party-cookie-blocking.html http/tests/storageAccess/has-storage-access-under-general-third-party-cookie-blocking-with-cookie.html http/tests/storageAccess/has-storage-access-under-general-third-party-cookie-blocking-without-cookie.html This patch adds Storage Access API support for the experimental 3rd-party cookie blocking that landed in . There are three policies at play because it can be changed with the experimental setting: 1. The underlying cookie policy. 2. Shipping ITP. 3. The off by default, experimental 3rd-party cookie blocking. To support them all, a CookieAccess enum was added to encode how the API should respond. The enum has these values: CannotRequest - This third-party cannot request storage access based on the current policy. BasedOnCookiePolicy – This third-party should be treated according to the underlying cookie policy. OnlyIfGranted – This third-party can and must get access through the Storage Access API. Here's the truth table I used to work through the logic for both document.hasStorageAccess() and document.requestStorageAccess(): Access | Is | User | Has | 3rd-party | | granted | prevalent | interaction | cookie | cookie block | RESULT | ------------------------------------------------------------------- | | | |  | | false | ------------------------------------------------------------------- | | | |  | true | false | ------------------------------------------------------------------- | | | | true | | true | ------------------------------------------------------------------- | | | | true | true | false | ------------------------------------------------------------------- | | | true |  | | false | ------------------------------------------------------------------- | | | true |  | true | false | ------------------------------------------------------------------- | | | true | true | | true | ------------------------------------------------------------------- | | | true | true | true | false | ------------------------------------------------------------------- | | true | !care | !care | !care | false | ------------------------------------------------------------------- | true | !care | !care | !care | !care | true | ------------------------------------------------------------------- * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess const): (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): Extra checks removed since there's no harm in granting access to a third-party that already has access by way of the underlying cookie policy. Also, this is a temporary compatibility fix. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess const): (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess): (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess): (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener): Extra checks removed since there's no harm in granting access to a third-party that already has access by way of the underlying cookie policy. Also, this is a temporary compatibility fix. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: (WebKit::ResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled): (WebKit::ResourceLoadStatisticsStore::isThirdPartyCookieBlockingEnabled const): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled): This is now the single path to control this setting in both ITP and the network storage session. See comment below. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): (WebKit::NetworkSession::setIsThirdPartyCookieBlockingEnabled): Restructured these so that they are initiated like the rest of the parameters and only have a single path for changes so that a reset to consistent state resets all the state. * NetworkProcess/NetworkSession.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 2019-10-28 Alex Christensen Remove unused NetworkProcessCreationParameters.urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest https://bugs.webkit.org/show_bug.cgi?id=203393 Reviewed by Chris Dumez. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest): 2019-10-28 Carlos Alberto Lopez Perez [GTK][WPE] Enable CSS typed OM https://bugs.webkit.org/show_bug.cgi?id=192875 Reviewed by Carlos Garcia Campos. Enable the runtime feature by default on GTK/WPE when building with experimental features enabled. Covered by existing tests. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: 2019-10-28 Carlos Garcia Campos [GTK] Simplify the Input Method implementation https://bugs.webkit.org/show_bug.cgi?id=203149 Reviewed by Adrian Perez de Castro. * Shared/NativeWebKeyboardEvent.h: Stop using WebCore::CompositionResults. (WebKit::NativeWebKeyboardEvent::text const): (WebKit::NativeWebKeyboardEvent::handledByInputMethod const): (WebKit::NativeWebKeyboardEvent::fakedForComposition const): * Shared/gtk/NativeWebKeyboardEventGtk.cpp: Ditto. (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebKeyboardEvent): Ditto. * Shared/gtk/WebEventFactory.h: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::doneWithKeyEvent): Updated to use the new name. * UIProcess/API/gtk/WebKitWebViewBase.cpp: Stop using WebCore::CompositionResults. (webkitWebViewBaseKeyPressEvent): (webkitWebViewBaseKeyReleaseEvent): * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Remove unused function. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setComposition): Use EditingRange instead of two integers and remove replacement range that is unused. (WebKit::WebPageProxy::confirmComposition): Remove unused selection range parameters. * UIProcess/WebPageProxy.h: * UIProcess/gtk/InputMethodFilter.cpp: (WebKit::InputMethodFilter::handleKeyboardEvent): (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults): (WebKit::InputMethodFilter::confirmComposition): (WebKit::InputMethodFilter::updatePreedit): (WebKit::InputMethodFilter::confirmCurrentComposition): (WebKit::InputMethodFilter::sendCompositionAndPreeditWithFakeKeyEvents): (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting): (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting): * UIProcess/gtk/InputMethodFilter.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::targetFrameForEditing): Receive a reference instead of a pointer. (WebKit::WebPage::confirmComposition): Remove the unused code to handle the selection range. (WebKit::WebPage::setComposition): Remove the unused code to handle the replacement range. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-10-27 Fujii Hironori Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds https://bugs.webkit.org/show_bug.cgi?id=203362 * UIProcess/UserMediaPermissionRequestProxy.h: Enclosed isUserGesturePriviledged with #if ENABLE(MEDIA_STREAM). 2019-10-21 Jiewen Tan [WebAuthn] Warn users when multiple NFC tags present https://bugs.webkit.org/show_bug.cgi?id=200932 Reviewed by Brent Fulgham. This patch utilizes -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] to inform clients about multiple physical tags are presenting such that clients can instruct users to select only one of them physically. Given a physical tag could have multiple different interfaces, which NearField will treat them into different NFTags, the tagID is then used to identify if there are actually multiple physical tags. This patch also adds the ability to restart polling of a partiuclar NFReaderSession to NfcConnection and the ability to restart the whole session to NfcService. The former is used to recover from errors in the discovery stages, and the latter is used to recover from errors returned from authenticators in the request stages. For the latter, given NfcConnection is not awared of the syntax of FIDO2/U2F protocol, and CtapAuthenticator/U2fAuthenticator are not awared the transport of the underneath driver. A generic restartDiscovery process is added to each service and it is up to the actual service to implement the actual process such that AuthenticatorManager can arbitrarily call it after exceptions are returned to restart the whole NFC session. To achieve restartDiscovery, NfcConnection is made RefCounted as well such that both the NfcService and the CtapNfcDriver could hold it at the same time. CtapNfcDriver uses the connection to complete requests as before while NfcService has the new capability to use it to stop the current session when restartDiscovery kicks off. * Platform/spi/Cocoa/NearFieldSPI.h: * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::serviceStatusUpdated): (WebKit::AuthenticatorManager::respondReceived): (WebKit::AuthenticatorManager::restartDiscovery): * UIProcess/WebAuthentication/AuthenticatorManager.h: * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp: (WebKit::AuthenticatorTransportService::startDiscovery): (WebKit::AuthenticatorTransportService::restartDiscovery): * UIProcess/WebAuthentication/AuthenticatorTransportService.h: (WebKit::AuthenticatorTransportService::restartDiscoveryInternal): * UIProcess/WebAuthentication/Cocoa/NfcConnection.h: * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: (WebKit::NfcConnection::create): (WebKit::NfcConnection::NfcConnection): (WebKit::NfcConnection::~NfcConnection): (WebKit::NfcConnection::stop const): (WebKit::NfcConnection::didDetectTags): (WebKit::NfcConnection::restartPolling): (WebKit::NfcConnection::startPolling): (WebKit::NfcConnection::didDetectTags const): Deleted. * UIProcess/WebAuthentication/Cocoa/NfcService.h: * UIProcess/WebAuthentication/Cocoa/NfcService.mm: (WebKit::NfcService::NfcService): (WebKit::NfcService::didConnectTag): (WebKit::NfcService::didDetectMultipleTags const): (WebKit::NfcService::setConnection): (WebKit::NfcService::restartDiscoveryInternal): (WebKit::NfcService::platformStartDiscovery): (WebKit::NfcService::setDriver): Deleted. * UIProcess/WebAuthentication/Mock/MockNfcService.h: * UIProcess/WebAuthentication/Mock/MockNfcService.mm: (-[WKMockNFTag tagID]): (-[WKMockNFTag initWithNFTag:]): (-[WKMockNFTag dealloc]): (-[WKMockNFTag initWithType:]): (-[WKMockNFTag initWithType:tagID:]): (WebKit::MockNfcService::receiveStopPolling): (WebKit::MockNfcService::receiveStartPolling): (WebKit::MockNfcService::platformStartDiscovery): (WebKit::MockNfcService::detectTags): (WebKit::MockNfcService::detectTags const): Deleted. * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp: (WebKit::CtapNfcDriver::CtapNfcDriver): * UIProcess/WebAuthentication/fido/CtapNfcDriver.h: * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: 2019-10-26 youenn fablet Enforce user gesture for getUserMedia in case a previous getUserMedia call was denied https://bugs.webkit.org/show_bug.cgi?id=203362 Reviewed by Eric Carlson. In case the request has user gesture priviledge, do not look at denied request history. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::isUserGesturePriviledged const): 2019-10-26 Chris Lord Put OffscreenCanvas behind a build flag https://bugs.webkit.org/show_bug.cgi?id=203146 Reviewed by Ryosuke Niwa. Split the ImageBitmapOffscreenCanvas setting into two separate settings so OffscreenCanvas can be disabled at build time. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::WebInspectorUI): 2019-10-25 Chris Dumez REGRESSION(r251599): Crash in MobileSafari tests (ASSERTION FAILED: m_pendingRequestToSuspendID) https://bugs.webkit.org/show_bug.cgi?id=203437 Reviewed by Geoffrey Garen. * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::updateAssertionIfNeeded): Start the timer before sending the PrepareToSuspend IPC. The reason is that if the process has been terminated, the completion handler may run synchronously and cancel the request to suspend / stop the timer. Therefore, re-starting the timer after would be a mistake. 2019-10-25 David Kilzer Unused arguments in MESSAGE_CHECK_CONTEXTID() macros Reviewed by Alex Christensen. * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: (#define MESSAGE_CHECK_CONTEXTID): - Rename macro argument from `contextID` to `identifier` and change `contextId`to `identifier` in the body of the macro so that the argument is always used. (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID): (WebKit::PlaybackSessionManagerProxy::currentTimeChanged): (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged): (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged): (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged): (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged): (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged): (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged): (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged): (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged): (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged): (WebKit::PlaybackSessionManagerProxy::mutedChanged): (WebKit::PlaybackSessionManagerProxy::volumeChanged): (WebKit::PlaybackSessionManagerProxy::durationChanged): (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged): (WebKit::PlaybackSessionManagerProxy::rateChanged): (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged): (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged): (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const): - Change `contextID` to `contextId` to match local variable name now that MESSAGE_CHECK_CONTEXTID() doesn't paper over this typo for us. * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (#define MESSAGE_CHECK_CONTEXTID): - Rename macro argument from `contextID` to `identifier` and change `contextId`to `identifier` in the body of the macro so that the argument is always used. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (#define MESSAGE_CHECK_CONTEXTID): - Rename macro argument and variable in the body of the macro from `id` to `identifier` for consistency. 2019-10-25 Per Arne Vollan [iOS] Fix sandbox violations seen while running layout tests https://bugs.webkit.org/show_bug.cgi?id=203419 Reviewed by Brent Fulgham. Deny mach lookup to 'com.apple.logd' and 'com.apple.logd.events' and suppress logs, since these are believed to be unneeded in the WebContent process. Allow sysctl write to 'vm.footprint_suspend'. Deny mach lookup to 'com.apple.system.notification_center' and suppress logs, since allowing this is not believed to be needed in the WebContent process. No new tests, covered by existing tests. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-25 Matt Lewis Rolling out r251579,r251162,r251512,r251500, and r251498 for build failures and test failures Unreviewed rollout. * Platform/spi/Cocoa/NearFieldSPI.h: * UIProcess/API/APIWebAuthenticationPanel.cpp: (API::WebAuthenticationPanel::create): (API::WebAuthenticationPanel::WebAuthenticationPanel): * UIProcess/API/APIWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (-[_WKWebAuthenticationPanel relyingPartyID]): (wkWebAuthenticationTransport): Deleted. (-[_WKWebAuthenticationPanel transports]): Deleted. (wkWebAuthenticationType): Deleted. (-[_WKWebAuthenticationPanel type]): Deleted. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::WebCore::collectTransports): (WebKit::AuthenticatorManager::handleRequest): (WebKit::AuthenticatorManager::respondReceived): (WebKit::AuthenticatorManager::respondReceivedInternal): (WebKit::AuthenticatorManager::startDiscovery): (WebKit::AuthenticatorManager::initTimeOutTimer): (WebKit::AuthenticatorManager::runPanel): (WebKit::AuthenticatorManager::startRequest): (WebKit::AuthenticatorManager::invokePendingCompletionHandler): (WebKit::WebCore::getClientDataType): Deleted. (WebKit::AuthenticatorManager::serviceStatusUpdated): Deleted. (WebKit::AuthenticatorManager::filterTransports const): Deleted. (WebKit::AuthenticatorManager::getTransports const): Deleted. (WebKit::AuthenticatorManager::restartDiscovery): Deleted. * UIProcess/WebAuthentication/AuthenticatorManager.h: (WebKit::AuthenticatorManager::respondReceivedInternal): Deleted. * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp: (WebKit::AuthenticatorTransportService::startDiscovery): (WebKit::AuthenticatorTransportService::restartDiscovery): Deleted. * UIProcess/WebAuthentication/AuthenticatorTransportService.h: (WebKit::AuthenticatorTransportService::restartDiscoveryInternal): Deleted. * UIProcess/WebAuthentication/Cocoa/NfcConnection.h: * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: (WebKit::NfcConnection::NfcConnection): (WebKit::NfcConnection::~NfcConnection): (WebKit::NfcConnection::didDetectTags const): (WebKit::NfcConnection::create): Deleted. (WebKit::NfcConnection::stop const): Deleted. (WebKit::NfcConnection::didDetectTags): Deleted. (WebKit::NfcConnection::restartPolling): Deleted. (WebKit::NfcConnection::startPolling): Deleted. * UIProcess/WebAuthentication/Cocoa/NfcService.h: * UIProcess/WebAuthentication/Cocoa/NfcService.mm: (WebKit::NfcService::NfcService): (WebKit::NfcService::didConnectTag): (WebKit::NfcService::setDriver): (WebKit::NfcService::platformStartDiscovery): (WebKit::NfcService::isAvailable): Deleted. (WebKit::NfcService::didDetectMultipleTags const): Deleted. (WebKit::NfcService::setConnection): Deleted. (WebKit::NfcService::restartDiscoveryInternal): Deleted. * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp: (WebKit::MockAuthenticatorManager::filterTransports const): Deleted. * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h: * UIProcess/WebAuthentication/Mock/MockNfcService.h: * UIProcess/WebAuthentication/Mock/MockNfcService.mm: (-[WKMockNFTag initWithNFTag:]): (-[WKMockNFTag dealloc]): (-[WKMockNFTag initWithType:]): (WebKit::MockNfcService::platformStartDiscovery): (WebKit::MockNfcService::detectTags const): (-[WKMockNFTag tagID]): Deleted. (-[WKMockNFTag initWithType:tagID:]): Deleted. (WebKit::MockNfcService::receiveStopPolling): Deleted. (WebKit::MockNfcService::receiveStartPolling): Deleted. * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp: (WebKit::CtapNfcDriver::CtapNfcDriver): * UIProcess/WebAuthentication/fido/CtapNfcDriver.h: * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: 2019-10-24 Wenson Hsieh [iOS 13] fast/forms/ios/accessory-bar-navigation.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=203294 Reviewed by Tim Horton. Add an SPI declaration (as well as an internal-SKD-only header import) for UIKeyboardPreferencesController. See Tools/ChangeLog for more details. * Platform/spi/ios/UIKitSPI.h: 2019-10-24 Ryosuke Niwa Add exclusion rules to text manipulation SPI https://bugs.webkit.org/show_bug.cgi?id=203398 Reviewed by Wenson Hsieh. Added SPI to specify the configuration for the text manipulation (see r251574), in particular, the set of rules governing which content should be excluded or included in text manipulations. Test: TextManipulation.StartTextManipulationExitEarlyWithoutDelegate * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _startTextManipulationsWithConfiguration:completion:]): Takes _WKTextManipulationConfiguration as an argument. Also fixed a bug that we weren't calling the completion handler when the delegate was not set. (-[WKWebView _completeTextManipulation:completion:]): (-[WKWebView _startTextManipulationsWithCompletionHandler:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKTextManipulationConfiguration.h: Added. * UIProcess/API/Cocoa/_WKTextManipulationConfiguration.mm: Added. * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.h: Added. * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.mm: Added. (-[_WKTextManipulationExclusionRule initExclusion:forElement:]): Added. (-[_WKTextManipulationExclusionRule initExclusion:forAttribute:value:]): Added. (-[_WKTextManipulationExclusionRule elementName]): Added. (-[_WKTextManipulationExclusionRule attributeName]): Added. (-[_WKTextManipulationExclusionRule attributeValue]): Added. * UIProcess/API/Cocoa/_WKTextManipulationToken.h: Added excluded boolean property. * UIProcess/API/Cocoa/_WKTextManipulationToken.mm: Removed the superflous import of RetainPtr.h * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startTextManipulations): (WebKit::WebPageProxy::completeTextManipulation): * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::startTextManipulations): (WebKit::WebPage::completeTextManipulation): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-10-25 Chris Dumez [iOS][WK2] Use sendWithAsyncReply() to simplify the prepareToSuspend logic https://bugs.webkit.org/show_bug.cgi?id=203422 Reviewed by Alex Christensen. Use sendWithAsyncReply() to simplify the prepareToSuspend logic and make it easier to understand. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::processWillSuspendImminentlyForTestingSync): (WebKit::NetworkProcess::prepareToSuspend): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processWillSuspendImminentlyForTesting]): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::sendPrepareToSuspend): (WebKit::NetworkProcessProxy::processReadyToSuspend): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::processReadyToSuspend): (WebKit::ProcessThrottler::sendPrepareToSuspendIPC): * UIProcess/ProcessThrottler.h: * UIProcess/ProcessThrottlerClient.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::sendPrepareToSuspend): (WebKit::WebProcessProxy::processReadyToSuspend): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::prepareToSuspend): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2019-10-25 youenn fablet WebProcess should unregister its interest for a SWServerRegistration when all its corresponding ServiceWorkerRegistrations are destroyed https://bugs.webkit.org/show_bug.cgi?id=203410 Reviewed by Chris Dumez. A SWServerRegistration is keeping a list of web processes that should be notified of change to its state. Previously, WebProcesses were registering their interest to a SWServerRegistration on construction of a ServiceWorkerRegistration, and unregistering their interest on destruction of a ServiceWorkerRegistration. This does not work in case two ServiceWorkerRegistrations are created for the same SWServerRegistration in the same WebProcess. In that case, when one of the two ServiceWorkerRegistration is destroyed, the WebProcess will no longer be notified of changes to the SWServerRegistration, thus breaking the second ServiceWorkerRegistration behavior. We introduce a map at WebProcess level to keep track of the number of ServiceWorkerRegistration created for a given SWServerRegistration. Covered by re-enabled tests. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer): (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::addServiceWorkerRegistration): (WebKit::WebProcess::removeServiceWorkerRegistration): * WebProcess/WebProcess.h: 2019-10-25 youenn fablet mp4 video element broken with service worker https://bugs.webkit.org/show_bug.cgi?id=184447 Reviewed by Chris Dumez. Make a response as range-requested as per https://fetch.spec.whatwg.org/#http-network-or-cache-fetch step 15. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkRedirection): (WebKit::NetworkLoadChecker::validateResponse): * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): 2019-10-25 Chris Dumez [iOS] Regression(r251067) WebProcesses with service workers no longer keep their network process alive https://bugs.webkit.org/show_bug.cgi?id=203388 Reviewed by Geoffrey Garen. Historically, WebProcessProxy::didSetAssertionState() used to return early for service worker processes because we did not want service worker processes to prevent the network process from suspending. The WebProcesses using the service worker process would prevent the network process from suspending when they are visible, so it would work fine. However, after r251067, there is no longer a concept of service worker process per se. Service workers will now sometimes run in regular WebProcesses where we have pages. In such cases, didSetAssertionState() would still return early and fail to keep its network process alive, even when the page(s) in this process are visible on screen. To address the issue, we now only return early if the process has a service worker but no page. This should restore pre-existing behavior. Note that this was causing hangs such as because the WebProcess would be stuck on sync IPC to a suspended network process. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didSetAssertionState): 2019-10-25 Chris Dumez Standardize "PageID=" vs "pageID =" in release logging https://bugs.webkit.org/show_bug.cgi?id=203002 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _updateVisibleContentRects]): (-[WKWebView _cancelAnimatedResize]): (-[WKWebView _didCompleteAnimatedResize]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _resizeWhileHidingContentWithUpdates:]): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::processDidTerminate): (WebKit::ProvisionalPageProxy::cancel): (WebKit::ProvisionalPageProxy::loadData): (WebKit::ProvisionalPageProxy::loadRequest): (WebKit::ProvisionalPageProxy::goToBackForwardItem): (WebKit::ProvisionalPageProxy::didCreateMainFrame): (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::didCommitLoadForFrame): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResource): (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::loadResourceSynchronously): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): (WebKit::WebResourceLoader::didReceiveResponse): (WebKit::WebResourceLoader::didReceiveData): (WebKit::WebResourceLoader::didFinishResourceLoad): (WebKit::WebResourceLoader::serviceWorkerDidNotHandle): (WebKit::WebResourceLoader::didFailResourceLoad): (WebKit::WebResourceLoader::didBlockAuthenticationChallenge): (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): (WebKit::WebResourceLoader::didReceiveResource): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailLoad): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::freezeLayerTree): (WebKit::WebPage::unfreezeLayerTree): 2019-10-24 Chris Dumez Simplify ProcessThrottler implementation https://bugs.webkit.org/show_bug.cgi?id=203370 Reviewed by Alex Christensen. Simplify ProcessThrottler implementation by: - Getting rid of CancelPrepareToSuspend IPC. Instead a regular ProcessDidResume IPC is sent to the child process. - Getting rid of the ProcessWillSuspendImminently IPC and send a regular ProcessDidResume IPC with a 'isSuspensionImminent' flag instead. - Whether the suspension is imminent or not, the child process now always responds with a ProcessReadyToSuspend IPC. This simplifies our logic as the idea is that treating imminent and non-imminent suspension should share as much of the same logic as possible. - All PrepareToSuspend IPCs now have an associated identifier and the child process sends back this identifier when responding with a ProcessReadyToSuspend IPC. This allows the ProcessThrottler to easily ignore outdated requests to suspend, without requiring the m_suspendMessageCount data member we had. This patch also adds more logging to ProcessThrottler and the suspension logic in the child processes. All ProcessThrottler logging now also shows the child process's PID for clarity. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::processWillSuspendImminentlyForTestingSync): (WebKit::NetworkProcess::prepareToSuspend): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processWillSuspendImminentlyForTesting]): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::sendPrepareToSuspend): (WebKit::NetworkProcessProxy::processReadyToSuspend): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/ProcessThrottler.cpp: (WebKit::generatePrepareToSuspendRequestID): (WebKit::ProcessThrottler::ProcessThrottler): (WebKit::m_backgroundCounter): (WebKit::ProcessThrottler::expectedAssertionState): (WebKit::ProcessThrottler::updateAssertionStateNow): (WebKit::ProcessThrottler::setAssertionState): (WebKit::ProcessThrottler::updateAssertionIfNeeded): (WebKit::ProcessThrottler::didConnectToProcess): (WebKit::ProcessThrottler::prepareToSuspendTimeoutTimerFired): (WebKit::ProcessThrottler::processReadyToSuspend): (WebKit::ProcessThrottler::clearPendingRequestToSuspend): (WebKit::ProcessThrottler::sendPrepareToSuspendIPC): (WebKit::ProcessThrottler::uiAssertionWillExpireImminently): * UIProcess/ProcessThrottler.h: * UIProcess/ProcessThrottlerClient.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::sendPrepareToSuspend): (WebKit::WebProcessProxy::processReadyToSuspend): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::prepareToSuspend): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2019-10-23 Ryosuke Niwa Add a mechanism to find and manipulate text by paragraphs https://bugs.webkit.org/show_bug.cgi?id=203286 Reviewed by Wenson Hsieh. This patch introduces a new SPI to find paragraphs of text and let client replace the content of each paragraph. For now, this SPI is limited to find & replace contents of main frame's document. WKWebView's _startTextManipulationsWithCompletionHandler sends StartTextManipulations message to WebContent process to find all paragraphs in the main frame. WebContent process will send back DidFindTextManipulationItem message for each paragraph, which in turn calls back _WKTextManipulationDelegate's _webView: didFindTextManipulationItem:. Upon receiving this delegate callback, the client can invoke WKWebView's _completeTextManipulation to replace the content. It will send CompleteTextManipulation to WebContent process, which will invoke completeManipulation on main frame's document's TextManipulationController. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _textManipulationDelegate]): Aded. (-[WKWebView _setTextManipulationDelegate:]): Aded. (-[WKWebView _startTextManipulationsWithCompletionHandler:]): (-[WKWebView _completeTextManipulation:completion:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKTextManipulationDelegate.h: Added. * UIProcess/API/Cocoa/_WKTextManipulationItem.h: Added. * UIProcess/API/Cocoa/_WKTextManipulationItem.mm: Added. (-[_WKTextManipulationItem initWithIdentifier:tokens:]): (-[_WKTextManipulationItem identifier]): (-[_WKTextManipulationItem tokens]): * UIProcess/API/Cocoa/_WKTextManipulationToken.h: Added. * UIProcess/API/Cocoa/_WKTextManipulationToken.mm: Added. (-[_WKTextManipulationToken init]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startTextManipulations): (WebKit::WebPageProxy::didFindTextManipulationItem): (WebKit::WebPageProxy::completeTextManipulation): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::startTextManipulations): (WebKit::WebPage::completeTextManipulation): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-10-24 Matt Lewis Unreviewed, rolling out r251558. This broke internal builds Reverted changeset: "Add a mechanism to find and manipulate text by paragraphs" https://bugs.webkit.org/show_bug.cgi?id=203286 https://trac.webkit.org/changeset/251558 2019-10-24 Alex Christensen REGRESSION(r251409) Service worker connection should not be established without service worker entitlement https://bugs.webkit.org/show_bug.cgi?id=203385 Reviewed by Chris Dumez. r251409 introduced a new call to establishSWServerConnection that should have an entitlement check. This was caught by a unit test in CI that is not easy to reproduce in WebKit's test. See the radar. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): 2019-10-24 Brent Fulgham [iOS] Mismatch in com.apple.coremedia.audiodeviceclock declarations https://bugs.webkit.org/show_bug.cgi?id=203367 Reviewed by Per Arne Vollan. The 'common.sb' sandbox allows access to "com.apple.coremedia.audiodeviceclock.xpc", but the WebContent sandbox blocked access to "com.apple.coremedia.audiodeviceclock". This means we aren't blocking that endpoint. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-24 Brent Fulgham [iOS] Mismatch in com.apple.MediaPlayer.RemotePlayerService declarations https://bugs.webkit.org/show_bug.cgi?id=203368 Reviewed by Per Arne Vollan. The 'common.sb' sandbox allows access to the xpc-service-name "com.apple.MediaPlayer.RemotePlayerService", but we block access to the global-name "com.apple.MediaPlayer.RemoteService". We aren't blocking the right thing. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-24 Brady Eidson Expose pageZoom as API. https://bugs.webkit.org/show_bug.cgi?id=203381 Reviewed by Andy Estes. No new tests (No behavior change, identical to SPI) * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setPageZoom:]): (-[WKWebView pageZoom]): (-[WKWebView _pageZoomFactor]): (-[WKWebView _setPageZoomFactor:]): 2019-10-23 Ryosuke Niwa Add a mechanism to find and manipulate text by paragraphs https://bugs.webkit.org/show_bug.cgi?id=203286 Reviewed by Wenson Hsieh. This patch introduces a new SPI to find paragraphs of text and let client replace the content of each paragraph. For now, this SPI is limited to find & replace contents of main frame's document. WKWebView's _startTextManipulationsWithCompletionHandler sends StartTextManipulations message to WebContent process to find all paragraphs in the main frame. WebContent process will send back DidFindTextManipulationItem message for each paragraph, which in turn calls back _WKTextManipulationDelegate's _webView: didFindTextManipulationItem:. Upon receiving this delegate callback, the client can invoke WKWebView's _completeTextManipulation to replace the content. It will send CompleteTextManipulation to WebContent process, which will invoke completeManipulation on main frame's document's TextManipulationController. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _textManipulationDelegate]): Aded. (-[WKWebView _setTextManipulationDelegate:]): Aded. (-[WKWebView _startTextManipulationsWithCompletionHandler:]): (-[WKWebView _completeTextManipulation:completion:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKTextManipulationDelegate.h: Added. * UIProcess/API/Cocoa/_WKTextManipulationItem.h: Added. * UIProcess/API/Cocoa/_WKTextManipulationItem.mm: Added. (-[_WKTextManipulationItem initWithIdentifier:tokens:]): (-[_WKTextManipulationItem identifier]): (-[_WKTextManipulationItem tokens]): * UIProcess/API/Cocoa/_WKTextManipulationToken.h: Added. * UIProcess/API/Cocoa/_WKTextManipulationToken.mm: Added. (-[_WKTextManipulationToken init]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startTextManipulations): (WebKit::WebPageProxy::didFindTextManipulationItem): (WebKit::WebPageProxy::completeTextManipulation): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::startTextManipulations): (WebKit::WebPage::completeTextManipulation): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-10-24 Brent Fulgham Unreviewed fix after r251511. Some syctl names were omitted from the initial checkin. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-24 Brady Eidson Formalize PDF snapshot API. https://bugs.webkit.org/show_bug.cgi?id=203374 Reviewed by Tim Horton. Covered by API tests and MiniBrowser usage. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKPDFConfiguration.h: Added. * UIProcess/API/Cocoa/WKPDFConfiguration.mm: Added. (-[WKPDFConfiguration init]): (-[WKPDFConfiguration copyWithZone:]): * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView createPDFWithConfiguration:completionHandler:]): (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]): * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h: Unified build strikes again. * WebKit.xcodeproj/project.pbxproj: 2019-10-24 Brent Fulgham [iOS] Remove 'deny' rules that do not have a corresponding 'allow' rule https://bugs.webkit.org/show_bug.cgi?id=203352 Reviewed by Per Arne Vollan. Now that we no longer import 'common.sb', and have removed entries that allowed services that we block, we can remove the 'deny' command. This is safe because everything is denied by default. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-24 Alex Christensen Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global https://bugs.webkit.org/show_bug.cgi?id=202891 Reviewed by Youenn Fablet. No change in behavior. Now the LegacySchemeRegistry is not used as much in the NetworkProcess, a step towards no use at all. This functionality is currently only available through the glib API webkit_security_manager_register_uri_scheme_as_cors_enabled but it has been requested in bug 201180 and bug 199064. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::registerURLSchemesAsCORSEnabled): * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::schemeRegistry): * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const): * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const): Deleted. * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::m_shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkSchemeRegistry.cpp: Added. (WebKit::NetworkSchemeRegistry::registerURLSchemeAsCORSEnabled): (WebKit::NetworkSchemeRegistry::shouldTreatURLSchemeAsCORSEnabled): * NetworkProcess/NetworkSchemeRegistry.h: Added. (WebKit::NetworkSchemeRegistry::create): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): Use nullptr, indicating that the PingLoad constructor that is used in ad click attribution should not check the custom scheme registry. This is Ok because ad click attribution is only used for HTTP family schemes. (WebKit::m_blobFiles): * NetworkProcess/PingLoad.h: * Sources.txt: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::registerURLSchemeAsCORSEnabled): (WebKit::WebProcess::ensureNetworkProcessConnection): (WebKit::WebProcess::registerURLSchemeAsCORSEnabled const): Deleted. * WebProcess/WebProcess.h: 2019-10-24 Carlos Alberto Lopez Perez [GTK][WPE] Enable runtime setting with experimental features for Server Timing API https://bugs.webkit.org/show_bug.cgi?id=203295 Reviewed by Carlos Garcia Campos. Enable the runtime ServerTiming by default when GTK or WPE is built with experimental features enabled. No new tests, no change in behaviour for WTR. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: 2019-10-23 Chris Dumez WebBackForwardCache::removeEntriesMatching() may re-enter and crash https://bugs.webkit.org/show_bug.cgi?id=203341 Reviewed by Geoffrey Garen. When WebBackForwardCache::removeEntriesMatching() was clearing the WebBackForwardListItem's WebBackForwardCacheEntry, it could destroyed a SuspendedPageProxy which could shutdown a WebProcess. Upon shutting down, we would try to remove WebBackForwardCache entries associated with a given process, re-enter removeEntriesMatching() and crash. To address the issue, I made WebBackForwardCache::removeEntriesMatching() safe to re-enter. We now clear the WebBackForwardListItems' WebBackForwardCacheEntries only after we're done updating m_itemsWithCachedPage. * UIProcess/WebBackForwardCache.cpp: (WebKit::WebBackForwardCache::removeEntriesMatching): 2019-10-23 Megan Gardner Rename force-press-related functions to refer to context menus, and fix a former force-press test https://bugs.webkit.org/show_bug.cgi?id=202663 Reviewed by Dean Jackson. Add plumbing for contextMenu tests to function again, and rename all relevant fuctions to more correctly reflect that this does not specifically require a force press to activate any longer. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didShowContextMenu]): (-[WKWebView _didDismissContextMenu]): (-[WKWebView _didShowForcePressPreview]): Deleted. (-[WKWebView _didDismissForcePressPreview]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]): (-[WKContentView _presentedViewControllerForPreviewItemController:]): (-[WKContentView _previewItemController:didDismissPreview:committing:]): (-[WKContentView _previewItemControllerDidCancelPreview:]): 2019-10-23 Tim Horton macCatalyst: Should dispatch contextmenu event on right click https://bugs.webkit.org/show_bug.cgi?id=203316 Reviewed by Wenson Hsieh. * WebProcess/WebPage/WebPage.cpp: (WebKit::isContextClick): (WebKit::handleContextMenuEvent): (WebKit::WebPage::contextMenuForKeyEvent): (WebKit::handleMouseEvent): * WebProcess/WebPage/WebPage.h: 2019-10-23 Brent Fulgham [iOS] Stop including 'common.sb' https://bugs.webkit.org/show_bug.cgi?id=203318 Reviewed by Per Arne Vollan. Replace the 'import' of common.sb with the equivalent statements. This is the first step in a task to remove uneeded sandbox rules. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-23 Kate Cheney Implement dumpResourceLoadStatistics in SQLite ITP Database https://bugs.webkit.org/show_bug.cgi?id=203224 Reviewed by John Wilander. This patch implements dumpResourceLoadStatistics() in the ITP database store. This function required a boolean flag isScheduledForWebsiteDataRemoval that now must be stored in the database, resulting in a small schema change. Because of the schema change, this patch also compares any existing database file against the new schema, and deletes the existing file if the schema is not current. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: The logic for topFrameLinkDecorationsFromQuery was the opposite of all other "xyzFrom" queries. When merging data from the memory store, the load statistic being inserted holds a list of topFrames which it has been redirected to from. I think it makes more sense to also organize the table this way. (WebKit::ObservedDomainsTableSchemaV1): (WebKit::ObservedDomainsTableSchemaV1Alternate): For support on both iOS and MacOS, there are two CREATE TABLE queries to compare to, depending on whether the query result contains quotes around the table name. (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase): (WebKit::ResourceLoadStatisticsDatabaseStore::openAndDropOldDatabaseIfNecessary): The code to check for the current schema was adapted from SQLiteIDBBackingStore.cpp (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): (WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndMakeDomainList): The previous naming of the list parameter in this function was confusing because it is used by many different relationships not just subframes under top frames. (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList): topFrameLinkDecorationsFrom were never inserted into the database. (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships): (WebKit::ResourceLoadStatisticsDatabaseStore::merge): (WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistic): Since the statement to get all data for a given domain is now used in multiple places, I stored the query as a constexpr auto. (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration): Matched the memory store functionality, which calls the boolean "gotLinkDecorationFromPrevalentResource." I thought isScheduledForWebsiteDataRemoval would be more clear of a name, because this flag gets cleared even when prevalent top frame link decorations for this domain still exist in the table. (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics): (WebKit::ResourceLoadStatisticsDatabaseStore::setIsScheduledForWebsiteDataRemoval): (WebKit::ResourceLoadStatisticsDatabaseStore::prevalentDomains): Deleted. (WebKit::ResourceLoadStatisticsDatabaseStore::domains): To match memory store functionality, the check for website data to delete should check all domains, not just prevalent ones. (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor): This now needs to check if the resource is prevalent, because it is no longer guaranteed. (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor): (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor): (WebKit::ResourceLoadStatisticsDatabaseStore::getDomainStringFromDomainID): (WebKit::ResourceLoadStatisticsDatabaseStore::getSubStatisticStatement): (WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList): (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString): This functionality matches the toString function in ResourceLoadStatistics.cpp. (WebKit::CompletionHandler Web Inspector: notify inspector when provisional page is created, committed and destroyed https://bugs.webkit.org/show_bug.cgi?id=202704 Reviewed by Devin Rousso. Target.targetCreated event is now generated for provisional pages as well as for regular ones. This is the first step toward reattaching inspector earlier during PSON. In the future if debugging is in progress the provisional target (page) will be paused until a signal from inspector frontend. This will enable the frontend configure all agents before navigation starts. * Sources.txt: * UIProcess/API/APIWebAuthenticationPanel.cpp: (API::WebAuthenticationPanel::WebAuthenticationPanel): Added explicit namespace specifier to the constructor's argument as otherwise compilation fails due to conflict between API::String and WTF::String. * UIProcess/InspectorTargetProxy.cpp: (WebKit::InspectorTargetProxy::create): (WebKit::InspectorTargetProxy::connect): (WebKit::InspectorTargetProxy::disconnect): (WebKit::InspectorTargetProxy::sendMessageToTargetBackend): (WebKit::InspectorTargetProxy::didCommitProvisionalTarget): (WebKit::InspectorTargetProxy::isProvisional const): (WebKit::InspectorTargetProxy::previousTargetID const): * UIProcess/InspectorTargetProxy.h: Target proxy can start as a provisional target (with a pointer to ProvisionalPageProxy) and later either be committed or destroyed. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::didReceiveMessage): Forward inspector messages to parent page's WebPageInspectorController. Since each WebPage has a unique identifier the target ids will be globally unique and there is no risk of collisions. * UIProcess/ProvisionalPageProxy.h: (WebKit::ProvisionalPageProxy::page const): * UIProcess/WebPageInspectorController.cpp: (WebKit::getTargetID): (WebKit::WebPageInspectorController::WebPageInspectorController): (WebKit::WebPageInspectorController::clearTargets): (WebKit::WebPageInspectorController::createInspectorTarget): (WebKit::WebPageInspectorController::destroyInspectorTarget): (WebKit::WebPageInspectorController::didCreateProvisionalPage): (WebKit::WebPageInspectorController::didDestroyProvisionalPage): (WebKit::WebPageInspectorController::didCommitProvisionalPage): (WebKit::WebPageInspectorController::addTarget): * UIProcess/WebPageInspectorController.h: * UIProcess/WebPageInspectorTargetAgent.cpp: Removed. Merged this agent into InspectorTargetAgent. * UIProcess/WebPageInspectorTargetAgent.h: Removed. * UIProcess/WebPageProxy.cpp: (WebKit::m_resetRecentCrashCountTimer): (WebKit::WebPageProxy::finishAttachingToWebProcess): (WebKit::WebPageProxy::commitProvisionalPage): * UIProcess/WebPageProxy.h: Moved the target management logic into WebPageInspectorController. WebPageProxy/ProvisionalPageProxy are expected to notifiy it about key lifecycle events and also forward to it messages from inspector in the inspected WebProcess. How it translates to Target events is inspector's business. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPageInspectorTarget.cpp: (WebKit::WebPageInspectorTarget::identifier const): (WebKit::WebPageInspectorTarget::connect): (WebKit::WebPageInspectorTarget::disconnect): (WebKit::WebPageInspectorTarget::toTargetID): * WebProcess/WebPage/WebPageInspectorTarget.h: Made the target own frontend channel instance as it's the only place where the page specific channel is used. * WebProcess/WebPage/WebPageInspectorTargetController.cpp: (WebKit::WebPageInspectorTargetController::removeTarget): (WebKit::WebPageInspectorTargetController::connectInspector): (WebKit::WebPageInspectorTargetController::disconnectInspector): * WebProcess/WebPage/WebPageInspectorTargetController.h: * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp: (WebKit::WebPageInspectorTargetFrontendChannel::WebPageInspectorTargetFrontendChannel): (WebKit::WebPageInspectorTargetFrontendChannel::sendMessageToFrontend): * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h: The channel's lifetime is managed by owning target. No need to reference count it. 2019-10-22 Jiewen Tan [WebAuthn] Supply FrameInfo in -[WKUIDelegatePrivate _webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] https://bugs.webkit.org/show_bug.cgi?id=202563 Reviewed by Brent Fulgham. This patch makes WKFrameInfo available to clients via the above SPI. To do so, SecuirtyOrigin of the caller document is passed from WebContent Process. * UIProcess/API/APIUIClient.h: (API::UIClient::runWebAuthenticationPanel): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::runPanel): * UIProcess/WebAuthentication/WebAuthenticationRequestData.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential): (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion): (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::makeCredential): (WebKit::WebAuthenticatorCoordinator::getAssertion): * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h: 2019-10-23 Andy Estes [Quick Look] Rename PreviewLoader{,Client} to LegacyPreviewLoader{,Client} https://bugs.webkit.org/show_bug.cgi?id=203306 Reviewed by Tim Horton. * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::createPreviewLoaderClient): * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h: 2019-10-22 Fujii Hironori Unreviewed build fix for non-unified source builds https://bugs.webkit.org/show_bug.cgi?id=203055 * WebProcess/Storage/WebServiceWorkerProvider.cpp: Added #include . 2019-10-22 John Wilander Resource Load Statistics (experimental): Block all third-party cookies https://bugs.webkit.org/show_bug.cgi?id=203266 Reviewed by Alex Christensen. This change updates the experimental change in to block all third-party cookies, regardless of user interaction with the first-party website. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting): * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Shared/WebPreferences.yaml: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2019-10-22 Tim Horton Make it possible to not include IPC Messages headers in other headers https://bugs.webkit.org/show_bug.cgi?id=203074 * Scripts/webkit/messages_unittest.py: (GeneratedFileContentsTest.assertHeaderEqual): (GeneratedFileContentsTest.assertImplementationEqual): (UnsupportedPrecompilerDirectiveTest.test_error_at_else): (UnsupportedPrecompilerDirectiveTest.test_error_at_elif): Fix the message generator unit tests. 2019-10-22 Alex Christensen Re-enable legacy TLS by default, keep runtime switch https://bugs.webkit.org/show_bug.cgi?id=203253 Reviewed by Geoffrey Garen. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2019-10-22 Alex Christensen Revert r243010 on pre-Catalina macOS https://bugs.webkit.org/show_bug.cgi?id=203265 Reviewed by Per Arne Vollan. * WebProcess/com.apple.WebProcess.sb.in: 2019-10-22 Tim Horton Update xcfilelists * DerivedSources-output.xcfilelist: 2019-10-22 Tim Horton Make it possible to not include IPC Messages headers in other headers https://bugs.webkit.org/show_bug.cgi?id=203074 Reviewed by Geoffrey Garen. Make the Messages generator generate a new -MessagesReplies.h file, which only includes headers for and definitions of DelayedReply/AsyncReply types, which need to be mentioned as arguments to message hander methods, and thus must be available in various headers throughout the project. In order to do this, we have to de-nest them from the primary message class, but we then 'using' them back into place inside the message class so that most of the code doesn't need to change. This helps to wildly decrease the header load of WebPage.h and WebPageProxy.h, especially, because the number of headers needed for types in their replies is much smaller than the number needed for all message receivers. Also, only invoke the Messages generator once per source file, and only parse the source file once, generating all three output files in one invocation. And then clean up all the missing indirect includes that we lost by doing this. All-in-all this is worth roughly 8% on the WebKit2 Build Time Benchmark. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources.make: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: * NetworkProcess/NetworkResourceLoader.h: * PluginProcess/PluginControllerProxy.cpp: * PluginProcess/PluginControllerProxy.h: * PluginProcess/WebProcessConnection.h: * Scripts/Makefile: * Scripts/generate-message-receiver.py: (main): * Scripts/generate-messages-header.py: Removed. * Scripts/webkit/LegacyMessageReceiver-expected.cpp: * Scripts/webkit/LegacyMessages-expected.h: * Scripts/webkit/LegacyMessagesReplies-expected.h: Added. * Scripts/webkit/MessageReceiver-expected.cpp: * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: * Scripts/webkit/Messages-expected.h: * Scripts/webkit/MessagesReplies-expected.h: Added. * Scripts/webkit/MessagesRepliesSuperclassReplies-expected.h: Added. * Scripts/webkit/MessagesSuperclass-expected.h: * Scripts/webkit/messages.py: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Plugins/PluginProcessManager.cpp: * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/ProvisionalPageProxy.h: * UIProcess/SuspendedPageProxy.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: * UIProcess/ios/WKContentView.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/cocoa/VideoFullscreenManager.h: * WebProcess/cocoa/VideoFullscreenManager.mm: 2019-10-22 Chris Dumez Simplify "Unexpectedly Resumed" assertion handling https://bugs.webkit.org/show_bug.cgi?id=203254 Reviewed by Geoffrey Garen. When the WebContent process gets resumed from suspension, it now unconditionally takes a process assertion on behalf on the UIProcess and sends a ProcessDidResume IPC to the UIProcess. The UIProcess then sends a DidHandleProcessWasResumed IPC back after handing the ProcessDidResume IPC allowing the WebContent process to release its assertion on behalf on the UIProcess. The previous code was racy because it relied on the m_processIsSuspended flag, which was queried and set from different threads. Also, the 'unexpectedly resumed' naming was confusing since we'd often take this assertion whenever the WebProcess got resumed, wether unexpected or not, simply because the processTaskStateDidChange IPC won the race with the ProcessDidResume IPC from the UIProcess. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::processWasResumed): (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processDidResume): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): (WebKit::WebProcess::didHandleProcessWasResumed): 2019-10-22 youenn fablet Remove mayHaveServiceWorkerRegisteredForOrigin https://bugs.webkit.org/show_bug.cgi?id=203055 Reviewed by Alex Christensen. This optimization was used for ensuring we would not create a storage process when no service worker registration is stored on disk. Now that we do not have a storage process and we are doing registration matching direclty in network process, we can safely remove that optimization. We also move the throttle state handling in WK2 layer. This allows us to not create a network process connection to update throttle state until there is a network process connection. This allows continuing passing an API test checking network process connections after crashes. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::updateServiceWorkerUserAgent): * UIProcess/WebProcessPool.h: * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnection): (WebKit::WebServiceWorkerProvider::updateThrottleState): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_textAutoSizingAdjustmentTimer): (WebKit::WebPage::updateThrottleState): 2019-10-22 Yury Semikhatsky [GTK] Web Inspector: add an option for disabling minification and concatenation of inspector UI in release build https://bugs.webkit.org/show_bug.cgi?id=203201 Reviewed by Carlos Garcia Campos. Allow passing COMBINE_INSPECTOR_RESOURCES and COMBINE_TEST_RESOURCES as cmake arguments. This enables to avoid minification of Web Inspector scripts in release binaries which is very convenient during inspector UI development. * InspectorGResources.cmake: 2019-10-22 Adrian Perez de Castro [GTK][WPE] Fix non-unified builds after r251326 https://bugs.webkit.org/show_bug.cgi?id=203244 Reviewed by Youenn Fablet. * Shared/UserData.cpp: Add missing inclusion of WebCoreArgumentCoders.h * UIProcess/Automation/SimulatedInputDispatcher.cpp: Add missing inclusion of wtf/Variant.h * UIProcess/ProvisionalPageProxy.h: Add missing inclusion of WebCore/ResourceRequest.h * UIProcess/WebTextChecker.cpp: Add missing inclusion of WebPageProxy.h * WebProcess/Databases/WebDatabaseProvider.cpp: Add missing inclusion of WebIDBConnectionToServer.h 2019-10-22 youenn fablet WebSWServerToContextConnection should not assert when failing loads at destruction time https://bugs.webkit.org/show_bug.cgi?id=203243 Reviewed by Alex Christensen. On WebSWServerToContextConnection destruction, we move the fetch task map and fail the tasks. At destruction of the tasks, which happens synchronously, they will try to unregister themselves and the assertion that the task is in the map will fail. To fix that, add a specific contextClosed method that will clear the task connection weak pointer. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::contextClosed): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection): 2019-10-22 youenn fablet ServiceWorkerFetchTask can use the NetworkConnectionToWebProcess sessionID https://bugs.webkit.org/show_bug.cgi?id=202208 Reviewed by Alex Christensen. No need to store the sessionID in ServiceWorkerFetchTask since we can get it from its loader. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::createFetchTask): 2019-10-22 youenn fablet Remove the ability to fallback to custom scheme handlers after a service worker did not handle the load https://bugs.webkit.org/show_bug.cgi?id=203239 Reviewed by Alex Christensen. We remove the ability for service workers to intercept custom scheme handlers. We can then remove the ability for loads that are not handled by service workers to go through custom scheme handlers. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::serviceWorkerDidNotHandle): 2019-10-22 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.2 release * gtk/NEWS: Add release notes for 2.27.2. 2019-10-21 Yusuke Suzuki [JSC] Thread JSGlobalObject* instead of ExecState* https://bugs.webkit.org/show_bug.cgi?id=202392 Reviewed by Geoffrey Garen. * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp: (webkit_frame_get_js_value_for_dom_object_in_script_world): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::reportException): (WebKit::InjectedBundle::createWebDataFromUint8Array): * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::callMethod): * WebProcess/Plugins/Netscape/JSNPMethod.h: * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::callNPJSObject): (WebKit::constructWithConstructor): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::put): (WebKit::JSNPObject::deleteProperty): (WebKit::JSNPObject::deletePropertyByIndex): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): (WebKit::JSNPObject::throwInvalidAccessError): * WebProcess/Plugins/Netscape/JSNPObject.h: * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::identifierFromIdentifierRep): (WebKit::NPJSObject::hasMethod): (WebKit::NPJSObject::invoke): (WebKit::NPJSObject::invokeDefault): (WebKit::NPJSObject::hasProperty): (WebKit::NPJSObject::getProperty): (WebKit::NPJSObject::setProperty): (WebKit::NPJSObject::removeProperty): (WebKit::NPJSObject::enumerate): (WebKit::NPJSObject::construct): * WebProcess/Plugins/Netscape/NPJSObject.h: * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue): (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): (WebKit::NPRuntimeObjectMap::evaluate): (WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState): (WebKit::NPRuntimeObjectMap::globalExec const): Deleted. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performJavaScriptURLRequest): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::jsContext): (WebKit::WebFrame::jsContextForWorld): (WebKit::WebFrame::frameForContext): (WebKit::WebFrame::jsWrapperForWorld): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::freezeLayerTree): (WebKit::WebPage::unfreezeLayerTree): (WebKit::WebPage::runJavaScript): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): 2019-10-22 Carlos Alberto Lopez Perez [GTK][WPE] Enable service workers by default https://bugs.webkit.org/show_bug.cgi?id=200815 Reviewed by Carlos Garcia Campos. Flip the run-time switch to be enabled by default and not only when building with experimental features enabled. * Shared/WebPreferencesDefaultValues.h: 2019-10-22 Carlos Garcia Campos [GTK] C++ comments used in C header files https://bugs.webkit.org/show_bug.cgi?id=203191 Reviewed by Žan Doberšek. * UIProcess/API/gtk/WebKitAutocleanups.h: * UIProcess/API/gtk/WebKitDefines.h: * UIProcess/API/gtk/WebKitForwardDeclarations.h: * UIProcess/API/gtk/WebKitWebViewBase.h: * UIProcess/API/wpe/WebKitAutocleanups.h: * UIProcess/API/wpe/WebKitDefines.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h: * WebProcess/InjectedBundle/API/wpe/WebKitWebEditor.h: * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: 2019-10-22 Wenson Hsieh imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html is flaky https://bugs.webkit.org/show_bug.cgi?id=203181 Reviewed by Ryosuke Niwa. Add a changeCount argument to informationForItemAtIndex and allPasteboardItemInfo, and also make then return optional values; also, adjust changeCount to be an `int64_t` in a few places. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::pasteboardCopy): (WebKit::WebPasteboardProxy::getPasteboardChangeCount): (WebKit::WebPasteboardProxy::addPasteboardTypes): (WebKit::WebPasteboardProxy::setPasteboardTypes): (WebKit::WebPasteboardProxy::setPasteboardURL): (WebKit::WebPasteboardProxy::setPasteboardColor): (WebKit::WebPasteboardProxy::setPasteboardStringForType): (WebKit::WebPasteboardProxy::setPasteboardBufferForType): (WebKit::WebPasteboardProxy::writeCustomData): (WebKit::WebPasteboardProxy::allPasteboardItemInfo): (WebKit::WebPasteboardProxy::informationForItemAtIndex): * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::allPasteboardItemInfo): (WebKit::WebPasteboardProxy::informationForItemAtIndex): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::changeCount): (WebKit::WebPlatformStrategies::addTypes): (WebKit::WebPlatformStrategies::setTypes): (WebKit::WebPlatformStrategies::setBufferForType): (WebKit::WebPlatformStrategies::setURL): (WebKit::WebPlatformStrategies::setColor): (WebKit::WebPlatformStrategies::setStringForType): (WebKit::WebPlatformStrategies::writeCustomData): (WebKit::WebPlatformStrategies::allPasteboardItemInfo): (WebKit::WebPlatformStrategies::informationForItemAtIndex): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2019-10-21 Daniel Bates Add some PencilKit extension points https://bugs.webkit.org/show_bug.cgi?id=202962 Reviewed by Andy Estes. This is the WebKit part corresponding to . * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): Call extension point. (-[WKContentView cleanupInteraction]): Ditto. 2019-10-21 Matt Lewis Unreviewed, rolling out r251381. This broke an internal build. Reverted changeset: "Add some PencilKit extension points" https://bugs.webkit.org/show_bug.cgi?id=202962 https://trac.webkit.org/changeset/251381 2019-10-21 Myles C. Maxfield [Cocoa] Move ui-serif, ui-monospaced, and ui-rounded out from behind SPI https://bugs.webkit.org/show_bug.cgi?id=203129 Reviewed by Tim Horton. * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _shouldAllowDesignSystemUIFonts]): Deleted. (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2019-10-21 youenn fablet Move service worker registration matching for navigation loads to network process https://bugs.webkit.org/show_bug.cgi?id=203144 Reviewed by Chris Dumez. Create a WebSWServerConnection whenever receiving a load request in NetworkProcess. This connection is used to check for service worker registration in case of navigation loads. Similarly, we create a WebSWClientConnection whenever WebProcess needs it, including when receiving WebSWClientConnection messages from NetworkProcess. This for instance happens when service worker registration import is complete to fill the shared registration origin store. Delay loads until SWServer has finished importing its registrations. This is needed since we might otherwise not intercept loads that could be intercepted. Waiting for importing registrations was previously ensured by WebProcess getting a matching registration in DocumentLoader. NetworkResourceLoader is now checking for service worker interception in case of redirections for navigations. This is needed as redirections could end up using a new registration. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection): (WebKit::NetworkConnectionToWebProcess::swConnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::startWithServiceWorker): (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::start): (WebKit::ServiceWorkerFetchTask::startFetch): (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: (WebKit::ServiceWorkerFetchTask::takeRequest): * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::controlClient): (WebKit::WebSWServerConnection::createFetchTask): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::WebSWClientConnection): (WebKit::WebSWClientConnection::registrationReady): (WebKit::WebSWClientConnection::documentIsControlled): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2019-10-21 Sihui Liu Remove IDBBackingStoreTemporaryFileHandler https://bugs.webkit.org/show_bug.cgi?id=203128 Reviewed by Alex Christensen. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::createIDBServer): (WebKit::NetworkProcess::accessToTemporaryFileComplete): Deleted. * NetworkProcess/NetworkProcess.h: 2019-10-21 John Wilander Resource Load Statistics: Update cookie blocking in NetworkStorageSession after first user interaction https://bugs.webkit.org/show_bug.cgi?id=203195 Reviewed by Alex Christensen and Chris Dumez. This change makes sure that the state of cookie blocking in WebCore:: NetworkStorageSession is immediately updated if the logged user interaction was new for this domain. It adds a completion handler to WebResourceLoadStatisticsStore::logUserInteraction() so that the call properly waits for everything to be updated. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::CompletionHandler Dispatch AR event on the originating anchor element https://bugs.webkit.org/show_bug.cgi?id=203198 Reviewed by Simon Fraser. Use the ElementContext on SystemPreviewInfo. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _triggerSystemPreviewActionOnElement:frame:page:]): (-[WKWebView _triggerSystemPreviewActionOnFrame:page:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: * UIProcess/SystemPreviewController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::systemPreviewActionTriggered): 2019-10-21 Dean Jackson Move ElementContext from WebKit to WebCore https://bugs.webkit.org/show_bug.cgi?id=203210 Reviewed by Simon Fraser. * Scripts/webkit/messages.py: * Shared/DocumentEditingContext.h: * Shared/DocumentEditingContext.mm: (IPC::ArgumentCoder::decode): * Shared/ElementContext.cpp: Removed. * Shared/ElementContext.h: Removed. * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultCSSOMViewScrollingAPIEnabled): * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::decode): * Shared/ios/InteractionInformationAtPosition.h: * Sources.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): * UIProcess/API/Cocoa/_WKTextInputContext.mm: (-[_WKTextInputContext _initWithTextInputContext:]): (-[_WKTextInputContext _textInputContext]): * UIProcess/API/Cocoa/_WKTextInputContextInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::textInputContextsInRect): (WebKit::WebPageProxy::focusTextInputContext): * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::textInputContextsInRect): (WebKit::WebPage::focusTextInputContext): (WebKit::WebPage::elementForContext const): (WebKit::WebPage::contextForElement const): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::startInteractionWithElementContextOrPosition): 2019-10-21 Alex Christensen ServiceWorker tests should use TCPServer instead of WKURLSchemeHandler https://bugs.webkit.org/show_bug.cgi?id=203141 Reviewed by Youenn Fablet. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::swServerForSession): (WebKit::NetworkProcess::addServiceWorkerSession): * NetworkProcess/NetworkProcess.h: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration registerURLSchemeServiceWorkersCanHandleForTesting:]): Deleted. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegisteredSchemes const): Deleted. (WebKit::WebsiteDataStoreConfiguration::registerServiceWorkerScheme): Deleted. 2019-10-21 Tim Horton macCatalyst: Swipe navigation gestures do not work https://bugs.webkit.org/show_bug.cgi?id=203205 Reviewed by Wenson Hsieh. * UIProcess/ios/ViewGestureControllerIOS.mm: (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]): Use a different gesture recognizer for swipe in macCatalyst that behaves more like the macOS implementation, based on scrolling instead of the gesture coming from a screen edge. 2019-10-21 Daniel Bates Add some PencilKit extension points https://bugs.webkit.org/show_bug.cgi?id=202962 Reviewed by Andy Estes. This is the WebKit part corresponding to . * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): Call extension point. (-[WKContentView cleanupInteraction]): Ditto. 2019-10-21 Chris Dumez Add more release logging for "Unexpectedly resumed" assertion https://bugs.webkit.org/show_bug.cgi?id=203196 Reviewed by Geoffrey Garen. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processDidResume): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): 2019-10-21 Carlos Garcia Campos [GTK] Objects category in emoji picker is empty https://bugs.webkit.org/show_bug.cgi?id=203189 Reviewed by Adrian Perez de Castro. There's a typo in the first emopi name of objects section. * UIProcess/API/gtk/WebKitEmojiChooser.cpp: (webkitEmojiChooserSetupEmojiSections): uted speaker -> muted speaker 2019-10-21 Carlos Garcia Campos [GTK][WPE] IconDatabase is not thread safe yet https://bugs.webkit.org/show_bug.cgi?id=202980 Reviewed by Adrian Perez de Castro. Current implementation is safer, but we still need to protect members used by both threads. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::populatePageURLToIconURLMap): (WebKit::IconDatabase::clearLoadedIconsTimerFired): (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded): (WebKit::IconDatabase::loadIconForPageURL): (WebKit::IconDatabase::iconURLForPageURL): (WebKit::IconDatabase::setIconForPageURL): (WebKit::IconDatabase::clear): * UIProcess/API/glib/IconDatabase.h: 2019-10-21 Tim Horton Clean up some includes to improve WebKit2 build speed https://bugs.webkit.org/show_bug.cgi?id=203071 Reviewed by Wenson Hsieh. This is worth about 6% on WebKit2, and unlocks another 8% improvement down the line (but which is less mechanical). * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkSocketChannel.h: * NetworkProcess/WebStorage/StorageArea.h: * NetworkProcess/WebStorage/StorageManager.cpp: * NetworkProcess/WebStorage/StorageManagerSet.cpp: * Platform/IPC/Connection.h: * Shared/API/APIURL.h: * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/_WKInspector.mm: * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: * UIProcess/TextCheckerCompletion.cpp: * UIProcess/TextCheckerCompletion.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addNetworkProcess): (WebKit::WebUserContentControllerProxy::removeNetworkProcess): * UIProcess/UserContent/WebUserContentControllerProxy.h: (WebKit::WebUserContentControllerProxy::addNetworkProcess): Deleted. (WebKit::WebUserContentControllerProxy::removeNetworkProcess): Deleted. * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Network/NetworkProcessConnection.cpp: * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/Plugins/Plugin.cpp: * WebProcess/Plugins/Plugin.h: * WebProcess/WebProcess.cpp: 2019-10-20 Brent Fulgham Improve serialization logic https://bugs.webkit.org/show_bug.cgi?id=203039 Reviewed by Alex Christensen. Check that the SecItemRequestData only contains relevant types for CFNetwork uses. * Platform/spi/Cocoa/SecItemSPI.h: Added. * Shared/mac/SecItemRequestData.cpp: (WebKit::arrayContainsInvalidType): Added. (WebKit::dictionaryContainsInvalidType): Added. (WebKit::validTypeIDs): Added. (WebKit::isValidType): Added. (WebKit::SecItemRequestData::decode): Check types during decode. * Shared/mac/SecItemRequestData.h: * WebKit.xcodeproj/project.pbxproj: 2019-10-19 Adrian Perez de Castro [GTK][WPE] Fix non-unified builds after r250857 https://bugs.webkit.org/show_bug.cgi?id=203145 Reviewed by Carlos Garcia Campos. * UIProcess/WebProcessProxy.cpp: Add missing inclusion of the WebBackForwardCache.h header. 2019-10-18 Tim Horton macCatalyst: Cursor should send mouse events, not touch events https://bugs.webkit.org/show_bug.cgi?id=203175 Reviewed by Simon Fraser. * Platform/spi/ios/UIKitSPI.h: * Shared/NativeWebMouseEvent.h: * Shared/ios/NativeWebMouseEventIOS.mm: (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Add a NativeWebMouseEvent constructor that doesn't actually wrap a native event, for creating totally-synthetic events. * UIProcess/ios/WKMouseGestureRecognizer.h: Added. * UIProcess/ios/WKMouseGestureRecognizer.mm: Added. (webEventModifiersForUIKeyModifierFlags): (-[WKMouseGestureRecognizer initWithTarget:action:]): (-[WKMouseGestureRecognizer setView:]): (-[WKMouseGestureRecognizer lastMouseEvent]): (-[WKMouseGestureRecognizer lastMouseLocation]): (-[WKMouseGestureRecognizer mouseTouch]): (-[WKMouseGestureRecognizer _wantsHoverEvents]): (-[WKMouseGestureRecognizer reset]): (-[WKMouseGestureRecognizer _shouldReceiveTouch:forEvent:recognizerView:]): (-[WKMouseGestureRecognizer _shouldReceivePress:]): (-[WKMouseGestureRecognizer createMouseEventWithType:]): (-[WKMouseGestureRecognizer touchesBegan:withEvent:]): (-[WKMouseGestureRecognizer touchesMoved:withEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): (-[WKMouseGestureRecognizer touchesCancelled:withEvent:]): (-[WKMouseGestureRecognizer _hoverEntered:withEvent:]): (-[WKMouseGestureRecognizer _hoverMoved:withEvent:]): (-[WKMouseGestureRecognizer _hoverExited:withEvent:]): (-[WKMouseGestureRecognizer _hoverCancelled:withEvent:]): (-[WKMouseGestureRecognizer locationInView:]): (-[WKMouseGestureRecognizer canPreventGestureRecognizer:]): (-[WKMouseGestureRecognizer canBePreventedByGestureRecognizer:]): Instead of just using UIHoverGestureRecognizer, introduce a new gesture recognizer that does what it did, but also supports cases where the button is pressed (so, mousedown and mouseup instead of just mousemove), and synthesizes mouse events for all state transitions. These events should look roughly identical to what a non-macCatalyst app would get in AppKit's mouseUp/mouseDown/mouseMoved NSResponder methods. * SourcesCocoa.txt: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _showShareSheet:inRect:completionHandler:]): (-[WKContentView _mouseGestureRecognizerChanged:]): (webEventFlagsForUIKeyModifierFlags): Deleted. (-[WKContentView _hoverGestureRecognizerChanged:]): Deleted. * WebKit.xcodeproj/project.pbxproj: Make use of WKMouseGestureRecognizer to plumb the synthesized events directly to the macOS-style "handleMouseEvent" codepath, instead of going through the touch events path (and then subsequently generating synthetic clicks). Also, ensure that other gesture recognizers ignore the mouse "touch" entirely by returning NO in shouldReceiveTouch. 2019-10-18 Jiewen Tan [WebAuthn] Warn users when no credentials are found https://bugs.webkit.org/show_bug.cgi?id=203147 Reviewed by Brent Fulgham. This patch returns _WKWebAuthenticationPanelUpdateNoCredentialsFound to client via -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] when either CtapAuthenticator receives kCtap2ErrNoCredentials or U2fAuthenticator exhausts the allow list. This patch also enhances CtapAuthenticator::tryDowngrade to check if the CTAP command can be converted to U2F commands to ensure kCtap2ErrNoCredentials is returned if it is the case. Otherwise, after downgrading, U2fAuthenticator will return NotSupportedError given it can't convert the commands. * UIProcess/API/APIUIClient.h: * UIProcess/API/APIWebAuthenticationPanelClient.h: (API::WebAuthenticationPanelClient::updatePanel const): * UIProcess/WebAuthentication/Authenticator.h: * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::authenticatorStatusUpdated): * UIProcess/WebAuthentication/AuthenticatorManager.h: * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h: * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient): (WebKit::wkWebAuthenticationPanelUpdate): (WebKit::WebAuthenticationPanelClient::updatePanel const): * UIProcess/WebAuthentication/WebAuthenticationFlags.h: Renamed from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationPanelFlags.h. * UIProcess/WebAuthentication/WebAuthenticationRequestData.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived): (WebKit::CtapAuthenticator::tryDowngrade): * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: (WebKit::U2fAuthenticator::issueSignCommand): * WebKit.xcodeproj/project.pbxproj: 2019-10-18 Wenson Hsieh [Clipboard API] Refactor Pasteboard::read() to take an optional item index https://bugs.webkit.org/show_bug.cgi?id=203161 Reviewed by Tim Horton. * Shared/mac/PasteboardTypes.mm: (WebKit::PasteboardTypes::forEditing): (WebKit::PasteboardTypes::forSelection): Support "com.apple.webarchive" alongside the private "Apple Web Archive pasteboard type". * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setPromisedDataForImage): 2019-10-18 Ryosuke Niwa [iOS] REGRESSION(r251269): fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation.html and fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html fail https://bugs.webkit.org/show_bug.cgi?id=203162 Reviewed by Simon Fraser. Synchronously update the rendering before the orientation change and other viewport size updates. Otherwise, resize event will be dispatched in the middle of orientation animation, and would result in non-determistic results. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2019-10-18 Chris Dumez [iOS] "Unexpectedly Resumed" process assertion may cause us to get terminated https://bugs.webkit.org/show_bug.cgi?id=203046 Reviewed by Geoffrey Garen. This patch implements the following to avoid getting terminated: 1. Schedule the task to release the assertion on a background thread instead of the main thread so that we end up releasing the task even if the main thread is somehow hung. 2. Add an invalidation handler to the process assertion which releases the assertion upon expiration. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processDidResume): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): 2019-10-18 Jer Noble Add experimental HDR MediaCapabilities support. https://bugs.webkit.org/show_bug.cgi?id=203113 Reviewed by Eric Carlson. Add experimental hdrMediaCapabilitiesEnabled preference. * Shared/WebPreferences.yaml: 2019-10-18 Jiewen Tan [WebAuthn] Implement AuthenticatorCancel https://bugs.webkit.org/show_bug.cgi?id=191523 Reviewed by Brent Fulgham. This patch implement two ways to cancel a pending WebAuthn ceremony: 1) Via navigation activities. Activities include i) main frame navigation, ii) main frame reload, iii) main frame destruction, iv) sub frame navigation, and v) sub frame destruction. All the above activities will cancel any pending WebAuthn ceremony that is associated with the frame. To prove the association, a GlobalFrameIdentifier is bridged into WebAuthenticationRequestData. Navigation cancel is done in WebPageProxy::didStartProvisionalLoadForFrameShared, and destruction cancel is done in WebProcessProxy::didDestroyFrame and WebPageProxy::resetState. 2) Via UI. This path is simply bridged -[_WKWebAuthenticationPanel cancel] into AuthenticatorManager. Noted, this patch follows the spec to wait until time out to notify RPs. References: i) Step 20 of https://www.w3.org/TR/webauthn/#createCredential, ii) Step 18 of https://www.w3.org/TR/webauthn/#getAssertion As for what the cancel actually does, it: 1) stops any HID/NFC scanning; 2) sends CTAPHID_CANCEL to any HID authenticators that have been added. Reference: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#usb-hid-cancel Sending CTAPHID_CANCEL, however, is not trivial. An abstract class FidoAuthenticator is crafted to do this labor for both CtapAuthenticator and U2fAuthenticator during the time of destructions. Noted: The CtapHidDriver is the only CtapDriver implements the cancel method. Since the message is sent during state reset, lifecycle of the HidConenction and HidService which manage the underlying IOHIDDeviceRef is very hard to hold. This is required for the regular async sender. Therefore, HidConnection::sendSync is crafted to send the message synchronously to get rid of the tediousness of managing those lifecycles. P.S. Vector::grow doesn't initialize POD types. Therefore, this patch also appends it with memset for FidoHidPacket. P.S.S. This patch also simplifies AuthenticatorCoordinatorClient by: i) moving code from AuthenticatorCoordinatorClient to WebAuthenticatorCoordinatorClient, and ii) using sendWithAsyncReply. The latter allows us to get rid of the complex mechanism of ensuring the right reply is returned. * DerivedSources.make: * Sources.txt: * UIProcess/API/APIWebAuthenticationPanel.cpp: (API::WebAuthenticationPanel::create): (API::WebAuthenticationPanel::WebAuthenticationPanel): (API::WebAuthenticationPanel::cancel const): * UIProcess/API/APIWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (-[_WKWebAuthenticationPanel cancel]): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::cancelRequest): (WebKit::AuthenticatorManager::clearState): (WebKit::AuthenticatorManager::runPanel): (WebKit::AuthenticatorManager::resetState): * UIProcess/WebAuthentication/AuthenticatorManager.h: * UIProcess/WebAuthentication/Cocoa/HidConnection.h: (WebKit::HidConnection::isInitialized const): (WebKit::HidConnection::setIsInitialized): * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: (WebKit::HidConnection::~HidConnection): (WebKit::HidConnection::initialize): (WebKit::HidConnection::terminate): (WebKit::HidConnection::sendSync): (WebKit::HidConnection::send): (WebKit::HidConnection::registerDataReceivedCallback): * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::initialize): (WebKit::MockHidConnection::terminate): (WebKit::MockHidConnection::sendSync): (WebKit::MockHidConnection::send): (WebKit::MockHidConnection::feedReports): * UIProcess/WebAuthentication/Mock/MockHidConnection.h: * UIProcess/WebAuthentication/WebAuthenticationRequestData.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential): (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion): (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest): (WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable): (WebKit::WebAuthenticatorCoordinatorProxy::requestReply): Deleted. * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::CtapAuthenticator): (WebKit::CtapAuthenticator::makeCredential): (WebKit::CtapAuthenticator::getAssertion): (WebKit::CtapAuthenticator::tryDowngrade): * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: * UIProcess/WebAuthentication/fido/CtapDriver.h: (WebKit::CtapDriver::cancel): * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp: (WebKit::CtapHidDriver::Worker::write): (WebKit::CtapHidDriver::Worker::read): (WebKit::CtapHidDriver::Worker::returnMessage): (WebKit::CtapHidDriver::Worker::reset): (WebKit::CtapHidDriver::Worker::cancel): (WebKit::CtapHidDriver::continueAfterChannelAllocated): (WebKit::CtapHidDriver::continueAfterResponseReceived): (WebKit::CtapHidDriver::returnResponse): (WebKit::CtapHidDriver::reset): (WebKit::CtapHidDriver::cancel): * UIProcess/WebAuthentication/fido/CtapHidDriver.h: * UIProcess/WebAuthentication/fido/FidoAuthenticator.cpp: Copied from Source/WebKit/UIProcess/API/APIWebAuthenticationPanel.cpp. (WebKit::FidoAuthenticator::FidoAuthenticator): (WebKit::FidoAuthenticator::~FidoAuthenticator): (WebKit::FidoAuthenticator::driver const): (WebKit::FidoAuthenticator::releaseDriver): * UIProcess/WebAuthentication/fido/FidoAuthenticator.h: Copied from Source/WebKit/UIProcess/API/APIWebAuthenticationPanel.cpp. * UIProcess/WebAuthentication/fido/FidoService.cpp: (WebKit::FidoService::continueAfterGetInfo): * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: (WebKit::U2fAuthenticator::U2fAuthenticator): (WebKit::U2fAuthenticator::issueCommand): * UIProcess/WebAuthentication/fido/U2fAuthenticator.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): (WebKit::WebPageProxy::resetState): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didDestroyFrame): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::WebAuthenticatorCoordinator): (WebKit::WebAuthenticatorCoordinator::makeCredential): (WebKit::WebAuthenticatorCoordinator::getAssertion): (WebKit::WebAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable): (WebKit::WebAuthenticatorCoordinator::~WebAuthenticatorCoordinator): Deleted. * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h: * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.messages.in: Removed. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::fromCoreFrame): * WebProcess/WebPage/WebFrame.h: 2019-10-18 Zan Dobersek Avoid crashes on GCC-compiled binaries by avoiding a use-after-move that's the result of differring call conventions. Rubber-stamped by Carlos Garcia Campos. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): Copy the SW identifier from the ServiceWorkerFetchTask before it's moved into the lambda. 2019-10-17 Mark Lam Use constexpr in more places and remove some unnecessary external linkage. https://bugs.webkit.org/show_bug.cgi?id=203115 Reviewed by Yusuke Suzuki. * UIProcess/API/APIContentRuleListStore.h: * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm: 2019-10-17 Antoine Quint [Web Animations] Enable the Web Animations JavaScript API by default https://bugs.webkit.org/show_bug.cgi?id=203075 Reviewed by Antti Koivisto. * Shared/WebPreferences.yaml: 2019-10-17 Carlos Alberto Lopez Perez [GTK][WPE] File and Directory Entries API is not enabled https://bugs.webkit.org/show_bug.cgi?id=202796 Reviewed by Adrian Perez de Castro. Enable by default the DirectoryUpload runtime setting that is used to enable the APIs of the File and Directory Entries API. Enable also the DataTransferItemsEnabled runtime setting that exposes the DataTransferItem API. This makes the manual tests available at https://w3c-test.org/entries-api mostly pass on platform GTK (those tests need also the DataTransferItem API to enable the drag-and-drop). The bug for DataTransferItem API remains open because the layout test editing/pasteboard/data-transfer-items.html is still not passing completely. However other manual tests for DataTransferItem pass after enabling it. * Shared/WebPreferencesDefaultValues.h: 2019-10-17 Devin Rousso Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type https://bugs.webkit.org/show_bug.cgi?id=200384 Reviewed by Joseph Pecoraro. * WebProcess/WebPage/RemoteWebInspectorUI.h: (WebKit::WebInspectorUI::backendCommandsURL const): Added. (WebKit::WebInspectorUI::debuggableType const): Added. (WebKit::WebInspectorUI::backendCommandsURL): Deleted. (WebKit::WebInspectorUI::debuggableType): Deleted. * WebProcess/WebPage/WebInspectorUI.h: (WebKit::WebInspectorUI::backendCommandsURL const): Added. (WebKit::WebInspectorUI::debuggableType const): Added. * UIProcess/WebPageDebuggable.h: (WebKit::WebPageDebuggable::type const): * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::RemoteInspectorClient): * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h: * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (debuggableTypeString): Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy). 2019-10-16 Emilio Cobos Álvarez Pass network cache directory in WebsiteDataStore::parameters() for non-Cocoa platforms. https://bugs.webkit.org/show_bug.cgi?id=203043 This was causing various errors in the network process that were visible in debug builds. Reviewed by Alex Christensen. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): 2019-10-16 Chris Dumez Rename PageCache to BackForwardCache https://bugs.webkit.org/show_bug.cgi?id=203048 Reviewed by Alex Christensen. Rename PageCache to BackForwardCache for clarity and consistency with the UIProcess's WebBackForwardCache. * Shared/CacheModel.cpp: (WebKit::calculateMemoryCacheSizes): * Shared/CacheModel.h: * Shared/WebPreferences.yaml: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::willGoToBackForwardListItem): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPageCacheEnabled): (WKPreferencesGetPageCacheEnabled): (WKPreferencesSetPageCacheSupportsPlugins): (WKPreferencesGetPageCacheSupportsPlugins): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setUsesPageCache:]): (-[WKPreferences _usesPageCache]): (-[WKPreferences _setPageCacheSupportsPlugins:]): (-[WKPreferences _pageCacheSupportsPlugins]): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration pageCacheEnabled]): (-[_WKProcessPoolConfiguration setPageCacheEnabled:]): * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_get_enable_page_cache): (webkit_settings_set_enable_page_cache): * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem): (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation): (WebKit::NavigationState::NavigationClient::didReceiveServerRedirectForProvisionalNavigation): (WebKit::NavigationState::NavigationClient::didFailProvisionalNavigationWithError): (WebKit::NavigationState::NavigationClient::didCommitNavigation): (WebKit::NavigationState::NavigationClient::didFinishDocumentLoad): (WebKit::NavigationState::NavigationClient::didFinishNavigation): (WebKit::NavigationState::NavigationClient::didFailNavigationWithError): (WebKit::NavigationState::NavigationClient::didSameDocumentNavigation): * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::shouldUseBackForwardCache const): (WebKit::WebPageProxy::willGoToBackForwardListItem): (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared): (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): (WebKit::WebPageProxy::didFinishLoadForFrame): (WebKit::WebPageProxy::didFailLoadForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::updateBackForwardCacheCapacity): * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp: (WKBundleBackForwardListItemIsInBackForwardCache): * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h: * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toBackForwardListItemState): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::WebFrameLoaderClient): (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const): (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): (WebKit::WebFrameLoaderClient::didRestoreFromBackForwardCache): (WebKit::WebFrameLoaderClient::createPlugin): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::forceLayoutOnRestoreFromBackForwardCache): * WebProcess/WebPage/VisitedLinkTableController.cpp: * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::removeItem): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::suspendForProcessSwap): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::setCacheModel): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::setBackForwardCacheCapacity): (WebKit::WebProcess::clearCachedPage): * WebProcess/WebProcess.h: 2019-10-16 Per Arne Vollan [iOS] Remove ubiquity client rule from sandbox https://bugs.webkit.org/show_bug.cgi?id=201347 Reviewed by Brent Fulgham. This rule is most likely not needed, since we have already blocked all of its associated mach services, and no issues have been reported. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-16 Tim Horton iOS: inputmode=none is not respected with a hardware keyboard attached https://bugs.webkit.org/show_bug.cgi?id=203061 Reviewed by Daniel Bates. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView shouldShowAutomaticKeyboardUI]): We can resolve this FIXME, as the underlying bug was fixed in . This now means that we will respect inputmode=none even when a hardware keyboard is attached, significantly improving the experience on sites that use it by avoiding an intermittent input bar. 2019-10-16 Per Arne Vollan [iOS] Remove send-signal from mach-lookup rule https://bugs.webkit.org/show_bug.cgi?id=201203 Reviewed by Brent Fulgham. The send-signal can be removed, since crashes have not been reported from this rule. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-16 Dean Jackson Add Swift modulemap for WebKit Private APIs https://bugs.webkit.org/show_bug.cgi?id=203059 Reviewed by Tim Horton. Provide a Swift modulemap for WebKit_Private, and ensure WKPreferencesPrivate.h is exposed. Renamed OSX.modulemap to macOS.modulemap while here. * Configurations/WebKit.xcconfig: * Modules/iOS.private.modulemap: Added. * Modules/macOS.modulemap: Renamed from Source/WebKit/Modules/OSX.modulemap. * Modules/macOS.private.modulemap: Added. * Shared/API/Cocoa/WebKitPrivate.h: Include WKPreferencesPrivate.h. 2019-10-16 John Wilander Resource Load Statistics (experimental): Block all third-party cookies on websites without prior user interaction https://bugs.webkit.org/show_bug.cgi?id=203017 Reviewed by Alex Christensen. This enhancement is off by default and controlled by an internal feature flag. The functional change is in WebCore::NetworkStorageSession::shouldBlockCookies() which is called from: - NetworkDataTaskCocoa::NetworkDataTaskCocoa() - NetworkDataTaskCocoa::willPerformHTTPRedirection shouldBlockCookies() now checks if the first-party website has received user interaction and if not, blocks all third-party cookies, regardless of the status of those third-party domains (prevalent or not). The changes to ResourceLoadStatisticsDatabaseStore and ResourceLoadStatisticsMemoryStore are about communicating which domains have received user interaction (prevalent or not) to the network storage session so that it can enforce the new restriction. The C API change and piping through the WebsiteDataStore is test infrastructure. Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::CompletionHandler WKWebsiteDataStoreStatisticsResetToConsistentState() should call store.setUseITPDatabase(false) https://bugs.webkit.org/show_bug.cgi?id=203020 Reviewed by Chris Dumez. The resourceLoadStatisticsStore should be reset between tests to use a memory store, and any test that needs to use the database store can use the setUseITPDatabase function. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setUseITPDatabase): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetUseITPDatabase): (WKWebsiteDataStoreStatisticsResetToConsistentState): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setUseITPDatabase): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setUseITPDatabase): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-10-16 Chris Dumez [WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess https://bugs.webkit.org/show_bug.cgi?id=203034 Reviewed by Antti Koivisto. Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess, now that back/forward cache management is done in the UIProcess. * UIProcess/WebBackForwardCacheEntry.cpp: (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry): (WebKit::WebBackForwardCacheEntry::takeSuspendedPage): (WebKit::WebBackForwardCacheEntry::expirationTimerFired): * UIProcess/WebBackForwardCacheEntry.h: Add a Timer to WebBackForwardCacheEntry to make the entry expire after 30 minutes, which is what used to happen on WebContent process side. One difference in behavior is that when the entry expires we now remove it from the cache right away to free-up memory, instead of simply refusing to use it later on. * WebProcess/WebPage/WebPage.cpp: Disable back forward cache expiration in the WebContent process when using modern WebKit. 2019-10-16 Chris Dumez [iOS] Stop terminating the prewarmed process on application suspension https://bugs.webkit.org/show_bug.cgi?id=203033 Reviewed by Alex Christensen. Stop terminating the prewarmed process on application suspension. Having no prewarmed process when the application resumes means the next cross-site load will be significantly slower. If the system needs memory, this process can be jetsammed. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::applicationIsAboutToSuspend): 2019-10-16 Chris Dumez Drop unused WKPageSetResourceCachingDisabled() SPI https://bugs.webkit.org/show_bug.cgi?id=203035 Reviewed by Alex Christensen. * UIProcess/API/C/WKPage.cpp: (WKPageGetResourceCachingDisabled): Deleted. (WKPageSetResourceCachingDisabled): Deleted. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setResourceCachingDisabled): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isResourceCachingDisabled const): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setResourceCachingDisabled): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-10-16 Wenson Hsieh Unreviewed, fix the internal macOS 10.13 and 10.14 builds after r251171 * Platform/spi/mac/ApplicationServicesSPI.h: Guard SPI declarations that use AXClientType with HAVE(AX_CLIENT_TYPE). 2019-10-15 Carlos Garcia Campos [GTK][WPE] Add user messages API https://bugs.webkit.org/show_bug.cgi?id=202847 Reviewed by Adrian Perez de Castro. We have never exposed an API to send/receive messages to/from Web extensions, to allow applications use their own IPC. Now, with PSON enabled, it's a lot more difficult to implement the custom IPC on the application side, because applications need to keep track of all the web processes launched, and the changes of web process in the web view to send the messages to the right extension. That's already done internally by WebKit, so it would be easier to provide a simple API so that apps don't need to worry about the web process being used. This patch adds WebKitUserMessage, a simple message API consisting on a message name, parameters and file descriptors. Messages can be sent from a WebKitWebContext to all the WebKitWebExtensions, or from a WebKitWebExtension to its WebKitWebContext, or from a WebKitWebView to its WebKitWebPage (and vice versa). * PlatformGTK.cmake: * PlatformWPE.cmake: * Shared/API/glib/WebKitUserMessage.cpp: Added. (webkitUserMessageDispose): (webkitUserMessageGetProperty): (webkitUserMessageSetProperty): (webkit_user_message_class_init): (webkitUserMessageCreate): (webkitUserMessageGetMessage): (webkit_user_message_new): (webkit_user_message_new_with_fd_list): (webkit_user_message_get_name): (webkit_user_message_get_parameters): (webkit_user_message_get_fd_list): (webkit_user_message_send_reply): * Shared/API/glib/WebKitUserMessagePrivate.h: Added. * Shared/glib/ArgumentCodersGLib.cpp: Added. (IPC::encode): (IPC::decode): * Shared/glib/ArgumentCodersGLib.h: Added. * Shared/glib/UserMessage.cpp: Added. (WebKit::UserMessage::encode const): (WebKit::UserMessage::decode): * Shared/glib/UserMessage.h: Added. (WebKit::UserMessage::UserMessage): * SourcesGTK.txt: * SourcesWPE.txt: * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkit_web_context_class_init): (webkit_web_context_send_message_to_all_extensions): * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): (webkitWebViewDidReceiveUserMessage): (webkit_web_view_send_message_to_page): (webkit_web_view_send_message_to_page_finish): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitUserMessage.h: Added. * UIProcess/API/gtk/WebKitWebContext.h: * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: * UIProcess/API/wpe/APIViewClient.h: (API::ViewClient::didReceiveUserMessage): * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::sendMessageToWebView): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::didReceiveUserMessage): * UIProcess/API/wpe/WPEView.h: * UIProcess/API/wpe/WebKitUserMessage.h: Added. * UIProcess/API/wpe/WebKitWebContext.h: * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/API/wpe/docs/wpe-docs.sgml: * UIProcess/API/wpe/webkit.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/glib/WebProcessProxyGLib.cpp: (WebKit::WebProcessProxy::sendMessageToWebContextWithReply): (WebKit::WebProcessProxy::sendMessageToWebContext): * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::sendMessageToWebViewWithReply): (WebKit::WebPageProxy::sendMessageToWebView): * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::sendMessageToWebViewWithReply): (WebKit::WebPageProxy::sendMessageToWebView): * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h: (WebKit::WebKitExtensionManager::extension const): * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: (webkitWebExtensionDidReceiveUserMessage): (webkit_web_extension_send_message_to_context): (webkit_web_extension_send_message_to_context_finish): * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h: * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (webkit_web_page_class_init): (webkitWebPageDidReceiveUserMessage): (webkit_web_page_send_message_to_view): (webkit_web_page_send_message_to_view_finish): * WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h: * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: * WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h: * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt: * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/glib/WebPageGLib.cpp: Added. (WebKit::WebPage::sendMessageToWebExtensionWithReply): (WebKit::WebPage::sendMessageToWebExtension): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/glib/WebProcessGLib.cpp: (WebKit::WebProcess::sendMessageToWebExtension): 2019-10-15 Wenson Hsieh Fix the internal macOS build after r251171 https://bugs.webkit.org/show_bug.cgi?id=203022 Reviewed by Dan Bernstein. Attempts to include in WebKit result in: ``` fatal error: 'HIServices/AccessibilityPriv.h' file not found ``` At least on macOS 10.15, it appears that HIServices.framework exists within the ApplicationServices framework. To fix this build error, we can instead turn AccessibilityPrivSPI.h into an SPI header for ApplicationServices, ApplicationServicesSPI.h, and use it in several places where we currently directly import . * Platform/IPC/cocoa/ConnectionCocoa.mm: Bring some more constants that were defined in the !USE(APPLE_INTERNAL_SDK) case into the ApplicationServices SPI header. * Platform/spi/mac/ApplicationServicesSPI.h: Renamed from Source/WebKit/Platform/spi/mac/AccessibilityPrivSPI.h. * Shared/mac/AuxiliaryProcessMac.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: 2019-10-15 Kate Cheney REGRESSION (~244100) [Mac WK2 Debug] Layout Test http/tests/resourceLoadStatistics/prune-statistics.html is a flaky failure (197285) https://bugs.webkit.org/show_bug.cgi?id=197285 Reviewed by Chris Dumez. This patch fixes a flaky failure which was being caused by other resourceLoadStatistics tests scheduling processing checks which were called during execution of prune-statistics.html. Now, any pending processing checks are cancelled between tests. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): 2019-10-15 Chris Dumez [iOS] Maintain the last Back/Forward cache entry when the application gets suspended https://bugs.webkit.org/show_bug.cgi?id=203014 Reviewed by Geoffrey Garen. Previously, we would clear all back/forward cache entries when the application is about to be suspended. This means that we would lose fast-back when coming back to the application. To be memory-friendly but maintain the fast-back when coming back to the application, we now maintain the last back/forward cache entry when the application gets suspended. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::applicationIsAboutToSuspend): (WebKit::WebProcessPool::notifyProcessPoolsApplicationIsAboutToSuspend): * UIProcess/WebBackForwardCache.cpp: (WebKit::WebBackForwardCache::pruneToSize): * UIProcess/WebBackForwardCache.h: * UIProcess/WebProcessPool.h: * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager init]): (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): A WebProcess no longer clears its PageCache on suspension on iOS. We let the UIProcess's back/forward cache control when PageCache entries should get destroyed. The back/forward cache will properly wake up a suspended process to clear one of its PageCache entries if needed. 2019-10-15 Andres Gonzalez AX: Make AXIsolatedTree compile again https://bugs.webkit.org/show_bug.cgi?id=202702 Reviewed by Joanmarie Diggs. Re-submitting r251045 with a fix for internal builds. * Platform/spi/mac/AccessibilityPrivSPI.h: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]): 2019-10-15 Chris Dumez Webview's drawing area may stay frozen on cross-site back/forward navigation https://bugs.webkit.org/show_bug.cgi?id=203004 Reviewed by Tim Horton. Whenever the UIScene becomes foreground / background, the WebPageProxy notifies its currently associated WebPage in the committed WebProcess so that it can freeze / unfreeze its layer tree with the BackgroundApplication reason. The issue is that if a WebPage gets suspended on cross-site navigation (because the UIScene is in the background when the load commits), then the suspended WebPage kept its a BackgroundApplication freeze. When the UIScene becomes foreground, the WebPage only notifies its committed page so the suspended page keeps its BackgroundApplication freeze still. If the user now navigates back, it will restore the suspended WebPage and the view will stay frozen. To address the issue, we now have the WebPage drop its BackgroundApplication freeze reason, whenever it transitions from committed to suspended. * UIProcess/ios/WKApplicationStateTrackingView.mm: (-[WKApplicationStateTrackingView didMoveToWindow]): Fix logging, [self isBackground] needs to be called *after* _applicationStateTracker has been initialized, or it will return YES unconditionally. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setIsSuspended): 2019-10-15 Peng Liu [Picture-in-Picture Web API] Implement HTMLVideoElement.requestPictureInPicture() / Document.exitPictureInPicture() https://bugs.webkit.org/show_bug.cgi?id=201024 Reviewed by Eric Carlson. Add configurations for Picture-in-Picture API and add a preference option for it. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferences.yaml: 2019-10-15 youenn fablet Move headers to keep from a HTTPHeaderNameSet to an OptionSet https://bugs.webkit.org/show_bug.cgi?id=202977 Reviewed by Anders Carlsson. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: 2019-10-15 Jiewen Tan [WebAuthn] Rename -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] to -[WKUIDelegatePrivate _webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] https://bugs.webkit.org/show_bug.cgi?id=202564 Reviewed by Brent Fulgham. Rename the SPI to a proper SPI style. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel): 2019-10-15 youenn fablet Scheduling a service worker job in server should wait for finishing the registration import https://bugs.webkit.org/show_bug.cgi?id=202975 Reviewed by Chris Dumez. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::scheduleJobInServer): We should not schedule a job until the registrations are fully imported. Covered by ServiceWorkerBasic API test flakily hitting debug asserts. 2019-10-15 Alex Christensen Unreviewed, rolling out r251138. Broke API tests Reverted changeset: "Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global" https://bugs.webkit.org/show_bug.cgi?id=202891 https://trac.webkit.org/changeset/251138 2019-10-15 Chris Dumez Stop using inheritance for WebBackForwardCacheEntry https://bugs.webkit.org/show_bug.cgi?id=202989 Reviewed by Alex Christensen. Stop using inheritance for WebBackForwardCacheEntry. This simplifies the code a bit. * Sources.txt: * UIProcess/WebBackForwardCache.cpp: (WebKit::WebBackForwardCache::addEntry): (): Deleted. * UIProcess/WebBackForwardCacheEntry.cpp: Copied from Source/WebKit/UIProcess/WebBackForwardCacheEntry.h. (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry): (WebKit::WebBackForwardCacheEntry::~WebBackForwardCacheEntry): (WebKit::WebBackForwardCacheEntry::takeSuspendedPage): (WebKit::WebBackForwardCacheEntry::process const): * UIProcess/WebBackForwardCacheEntry.h: (WebKit::WebBackForwardCacheEntry::suspendedPage const): (WebKit::WebBackForwardCacheEntry::processIdentifier const): (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry): Deleted. * WebKit.xcodeproj/project.pbxproj: 2019-10-15 Alex Christensen Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global https://bugs.webkit.org/show_bug.cgi?id=202891 Reviewed by Youenn Fablet. No change in behavior. Now the LegacySchemeRegistry is not used as much in the NetworkProcess, a step towards no use at all. This functionality is currently only available through the glib API webkit_security_manager_register_uri_scheme_as_cors_enabled but it has been requested in bug 201180 and bug 199064. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::registerURLSchemesAsCORSEnabled): * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::schemeRegistry): * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const): * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const): Deleted. * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::m_shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkSchemeRegistry.cpp: Added. (WebKit::NetworkSchemeRegistry::registerURLSchemeAsCORSEnabled): (WebKit::NetworkSchemeRegistry::shouldTreatURLSchemeAsCORSEnabled): * NetworkProcess/NetworkSchemeRegistry.h: Added. (WebKit::NetworkSchemeRegistry::create): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): Use nullptr, indicating that the PingLoad constructor that is used in ad click attribution should not check the custom scheme registry. This is Ok because ad click attribution is only used for HTTP family schemes. (WebKit::m_blobFiles): * NetworkProcess/PingLoad.h: * Sources.txt: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::registerURLSchemeAsCORSEnabled): (WebKit::WebProcess::ensureNetworkProcessConnection): (WebKit::WebProcess::registerURLSchemeAsCORSEnabled const): Deleted. * WebProcess/WebProcess.h: 2019-10-15 Carlos Garcia Campos Unreviewed. Fix several GTK tests in /WebKit2Gtk/TestUIClient crashing since r241988 Show a warning message and return nullptr from WebKitWebView::create if the new web view is not related to the given one. Also make it clear in the documentation that the new web view should be related to the given one. * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): (webkitWebViewCreateNewPage): 2019-10-15 Carlos Garcia Campos Unreviewed. Fix GTK test /webkit/Authentication/authentication-storage after r249962 * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewHandleAuthenticationChallenge): Do not use webkit_settings_get_enable_private_browsing(). 2019-10-15 Carlos Garcia Campos Unreviewed. Fix GTK test /webkit/WebKitSettings/webkit-settings after r249962. Legacy private browsing was removed in r249962, so webkit_settings_set_enable_private_browsing() is now no-op. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsSetProperty): Only call webkit_settings_set_enable_private_browsing() when trying to enable it. (webkit_settings_set_enable_private_browsing): Show a warning to let users know that it does nothing now. 2019-10-15 Carlos Garcia Campos [GTK][WPE] WebKitWebContext should identify web views by their WebPageProxy identifier https://bugs.webkit.org/show_bug.cgi?id=202924 Reviewed by Adrian Perez de Castro. Instead of the WebPage identifier, since it maps WebPageProxy to WebKitWebView. * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextCreatePageForWebView): (webkitWebContextWebViewDestroyed): (webkitWebContextGetWebViewForPage): 2019-10-15 youenn fablet Handle service worker loads through NetworkResourceLoader https://bugs.webkit.org/show_bug.cgi?id=202309 Unreviewed. Fix !ENABLE(SERVICE_WORKER) builds. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::continueDidReceiveResponse): (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): 2019-10-14 Youenn Fablet Handle service worker loads through NetworkResourceLoader https://bugs.webkit.org/show_bug.cgi?id=202309 Reviewed by Alex Christensen. Remove ServiceWorkerFetchClient. Instead we use the normal NetworkResourceLoader/WebResourceLoader communication channel. We pass additional parameters, in particular service worker mode and registration identifier. Based on that information, network process will decide whether to load from service worker or network. The first advantage is that in case of service worker not handling the load, going to the network is faster. This will also allow us to do the registration matching in network process when receiving a navigation request. ServiceWorkerFetchTask is now beefed up to do the link between service worker and NetworkResourceLoader/WebResourceLoader. To support the same console logging, we add a new message called DidFailServiceWorkerLoad. To support API tests, we continue to go to the service worker before trying to go to URL scheme handlers. This adds some burden as we need to go to network process/service worker process and, in case load is not handled by service worker, we go back to the web process to do the load through URL scheme handlers. For that purpose we use ServiceWorkersMode::Only. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::abort): (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::continueDidReceiveResponse): (WebKit::NetworkResourceLoader::startWithServiceWorker): (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::~ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::sendToServiceWorker): (WebKit::ServiceWorkerFetchTask::sendToClient): (WebKit::ServiceWorkerFetchTask::start): (WebKit::ServiceWorkerFetchTask::startFetch): (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didReceiveData): (WebKit::ServiceWorkerFetchTask::didReceiveFormData): (WebKit::ServiceWorkerFetchTask::didFinish): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): (WebKit::ServiceWorkerFetchTask::cancelFromClient): (WebKit::ServiceWorkerFetchTask::continueDidReceiveFetchResponse): (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: (WebKit::ServiceWorkerFetchTask::fetchIdentifier const): (WebKit::ServiceWorkerFetchTask::serviceWorkerIdentifier const): * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::cancelFetch): (WebKit::WebSWServerConnection::createFetchTask): (WebKit::WebSWServerConnection::startFetch): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::startFetch): (WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse): (WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage): (WebKit::WebSWServerToContextConnection::registerFetch): (WebKit::WebSWServerToContextConnection::unregisterFetch): (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: (WebKit::WebSWServerToContextConnection::ipcConnection const): * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didFailServiceWorkerLoad): (WebKit::WebResourceLoader::serviceWorkerDidNotHandle): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed. * WebProcess/Storage/ServiceWorkerClientFetch.h: Removed. * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed. * WebProcess/Storage/WebSWClientConnection.cpp: * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: * WebProcess/Storage/WebServiceWorkerProvider.h: 2019-10-14 Carlos Garcia Campos [GTK] White pages in AC mode: Cannot get default EGL display: EGL_BAD_PARAMETER https://bugs.webkit.org/show_bug.cgi?id=202362 Reviewed by Carlos Alberto Lopez Perez. * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences): Disable accelerated compositing mode when we failed to reate the shared display for compositing. * WebProcess/glib/WebProcessGLib.cpp: (WebKit::WebProcess::platformInitializeWebProcess): Destroy the wpe display when initialization fails. 2019-10-14 Chris Dumez [WK2] Have WebBackForwardCache class coordinate page caching in all WebProcesses https://bugs.webkit.org/show_bug.cgi?id=202929 Reviewed by Alex Christensen. Have WebBackForwardCache class coordinate page caching in all WebProcesses. To achieve this, the following changes were made: 1. Whenever HistoryItem::m_cachedPage changes in WebCore, we notify the client that the HistoryItem has changed. I added a "hasCachedPage" boolean to the item info being passed the the UIProcess that is set based on whether or not HistoryItem::m_cachedPage is null. 2. The WebBackForwardCache now contains WebBackForwardCacheEntry objects instead of SuspendedPage objects. A WebBackForwardCacheEntry may have a SuspendedPage or not. As a result, we can now add the the back/forward cache CachedPage entries from the WebContent process, which do not have a SuspendedPageProxy in the UIProcess. 3. Now that WebBackForwardCache is aware of all CachedPages, it can properly enforce a cache capacity across call processes. Whenever a WebBackForwardCacheEntry is pruned from the cache and this entry does not have a SuspendedPageProxy, we send an IPC to the WebContent process to remove this cached page from the PageCache in WebCore. Previously, as soon as we would cache a page in the WebContent process, we would send an IPC to the UIProcess so that it would clear the PageCache in any previous WebContent process. This was a stop-gap measure to avoid blowing up memory in a multi-process model by keeping a PageCache around in all WebContent process. This would make sure only one process could have a PageCache at any point in time. This logic is now dropped since the WebBackForwardCache can keep track of all cached pages across all processes and enforce a cross-process limit on the number of cached pages. This means we can now have PageCache entries across several WebContent processes, as long as we do not exceed the maximum number of cached pages. * Platform/Logging.h: Add new BackForwardCache logging channel. * Shared/SessionState.cpp: (WebKit::BackForwardListItemState::encode const): (WebKit::BackForwardListItemState::decode): * Shared/SessionState.h: Add new bit to BackForwardListItemState to indicate whether a HistoryItem has an associated CachedPage or not. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::~WebBackForwardListItem): (WebKit::WebBackForwardListItem::wasRemovedFromBackForwardList): (WebKit::WebBackForwardListItem::removeFromBackForwardCache): (WebKit::WebBackForwardListItem::setBackForwardCacheEntry): (WebKit::WebBackForwardListItem::suspendedPage const): (WebKit::WebBackForwardListItem::loggingString): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::backForwardCacheEntry const): WebBackForwardListItem now own a WebBackForwardCacheEntry instead of simply a SuspendedPage. The WebBackForwardCacheEntry may have a SuspendedPage or not. Now, whenever a HistoryItem has a CachedPage in WebCore, its corresponding WebBackForwardListItem in the UIProcess has an associated WebBackForwardCacheEntry whether we have a SuspendedPageProxy for it in the UIProcess or not. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: Pass the PageCache capacity to the WebContent process on creation, so that it matches the capacity of the WebBackForwardCache in the UIProcess. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::goToBackForwardItem): * UIProcess/SuspendedPageProxy.cpp: (WebKit::messageNamesToIgnoreWhileSuspended): (WebKit::SuspendedPageProxy::suspensionTimedOut): * UIProcess/SuspendedPageProxy.h: Stop storing the WebBackForwardListItem on the SuspendedPageProxy. This avoids having to keep this pointer up to date. We do not really need it as we can now ask the WebBackForwardCache to clear an entry by giving it a SuspendedPageProxy to match. Given how many entries we have at most in the cache (2), iterating over them to find the one with a given suspended page is cheap. * UIProcess/WebBackForwardCache.cpp: (WebKit::WebBackForwardCache::WebBackForwardCache): (WebKit::WebBackForwardCache::~WebBackForwardCache): (WebKit::WebBackForwardCache::setCapacity): Send an IPC of each WebProcess whenever the capacity of the WebBackForwardCache changes, in order to update the capacity of the PageCache in those processes. (WebKit::WebBackForwardCache::addEntry): (WebKit::WebBackForwardCache::removeEntry): (WebKit::WebBackForwardCache::takeSuspendedPage): (WebKit::WebBackForwardCache::removeEntriesForProcess): (WebKit::WebBackForwardCache::removeEntriesForSession): (WebKit::WebBackForwardCache::removeEntriesMatching): (WebKit::WebBackForwardCache::clear): * UIProcess/WebBackForwardCache.h: Use a Vector instead of a ListHashSet to store the entries. Given that we have at most 2 entries, using a Vector will likely be more efficient and definitely use less memory. * UIProcess/WebBackForwardCacheEntry.h: Added. (WebKit::WebBackForwardCacheEntry::backForwardCache const): (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry): Add new WebBackForwardCacheEntry abstraction to match the concept of WebCore::CachedPage in the UIProcess. A WebBackForwardCacheEntry may have a SuspendedPageProxy associated with it in the UIProcess or not. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Drop didSaveToPageCache as it is no longer necessary. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::disconnectProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::updateBackForwardItem): Whenever we get a BackForwardItem from the WebContent process, we now check it now has an associated CachedPage or not. If it does, we make sure we add a corresponding entry in the WebBackForwardCache so that the UIProcess knows about it. If it no longer has a CachedPage and we don't have a SuspendedPageProxy for this item in the UIProcess, then we remove the corresponding entry from the back/forward cache. Note that we don't drop SuspendedPageProxy objects in the UIProcess simply because their corresponding CachedPage in the WebProcess is gone, to maintain previous behavior. This is an optimization that is useful on iOS, where we do not have a WebProcessCache, since we can reuse processes from SuspendedPageProxies on navigation. * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toBackForwardListItemState): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::setBackForwardCacheCapacity): (WebKit::WebProcess::clearCachedPage): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2019-10-14 Wenson Hsieh [Clipboard API] Refactor custom pasteboard writing codepaths to handle multiple items https://bugs.webkit.org/show_bug.cgi?id=202916 Reviewed by Tim Horton. Change more function and method signatures from `const PasteboardCustomData&` to `const Vector&`. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::writeCustomData): * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::writeCustomData): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::writeCustomData): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2019-10-14 Per Arne Vollan REGRESSION(251087): Several API tests are failing https://bugs.webkit.org/show_bug.cgi?id=202961 Reviewed by Brent Fulgham. WebPageProxy::maybeInitializeSandboxExtensionHandle returns early if the WebContent process is currently launching, since the audit token is needed to create the sandbox extension. The audit token will not be available until the process has finished launching. In the same way, the method should return early if the WebContent process has terminated. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): 2019-10-14 Matt Mokary FindController::findString always updates foundStringMatchIndex even if match is the same as before https://bugs.webkit.org/show_bug.cgi?id=201775 Reviewed by Tim Horton. Allow an update to a find string without changing current match index, as is often the desired behavior when modifying a query rather than moving forward or backward through a match set. * Shared/WebFindOptions.h: * UIProcess/API/Cocoa/WKWebView.mm: (toFindOptions): * UIProcess/API/Cocoa/_WKFindOptions.h: * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::findString): Do not change match index if NoIndexChange bit is set. Otherwise, no change in behavior. 2019-10-14 David Quesada Remove WebCore::IOSApplication::isWebApp() https://bugs.webkit.org/show_bug.cgi?id=181259 Reviewed by Alex Christensen. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory): Remove the wording "this is not supported as of right now", as it seems to be supported since r247686, which added SPI on _WKWebsiteDataStoreConfiguration to set the application cache directory. 2019-10-14 Wenson Hsieh [Clipboard API] Support writing multiple PasteboardCustomData with SharedBuffers to the pasteboard https://bugs.webkit.org/show_bug.cgi?id=202851 Reviewed by Darin Adler. See WebCore ChangeLog for more details. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Add helpers to encode and decode PasteboardCustomData::Entry. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: Add support for encoding and decoding PasteboardCustomData by encoding and decoding each of its items (see above). * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::requestDOMPasteAccess): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): (allPasteboardItemOriginsMatchOrigin): (-[WKContentView _didHandleAdditionalDragItemsRequest:]): Tweak several methods to use the new methods on PasteboardCustomData instead of accessing the member variables directly. (-[WKContentView cleanUpDragSourceSessionState]): (-[WKContentView _prepareToDragPromisedAttachment:]): (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationLists:stagedDragSource:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]): Deleted. Adjust these methods to handle multiple staged item providers (for now, it remains that iOS drag and drop codepaths will still only write a single item to the pasteboard). 2019-10-14 Per Arne Vollan [macOS] Sandbox extensions should be created with audit tokens, not PIDs https://bugs.webkit.org/show_bug.cgi?id=201828 Reviewed by Brent Fulgham. Stop issuing mach/read sandbox extensions by PID in the UI process, and use audit tokens instead. The audit tokens for the WebContent processes are retrieved from the IPC connection to the process. * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtensionImpl::create): (WebKit::SandboxExtensionImpl::sandboxExtensionForType): (WebKit::SandboxExtensionImpl::SandboxExtensionImpl): (WebKit::SandboxExtension::createHandleForMachLookupByAuditToken): (WebKit::SandboxExtension::createHandleForReadByAuditToken): (WebKit::SandboxExtension::createHandleForMachLookupByPid): Deleted. (WebKit::SandboxExtension::createHandleForReadByPid): Deleted. * Shared/SandboxExtension.h: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::loadFile): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shouldSendPendingMessage): (WebKit::WebProcessProxy::didFinishLaunching): * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded): 2019-10-14 Myles C. Maxfield [Cocoa] REGRESSION (r245672): Contenteditable with optical sizing freezes Safari https://bugs.webkit.org/show_bug.cgi?id=202262 Reviewed by Tim Horton. r250640 didn't go far enough. We need to apply the same fix everywhere [NSFontDescriptor fontDescriptorWithFontAttributes:] is called. * Shared/Cocoa/ArgumentCodersCocoa.mm: (IPC::decodeFontInternal): * Shared/Cocoa/CoreTextHelpers.h: Added. * Shared/Cocoa/CoreTextHelpers.mm: Added. (fontDescriptorWithFontAttributes): * SourcesCocoa.txt: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateFontManagerIfNeeded): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebKit.xcodeproj/project.pbxproj: 2019-10-14 Truitt Savell Unreviewed, rolling out r251045. Broke internal builds Reverted changeset: "AX: Make AXIsolatedTree compile again" https://bugs.webkit.org/show_bug.cgi?id=202702 https://trac.webkit.org/changeset/251045 2019-10-14 youenn fablet Reuse existing web processes for running service workers https://bugs.webkit.org/show_bug.cgi?id=202195 Unreviewed. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::disableServiceWorkers): (WebKit::WebProcessProxy::enableServiceWorkers): Fix case where ENABLE_SERVICE_WORKER is not defined. 2019-10-14 Philippe Normand [GTK][WebInspector] Support for saving data https://bugs.webkit.org/show_bug.cgi?id=202894 Reviewed by Carlos Garcia Campos. Implement the WebInspectorProxy::platformSave() method. This allows users to save the inspector performance measurements, for instance. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformSave): * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp: (WebKit::WebInspectorUI::canSave): 2019-10-14 youenn fablet Reuse existing web processes for running service workers https://bugs.webkit.org/show_bug.cgi?id=202195 Reviewed by Chris Dumez. When network process asks for a service worker context connection, we now iterate through existing web processes and reuse one if both session and registrable domain match. We then ask the web process to create a context connection to the network process. When network process no longer needs the connection, it instructs the UIProcess that will update its state so that the web process is no longer considered as running service workers. UIProcess then instructs the web process to stop its service workers and its connection. Later on, the same web process may be reused for running service workers in which case a new connection will replace the stopped connection. Similarly, on network process crash, all web process running service workers are updated so that they are no longer considered as running service workers. Add a boolean state to WebProcessPool to control whether creating a separate service worker process. We no longer terminate the web process when stopping service workers or when network process crash. We use the enableTermination/disableTermination at context connection start/stop time. We consider that the context connection is similar to running a page in the process and creating/removing a page calls disableTermination/enableTermination. NetworkProcess is handling the management of service worker processes by checking for clients. In case there is no client, the process is terminated. This removes the need for the WebProcessPool service worker process timer. This patch removes this timer. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection): (WebKit::NetworkConnectionToWebProcess::closeSWContextConnection): (WebKit::NetworkConnectionToWebProcess::serverToContextConnectionNoLongerNeeded): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection): (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection): (WebKit::WebSWServerToContextConnection::messageSenderConnection const): (WebKit::WebSWServerToContextConnection::connectionIsNoLongerNeeded): (WebKit::WebSWServerToContextConnection::startFetch): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * UIProcess/API/C/WKContext.cpp: (WKContextSetUseSeparateServiceWorkerProcess): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setUseSeparateServiceWorkerProcess:]): (-[WKProcessPool _webPageContentProcessCount]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::workerContextConnectionNoLongerNeeded): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::networkProcessCrashed): (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::removeFromServiceWorkerProcesses): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::terminateNetworkProcess): (WebKit::WebProcessPool::setUseSeparateServiceWorkerProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createForServiceWorkers): (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess): (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame): (WebKit::WebProcessProxy::disableServiceWorkers): (WebKit::WebProcessProxy::enableServiceWorkers): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::isMatchingRegistrableDomain const): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::m_userAgent): (WebKit::WebSWContextManagerConnection::terminateWorker): (WebKit::WebSWContextManagerConnection::syncTerminateWorker): (WebKit::WebSWContextManagerConnection::close): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): (WebKit::WebProcess::registerServiceWorkerClients): 2019-10-12 Chris Dumez Back/Forward cache does not work after doing a favorite navigation https://bugs.webkit.org/show_bug.cgi?id=202762 Reviewed by Antti Koivisto. When a process-swap was forced by the client, we would always close the page in the previous process after navigating. This would prevent leveraging the back/forward cache when navigating back after such a process-swap. The reason we were doing this is that other pages may have opener link to this page and closing the page was an easy way to break this opener link. To address the issue, we no longer close the previous page when a process-swap is forced by the client. Instead, we make sure to disconnect the frames' openees from their opener then the opener enters the page cache. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::suspendCurrentPageIfPossible): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::suspendForProcessSwap): 2019-10-12 Chris Dumez Clearing Website data for a given session should not shut down cached processes for other sessions https://bugs.webkit.org/show_bug.cgi?id=202865 Reviewed by Antti Koivisto. When clearing Website data for a given data store, we now only clear cached processes (either if BackForwardCache or WebProcessCache) if they are associated with this particular data store. It is very wasteful otherwise. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy): * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::~SuspendedPageProxy): ProvisionalPageProxy & SuspendedPageProxy's destructors no longer call WebProcessProxy::maybeShutdown() asynchronously. We now call maybeShutdown() synchronously in WebProcessProxy::decrementSuspendedPageCount() and WebProcessProxy::removeProvisionalPageProxy() instead. This makes things a lot more predictable. * UIProcess/WebBackForwardCache.cpp: (WebKit::WebBackForwardCache::removeEntriesForSession): Add new removeEntriesForSession() method to clear only back / forward cache entries associated with a particular session. (WebKit::WebBackForwardCache::clear): Stop taking a parameter indicating if we allow the processes to enter the process cache. Now that we call maybeShutdown() synchronously when destroying a SuspendedPageProxy, we can simply allow the processes to enter the process cache unconditionally. If the caller does not want this processes in the page cache, they can clear the process cache afterwards. * UIProcess/WebBackForwardCache.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): Now that destroying a SuspendedPageProxy or a ProvisionalPageProxy may shutdown their process synchronously, add a scope here to prevent shutdown of the process for the duration of this scope, since we're about to use it for a navigation and we don't want it to get shutdown, even if there is no longer anything using it. (WebKit::WebPageProxy::continueNavigationInNewProcess): Add new assertion and rename parameter for consistency. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::handleMemoryPressureWarning): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addProvisionalPageProxy): Add new assertion. (WebKit::WebProcessProxy::removeProvisionalPageProxy): Call maybeShutDown() if this was the last provisional page. (WebKit::WebProcessProxy::maybeShutDown): Drop parameter indicating if we want to allow the process to enter the process cache and allow caching unconditionally. (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess): Prevent termination if there is a ScopePreventingShutdown. (WebKit::WebProcessProxy::decrementSuspendedPageCount): Call maybeShutDown() if this was the last suspended page. * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::ScopePreventingShutdown::ScopePreventingShutdown): (WebKit::WebProcessProxy::ScopePreventingShutdown::~ScopePreventingShutdown): (WebKit::WebProcessProxy::makeScopePreventingShutdown): Add new facility to prevent shutdown of a process for the duration of the scope. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): When removing website data, only clear cached processes if they are associated with the current data store. 2019-10-12 Chris Fleizach AX: Make AXIsolatedTree compile again https://bugs.webkit.org/show_bug.cgi?id=202702 Reviewed by Joanmarie Diggs. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]): 2019-10-11 Rob Buis Cleanup RuntimeEnabledFeatures includes https://bugs.webkit.org/show_bug.cgi?id=202857 Reviewed by Eric Carlson. These classes must have had made use of runtime flags before but are not using them anymore. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: * UIProcess/WebAuthentication/Cocoa/LocalService.mm: * UIProcess/WebProcessPool.cpp: 2019-10-11 Chris Dumez Move SuspendedPage logic from WebProcessPool to new WebBackForwardCache class https://bugs.webkit.org/show_bug.cgi?id=202660 Reviewed by Antti Koivisto. Move SuspendedPage logic from WebProcessPool to new WebBackForwardCache class. This is a first step towards implementing back / forward cache handling in the UIProcess. The following changes were made: 1. SuspendedPageProxy objects are now normally owned by their associated WebBackForwardListItem (Similarly to CachedPage objects being owned by their HistoryItem in WebCore) instead of the WebProcessPool. 2. A new WebBackForwardCache class is introduced to cap the number of cached pages and clear them (similary to the PageCache in WebCore). * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::~WebBackForwardListItem): (WebKit::WebBackForwardListItem::wasRemovedFromBackForwardList): (WebKit::WebBackForwardListItem::setSuspendedPage): (WebKit::WebBackForwardListItem::takeSuspendedPage): (WebKit::WebBackForwardListItem::suspendedPage const): * Shared/WebBackForwardListItem.h: * Sources.txt: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _maximumSuspendedPageCount]): * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::findReusableSuspendedPageProcess): (WebKit::SuspendedPageProxy::SuspendedPageProxy): (WebKit::SuspendedPageProxy::~SuspendedPageProxy): (WebKit::SuspendedPageProxy::setBackForwardListItem): (WebKit::SuspendedPageProxy::clearBackForwardListItem): (WebKit::SuspendedPageProxy::backForwardCache const): (WebKit::SuspendedPageProxy::suspensionTimedOut): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebAuthentication/Mock/MockHidConnection.h: * UIProcess/WebAuthentication/Mock/MockHidService.h: * UIProcess/WebBackForwardCache.cpp: Added. (WebKit::WebBackForwardCache::removeOldestEntry): (WebKit::WebBackForwardCache::setCapacity): (WebKit::WebBackForwardCache::addEntry): (WebKit::WebBackForwardCache::removeEntry): (WebKit::WebBackForwardCache::takeEntry): (WebKit::WebBackForwardCache::removeEntriesForProcess): (WebKit::WebBackForwardCache::removeEntriesForPage): (WebKit::WebBackForwardCache::removeEntriesMatching): (WebKit::WebBackForwardCache::clear): * UIProcess/WebBackForwardCache.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidService.h. (WebKit::WebBackForwardCache::capacity const): (WebKit::WebBackForwardCache::size const): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::didRemoveItem): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::suspendCurrentPageIfPossible): (WebKit::WebPageProxy::backForwardCache const): (WebKit::WebPageProxy::shouldUseBackForwardCache const): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::enterAcceleratedCompositingMode): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::process const): * UIProcess/WebProcessPool.cpp: (WebKit::m_webProcessCache): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::processForRegistrableDomain): (WebKit::WebProcessPool::handleMemoryPressureWarning): (WebKit::WebProcessPool::updateBackForwardCacheCapacity): (WebKit::WebProcessPool::setCacheModel): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::setMockWebAuthenticationConfiguration): * WebKit.xcodeproj/project.pbxproj: 2019-10-11 Alex Christensen Only use CFNetwork SPI for metrics where needed https://bugs.webkit.org/show_bug.cgi?id=202825 Reviewed by Joseph Pecoraro. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (stringForSSLProtocolVersion): (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): 2019-10-11 Kate Cheney Get StorageAccess API features working on SQLite database implementation (195422) https://bugs.webkit.org/show_bug.cgi?id=195422 Reviewed by Brent Fulgham. This patch migrates the http/tests/storageAccess/ Layout tests to use the ITP database and uncovered 3 bugs in the process. 1. It was previously blocking cookies to a third party domain which was not marked as prevalent. Now it ensures that the user is prompted using the storage acess API regarding that third party domain. 2. It was not requesting storage access if cookies had previously been blocked. Now it will only return early from ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener if cookie access is allowed, and request storage access otherwise. 3. hasUserGrantedStorageAccessThroughPrompt was returning true even if the result was not previously granted storage access. All of these fixes match behavior in ResourceLoadStatisticsMemoryStore. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt): 2019-10-11 Dean Jackson REGRESSION: fast/events/touch/ios/long-press-on-image.html is failing https://bugs.webkit.org/show_bug.cgi?id=202845 Reviewed by Antoine Quint. Update _contentsOfUserInterfaceItem so that it returns more information on a context menu. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _contentsOfUserInterfaceItem:]): 2019-10-11 Alex Christensen Use sendWithAsyncReply for cookie getting/clearing functions https://bugs.webkit.org/show_bug.cgi?id=202841 Reviewed by Carlos Garcia Campos. No change in behavior. This just simplifies the message sending a bit. * NetworkProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::getHostnamesWithCookies): (WebKit::WebCookieManager::deleteAllCookies): (WebKit::WebCookieManager::deleteCookie): (WebKit::WebCookieManager::deleteAllCookiesModifiedSince): (WebKit::WebCookieManager::getAllCookies): (WebKit::WebCookieManager::getCookies): (WebKit::WebCookieManager::setCookie): (WebKit::WebCookieManager::setCookies): (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy): * NetworkProcess/Cookies/WebCookieManager.h: * NetworkProcess/Cookies/WebCookieManager.messages.in: * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm: * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::cookies): (API::HTTPCookieStore::setCookies): (API::HTTPCookieStore::deleteCookie): (API::HTTPCookieStore::setHTTPCookieAcceptPolicy): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setCookieAcceptPolicy:]): * UIProcess/API/glib/WebKitCookieManager.cpp: (webkit_cookie_manager_set_accept_policy): (webkit_cookie_manager_get_accept_policy): (webkit_cookie_manager_add_cookie): (webkit_cookie_manager_get_cookies): (webkit_cookie_manager_delete_cookie): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::addSingleCookie): * UIProcess/AuxiliaryProcessProxy.h: (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply): * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::processPoolDestroyed): (WebKit::WebCookieManagerProxy::processDidClose): (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): (WebKit::WebCookieManagerProxy::deleteCookie): (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince): (WebKit::WebCookieManagerProxy::setCookies): (WebKit::WebCookieManagerProxy::getAllCookies): (WebKit::WebCookieManagerProxy::getCookies): (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): Deleted. (WebKit::WebCookieManagerProxy::didSetCookies): Deleted. (WebKit::WebCookieManagerProxy::didGetCookies): Deleted. (WebKit::WebCookieManagerProxy::didDeleteCookies): Deleted. (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy): Deleted. (WebKit::WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy): Deleted. * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebCookieManagerProxy.messages.in: 2019-10-10 Alex Christensen Remove unused WebProcessPool::requestNetworkingStatistics https://bugs.webkit.org/show_bug.cgi?id=202818 Reviewed by Chris Dumez. Its only use was removed in rdar://problem/56160996 * NetworkProcess/Downloads/DownloadManager.h: (WebKit::DownloadManager::isDownloading const): (WebKit::DownloadManager::activeDownloadCount const): Deleted. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::getNetworkProcessStatistics): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Shared/Authentication/AuthenticationManager.h: (WebKit::AuthenticationManager::outstandingAuthenticationChallengeCount const): Deleted. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveMessage): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getStatistics): (WebKit::WebProcessPool::requestNetworkingStatistics): Deleted. * UIProcess/WebProcessPool.h: 2019-10-10 Basuke Suzuki [WinCairo] Move remote communication handling from RemoteInspectorServer to RemoteInspector. https://bugs.webkit.org/show_bug.cgi?id=202763 Reviewed by Ross Kirsling. Remove deleted method invocations. * UIProcess/win/WebProcessPoolWin.cpp: (WebKit::initializeRemoteInspectorServer): (WebKit::WebProcessPool::platformInitialize): 2019-10-10 Youenn Fablet Do not timeout a load intercepted by service worker that receives a response https://bugs.webkit.org/show_bug.cgi?id=202787 Reviewed by Chris Dumez. Stop making ServiceWorkerFetchTask ref counted since it is not needed and can potentially make ServiceWorkerFetchTask oulive its WebSWServerToContextConnection member. Stop the ServiceWorkerFetchTask timeout timer whenever receiving a response so that the load will not timeout in that case. This ensures that a load that is starting in a service worker will not be failing. Instead the load will go to network process. Removed m_didReachTerminalState which is not needed as WebSWServerToContextConnection unregisters the ServiceWorkerFetchTask as an IPC listener for all terminating messages. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didReceiveData): (WebKit::ServiceWorkerFetchTask::didReceiveFormData): (WebKit::ServiceWorkerFetchTask::didFinish): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::startFetch): (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): Use a Vector instead of a HasSet for performance reasons. Update according fetch map using unique_ptr instead of Ref<>. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: 2019-10-10 Rob Buis SpeculativeLoad should use CompletionHandler https://bugs.webkit.org/show_bug.cgi?id=202795 Reviewed by Chris Dumez. SpeculativeLoad should use CompletionHandler, as remarked in Bug 201641 review. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: 2019-10-10 Wenson Hsieh Support programmatic paste requests on macOS https://bugs.webkit.org/show_bug.cgi?id=202773 Reviewed by Tim Horton. Adds support for programmatic paste requests on macOS, as well as some testing SPI in WKWebView to allow WebKitTestRunner to grab the NSMenu used for the DOM paste request. This patch adopts the same strategy taken to allow programmatic paste on iOS, by allowing programmatic pastes coming from the page to show platform UI which the user must then interact with in order to proceed with the paste. See below for more details. * Shared/WebPreferencesDefaultValues.h: Make this available on both iOS and macOS (iOS family is omitted for now, since callout bar UI is not generally present on non-iOS iOS-family platforms such as Apple Watch). * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _web_grantDOMPasteAccess]): This selector is called when the user taps the Paste option in the presented NSMenu. (-[WKWebView _activeMenu]): Returns the currently active NSMenu. Only for testing purposes. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _web_grantDOMPasteAccess]): Same exercise as above, only for WKView instead of WKWebView. * UIProcess/Cocoa/WebViewImpl.h: (WebKit::WebViewImpl::domPasteMenu const): * UIProcess/Cocoa/WebViewImpl.mm: (-[WKDOMPasteMenuDelegate initWithWebViewImpl:]): (-[WKDOMPasteMenuDelegate menuDidClose:]): (-[WKDOMPasteMenuDelegate numberOfItemsInMenu:]): (-[WKDOMPasteMenuDelegate confinementRectForMenu:onScreen:]): Adds a new object, whose purpose is to be a delegate for the NSMenu that is presented when requesting DOM paste access. This object is used instead of WKWebView, since API clients may end up making the WKWebView the delegate for a different menu, in which case some implementations (either theirs or ours) of NSMenuDelegate methods would not be called. Avoiding this would require the client to be aware that WKWebView conforms to NSMenuDelegate, which is only declared privately. (WebKit::WebViewImpl::handleProcessSwapOrExit): On process swap or exit, automatically bail out of any pending DOM paste request by denying it. (WebKit::WebViewImpl::requestDOMPasteAccess): (WebKit::WebViewImpl::handleDOMPasteRequestWithResult): Handle the DOM paste request by showing an NSMenu near the mouse cursor with a single option to paste. * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::requestDOMPasteAccess): 2019-10-10 youenn fablet Remove unified plan runtime flag https://bugs.webkit.org/show_bug.cgi?id=202721 Reviewed by Geoffrey Garen. * Shared/WebPreferences.yaml: * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsConstructed): Remove ability to disable unified plan. 2019-10-10 Adrian Perez de Castro Remove a "The " in "The The HTTP headers of the response" https://bugs.webkit.org/show_bug.cgi?id=194851 Reviewed by Carlos Garcia Campos. * Shared/API/glib/WebKitURIResponse.cpp: (webkit_uri_response_class_init): Fix typo in description of the WebKitURIResponse::http-headers property. 2019-10-10 youenn fablet [Mac] Allow SYS___pthread_markcancel call https://bugs.webkit.org/show_bug.cgi?id=202723 Reviewed by Alex Christensen. Allow this pthread call as libwebrtc uses it on the Mac as well. * WebProcess/com.apple.WebProcess.sb.in: 2019-10-09 youenn fablet A service worker process should not be created when enqueuing a service worker job https://bugs.webkit.org/show_bug.cgi?id=202578 Reviewed by Chris Dumez. Remove the calls to create service worker context connection. They are now done at SWServer level when trying to either run a service worker or install one. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorker): (WebKit::WebSWServerConnection::scheduleJobInServer): 2019-10-09 Wenson Hsieh [Clipboard API] Refactor Pasteboard item reading functions to work on both iOS and macOS https://bugs.webkit.org/show_bug.cgi?id=202647 Reviewed by Tim Horton. Refactor iOS-specific pasteboard functions to be platform-agnostic. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::allPasteboardItemInfo): (WebKit::WebPasteboardProxy::informationForItemAtIndex): (WebKit::WebPasteboardProxy::getPasteboardItemsCount): (WebKit::WebPasteboardProxy::readStringFromPasteboard): (WebKit::WebPasteboardProxy::readURLFromPasteboard): (WebKit::WebPasteboardProxy::readBufferFromPasteboard): (WebKit::WebPasteboardProxy::writeURLToPasteboard): (WebKit::WebPasteboardProxy::writeWebContentToPasteboard): (WebKit::WebPasteboardProxy::writeImageToPasteboard): (WebKit::WebPasteboardProxy::writeStringToPasteboard): * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::allPasteboardItemInfo): (WebKit::WebPasteboardProxy::informationForItemAtIndex): (WebKit::WebPasteboardProxy::getPasteboardItemsCount): (WebKit::WebPasteboardProxy::readStringFromPasteboard): (WebKit::WebPasteboardProxy::readURLFromPasteboard): (WebKit::WebPasteboardProxy::readBufferFromPasteboard): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/wpe/WebPasteboardProxyWPE.cpp: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::informationForItemAtIndex): (WebKit::WebPlatformStrategies::readBufferFromPasteboard): (WebKit::WebPlatformStrategies::readURLFromPasteboard): (WebKit::WebPlatformStrategies::readStringFromPasteboard): (WebKit::WebPlatformStrategies::writeToPasteboard): (WebKit::WebPlatformStrategies::updateSupportedTypeIdentifiers): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2019-10-09 John Wilander IsLoggedIn: Add as experimental feature https://bugs.webkit.org/show_bug.cgi?id=202707 Reviewed by Brent Fulgham and Chris Dumez. IsLoggedIn was proposed to the WebAppSec WG at TPAC 2019. So far there is only an explainer posted to the mailing list: https://lists.w3.org/Archives/Public/public-webappsec/2019Sep/0004.html * Shared/WebPreferences.yaml: 2019-10-09 Jiewen Tan [WebAuthn] Move the mock testing entrance to Internals https://bugs.webkit.org/show_bug.cgi?id=202560 Reviewed by Chris Dumez. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration): Deleted. * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp: (WebKit::AuthenticatorTransportService::createMock): * UIProcess/WebAuthentication/AuthenticatorTransportService.h: * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp: (WebKit::MockAuthenticatorManager::MockAuthenticatorManager): * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h: * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::send): (WebKit::MockHidConnection::registerDataReceivedCallbackInternal): (WebKit::MockHidConnection::parseRequest): (WebKit::MockHidConnection::feedReports): (WebKit::MockHidConnection::shouldContinueFeedReports): * UIProcess/WebAuthentication/Mock/MockHidConnection.h: * UIProcess/WebAuthentication/Mock/MockHidService.cpp: (WebKit::MockHidService::MockHidService): * UIProcess/WebAuthentication/Mock/MockHidService.h: * UIProcess/WebAuthentication/Mock/MockLocalConnection.h: * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::MockLocalConnection): * UIProcess/WebAuthentication/Mock/MockLocalService.h: * UIProcess/WebAuthentication/Mock/MockLocalService.mm: (WebKit::MockLocalService::MockLocalService): * UIProcess/WebAuthentication/Mock/MockNfcService.h: * UIProcess/WebAuthentication/Mock/MockNfcService.mm: (WebKit::MockNfcService::MockNfcService): (WebKit::MockNfcService::platformStartDiscovery): (WebKit::MockNfcService::detectTags const): * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h: Removed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMockWebAuthenticationConfiguration): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setMockWebAuthenticationConfiguration): * WebProcess/WebCoreSupport/WebChromeClient.h: 2019-10-09 Simon Fraser Rename WheelEventTestTrigger and improve naming in related code https://bugs.webkit.org/show_bug.cgi?id=202772 Reviewed by Tim Horton. Change the "test trigger" terminology to "monitor wheel events"; after all, tests call monitorWheelEvents() and callAfterScrollingCompletes(), and this is not triggering a test. * UIProcess/API/C/WKPage.cpp: (WKPageClearWheelEventTestMonitor): (WKPageClearWheelEventTestTrigger): Deleted. * UIProcess/API/C/WKPage.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::clearWheelEventTestMonitor): (WebKit::WebPageProxy::clearWheelEventTestTrigger): Deleted. * UIProcess/WebPageProxy.h: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageStartMonitoringScrollOperations): (WKBundlePageRegisterScrollOperationCompletionCallback): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::createScrollbar): * WebProcess/WebPage/EventDispatcher.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::clearWheelEventTestMonitor): (WebKit::WebPage::clearWheelEventTestTrigger): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-10-09 Andy Estes [Cocoa] IPC::decode should gracefully handle a nil allowed class https://bugs.webkit.org/show_bug.cgi?id=202753 Reviewed by Geoffrey Garen. If IPC::decode is called with a nil allowed class, an NSInvalidArgumentException will be thrown when trying to create an NSArray literal with a nil value. Depending on who calls IPC::decode, this exception might or might not be caught, leading to dropped messages or crashes. One case of this happening is tracked by rdar://problem/55839467. In this case, the nil allowed class was due to a build misconfiguration, and the exception caused the UI process to not respond to a synchronous IPC message, hanging the WebContent process. rdar://problem/55839467 was resolved by fixing the build misconfiguration, but this patch improves IPC::decode so that a nil allowed class results in a message decoding failure rather than a maybe-caught NSException. * Shared/Cocoa/ArgumentCodersCocoa.h: (IPC::decode): 2019-10-09 youenn fablet Remove testRunner.setWebRTCUnifiedPlanEnabled https://bugs.webkit.org/show_bug.cgi?id=202700 Reviewed by Eric Carlson. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2019-10-09 Carlos Garcia Campos REGRESSION(r250597): [GTK][WPE] 2.27.1 shows HTML content as text/plain in custom protocols when passing a charset in content type https://bugs.webkit.org/show_bug.cgi?id=202633 Reviewed by Žan Doberšek. This is a regression of the switch to use the new custom protocols implementation. Before r250597, we extracted the mime type and charset from content type in the network process, but we are now sending the response directly from the UI process, so we need to do that when building our response. Rename the mime_type parameter as content_type to avoid confusion, since it's documented as the content type. * UIProcess/API/glib/WebKitURISchemeRequest.cpp: (webkitURISchemeRequestReadCallback): (webkit_uri_scheme_request_finish): * UIProcess/API/gtk/WebKitURISchemeRequest.h: * UIProcess/API/wpe/WebKitURISchemeRequest.h: 2019-10-09 Carlos Garcia Campos [GTK][WPE] about:gpu should also show the client EGL extensions https://bugs.webkit.org/show_bug.cgi?id=202690 Reviewed by Carlos Alberto Lopez Perez. We are showing the extensions supported by the display. * UIProcess/API/glib/WebKitProtocolHandler.cpp: (WebKit::WebKitProtocolHandler::handleGPU): 2019-10-09 Carlos Garcia Campos CustomProtocols: convert log messages in WebURLSchemeTaskProxy to RELEASE_LOG https://bugs.webkit.org/show_bug.cgi?id=202686 Reviewed by Alex Christensen. Instead of using WTFLogAlways, since those messages are confusing on stdout. * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: (WebKit::WebURLSchemeTaskProxy::didPerformRedirection): (WebKit::WebURLSchemeTaskProxy::didReceiveResponse): (WebKit::WebURLSchemeTaskProxy::didReceiveData): 2019-10-09 Carlos Garcia Campos [WPE][GTK] WebKitSecurityManager should consider webkit:// to be a local URI scheme https://bugs.webkit.org/show_bug.cgi?id=202638 Reviewed by Michael Catanzaro. * UIProcess/API/glib/WebKitProtocolHandler.cpp: (WebKit::WebKitProtocolHandler::WebKitProtocolHandler): 2019-10-08 Antti Koivisto [CSS Shadow Parts] Enable by default https://bugs.webkit.org/show_bug.cgi?id=202644 Reviewed by Ryosuke Niwa. * Shared/WebPreferences.yaml: Flip the switch. 2019-10-08 Andy Estes [iOS] Add a fast path that avoids hit testing during context menu interactions on elements https://bugs.webkit.org/show_bug.cgi?id=202510 Reviewed by Tim Horton. When computing position information for an element, we can store sufficient context information in InteractionInformationAtPosition such that the same element could be retrieved again without hit testing. The existing TextInputContext can already store an element's page identifier, document identifier, and element identifier, which is sufficient context for such a task. This patch renames TextInputContext to ElementContext and uses it when populating new InteractionInformationAtPosition structs in elementPositionInformation(). When a context menu interaction occurs, WebPage::startInteractionWithElementContextOrPosition() uses this context to look up the interaction element by its identifier triplet, falling back to hit testing if this lookup fails. * Scripts/webkit/messages.py: * Shared/DocumentEditingContext.h: * Shared/DocumentEditingContext.mm: (IPC::ArgumentCoder::decode): * Shared/ElementContext.cpp: Renamed from Source/WebKit/Shared/TextInputContext.cpp. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/ElementContext.h: Renamed from Source/WebKit/Shared/TextInputContext.h. (WebKit::operator==): * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): * Sources.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): * UIProcess/API/Cocoa/_WKTextInputContext.mm: (-[_WKTextInputContext _initWithTextInputContext:]): (-[_WKTextInputContext _textInputContext]): * UIProcess/API/Cocoa/_WKTextInputContextInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::textInputContextsInRect): (WebKit::WebPageProxy::focusTextInputContext): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]): (-[WKContentView assignLegacyDataForContextMenuInteraction]): (-[WKContentView continueContextMenuInteraction:]): (-[WKContentView continueContextMenuInteractionWithDataDetectors:]): (-[WKContentView _presentedViewControllerForPreviewItemController:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startInteractionWithPositionInformation): (WebKit::WebPageProxy::startInteractionWithElementAtPosition): Deleted. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::textInputContextsInRect): (WebKit::WebPage::focusTextInputContext): (WebKit::WebPage::elementForContext const): (WebKit::WebPage::contextForElement const): (WebKit::WebPage::elementForTextInputContext): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::elementPositionInformation): (WebKit::WebPage::startInteractionWithElementContextOrPosition): (WebKit::WebPage::requestDocumentEditingContext): (WebKit::WebPage::startInteractionWithElementAtPosition): Deleted. 2019-10-08 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.1 release * wpe/NEWS: Add release notes for 2.27.1 2019-10-08 Kate Cheney Implement Telemetry and Dumping Routines for SQLite backend (195088) https://bugs.webkit.org/show_bug.cgi?id=195088 Reviewed by John Wilander. Implemented database telemetry calculating for ITP. Mimicked ResourceLoadStatisticsMemoryStore telemetry logging behavior using SQLite Queries as opposed to vector sorting/manipulation. Once fully integrated, this will simplify analysis of ITP data by transitioning ITP data storage from a plist to a SQLite database. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): Added SQL queries to be initialized in the constructor. These queries are needed to mimic the telemetry calculations done in ResourceLoadStatisticsMemoryStore. (WebKit::resetStatement): To reduce code duplication, this function holds common code to reset a SQL query. (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): Added SQL queries needed for telemetry calculations to be prepared. (WebKit::joinSubStatisticsForSorting): This function returns the query string for sorting resources that is shared by many queries. (WebKit::ResourceLoadStatisticsDatabaseStore::getMedianOfPrevalentResourcesWithUserInteraction const): Implemented a function to take the median days since user interaction from all prevalent resources in the database with user interaction (sorted by max count of subframes, subresources and unique redirects under the top frame domain). (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResources const): Executes a SQL query to get the number of prevalent resources to log as telemetry. (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResourcesWithUI const): Executes a SQL query to get the number of prevalent resources with user interaction to log as telemetry. (WebKit::ResourceLoadStatisticsDatabaseStore::getTopPrevelentResourceDaysSinceUI const): Prepares and executes a SQL query to get the days since user interaction from the top prevalent resource to be recorded as telemetry data. (WebKit::ResourceLoadStatisticsDatabaseStore::getMedianStatisticOfPrevalentResourceWithoutUserInteraction const): Implemented a function which takes a statistic and returns the value of that statistic for the median prevalent resource without user interaction to be recorded as telemetry data. (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResourcesInTopResources const): Returns the count of prevalent resources in the top x resources sorted by sum of substatistics again to be logged as telemetry. (WebKit::ResourceLoadStatisticsDatabaseStore::calculateTelemetryData const): Function which executes all functions which populate the struct with telemetry data. This struct will then be passed to WebResourceLoadStatisticsTelemetry to be logged. (WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const): Initializes the telemetry struct and calls the function to populate it, then passes it to the WebResourceLoadStatisticsTelemetry object to be recorded. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: Describe PrevalentResourceDatabaseTelemetry Struct to be passed and logged as telemetry data. * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::databaseSubmitTopLists): Logging telemetry data by looping through 2D array of statistics for the top 1, 3, 10, 50, and 100 prevalent resources sorted by the sum of substatistics under the top frame domain. This matches the logging already done in ResourceLoadStatisticsMemoryStore. (WebKit::WebResourceLoadStatisticsTelemetry::submitTelemetry): Submits data to the webPageProxy logs and plists. * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.h: Added new submitTopList function to accomodate database telemetry logging. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished): * NetworkProcess/NetworkSession.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: Updated the current testing for telemetry which only tested 3 statistics. With this patch it now tests 10 statistics. 2019-10-08 Adrian Perez de Castro [GTK][WPE] Fix non-unified builds after r250486 https://bugs.webkit.org/show_bug.cgi?id=202636 Reviewed by Youenn Fablet. * NetworkProcess/NetworkConnectionToWebProcess.cpp: Add missing inclusion of the Logging.h header. 2019-10-08 Brady Eidson Service Worker Fetch events should time out. https://bugs.webkit.org/show_bug.cgi?id=202188 Reviewed by Alex Christensen. When we start a fetch task in the server, we also start a timeout on that fetch task. "Time out" means the fetch task must continue to make progress at the given frequency (once every 60 seconds by default) If any given fetch task times out in a service worker instance, that instance loses the right to handle fetches. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setServiceWorkerFetchTimeoutForTesting): (WebKit::NetworkProcess::resetServiceWorkerFetchTimeoutForTesting): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::serviceWorkerFetchTimeout const): * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didReceiveData): (WebKit::ServiceWorkerFetchTask::didReceiveFormData): (WebKit::ServiceWorkerFetchTask::didFinish): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: (WebKit::ServiceWorkerFetchTask::create): (WebKit::ServiceWorkerFetchTask::serviceWorkerIdentifier const): (WebKit::ServiceWorkerFetchTask::wasHandled const): (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): Deleted. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::startFetch): (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * UIProcess/API/C/WKContext.cpp: (WKContextSetServiceWorkerFetchTimeoutForTesting): (WKContextResetServiceWorkerFetchTimeoutForTesting): * UIProcess/API/C/WKContext.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setServiceWorkerTimeoutForTesting): (WebKit::WebProcessPool::resetServiceWorkerTimeoutForTesting): * UIProcess/WebProcessPool.h: 2019-10-08 Ross Kirsling Unreviewed. Restabilize non-unified build. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: 2019-10-08 Dean Jackson Sort Internal and Experimental features by human readable name https://bugs.webkit.org/show_bug.cgi?id=202667 Reviewed by Zalan Bujtas. Sort the statically generated vectors of internal and experimental features by their human readable name, rather than the feature key, so that looking at them in the Settings app doesn't make people who like alphabetical order angry. * Scripts/GeneratePreferences.rb: Add an extra sort call to the list generation. 2019-10-08 Wenson Hsieh [Clipboard API] Introduce bindings for the async Clipboard API https://bugs.webkit.org/show_bug.cgi?id=202622 Reviewed by Ryosuke Niwa. Adds a new experimental feature flag. See WebCore ChangeLog for more details. * Shared/WebPreferences.yaml: 2019-10-08 Alexander Mikhaylenko [GTK] Navigation gesture improvements https://bugs.webkit.org/show_bug.cgi?id=202645 Reviewed by Carlos Garcia Campos. Measure velocity threshold in pixels per second rather than distance (range [0-1]) per second. The value is the same as it was on touchpads, since a fixed distance is used, but is now consistent on touchscreens, regardless of the webview width. Add a threshold for cancelling gesture when the page is more than halfway through, so that it's symmetric with the first half. Align the moving page to pixel grid on hidpi devices correctly. Just rounding the position doesn't work correctly, since the cairo context is pre-scaled. Multiplying by scale factor, rounding and then dividing by scale factor fixes this. * UIProcess/ViewGestureController.h: * UIProcess/gtk/ViewGestureControllerGtk.cpp: (WebKit::ViewGestureController::SwipeProgressTracker::reset): (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent): (WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel): (WebKit::ViewGestureController::draw): 2019-10-08 Carlos Garcia Campos Unreviewed. Remove unused WebKitSoupRequestGeneric after r250597 * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: 2019-10-08 Adrian Perez de Castro [WPE][GTK] Build fails with ENABLE_WEBDRIVER=OFF https://bugs.webkit.org/show_bug.cgi?id=202658 Reviewed by Carlos Garcia Campos. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Add missing ENABLE(WEBDRIVER_MOUSE_INTERACTIONS) and ENABLE(WEBDRIVER_KEYBOARD_INTERACTIONS) preprocessor guards. * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: Ditto. 2019-10-07 Ryosuke Niwa Add IDL for requestIdleCallback https://bugs.webkit.org/show_bug.cgi?id=202653 Reviewed by Geoffrey Garen. * Shared/WebPreferences.yaml: 2019-10-07 Kate Cheney Domain relationships in the ITP Database should be inserted in a single query and ignore repeat insert attempts. (202604) https://bugs.webkit.org/show_bug.cgi?id=202604 Reviewed by Chris Dumez. This patch addresses two clean-ups for the ITP SQLite Database Store. First, by using INSERT OR IGNORE as opposed to INSERT, it eliminates the need to check if a relationship already exists in the database before inserting it. Second, instead of looping through domain lists and inserting each relationship as a separate query, this patch now converts lists to a string which SQLite can use to insert multiple rows into a database using a single query. Some Exists queries could not be deleted because they were being used for testing. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): Removed old insert queries and replaced them with queries able to insert string-lists of domains in a single query. Also reorganized the queries by functionality to make them easier to find and edit. (WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices): (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema): In order to properly take advantage of the INSERT OR IGNORE functionality, unique indices must be established so the SQLite table is aware of what patterns to look for when ignoring a new insert. (WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndmakeDomainList): (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList): (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships): Looping through the domain list is no longer needed with the new query changes. Additionally, ensuring a domain is in the Observed Domains table of the database must be done before utilizing any inserting of relationships because the relationship queries rely on fetching the topFrame domainID from the ObservedDomains table. (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation): (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration): (WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo): (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom): (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo): (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom): With the ensure check being done once in the ensureAndmakeDomainList function, these functions no longer have to make that check before inserting. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::mergeStatisticForTesting): (WebKit::WebResourceLoadStatisticsStore::isRelationshipOnlyInDatabaseOnce): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Changes in WeResourceLoadStatisticsStore were for testing only. This patch updated the merge statistic testing to also test this change by having a topFrameDomain list with more than one domain. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::mergeStatisticForTesting): (WebKit::NetworkProcess::isRelationshipOnlyInDatabaseOnce): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetStatisticsMergeStatistic): (WKWebsiteDataStoreIsStatisticsOnlyInDatabaseOnce): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::mergeStatisticForTesting): (WebKit::NetworkProcessProxy::isRelationshipOnlyInDatabaseOnce): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::mergeStatisticForTesting): (WebKit::WebsiteDataStore::isRelationshipOnlyInDatabaseOnce): * UIProcess/WebsiteData/WebsiteDataStore.h: Added a new function for testing that there are no repeat inserts into the database. Updated mergeStatistics to test the list-insert functionality. 2019-10-07 Yusuke Suzuki [JSC] Change signature of HostFunction to (JSGlobalObject*, CallFrame*) https://bugs.webkit.org/show_bug.cgi?id=202569 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::callMethod): * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::callNPJSObject): (WebKit::constructWithConstructor): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: 2019-10-07 Megan Gardner Switch to WKShareSheet for WKPDFView https://bugs.webkit.org/show_bug.cgi?id=202338 Reviewed by Tim Horton. Switch to WKShareSheet from the share sheet in UIWKSelectionAssistant, since this is the only instance of UIWKSelectionAssistant any more. This will keep all our share sheet code together, and allow us to eliminate this class that will be completely unused with this change. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKPDFView.h: * UIProcess/ios/WKPDFView.mm: (-[WKPDFView dealloc]): (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]): (-[WKPDFView shareSheetDidDismiss:]): 2019-10-07 Per Arne Vollan [macOS] Layering violation in AuxiliaryProcessProxy::didFinishLaunching https://bugs.webkit.org/show_bug.cgi?id=201617 Reviewed by Brent Fulgham. The commit introduced a layering violation in AuxiliaryProcessProxy::didFinishLaunching where we inspect the pending message queue looking for a local file load message which needs the PID to create a sandbox extension for the WebContent process. The layering violation can be fixed by creating a virtual method in AuxiliaryProcessProxy and override the method in the WebProcessProxy to do the work needed to replace the message with a load request message containing a sandbox extension created using the PID of the WebContent process. No new tests have been created, since this is covered by existing tests. * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::didFinishLaunching): * UIProcess/AuxiliaryProcessProxy.h: (WebKit::AuxiliaryProcessProxy::shouldSendPendingMessage): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shouldSendPendingMessage): * UIProcess/WebProcessProxy.h: 2019-10-07 Dean Jackson Provide options for DTTZ to happen in more situations https://bugs.webkit.org/show_bug.cgi?id=202634 Reviewed by Antoine Quint. Add two options that can be enabled to trigger double tap zooming in more places. Firstly, an option to keep listening for a double-tap-to-zoom if the first tap found a click handler on the body or document element. The tap will still be dispatched. This is probably the most common case for disabling a DTTZ. Secondly, an option to always keep listening for a double-tap-to-zoom, even if there was a clickable (non-root) element under the first tap. * Shared/WebPreferences.yaml: Add ZoomOnDoubleTapWhenRoot and AlwaysZoomOnDoubleTap. * UIProcess/PageClient.h: The message from the WebProcess now tells the UIProcess if the tapped element was a root-level (document or body). * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::handleSmartMagnificationInformationForPotentialTap): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]): (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:nodeIsRootLevel:]): Handle the two new options. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::handleSmartMagnificationInformationForPotentialTap): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::potentialTapAtPosition): Check if the tap was on a root-level element. 2019-10-07 Matt Mokary foundStringMatchIndex in FindController::findString gets reset on page scroll https://bugs.webkit.org/show_bug.cgi?id=201773 Reviewed by Tim Horton. Decouple hiding of the find indicator from resetting match index, and only reset match index when there is not an active match. * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): (WebKit::FindController::hideFindUI): (WebKit::FindController::hideFindIndicator): (WebKit::FindController::resetMatchIndex): * WebProcess/WebPage/FindController.h: * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::hideFindIndicator): (WebKit::FindController::resetMatchIndex): 2019-10-07 youenn fablet WebPageProxy::updatePlayingMediaDidChange should protect from a null m_userMediaPermissionRequestManager https://bugs.webkit.org/show_bug.cgi?id=202628 Reviewed by Eric Carlson. On process swap on navigation or process crash, m_userMediaPermissionRequestManager is made null. At the same time, the media state is set back to not playing. Future calls of updatePlayingMediaDidChange should not have any capture state change until getUserMedia/getDisplayMedia is called, which would create m_userMediaPermissionRequestManager. But this assumption is not always true given that the media state is computed as process-wide in MediaStreamTrack::captureState on iOS. The above behavior is fixed as part of https://bugs.webkit.org/show_bug.cgi?id=202627. Since the call to updatePlayingMediaDidChange is triggered straight from IPC, it should not be trusted and a null check should be added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updatePlayingMediaDidChange): 2019-10-04 Dean Jackson Use a better name than allowFastClicksEverywhere https://bugs.webkit.org/show_bug.cgi?id=202607 Reviewed by Tim Horton. This preference name is quite confusing. Change it to PreferFasterClickOverDoubleTap. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::preferFasterClickOverDoubleTap const): (WebKit::WebPageProxy::allowsFastClicksEverywhere const): Deleted. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies): 2019-10-04 Ross Kirsling Socket-based RWI should base64-encode backend commands on client, not server https://bugs.webkit.org/show_bug.cgi?id=202605 Reviewed by Don Olmstead. * UIProcess/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::setBackendCommands): 2019-10-04 Jiewen Tan Unreviewed, build fix after r250729 * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h: 2019-10-04 Keith Rollin Fix determination of the top-level resource https://bugs.webkit.org/show_bug.cgi?id=202491 Reviewed by Youenn Fablet. When loading the resources associated with a page, the Networking process needs to know the main resource for the main frame. It uses this information to keep track of page loads and the resources that are loaded in those pages. By keeping track of this information, WebKit can track and report difficult (slow or incomplete) resource loads and their impact on the overall page. The initial determination of the top resource only looked at whether the resource was the "main" resource of a frame or not. However, this determination was insufficient, and would confuse the tracking mechanism when sub-frames also had main frames. Therefore, augment the test by also looking to see if the hosting frame is the main frame. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): 2019-10-04 Ross Kirsling Unreviewed WinCairo build fix for r250717. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: (WebKit::LayerTreeHost::invalidate): Deleted. 2019-10-04 Alex Christensen Stop sending list of display-isolated schemes to NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=202557 Reviewed by Youenn Fablet. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::registerURLSchemeAsDisplayIsolated): 2019-10-04 Alex Christensen Rename SchemeRegistry to LegacySchemeRegistry https://bugs.webkit.org/show_bug.cgi?id=202586 Reviewed by Tim Horton. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::registerURLSchemeAsSecure const): (WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const): (WebKit::NetworkProcess::registerURLSchemeAsLocal const): (WebKit::NetworkProcess::registerURLSchemeAsNoAccess const): (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const): (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const): (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const): * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const): * UIProcess/API/Cocoa/WKWebView.mm: (+[WKWebView handlesURLScheme:]): * UIProcess/API/glib/WebKitSecurityManager.cpp: (registerSecurityPolicyForURIScheme): (checkSecurityPolicyForURIScheme): * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::webVisiblePluginInfo): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::canHandleRequest): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::registerURLSchemeAsEmptyDocument): (WebKit::WebProcess::registerURLSchemeAsSecure const): (WebKit::WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy const): (WebKit::WebProcess::setDomainRelaxationForbiddenForURLScheme const): (WebKit::WebProcess::registerURLSchemeAsLocal const): (WebKit::WebProcess::registerURLSchemeAsNoAccess const): (WebKit::WebProcess::registerURLSchemeAsDisplayIsolated const): (WebKit::WebProcess::registerURLSchemeAsCORSEnabled const): (WebKit::WebProcess::registerURLSchemeAsAlwaysRevalidated const): (WebKit::WebProcess::registerURLSchemeAsCachePartitioned const): (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const): * WebProcess/WebStorage/StorageAreaImpl.cpp: 2019-10-04 Jiewen Tan [WebAuthn] Implement _WKWebAuthenticationPanel SPI https://bugs.webkit.org/show_bug.cgi?id=202559 Reviewed by Brent Fulgham. This patch implements _WKWebAuthenticationPanel SPI. Here is the structure: 1) API::WebAuthenticationPanel is the APIObject of _WKWebAuthenticationPanel. It is owned by AuthenticatorManager. The lifetime of _WKWebAuthenticationPanel on the other hand is managed by clients. This binding is the surface where clients could interact with WebKit's WebAuthentication implementation. 2) API::WebAuthenticationPanelClient is a base class representing _WKWebAuthenticationPanelDelegate. Its subclass WebKit::WebAuthenticationPanelClient implements bridges to _WKWebAuthenticationPanelDelegate methods. It is owned by API::WebAuthenticationPanel. A weak pointer of WebKit::WebAuthenticationPanelClient is kept in _WKWebAuthenticationPanel to get the _WKWebAuthenticationPanelDelegate set by clients or nil otherwise. This binding is the surface where WebKit interacts with clients. 3) WebAuthenticationPanelFlags is the mirror of enums within _WKWebAuthenticationPanel. Implementation wise, this patch implements: 1) -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:], this is bridged from the regular UIDelegate route. Noted, WKFrameInfo is nil for now, a follow up on Bug 202563 will take care of it. This will be called from AuthenticatorManager::runPanel() which gates the start of discovery on the callback. For clients that don't implement the delegate, the callback will always be called with _WKWebAuthenticationPanelResultUnavailable to allow WebKit run on non-UI mode. A specific C API hack is added to always return _WKWebAuthenticationPanelResultPresented in WebKitTestRunner for layout tests. 2) -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] will be implemented in Bug 200932. 3) -[_WKWebAuthenticationPanelDelegate panel:dismissWebAuthenticationPanelWithResult:], this is bridged from API::WebAuthenticationPanel/API::WebAuthenticationPanelClient. This will be called whenever AuthenticatorManager::m_pendingCompletionHandler is invoked. Depending on the respond, _WKWebAuthenticationResult will be returned accordingly. To facilitate that, invokePendingCompletionHandler is crafted to bundle those two operations. 4) -[_WKWebAuthenticationPanel cancel] will be implemented in Bug 191523. Besides the above, this patch also silents the NFC action sheet. * Platform/spi/Cocoa/NearFieldSPI.h: * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Sources.txt: * SourcesCocoa.txt: * UIProcess/API/APIUIClient.h: (API::UIClient::runWebAuthenticationPanel): * UIProcess/API/APIWebAuthenticationPanel.cpp: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm. (API::WebAuthenticationPanel::create): (API::WebAuthenticationPanel::WebAuthenticationPanel): (API::WebAuthenticationPanel::setClient): * UIProcess/API/APIWebAuthenticationPanel.h: Copied from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationRequestData.h. * UIProcess/API/APIWebAuthenticationPanelClient.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h. (API::WebAuthenticationPanelClient::dismissPanel const): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (-[_WKWebAuthenticationPanel dealloc]): (-[_WKWebAuthenticationPanel relyingPartyID]): (-[_WKWebAuthenticationPanel delegate]): (-[_WKWebAuthenticationPanel setDelegate:]): (-[_WKWebAuthenticationPanel _apiObject]): (-[_WKWebAuthenticationPanel _initWithRelayingPartyID:]): Deleted. * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::webAuthenticationPanelResult): (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::WebCore::isFeatureEnabled): (WebKit::WebCore::getRpId): (WebKit::AuthenticatorManager::handleRequest): (WebKit::AuthenticatorManager::respondReceived): (WebKit::AuthenticatorManager::startDiscovery): (WebKit::AuthenticatorManager::initTimeOutTimer): (WebKit::AuthenticatorManager::timeOutTimerFired): (WebKit::AuthenticatorManager::runPanel): (WebKit::AuthenticatorManager::startRequest): (WebKit::AuthenticatorManager::invokePendingCompletionHandler): (WebKit::AuthenticatorManagerInternal::collectTransports): Deleted. (WebKit::AuthenticatorManagerInternal::processGoogleLegacyAppIdSupportExtension): Deleted. * UIProcess/WebAuthentication/AuthenticatorManager.h: (WebKit::AuthenticatorManager::pendingCompletionHandler): Deleted. * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: (WebKit::NfcConnection::NfcConnection): * UIProcess/WebAuthentication/Cocoa/NfcService.mm: (WebKit::NfcService::platformStartDiscovery): * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h: Copied from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationRequestData.h. * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp. (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient): (WebKit::wkWebAuthenticationResult): (WebKit::WebAuthenticationPanelClient::dismissPanel const): * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp: (WebKit::MockAuthenticatorManager::respondReceivedInternal): * UIProcess/WebAuthentication/WebAuthenticationPanelFlags.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h. * UIProcess/WebAuthentication/WebAuthenticationRequestData.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential): (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion): * WebKit.xcodeproj/project.pbxproj: 2019-10-04 Alex Christensen Move WKProcessPool._registerURLSchemeServiceWorkersCanHandle to _WKWebsiteDataStoreConfiguration https://bugs.webkit.org/show_bug.cgi?id=202553 Reviewed by Youenn Fablet. It was only used for testing, and all the tests that use it still pass with the new SPI. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::swServerForSession): (WebKit::NetworkProcess::addServiceWorkerSession): * NetworkProcess/NetworkProcess.h: * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const): Deleted. * Shared/AuxiliaryProcess.h: * Shared/AuxiliaryProcess.messages.in: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _registerURLSchemeServiceWorkersCanHandle:]): Deleted. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration registerURLSchemeServiceWorkersCanHandleForTesting:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle): Deleted. * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegisteredSchemes const): (WebKit::WebsiteDataStoreConfiguration::registerServiceWorkerScheme): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2019-10-04 youenn fablet Allow to suspend RTCPeerConnection when not connected https://bugs.webkit.org/show_bug.cgi?id=202403 Reviewed by Chris Dumez. Implement suspend/resume of sockets by doing the following: - For UDP sockets, we simulate as if being sent data is queued when being suspended. the webrtc backend will then stop sending packets until the queue is emptied. At resume time, we do as if the queue is emptied and packets sent (even though packets are not sent). For incoming traffic, we ignore it when being suspended. - For TCP sockets, we close them at suspend time. We then notify at resume time that an error happeneded for these sockets to the webrtc backend. We cannot simulate packet dropping like in the UDP case. To manage resume/suspend, each socket now has a isSuspended state and a socket group. The socket group is per peer connection. A peer connection will notify the factory that it is suspended/resumed. The factory will iterate through all sockets and will suspend/resume each socket of the socket group. * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::RTCSocketFactory::RTCSocketFactory): (WebKit::RTCSocketFactory::CreateUdpSocket): (WebKit::RTCSocketFactory::CreateServerTcpSocket): (WebKit::RTCSocketFactory::CreateClientTcpSocket): (WebKit::RTCSocketFactory::CreateAsyncResolver): (WebKit::RTCSocketFactory::suspend): (WebKit::RTCSocketFactory::resume): (WebKit::LibWebRTCProvider::createSocketFactory): * WebProcess/Network/webrtc/LibWebRTCProvider.h: * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::LibWebRTCSocket::LibWebRTCSocket): (WebKit::LibWebRTCSocket::~LibWebRTCSocket): (WebKit::LibWebRTCSocket::signalReadPacket): (WebKit::LibWebRTCSocket::signalSentPacket): (WebKit::LibWebRTCSocket::SendTo): (WebKit::LibWebRTCSocket::Close): (WebKit::LibWebRTCSocket::SetOption): (WebKit::LibWebRTCSocket::resume): (WebKit::LibWebRTCSocket::suspend): * WebProcess/Network/webrtc/LibWebRTCSocket.h: * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::createServerTcpSocket): (WebKit::LibWebRTCSocketFactory::createUdpSocket): (WebKit::LibWebRTCSocketFactory::createClientTcpSocket): (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket): (WebKit::LibWebRTCSocketFactory::addSocket): (WebKit::LibWebRTCSocketFactory::removeSocket): (WebKit::LibWebRTCSocketFactory::forSocketInGroup): * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h: 2019-10-04 Alex Christensen Simplify sandbox enabling macros https://bugs.webkit.org/show_bug.cgi?id=202536 Reviewed by Brent Fulgham. ENABLE_WEB_PROCESS_SANDBOX was always on for Cocoa platforms and only used in WebProcessCocoa.mm, so it did nothing. ENABLE_MANUAL_SANDBOXING was on for sdk=macosx* which I made more explicit in the code by using PLATFORM(MAC) || PLATFORM(MAACCATALYST) ENABLE_MANUAL_NETWORK_SANDBOXING was always off and hiding dead code we do not intend to use because iOS sandboxes are always on and never manual. * Configurations/FeatureDefines.xcconfig: * NetworkProcess/ios/NetworkProcessIOS.mm: (WebKit::NetworkProcess::initializeSandbox): * Shared/ios/AuxiliaryProcessIOS.mm: (WebKit::AuxiliaryProcess::initializeSandbox): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeSandbox): 2019-10-04 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.1 release * gtk/NEWS: Add release notes for 2.27.1. 2019-10-04 Carlos Garcia Campos [GTK] Crash in WebChromeClient::createDisplayRefreshMonitor https://bugs.webkit.org/show_bug.cgi?id=202551 Reviewed by Žan Doberšek. The crash happens when the drawing area is destroyed due to a page close. The layer tree host is invalidated causing a layer flush that ends up trying to create a display refresh monitor, which requires the drawing area. We need to null-check the drawing area in WebChromeClient::createDisplayRefreshMonitor() but we should also ensure that layer flush is not performed after layer tree host is destroyed. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createDisplayRefreshMonitor const): Null-check drawing area before using it. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::CompositingCoordinator): Receive a WebPage instead of a WebCore::Page and create the root layer here. (WebKit::CompositingCoordinator::~CompositingCoordinator): Do not purge backing stores again, invalidate should always be called right before the object is destroyed. (WebKit::CompositingCoordinator::flushPendingLayerChanges): Get WebCore::Page from WebPage. (WebKit::CompositingCoordinator::timestamp const): Ditto. (WebKit::CompositingCoordinator::syncDisplayState): Ditto. (WebKit::CompositingCoordinator::notifyFlushRequired): Do not continue if m_rootLayer is nullptr. (WebKit::CompositingCoordinator::deviceScaleFactor const): Get WebCore::Page from WebPage. (WebKit::CompositingCoordinator::pageScaleFactor const): Ditto. (WebKit::CompositingCoordinator::createGraphicsLayer): Call attachLayer() instead of duplicating the code. (WebKit::CompositingCoordinator::setVisibleContentsRect): Get WebCore::Page from WebPage. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost): Do not call LayerTreeHost::invalidate() that has been removed. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: (WebKit::LayerTreeHost::LayerTreeHost): Construct the coordinator after the sceneIntegration. (WebKit::LayerTreeHost::~LayerTreeHost): Invalidate everything here now. We don't really need invalidate() method since LayerTreeHost is not refcounted and we always called invalidate right before deleting the object. (WebKit::LayerTreeHost::layerFlushTimerFired): This can't happen on invalid state anymore. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: 2019-10-04 Carlos Garcia Campos [GTK][WPE] REGRESSION(r250673): connection to network process is broken after r250673 https://bugs.webkit.org/show_bug.cgi?id=202575 Reviewed by Carlos Alberto Lopez Perez. The file descriptor is now closed when the IPC::Attachment is destroyed in NetworkProcessConnectionInfo destructor. In case of unix domain sockets we need to transfer the ownership of the fd to NetworkProcessConnection, but NetworkProcessConnectionInfo is ow keeping the ownership. * WebProcess/Network/NetworkProcessConnectionInfo.h: (WebKit::NetworkProcessConnectionInfo::releaseIdentifier): Use IPC::Attachment::releaseFileDescriptor() in case of unix domain sockets. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureNetworkProcessConnection): Use NetworkProcessConnectionInfo::releaseIdentifier() when passing the identifier to NetworkProcessConnection. 2019-10-04 Carlos Garcia Campos Unreviewed. Fix GTK distcheck * webkitglib-symbols.map: Remove symbols that are no longer in lib. 2019-10-03 Carlos Garcia Campos [GTK] WebAutomation: make setWindowRect synchronous https://bugs.webkit.org/show_bug.cgi?id=202530 Reviewed by Carlos Alberto Lopez Perez. Move/resize window is asynchronous in GTK, but automation expects it to be synchronous so that get window rect after setting it always returns the value set. Use a nested run loop to wait for the configure events after the move/resize. * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::windowConfigureEventCallback): (UIClient::setWindowFrameTimerFired): 2019-10-03 Carlos Garcia Campos Unreviewed. Address review comments after r250646. I forgot to include the documentation improvements suggested. * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_class_init): 2019-10-03 Christopher Reid [WinCairo] Remote inspector client target list is racy https://bugs.webkit.org/show_bug.cgi?id=202169 Reviewed by Ross Kirsling. Original patch by Basuke Suzuki. Use LoaderClient to defer javascript target update calls to until after the page finished load. * UIProcess/socket/RemoteInspectorProtocolHandler.cpp: * UIProcess/socket/RemoteInspectorProtocolHandler.h: 2019-10-03 Ross Kirsling Socket RWI client should acquire backend commands from server https://bugs.webkit.org/show_bug.cgi?id=202421 Reviewed by Devin Rousso. * UIProcess/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::dispatchMap): (WebKit::RemoteInspectorClient::setBackendCommands): * UIProcess/socket/RemoteInspectorClient.h: Receive "BackendCommands" message from server (which is already base64-encoded) and hand it over to RWIProxy. * UIProcess/win/WebProcessPoolWin.cpp: (WebKit::backendCommandsPath): (WebKit::initializeRemoteInspectorServer): On Windows, initialize server with the path to InspectorBackendCommands.js from the CFBundle. 2019-10-03 Alex Christensen Replace _WKProcessPoolConfiguration.suppressesConnectionTerminationOnSystemChange with SPI on _WKWebsiteDataStoreConfiguration https://bugs.webkit.org/show_bug.cgi?id=202544 Reviewed by Tim Horton. The _WKProcessPoolConfiguration SPI was originally introduced in rdar://problem/40650244 Keep both working during the transition period, but we need it to not be on the process pool. * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration suppressesConnectionTerminationOnSystemChange]): (-[_WKWebsiteDataStoreConfiguration setSuppressesConnectionTerminationOnSystemChange:]): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::suppressesConnectionTerminationOnSystemChange const): (WebKit::WebsiteDataStoreConfiguration::setSuppressesConnectionTerminationOnSystemChange): 2019-10-03 Per Arne Vollan REGRESSION(249649): Unable to open local files in MiniBrowser on macOS https://bugs.webkit.org/show_bug.cgi?id=201798 Reviewed by Brent Fulgham. The commit introduced a MiniBrowser regression on macOS where MiniBrowser is not able to open local files. The change set r249649 fixed a problem where the WebContent process PID was not ready to be used when creating a sandbox extension. This happened in the cases where the WebContent process had not finished launching when the load started. The WebContent process is also creating sandbox extensions for the Networking process for the files being loaded, and also needs to be passing the audit token of the Networking process when creating these. This patch implements getting the audit token for the Networking process when the WebProcess is sending a message to the UI process to establish the Networking process connection. The audit token is stored in the NetworkProcessConnection object, and passed to the NetworkLoadParameters object when the load is started. Finally, when encoding the Network resources load parameters, the audit token is used to create an extension for the Networking process. API test: WKWebView.LoadFileWithLoadRequest * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Platform/IPC/ArgumentCoders.h: * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtensionImpl::create): (WebKit::SandboxExtensionImpl::sandboxExtensionForType): (WebKit::SandboxExtensionImpl::SandboxExtensionImpl): (WebKit::SandboxExtension::createHandleForMachLookupByPid): (WebKit::SandboxExtension::createHandleForReadByPid): (WebKit::SandboxExtension::createHandleForReadByAuditToken): * Shared/SandboxExtension.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::openNetworkProcessConnection): * UIProcess/WebProcessProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.h: (WebKit::NetworkProcessConnection::setNetworkProcessAuditToken): (WebKit::NetworkProcessConnection::networkProcessAuditToken const): * WebProcess/Network/NetworkProcessConnectionInfo.h: Added. (WebKit::NetworkProcessConnectionInfo::identifier): (WebKit::NetworkProcessConnectionInfo::encode const): (WebKit::NetworkProcessConnectionInfo::decode): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::preconnectTo): * WebProcess/WebProcess.cpp: (WebKit::getNetworkProcessConnection): (WebKit::WebProcess::ensureNetworkProcessConnection): 2019-10-03 Konstantin Tokarev CMake-built WebKit.framework should launch XPC services successfully https://bugs.webkit.org/show_bug.cgi?id=202490 Reviewed by Carlos Alberto Lopez Perez. target_link_options() requires CMake 3.10, however we can avoid raising required CMake version by moving it to PlatformMac.cmake, also avoid introduction of new CMake variable. * CMakeLists.txt: * PlatformMac.cmake: 2019-10-03 Jiewen Tan Support googleLegacyAppidSupport extension https://bugs.webkit.org/show_bug.cgi?id=202427 Reviewed by Brent Fulgham. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManagerInternal::collectTransports): (WebKit::AuthenticatorManagerInternal::processGoogleLegacyAppIdSupportExtension): (WebKit::AuthenticatorManager::handleRequest): * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::makeCredential): (WebKit::CtapAuthenticator::processGoogleLegacyAppIdSupportExtension): * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived): 2019-10-03 Jiewen Tan [WebAuthn] Implement dummy _WKWebAuthenticationPanel SPI https://bugs.webkit.org/show_bug.cgi?id=202507 Reviewed by Brent Fulgham. This patch implements dummy _WKWebAuthenticationPanel SPI to unblock Safari. Here are the illustrations for each SPI: 1) -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] is used at the beginning of any WebAuthn ceremonies. A WKFrameInfo is provided for more info of the initiating frame so clients could decide either show the RP ID or the origin of the frame which may or may not be the RP ID. A callback of _WKWebAuthenticationPanelResult is provided such that clients could inform WebKit to continue the ceremony or not. Case like rate limiting of a modular dialog could result in _WKWebAuthenticationPanelResultDidNotPresent. Then WebKit will abort the operation. _WKWebAuthenticationPanelResultUnavailable tells WebKit the client has no UI implemented and therefore WebKit will operate in a non UI mode which basically will only enable HID authenticators, and is the current behavior of macOS Safari. 2) -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] is primarily to instruct users to do some actionable thing to recover from some error state. However, it could be used for pure info as well. For _WKWebAuthenticationPanelInfoMultipleNFCTagPresents, users can be instructed to only hold one NFC tag to the scanner. For _WKWebAuthenticationPanelInfoNoCredentialsFound, users can potentially switch to another security key that could hit a match. 3) -[_WKWebAuthenticationPanelDelegate panel:dismissWebAuthenticationPanelWithResult:] is to dismiss UI. _WKWebAuthenticationResult is provided such that client could show different animations as a hint to the user. The reasons for failure could either be timeout or InvalidStateError which will be reported to the page as well. InvalidStateError signals a credential matching an entry of the exclude list (excludeCredentials) is found on the authenticator. 4) -[_WKWebAuthenticationPanel cancel] is the way clients tell WebKit a user cancel. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: Added. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: Added. (-[_WKWebAuthenticationPanel _initWithRelayingPartyID:]): (-[_WKWebAuthenticationPanel relyingPartyID]): (-[_WKWebAuthenticationPanel cancel]): * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h: Added. * WebKit.xcodeproj/project.pbxproj: 2019-10-03 Zan Dobersek [GTK][WPE] Enable async scrolling https://bugs.webkit.org/show_bug.cgi?id=202449 Reviewed by Carlos Garcia Campos. For WPE, explicitly enable the threaded scrolling preference on the WebPreferences object. For GTK, the same preference is enabled in parallel with the forced-compositing preference, as the async scrolling feature depends on always-on AC mode. To help with quick evaluation of potential issues around async scrolling the feature can still be disabled via the WEBKIT_DISABLE_ASYNC_SCROLLING environment variable, though this only works in DEVELOPER_MODE builds. * Shared/WebPreferencesDefaultValues.h: Default-enable async frame and overflow scrolling on Nicosia-using ports. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_set_hardware_acceleration_policy): * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_backend): * UIProcess/gtk/WebPreferencesGtk.cpp: (WebKit::WebPreferences::platformInitializeStore): * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics): (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences): (WebKit::DrawingAreaCoordinatedGraphics::supportsAsyncScrolling): * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: 2019-10-03 Zan Dobersek [Nicosia] Enable runtime checks and triggers for async non-main-frame scrolling https://bugs.webkit.org/show_bug.cgi?id=202509 Reviewed by Carlos Garcia Campos. * WebProcess/WebCoreSupport/WebChromeClient.h: Allow the non-main-frame compositing trigger for the Nicosia-using ports as well. This will enable non-main-frame compositing if the related setting is also enabled. 2019-10-03 Alexander Mikhaylenko [GTK] Don't hardcode swipe navigation gesture style https://bugs.webkit.org/show_bug.cgi?id=202447 Reviewed by Carlos Garcia Campos. Use GTK foreign drawing to draw swipe gesture dimming and shadow instead of hardcoded opacity and gradient values. Have separate elements for dimming and shadow. Additionally, add border and outline. Dimming layer opacity always matches progress, shadow opacity is 1 except when the page is almost completely retracted. Border and outline opacity is always 1. Outline is drawn above the top page. For determining shadow, border and outline width, 'min-width' property is used. Each element also has .right or .left style class depending on text direction. Creating patterns is relatively expensive, so do it once a gesture starts and clear them once it ends. Style changes are currently not handled, since it's unlikely anything would change while the gesture is done. Dimming layer is created with the same width as webview and is clipped when drawing. Translate existing dimming and shadow into css as is, add subtle border and outline. Since it's controlled via css, downstreams can override the style. Set WebKitWebView css name to 'webkitwebview', and only apply styles for elements directly preceded by it, otherwise the selectors are too generic. * PlatformGTK.cmake: Add gtk.css to gresource bundle. * Resources/gtk/gtk-theme.css: Added. (webkitwebview > dimming): (webkitwebview > shadow): (webkitwebview > shadow.right): (webkitwebview > shadow.left): (webkitwebview > border): (webkitwebview > outline): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkit_web_view_base_class_init): Set css name to 'webkitwebview'. * UIProcess/ViewGestureController.h: * UIProcess/gtk/ViewGestureControllerGtk.cpp: (WebKit::ViewGestureController::createStyleContext): (WebKit::createElementPattern): (WebKit::elementWidth): (WebKit::ViewGestureController::beginSwipeGesture): Create helper patterns. (WebKit::ViewGestureController::draw): Rework drawing to use the patterns. (WebKit::ViewGestureController::removeSwipeSnapshot): Clear the patterns. 2019-10-03 Carlos Garcia Campos [GTK] Make PSON optional https://bugs.webkit.org/show_bug.cgi?id=200967 Reviewed by Michael Catanzaro. It's not possible to enable PSON by default and keep backwards compatibility, applications might need to use new API to monitor the page ID changes in the Web view. So, this patch adds a construct only property to WebKitWebContext to enable PSON. * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextGetProperty): (webkitWebContextSetProperty): (webkitWebContextConstructed): (webkit_web_context_class_init): 2019-10-03 Carlos Garcia Campos [GTK][WPE] Add WebKitWebView:page-id property https://bugs.webkit.org/show_bug.cgi?id=201642 Reviewed by Michael Catanzaro. The page ID of a WebKitWebView can now change, so we need a way to get notified when it changes. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewGetProperty): Add getter for page-id. (webkit_web_view_class_init): Add page-id property (webkitWebViewDidChangePageID): Emit notify::page-id. * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::didChangeWebPageID const): Call webkitWebViewDidChangePageID(). * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/wpe/APIViewClient.h: (API::ViewClient::didChangePageID): Added virtual method. * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::didChangeWebPageID const): Call WKWPE::View::didChangePageID(). * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::didChangePageID): Call API::ViewClient::didChangePageID(). * UIProcess/API/wpe/WPEView.h: * UIProcess/PageClient.h: (WebKit::PageClient::didChangeWebPageID const): Added virtual method. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::swapToWebProcess): Call PageClient::didChangeWebPageID(). 2019-10-02 Andy Estes [iOS] When hit testing for a context menu interaction, do not consider whether the element is contenteditable https://bugs.webkit.org/show_bug.cgi?id=202498 Reviewed by Tim Horton. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::startInteractionWithElementAtPosition): Changed to call WebCore::Frame::nodeRespondingToInteraction. 2019-10-02 Myles C. Maxfield REGRESSION (r245672):