2018-05-22 Sihui Liu [iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies use different files with/without processpool https://bugs.webkit.org/show_bug.cgi?id=185831 Reviewed by Chris Dumez. Started to use uiProcessCookieStorageIdentifier for iOS: make sure cookies handled without processpool would use the same storage file as when processpool exists. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2018-05-22 Chris Dumez Regression(AsyncPolicyDelegates): Box.app login Window is blank https://bugs.webkit.org/show_bug.cgi?id=185832 Reviewed by Geoffrey Garen. Moved WeakObjCPtr.h header from WebKit/ to wtf/ so that it can be used in WebKitLegacy code. * UIProcess/API/Cocoa/WKBrowsingContextController.mm: * UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h: * UIProcess/API/Cocoa/WKConnection.mm: * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: * UIProcess/API/Cocoa/WKProcessGroup.mm: * UIProcess/API/Cocoa/WKProcessPool.mm: * UIProcess/API/Cocoa/WKScriptMessage.mm: * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: * UIProcess/API/Cocoa/_WKAutomationSession.mm: * UIProcess/API/Cocoa/_WKDownload.mm: * UIProcess/API/Cocoa/_WKElementAction.mm: * UIProcess/ApplicationStateTracker.h: * UIProcess/Cocoa/AutomationClient.h: * UIProcess/Cocoa/AutomationSessionClient.h: * UIProcess/Cocoa/DiagnosticLoggingClient.h: * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/FindClient.h: * UIProcess/Cocoa/FullscreenClient.h: * UIProcess/Cocoa/IconLoadingDelegate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/ios/ViewGestureControllerIOS.mm: * UIProcess/ios/WKActionSheetAssistant.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/WKPDFView.mm: (-[WKPDFView web_setContentProviderData:suggestedFilename:]): * UIProcess/ios/WKScrollView.mm: * UIProcess/mac/WKInspectorViewController.mm: * UIProcess/mac/WKInspectorWKWebView.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: 2018-05-22 Sihui Liu Conversion between SecurityOriginData and DatabaseIdentifier is asymmetric when port is null https://bugs.webkit.org/show_bug.cgi?id=185715 Reviewed by Geoffrey Garen. Add getter for origins in WKWebsiteDataRecord for testing. * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (-[WKWebsiteDataRecord _originsString]): * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: 2018-05-22 Brady Eidson Rename the "Web content is visible" process assertion. https://bugs.webkit.org/show_bug.cgi?id=185878 Reviewed by Chris Dumez. * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAssertion::ProcessAssertion): 2018-05-22 Andy Estes [Wi-Fi Assertions] Drop assertions on process suspension https://bugs.webkit.org/show_bug.cgi?id=185844 Reviewed by Daniel Bates. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::actualPrepareToSuspend): (WebKit::NetworkProcess::processDidResume): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformPrepareToSuspend): (WebKit::NetworkProcess::platformProcessDidResume): 2018-05-22 Brent Fulgham REGRESSION(r229093): Re-enable Network Extension support in the WebContent process (Take 2) https://bugs.webkit.org/show_bug.cgi?id=185874 Reviewed by Eric Carlson. Add back a necessary XPC connection after locking down the network features in r229093. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2018-05-22 Ryan Haddad Unreviewed, rolling out r232052. Breaks internal builds. Reverted changeset: "Use more C++17" https://bugs.webkit.org/show_bug.cgi?id=185176 https://trac.webkit.org/changeset/232052 2018-05-22 Alberto Garcia [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations https://bugs.webkit.org/show_bug.cgi?id=182622 Reviewed by Michael Catanzaro. Move the test to determine whether we need to link against libatomic to the common file WebKitCompilerFlags.cmake so it can also be used for JavaScriptCore. * CMakeLists.txt: 2018-05-22 Michael Catanzaro Unreviewed, rolling out r231843. Broke cross build Reverted changeset: "[CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations" https://bugs.webkit.org/show_bug.cgi?id=182622 https://trac.webkit.org/changeset/231843 2018-05-22 Carlos Garcia Campos Crash when loading a SVG image https://bugs.webkit.org/show_bug.cgi?id=185819 Reviewed by Brent Fulgham. This is happening in WebLoaderStrategy::scheduleLoad() when getting the value of FrameLoaderClient::pageID(). SVGImage uses the empty clients for the loader, and EmptyFrameLoaderClient::pageID() returns std::nullopt. The same happens with the frameID. This changed in r225934, when pageID() and frameID() were changed to return std::optional, EmptyFrameLoaderClient was updated to return std::nullopt instead of 0. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): Use value_or(0) instead of value() to get pageID and frameID from FrameLoaderClient. 2018-05-21 Yusuke Suzuki Use more C++17 https://bugs.webkit.org/show_bug.cgi?id=185176 Reviewed by JF Bastien. * Configurations/Base.xcconfig: * DerivedSources.make: 2018-05-21 Carlos Garcia Campos [GTK][Wayland] UI process crash when closing the window https://bugs.webkit.org/show_bug.cgi?id=185818 Reviewed by Michael Catanzaro. This happens when a page containing a text field is loaded but the focus remains in the url bar when the window is closed. This is because we are sending a notify-in to the IM context, but the focus is still in the URL bar. That confuses the wayland input method manager that tries to free the text of the web view IM context that has already been deleted. * UIProcess/gtk/InputMethodFilter.cpp: (WebKit::InputMethodFilter::setEnabled): Only send notify-in if the view is actually focused. 2018-05-21 Ryosuke Niwa Remove unused and no-op WKContextSetCookieStorageDirectory https://bugs.webkit.org/show_bug.cgi?id=185857 Reviewed by Youenn Fablet. Deleted C API which didn't do anything useful, and consequently not used by anyone. * UIProcess/API/C/WKContext.cpp: (WKContextSetCookieStorageDirectory): Deleted. * UIProcess/API/C/WKContextPrivate.h: * UIProcess/WebProcessPool.h: 2018-05-21 Chris Nardi Remove dead exception in MediaList.appendMedium https://bugs.webkit.org/show_bug.cgi?id=185278 Reviewed by Chris Dumez. Remove code pertaining to an exception being thrown by appendMedium(). * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp: (webkit_dom_media_list_append_medium): 2018-05-21 Aditya Keerthi [iOS] Click events only fire once when editing https://bugs.webkit.org/show_bug.cgi?id=185777 Reviewed by Tim Horton. gestureRecognizerShouldBegin: was returning false for the single tap gesture when a node was being edited. This is an artifact of how the gesture was previously handled with the text selection assistant. This condition is now removed, allowing the single tap gesture to go through and correctly propagate the click event. Also added an early return to _didGetTapHighlightForRequest: in order to prevent the tap highlight from being shown when the node is already being assisted. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): (-[WKContentView gestureRecognizerShouldBegin:]): 2018-05-21 Daniel Bates REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR https://bugs.webkit.org/show_bug.cgi?id=185789 Reviewed by Andy Estes. Have NetworkLoadChecker implement the ContentSecurityPolicyClient interface and support logging console messages, sending CSP reports, and dispatching SecurityPolicyViolation events. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): Modified to take a reference to the NetworkConnectionToWebProcess, the web page ID, the web frame ID, and the resource load identifier. These details are necessary in order to implement the ContentSecurityPolicyClient interface. (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): Added. (WebKit::NetworkLoadChecker::continueCheckingRequest): Write in terms of isAllowedByContentSecurityPolicy(). (WebKit::NetworkLoadChecker::contentSecurityPolicy): Pass ourself as the client so that we receive delegate callbacks. (WebKit::NetworkLoadChecker::addConsoleMessage): Added. (WebKit::NetworkLoadChecker::sendCSPViolationReport): Added. (WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Added. * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkResourceLoader.cpp: (NetworkResourceLoader::enqueueSecurityPolicyViolationEvent): Added. * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): Modified to take a reference to the NetworkConnectionToWebProcess and pass this through to the NetworkLoadChecker along with the web page ID, web frame ID and resource load identifier. * NetworkProcess/PingLoad.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::enqueueSecurityPolicyViolationEvent): Added. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add message EnqueueSecurityPolicyViolationEvent. 2018-05-21 Brian Burg Web Automation: always return an empty cookie list if document.cookieURL() is empty https://bugs.webkit.org/show_bug.cgi?id=185838 Reviewed by Tim Horton. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::getCookiesForFrame): This crashes in CFNetwork code because an empty cookie URL is not a valid input. Just return an empty list since there couldn't be any cookies returned. 2018-05-21 Brian Burg Web Automation: terminate the automation session if the network or storage process crashes https://bugs.webkit.org/show_bug.cgi?id=185827 Reviewed by Tim Horton. If one of the processes crashes, the page may be in an undefined state and automation will fail in unpredictable ways. It's better to just give up immediately. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::networkProcessFailedToLaunch): (WebKit::WebProcessPool::storageProcessCrashed): 2018-05-21 Sihui Liu Add a diskCacheSizeOverride accessor function on WKContextConfigurationRef https://bugs.webkit.org/show_bug.cgi?id=185826 Reviewed by Alex Christensen. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationDiskCacheSizeOverride): (WKContextConfigurationSetDiskCacheSizeOverride): * UIProcess/API/C/WKContextConfigurationRef.h: 2018-05-21 Jer Noble Complete fix for enabling modern EME by default https://bugs.webkit.org/show_bug.cgi?id=185770 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2018-05-21 Sam Weinig Modernize RenderStyleConstants.h - Part 1 https://bugs.webkit.org/show_bug.cgi?id=185809 Reviewed by Yusuke Suzuki. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::getPositionInformation): Update for new enum names. 2018-05-21 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release. * gtk/NEWS: Add release notes for 2.21.2. 2018-05-21 Carlos Garcia Campos Unreviewed, rolling out r222967. It's not ready yet Reverted changeset: "[GTK][WPE] Add API to configure and enable resource load statistics" https://bugs.webkit.org/show_bug.cgi?id=177943 https://trac.webkit.org/changeset/222967 2018-05-18 Commit Queue Unreviewed, rolling out r231982. https://bugs.webkit.org/show_bug.cgi?id=185793 Caused layout test failures (Requested by realdawei on #webkit). Reverted changeset: "Complete fix for enabling modern EME by default" https://bugs.webkit.org/show_bug.cgi?id=185770 https://trac.webkit.org/changeset/231982 2018-05-18 Brian Burg [Cocoa] Add missing nullability annotations to _WKAutomationSessionDelegate https://bugs.webkit.org/show_bug.cgi?id=185791 Reviewed by Tim Horton. * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: If there is no dialog shown, then the delegate methods to return the dialog text may return a nil NSString. 2018-05-18 Youenn Fablet NetworkLoadChecker should cancel its content extension retrieval task when being destroyed https://bugs.webkit.org/show_bug.cgi?id=185661 Reviewed by Chris Dumez. Make sure that the Content Extension retrieval callback checks that NetworkLoadChecker is alive. This allows stopping NetworkLoadChecker be ref counted. This in turns allows NetworkResourceLoader to delete its NetworkLoadChecker when being deleted as well. By doing so, we simplify the memory management of NetworkResourceLoader and NetworkLoadChecker. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkRequest): (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::weakPtrFactory): * NetworkProcess/NetworkResourceLoader.cpp: * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): * NetworkProcess/PingLoad.h: 2018-05-18 Per Arne Vollan WebProcess fails to launch https://bugs.webkit.org/show_bug.cgi?id=185140 Reviewed by Geoffrey Garen. If the NSApplication runloop is not used in the WebContent process, launchServicesCheckIn() needs to be called in order for enableSandboxStyleFileQuarantine() to succeed. Determine at runtime if launchServicesCheckIn() should be called by checking if the NSApplication event loop is running. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeProcess): 2018-05-18 Jer Noble Complete fix for enabling modern EME by default https://bugs.webkit.org/show_bug.cgi?id=185770 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2018-05-18 Brent Fulgham Convert ProcessPrivilege assertions to regular debug-only assertions https://bugs.webkit.org/show_bug.cgi?id=185775 Reviewed by Geoffrey Garen. In Bug 184322 I added a number of RELEASE_ASSERT checks that certain UI-only calls were not being made in the WebContent process. Measurements have shown that these RELEASE_ASSERTs have regressed performance by around 1% on some benchmarks, so we should convert them to normal asserts. This patch changes the RELEASE_ASSERTs into ASSERTs. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): (WebKit::WebViewImpl::becomeFirstResponder): (WebKit::WebViewImpl::pluginFocusOrWindowFocusChanged): (WebKit::WebViewImpl::validateUserInterfaceItem): (WebKit::WebViewImpl::startSpeaking): (WebKit::WebViewImpl::stopSpeaking): (WebKit::applicationFlagsForDrag): (WebKit::WebViewImpl::doneWithKeyEvent): * UIProcess/Gamepad/mac/UIGamepadProviderMac.mm: (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::enterFullscreen): (WebKit::PluginProcessProxy::beginModal): (WebKit::PluginProcessProxy::endModal): * UIProcess/mac/DisplayLink.cpp: (WebKit::DisplayLink::DisplayLink): (WebKit::DisplayLink::~DisplayLink): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::getIsSpeaking): (WebKit::WebPageProxy::speak): (WebKit::WebPageProxy::stopSpeaking): (WebKit::WebPageProxy::startDisplayLink): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): 2018-05-18 Eric Carlson Handle failure to extend sandbox gracefully https://bugs.webkit.org/show_bug.cgi?id=185779 Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _denyNextUserMediaRequest]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Don't append the request to m_grantedRequests if it failed. (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): Deny request if willCreateMediaStream fails. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willCreateMediaStream): Don't try to extend sandbox if we fail to allocate all necessary handles. * UIProcess/UserMediaProcessManager.h: (WebKit::UserMediaProcessManager::denyNextUserMediaRequest): New, for testing. 2018-05-18 Antoine Quint [Web Animations] Turn Web Animations with CSS integration on for test runners https://bugs.webkit.org/show_bug.cgi?id=184819 Unreviewed. Rolling out the patch for this bug, it caused some flaky timeouts for animation suspension tests. * Shared/WebPreferences.yaml: 2018-05-18 Wenson Hsieh [Extra zoom mode] Clearing text fields should dispatch input events of type "deleteContent" https://bugs.webkit.org/show_bug.cgi?id=185769 Reviewed by Tim Horton. When setting the text of the currently focused element to the empty string, just delete the text instead of pretending to insert an empty string. This mimics deleting content using the delete key on macOS, and fires an input event with inputType "deleteContent" instead of "insertText". Test: fast/forms/extrazoom/delete-content-in-text-field.html * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setTextAsync): 2018-05-18 Keith Rollin Renamed "trackNetworkActivity" to "tracksResourceLoadMilestones" https://bugs.webkit.org/show_bug.cgi?id=185523 Reviewed by Geoffrey Garen. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::networkActivityTrackingEnabled): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::tracksResourceLoadMilestones const): (WebKit::NetworkProcess::trackNetworkActivity const): Deleted. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationTracksResourceLoadMilestones): (WKContextConfigurationSetTracksResourceLoadMilestones): (WKContextConfigurationTrackNetworkActivity): Deleted. (WKContextConfigurationSetTrackNetworkActivity): Deleted. * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration tracksResourceLoadMilestones]): (-[_WKProcessPoolConfiguration setTracksResourceLoadMilestones:]): (-[_WKProcessPoolConfiguration trackNetworkActivity]): Deleted. (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]): Deleted. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2018-05-18 Chris Dumez Avoid keeping the frame alive when ref'ing a WindowProxy https://bugs.webkit.org/show_bug.cgi?id=185737 Reviewed by Sam Weinig. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::windowScriptNPObject): 2018-05-18 Youenn Fablet -Wmemset-elt-size warning in LibWebRTCSocket constructor https://bugs.webkit.org/show_bug.cgi?id=185555 Reviewed by Darin Adler. GetOption implementation was broken in that it was not initializing properly its array of options. This patch fixes it by using an array of optional which are initialized by default. When no value is set, we return the error code -1. In theory, we should go to NetworkProcess to get the actual value. Since GetOption is not used in practice, we just do this best effort implementation of storing previously set values. * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::LibWebRTCSocket::LibWebRTCSocket): (WebKit::LibWebRTCSocket::GetOption): * WebProcess/Network/webrtc/LibWebRTCSocket.h: 2018-05-18 Antoine Quint [Web Animations] Turn Web Animations with CSS integration on for test runners https://bugs.webkit.org/show_bug.cgi?id=184819 Reviewed by Jon Lee. * Shared/WebPreferences.yaml: Leave Web Animations off by default, it's up to clients to turn it on. 2018-05-18 Fujii Hironori [Curl] Remove unused SystemProxyWin.cpp https://bugs.webkit.org/show_bug.cgi?id=185224 Reviewed by Antti Koivisto. SystemProxyWin is not used at the moment. Remove it. * NetworkProcess/win/SystemProxyWin.cpp: Removed. * NetworkProcess/win/SystemProxyWin.h: Removed. * PlatformWin.cmake: Removed SystemProxyWin.cpp. 2018-05-17 Nan Wang AX: [macOS] Expose the primary screen height through AX API https://bugs.webkit.org/show_bug.cgi?id=185742 Reviewed by Chris Fleizach. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeNames]): (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]): 2018-05-17 Alex Christensen Use CompletionHandlers for DelayedReplies https://bugs.webkit.org/show_bug.cgi?id=182269 Reviewed by Youenn Fablet. DelayedReplies should be a noncopyable, non-refcountable type. They should be called once and only once. This is what CompletionHandlers are for. No change in behavior. Just cleaner code. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData): (WebKit::sendReplyToSynchronousRequest): (WebKit::NetworkResourceLoader::NetworkResourceLoader): * NetworkProcess/NetworkResourceLoader.h: * Platform/IPC/HandleMessage.h: (IPC::callMemberFunctionImpl): (IPC::callMemberFunction): (IPC::handleMessageDelayed): * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::setInitializationReply): (WebKit::PluginControllerProxy::takeInitializationReply): * PluginProcess/PluginControllerProxy.h: * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::destroyPlugin): (WebKit::WebProcessConnection::createPlugin): (WebKit::WebProcessConnection::createPluginAsynchronously): * PluginProcess/WebProcessConnection.h: * Scripts/webkit/LegacyMessageReceiver-expected.cpp: (Messages::WebPage::GetPluginProcessConnection::send): (Messages::WebPage::TestMultipleAttributes::send): (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted. (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted. (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted. (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted. (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted. (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted. * Scripts/webkit/LegacyMessages-expected.h: * Scripts/webkit/MessageReceiver-expected.cpp: (Messages::WebPage::GetPluginProcessConnection::send): (Messages::WebPage::TestMultipleAttributes::send): (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted. (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted. (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted. (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted. (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted. (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted. * Scripts/webkit/Messages-expected.h: * Scripts/webkit/messages.py: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getNetworkProcessConnection): (WebKit::NetworkProcessProxy::networkProcessCrashed): (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch): (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Plugins/PluginProcessManager.cpp: (WebKit::PluginProcessManager::getPluginProcessConnection): * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::getPluginProcessConnection): (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch): (WebKit::PluginProcessProxy::didCreateWebProcessConnection): * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::getStorageProcessConnection): (WebKit::StorageProcessProxy::didClose): (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::ExceededDatabaseQuotaRecords::createRecord): (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationActionSync): (WebKit::WebPageProxy::createNewPage): (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::webGLPolicyForURL): (WebKit::WebPageProxy::resolveWebGLPolicyForURL): (WebKit::WebPageProxy::getToolbarsAreVisible): (WebKit::WebPageProxy::getMenuBarIsVisible): (WebKit::WebPageProxy::getStatusBarIsVisible): (WebKit::WebPageProxy::getWindowFrame): (WebKit::WebPageProxy::screenToRootView): (WebKit::WebPageProxy::rootViewToScreen): (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): (WebKit::WebPageProxy::exceededDatabaseQuota): (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::networkProcessCrashed): (WebKit::WebProcessPool::getNetworkProcessConnection): (WebKit::WebProcessPool::getStorageProcessConnection): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getPluginProcessConnection): (WebKit::WebProcessProxy::getNetworkProcessConnection): (WebKit::WebProcessProxy::getStorageProcessConnection): * UIProcess/WebProcessProxy.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::syncTerminateWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): 2018-05-17 Jer Noble CRASH in -[WKFullScreenViewController _manager] https://bugs.webkit.org/show_bug.cgi?id=185745 Reviewed by Eric Carlson. Protect against WKFullScreenViewController outliving WKWebView by making its _webView property weak. Additionally, add a sanity-check RetainPtr where _webView is referenced multiple times within a function. * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController initWithWebView:]): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController _completedExitFullScreen]): (-[WKFullScreenWindowController close]): (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]): (-[WKFullScreenWindowController _exitFullscreenImmediately]): (-[WKFullScreenWindowController _isSecure]): (-[WKFullScreenWindowController _serverTrust]): (-[WKFullScreenWindowController _updateLocationInfo]): (-[WKFullScreenWindowController _manager]): (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]): 2018-05-17 Brent Fulgham Correct default for StorageAccess API https://bugs.webkit.org/show_bug.cgi?id=185748 Reviewed by Dean Jackson. Flip the default state to 'true' so that the new "sticky" state for Storage Access API and attributing user interaction for Storage Access API use is applied by default. * Shared/WebPreferences.yaml: 2018-05-17 Carlos Alberto Lopez Perez [WPE] Implement and enable FULLSCREEN_API https://bugs.webkit.org/show_bug.cgi?id=185676 Reviewed by Žan Doberšek. Do the initial implementation of FULLSCREEN_API for WPE and enable the CMake option by default. Most of the layout tests (55 of 58) are passing and the feature seems to work fine on different websites that use it. * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::fullScreenManagerProxyClient): (WebKit::PageClientImpl::closeFullScreenManager): (WebKit::PageClientImpl::isFullScreen): (WebKit::PageClientImpl::enterFullScreen): (WebKit::PageClientImpl::exitFullScreen): (WebKit::PageClientImpl::beganEnterFullScreen): (WebKit::PageClientImpl::beganExitFullScreen): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.h: (WKWPE::View::isFullScreen): (WKWPE::View::setFullScreen): 2018-05-17 Jiewen Tan Convert CertificateInfo into Credential in UI Process instead of Networking Process https://bugs.webkit.org/show_bug.cgi?id=185662 Reviewed by Alex Christensen. Right now we convert CertificateInfo into Credential in the very last stage of client certificate authentication process when it reaches Networking Process. This patch moves that conversion earlier in UI Process such that we don't have to pass both Credential and CertificateInfo to Networking Process. CertificateInfo is only used in macOS for C API specifically. WK2 includes macOS/iOS relies on NSURLCredential/WebCore::Credential solely. WK2 has already exercised the ability of using WebCore::Credential to do client certficate authentication. This patch therefore takes advantage of that. It converts CertficateInfo objects into Credential objects right after WebCredential is initialized, and then merge any code paths that utilizes CertficateInfo into ones that uses WebCore::Credential. Covered by existing tests. * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::useCredentialForChallenge): (WebKit::AuthenticationManager::useCredentialForSingleChallenge): (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): Deleted. * Shared/Authentication/AuthenticationManager.h: * Shared/Authentication/AuthenticationManager.messages.in: * UIProcess/Authentication/AuthenticationChallengeProxy.cpp: (WebKit::AuthenticationChallengeProxy::useCredential): * UIProcess/Authentication/WebCredential.cpp: (WebKit::WebCredential::WebCredential): (WebKit::WebCredential::certificateInfo): Deleted. * UIProcess/Authentication/WebCredential.h: (WebKit::WebCredential::create): * UIProcess/Authentication/mac/WebCredentialMac.mm: Renamed from Source/WebKit/Shared/Authentication/mac/AuthenticationManager.mac.mm. (WebKit::leafCertificate): (WebKit::chain): (WebKit::WebCredential::WebCredential): * WebKit.xcodeproj/project.pbxproj: 2018-05-17 Jeremy Jones Ensure valid rects for fullsceen animation. https://bugs.webkit.org/show_bug.cgi?id=185736 rdar://problem/40320174 Reviewed by Jer Noble. Protect against zero width and height since those can make for NANs in the animation transforms. * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): 2018-05-17 Jer Noble Turn Modern EME API on by default and remove it as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=185693 Reviewed by Eric Carlson. * Shared/WebPreferences.yaml: 2018-05-17 Dean Jackson Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes https://bugs.webkit.org/show_bug.cgi?id=185722 Reviewed by Antoine Quint. I made a rookie mistake in the original patch: I was holding a strong reference to "self" in a block, which was causing a retain cycle. Replace that with a WeakObjCPtr. * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): 2018-05-16 Brent Fulgham REGRESSION(r229093)[macOS] Allow network-outbound for syslog use https://bugs.webkit.org/show_bug.cgi?id=185703 Reviewed by Eric Carlson. In r229093 I removed the 'network-outbound' permission for syslog use. Further testing has shown that this is still needed for subsystem logging in our bundle loading code. This patch re-enabled network-outbound for syslog. * WebProcess/com.apple.WebProcess.sb.in: 2018-05-16 Andy VanWagoner Add support for Intl NumberFormat formatToParts https://bugs.webkit.org/show_bug.cgi?id=185375 Reviewed by Yusuke Suzuki. Add flag for NumberFormat formatToParts. * Configurations/FeatureDefines.xcconfig: 2018-05-16 Andy Estes [Wi-Fi Assertions] Adopt WiFiAssertionHolderAdditions https://bugs.webkit.org/show_bug.cgi?id=185685 Reviewed by Sam Weinig. * NetworkProcess/cocoa/WiFiAssertionHolder.cpp: (WebKit::WiFiAssertionHolder::WiFiAssertionHolder): (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder): (WebKit::ensureWiFiManagerClient): Deleted. 2018-05-16 Fujii Hironori [Win] Implement WebPage::handleEditingKeyboardEvent https://bugs.webkit.org/show_bug.cgi?id=185327 Reviewed by Alexey Proskuryakov. * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::handleEditingKeyboardEvent): Copied from WebKitLegacy. 2018-05-16 Sihui Liu Session cookies aren't reliably set when using default WKWebSiteDataStore https://bugs.webkit.org/show_bug.cgi?id=185624 Reviewed by Geoffrey Garen. Session cookies of default session were set in UI Process when there was no process pool, but they were not synced (or synced slowly to) Network Process. To make these cookies visible as soon as they were set through API, we could manually set those cookies in Network Process during its initilization. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::cookies): (API::HTTPCookieStore::setCookie): (API::HTTPCookieStore::deleteCookie): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::clearPendingCookies): * UIProcess/WebsiteData/WebsiteDataStore.h: 2018-05-16 Chris Nardi Remove Document#selectedStylesheetSet/preferredStylesheetSet https://bugs.webkit.org/show_bug.cgi?id=185381 Reviewed by Darin Adler. Make API methods for Document#selectedStylesheetSet/preferredStylesheetSet do nothing. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: (webkit_dom_document_set_property): (webkit_dom_document_get_property): (webkit_dom_document_get_preferred_stylesheet_set): (webkit_dom_document_get_selected_stylesheet_set): (webkit_dom_document_set_selected_stylesheet_set): 2018-05-16 Alberto Garcia [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations https://bugs.webkit.org/show_bug.cgi?id=182622 Reviewed by Michael Catanzaro. Move the test to determine whether we need to link against libatomic to the common file WebKitCompilerFlags.cmake so it can also be used for JavaScriptCore. * CMakeLists.txt: 2018-05-15 Yusuke Suzuki [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function https://bugs.webkit.org/show_bug.cgi?id=185601 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPObject.h: 2018-05-15 Sihui Liu StorageManager::deleteLocalStorageOriginsModifiedSince: database files get deleted before database connections close https://bugs.webkit.org/show_bug.cgi?id=185671 Reviewed by Geoffrey Garen. We should delete database files before closing databases. * UIProcess/WebStorage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems): * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince): (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): Deleted. * UIProcess/WebStorage/LocalStorageDatabaseTracker.h: * UIProcess/WebStorage/StorageManager.cpp: (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): 2018-05-15 Dean Jackson Launch System Preview as the download starts, rather than waiting for a response https://bugs.webkit.org/show_bug.cgi?id=185669 Reviewed by Tim Horton. We were waiting for the RequestResponse to get a MIME-type before launching the system preview. This causes an annoying delay. Instead, assume that the system preview is one of the handled mime types and launch the viewer immediately. If it gets something it didn't expect, it will show an error. * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::didStart): (WebKit::DownloadClient::didReceiveResponse): * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): (WebKit::SystemPreviewController::start): Small cleanup to ensure we don't try to present twice (this shouldn't happen). 2018-05-15 Dean Jackson Post-review cleanup for 185459 https://bugs.webkit.org/show_bug.cgi?id=185665 Reviewed by Tim Horton. Jon made some comments in 185459 that I'm addressing here. * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: Guard the activity token for iOS in a way that means it will still work ok on macOS. (WebKit::DownloadClient::didStart): (WebKit::DownloadClient::processDidCrash): (WebKit::DownloadClient::didFinish): (WebKit::DownloadClient::didFail): (WebKit::DownloadClient::didCancel): (WebKit::DownloadClient::takeActivityToken): (WebKit::DownloadClient::releaseActivityTokenIfNecessary): (WebKit::DownloadClient::releaseActivityToken): Deleted. * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add an early return. (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): 2018-05-15 Tadeu Zagallo Update touch event tracking types on every touch https://bugs.webkit.org/show_bug.cgi?id=184250 Reviewed by Geoffrey Garen. The tracking types for touch events were only update on touchstart, which meant that event listeners added after the touchstart would always be treated as passive, even if explicitly setting passive to false. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleTouchEventSynchronously): (WebKit::WebPageProxy::handleTouchEvent): 2018-05-15 Per Arne Vollan Pause display links when window is not visible. https://bugs.webkit.org/show_bug.cgi?id=185627 Reviewed by Simon Fraser. Pause/resume display links created in the UI process when the window is hidden/shown. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dispatchActivityStateChange): * UIProcess/mac/DisplayLink.cpp: (WebKit::DisplayLink::pause): (WebKit::DisplayLink::resume): * UIProcess/mac/DisplayLink.h: 2018-05-15 Dean Jackson Provide UIView and UIImage for zoom transition https://bugs.webkit.org/show_bug.cgi?id=185655 Reviewed by Antoine Quint. Provide a UIView* for the frameForPreviewItem to use as a source view. Also implement the transitionImageForPreviewItem delegate, even though we're returning nil. * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]): (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]): 2018-05-15 Daniel Bates Fix the Apple Internal build Make a similar change to WebKit as I did for LegacyWebKit in r231777. See for more details. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController exitFullScreen]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): 2018-05-15 Megan Gardner Clear selections from web content with single tap https://bugs.webkit.org/show_bug.cgi?id=185634 Reviewed by Tim Horton. With the switch to the single text selection assistant, we were not correctly clearing the selection when a single tap happened. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _singleTapCommited:]): 2018-05-15 Antoine Quint [Web Animations] Expose Web Animations CSS integration as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=185647 Reviewed by Dean Jackson. Rename the Web Animations CSS integration flag. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebAnimationsCSSIntegrationEnabled): (WKPreferencesGetWebAnimationsCSSIntegrationEnabled): (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted. (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]): (-[WKPreferences _webAnimationsCSSIntegrationEnabled]): (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]): Deleted. (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): (WebKit::InjectedBundle::setWebAnimationsCSSIntegrationEnabled): (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted. * WebProcess/InjectedBundle/InjectedBundle.h: 2018-05-15 Dean Jackson Update animation when presenting QuickLook https://bugs.webkit.org/show_bug.cgi?id=185648 Reviewed by Antoine Quint. Implement the QuickLook delegate on _WKPreviewControllerDelegate that produces a zoom-like animation when the QLPreviewController appears. * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]): * UIProcess/SystemPreviewController.h: Add a reference back to the page, so that the delegate implementation can access the presentingViewController. (WebKit::SystemPreviewController::page): 2018-05-14 Dean Jackson Download and present System Preview https://bugs.webkit.org/show_bug.cgi?id=185459 Reviewed by Tim Horton. Extend DownloadClient so that it can handle the case where the download was triggered by a System Preview. In this situation the result (and progress) are piped into QuickLook via the SystemPreviewController. The DownloadProxy class is also extended to handle the destination filename and the size of the content. Lastly, SystemPreviewController is updated to have a start(), show() and cancel() interface, and no longer adjusts page navigation. * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: Handle the SystemPreview case, which doesn't have a download delegate, but instead needs to communicate with the SystemPreviewController, if one exists. (WebKit::DownloadClient::didStart): (WebKit::DownloadClient::didReceiveResponse): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::didCreateDestination): (WebKit::DownloadClient::processDidCrash): (WebKit::DownloadClient::decideDestinationWithSuggestedFilename): (WebKit::DownloadClient::didFinish): (WebKit::DownloadClient::didFail): (WebKit::DownloadClient::didCancel): (WebKit::DownloadClient::releaseActivityToken): * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the new API. (-[_WKPreviewControllerDataSource initWithMIMEType:]): (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): (-[_WKPreviewControllerDataSource setProgress:]): (-[_WKPreviewControllerDataSource finish:]): (-[_WKPreviewControllerDelegate previewControllerDidDismiss:]): (WebKit::SystemPreviewController::start): (WebKit::SystemPreviewController::updateProgress): (WebKit::SystemPreviewController::finish): (WebKit::SystemPreviewController::cancel): (-[_WKPreviewControllerDataSource initWithURL:]): Deleted. (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]): Deleted. (WebKit::SystemPreviewController::canPreview const): Deleted. (WebKit::SystemPreviewController::showPreview): Deleted. * UIProcess/Downloads/DownloadProxy.h: Track the destination file by name and size. Also expose a helper to identify system preview downloads. (WebKit::DownloadProxy::destinationFilename const): (WebKit::DownloadProxy::setDestinationFilename): (WebKit::DownloadProxy::expectedContentLength const): (WebKit::DownloadProxy::setExpectedContentLength): (WebKit::DownloadProxy::bytesLoaded const): (WebKit::DownloadProxy::setBytesLoaded): (WebKit::DownloadProxy::isSystemPreviewDownload const): * UIProcess/SystemPreviewController.cpp: New API. (WebKit::SystemPreviewController::canPreview const): (WebKit::SystemPreviewController::sendPageBack): Deleted. (WebKit::SystemPreviewController::showPreview): Deleted. * UIProcess/SystemPreviewController.h: * UIProcess/WebPageProxy.cpp: (WebKit::m_configurationPreferenceValues): (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: 2018-05-14 Brady Eidson Add an API test to guard against regressions while re-entering setDefersLoading:. and https://bugs.webkit.org/show_bug.cgi?id=185630 Reviewed by Chris Dumez. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setDefersLoadingForTesting:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setDefersLoadingForTesting): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.messages.in: 2018-05-14 Tim Horton Use the system font by default in extra zoom mode https://bugs.webkit.org/show_bug.cgi?id=185638 Reviewed by Wenson Hsieh. * Shared/WebPreferencesDefaultValues.h: 2018-05-14 Michael Catanzaro Unreviewed, rolling out r231755. Change is not correct Reverted changeset: "-Wmemset-elt-size warning in LibWebRTCSocket constructor" https://bugs.webkit.org/show_bug.cgi?id=185555 https://trac.webkit.org/changeset/231755 2018-05-14 Wenson Hsieh [Extra zoom mode] Google search results are excessively zoomed in https://bugs.webkit.org/show_bug.cgi?id=185347 Reviewed by Tim Horton. Adds a new experimental feature for the "disabled-adaptations" meta tag, and adds plumbing in WebKit to propagate disabled adaptation changes to the ViewportConfiguration. The experimental feature is on by default in extra zoom mode. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::dispatchDisabledAdaptationsDidChange const): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::disabledAdaptationsDidChange): * WebProcess/WebPage/WebPage.h: 2018-05-14 Chris Dumez Overly aggressive timer throttling in service workers https://bugs.webkit.org/show_bug.cgi?id=185575 Reviewed by Geoff Garen. After ~30 seconds, the system would put the service worker process in "App Nap", causing its timers to get aggressively throttled. This happens because the service worker processes are WebProcesses that have no visible WebPages. To address the issue, we now disable process suppression for all service worker processes. This causes those processes to construct a UserActivity which prevents App Nap. This patch also refactors the code a bit to avoid duplication. The ProcessSuppression suppression logic in now all on ChildProcessProxy / ChildProcess. * NetworkProcess/NetworkProcess.messages.in: * PluginProcess/PluginProcess.messages.in: * Shared/ChildProcess.messages.in: * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::setProcessSuppressionEnabled): * UIProcess/ChildProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/mac/NetworkProcessProxyMac.mm: Removed. * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::didFinishLaunching): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebProcess.messages.in: 2018-05-14 Andy Estes [Wi-Fi Assertions] Allow clients to specify a context identifier https://bugs.webkit.org/show_bug.cgi?id=185620 Reviewed by Brady Eidson. Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a context identifier. * 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/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration wirelessContextIdentifier]): (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2018-05-11 Brian Burg Web Automation: Automation.getBrowsingContext returns window origin that differs from window.screenX/Y https://bugs.webkit.org/show_bug.cgi?id=185571 Reviewed by Timothy Hatcher. This code path was refactored to use completion handlers. It seems that the window.screenX/Y code path converts back to user coordinates but the WebDriver code path does not. Make them consistent since that is how it is spec'd and tested. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::getWindowFrameWithCallback): Convert the window frame to user coordinate space so it's the same as window.screenY. 2018-05-14 Brian Burg WebDriver: W3C test case actions/key.py::test_lone_keyup_sends_no_events is failing https://bugs.webkit.org/show_bug.cgi?id=185577 Reviewed by Timothy Hatcher. This test is failing because it expects Release Actions to not emit any events if nothing has changed from the initial state. Because the two code paths for creating empty states don't actually produce the same empty state, a difference in location was detected between the two empty states. This generates a mousemove. To fix this, unify the code that creates an empty state. For mouse input sources, always initialize the location to (0, 0) so that the mouse input source always has a location that is valid to click at. * UIProcess/Automation/SimulatedInputDispatcher.h: Extract the type enum out of the class to avoid circular definitions of SimulatedInputSource and SimulatedInputSourceState. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputSourceState::emptyStateForSourceType): Take the input source type when generating an empty state. We always want location set for a mouse input source, but not set it for other input sources like keys. (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): (WebKit::SimulatedInputSource::create): (WebKit::SimulatedInputSource::SimulatedInputSource): (WebKit::SimulatedInputSourceState::emptyState): Deleted. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::WebAutomationSession): (WebKit::WebAutomationSession::inputSourceForType const): (WebKit::simulatedInputSourceTypeFromProtocolSourceType): (WebKit::WebAutomationSession::performInteractionSequence): * UIProcess/Automation/WebAutomationSession.h: 2018-05-14 Michael Catanzaro -Wmemset-elt-size warning in LibWebRTCSocket constructor https://bugs.webkit.org/show_bug.cgi?id=185555 Reviewed by Youenn Fablet. Add missing multiplication. * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::LibWebRTCSocket::LibWebRTCSocket): 2018-05-14 Zan Dobersek [GTK] REGRESSION(r231170) Build broken with Clang 5.0 https://bugs.webkit.org/show_bug.cgi?id=185198 Reviewed by Michael Catanzaro. * Shared/RTCNetwork.h: With std::optional forward declaration gone, explicitly include the WTF Optional.h header. 2018-05-13 Dean Jackson WebKit2_Sim-7606.1.17.4 introduced dep cycle https://bugs.webkit.org/show_bug.cgi?id=185588 Reviewed by Tim Horton. Soft link AssetViewer.framework to avoid a dependency cycle. * Configurations/WebKit.xcconfig: * UIProcess/ios/WKSystemPreviewView.mm: (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): 2018-05-11 Daniel Bates X-Frame-Options: SAMEORIGIN needs to check all ancestor frames https://bugs.webkit.org/show_bug.cgi?id=185567 Reviewed by Brent Fulgham. Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames are same-origin with the document that delivered this header. This prevents an intermediary malicious frame from clickjacking a child frame whose document is same-origin with the top- level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match the behavior of X-Frame-Options in other browsers, including Chrome and Firefox. Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin with the top-level frame's document in order to be displayed. This prevents clickjacking by a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However, it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim) if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a document same origin with the victim page. We should protect against such attacks. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): 2018-05-11 Dean Jackson WKWebViewContentProvider should know what MIME type it was created to handle https://bugs.webkit.org/show_bug.cgi?id=185574 Reviewed by Tim Horton. Pass the MIME type of the downloaded asset into the WKWebViewContentProvider's init method, so it can choose to do something based on that information. The PDF and LegacyPDF views don't care because they, clearly, only handle PDF. But a WKSystemPreviewView can handle multiple types. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Send the MIME type on to the WKWebViewContentProvider. * UIProcess/Cocoa/WKWebViewContentProvider.h: Add a new parameter to web_initWithFrame. * UIProcess/ios/WKLegacyPDFView.mm: (-[WKLegacyPDFView web_initWithFrame:webView:mimeType:]): (-[WKLegacyPDFView web_initWithFrame:webView:]): Deleted. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView web_initWithFrame:webView:mimeType:]): (-[WKPDFView web_initWithFrame:webView:]): Deleted. * UIProcess/ios/WKSystemPreviewView.mm: (-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]): (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Actually use the MIME type to tell QuickLook what it will be getting, rather than basing it on the file extension. (-[WKSystemPreviewView web_initWithFrame:webView:]): Deleted. 2018-05-11 Brent Fulgham Allow the WebContent process to read global ViewBridge preferences https://bugs.webkit.org/show_bug.cgi?id=185569 Reviewed by Eric Carlson. Allow reads of the global /Library/Preferences/com.apple.ViewBridge.plist preference file. * WebProcess/com.apple.WebProcess.sb.in: 2018-05-11 Megan Gardner Cleanup canPerformActionForWebView in relation to the webSelectionAssistant being removed https://bugs.webkit.org/show_bug.cgi?id=185536 Reviewed by Tim Horton. The _webSelectionAssistant is now always nil, therefor many of these checks are unnecessary. Remove the check for a webSelection and clean up the logic surrounding those checks. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): 2018-05-11 Brady Eidson Followup to: Make sure history navigations reuse the existing process when necessary. https://bugs.webkit.org/show_bug.cgi?id=185532 Reviewed by Andy Estes. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): When re-using the same process, don't change the policy action. 2018-05-11 Charles Vazac Runtime feature flag for Server-Timing https://bugs.webkit.org/show_bug.cgi?id=184758 Reviewed by Youenn Fablet. * Shared/WebPreferences.yaml: Added ServerTimingEnabled. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesGetServerTimingEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: WK_EXPORT for WKPreferencesSetServerTimingEnabled. * WebProcess/Storage/WebSWContextManagerConnection.cpp: Call setServerTimingEnabled. 2018-05-11 Antti Koivisto Network process should not stat() all cache files on startup to find their sizes https://bugs.webkit.org/show_bug.cgi?id=185542 Reviewed by Chris Dumez. This is done to compute how much disk space a cache is using. While the operation happens in a background priority thread it is still quite a bit of work. Large bodies are saved in separate blob files so record file sizes are capped. We can avoid work by estimating their size instead of counting it exactly. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::estimateRecordsSize): (WebKit::NetworkCache::Storage::synchronize): Use size estimation if blob storage is in use. Remove the code that would delete empty files. Normal cache shrinking handles this. (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob): 2018-05-11 Brady Eidson Make sure history navigations reuse the existing process when necessary. and https://bugs.webkit.org/show_bug.cgi?id=185532 Reviewed by Ryosuke Niwa. If a view navigates to either a data: or blob: URL, it reuses the existing process. In such cases we need to also ensure that history navigations back will also reuse the existing process. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode const): (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: * UIProcess/API/APINavigation.h: (API::Navigation::setTargetItem): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration pageCacheEnabled]): (-[_WKProcessPoolConfiguration setPageCacheEnabled:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): If the current and target back/forward items both came from the same process, then reuse the existing process. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2018-05-10 Brent Fulgham REGRESSION(r231057): Encrypted media content playback failures https://bugs.webkit.org/show_bug.cgi?id=185537 Reviewed by Eric Carlson. Put access to the SecurityServer back in the sandbox so we can validate the signatures of media encoder/decoders. * WebProcess/com.apple.WebProcess.sb.in: 2018-05-11 Youenn Fablet NetworkCORSPreflightChecker should proceed when having a ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested challenge https://bugs.webkit.org/show_bug.cgi?id=185522 Reviewed by Brent Fulgham. In case of such challenge, refuse to proceed with authentication since preflight is not using credentials. Previously, we were failing right away which is not right in case preflight is the request triggering the connection. Manually tested. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge): 2018-05-10 Daniel Bates Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options https://bugs.webkit.org/show_bug.cgi?id=185412 Reviewed by Ryosuke Niwa. Update code for renaming and write in terms of WebLoaderStrategy::shouldPerformSecurityChecks() instead of explicitly querying RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess(). * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::preconnectTo): (WebKit::WebLoaderStrategy::shouldPerformSecurityChecks const): (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const): (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const): Deleted. * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebPage.cpp: 2018-05-10 Timothy Horton Fix the build after r231393 ​https://bugs.webkit.org/show_bug.cgi?id=185519 * Configurations/WebKit.xcconfig: 2018-05-10 John Wilander Storage Access API: Extend lifetime of cookies on successful user approval https://bugs.webkit.org/show_bug.cgi?id=185534 Reviewed by Brent Fulgham. * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded): Picks up the experimental feature flag. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal): Now updates the domain's user interaction timestamp if the user was prompted for this access. * UIProcess/WebResourceLoadStatisticsStore.h: 2018-05-10 Chris Dumez [iOS] Release page load process assertion if the screen is locked https://bugs.webkit.org/show_bug.cgi?id=185333 Reviewed by Geoff Garen. We normally take a background process assertion during page loads to allow them to complete even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding is caused by the screen locking. Keeping the process assertion in this case would prevent the whole device from sleeping longer than it should, thus negatively impacting power. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationState): (WebKit::NavigationState::releaseNetworkActivityToken): (WebKit::NavigationState::didChangeIsLoading): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationDidEnterBackground): 2018-05-10 Megan Gardner Remove Unused Chinese/Japanese Reanalyze code https://bugs.webkit.org/show_bug.cgi?id=185529 Reviewed by Wenson Hsieh. The code for this has actually been completely removed from UIKit. This is unreachable dead code that should be removed if just for cleanliness. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView _reanalyzeForWebView:]): Deleted. 2018-05-10 Chris Dumez [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background https://bugs.webkit.org/show_bug.cgi?id=185318 Reviewed by Geoffrey Garen. Whenever there is a page load going on, we take a background process assertion to delay process suspension until this load completes. However, there is also a 3 seconds grace period after a load is complete to allow the app to trigger a new load shortly after. This grace period was introduced to support use cases where a visible app does loads in an offscreen view. However, it can be abused by apps running in the background as they could trigger new page loads while in the background to delay process suspension. This patch tightens the policy so that only apps that are currently visible get to use this grace period. Apps that are in the background get to finish their current load and will then get suspended. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::didChangeIsLoading): 2018-05-10 Chris Dumez 'Cross-Origin-Options header implementation follow-up https://bugs.webkit.org/show_bug.cgi?id=185520 Reviewed by Ryosuke Niwa. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::frameBecameRemote): 2018-05-10 Per Arne Vollan Drop-down Control borders missing. https://bugs.webkit.org/show_bug.cgi?id=185500 Reviewed by Brent Fulgham. Open sandbox for reading of some files in temp folder. * WebProcess/com.apple.WebProcess.sb.in: 2018-05-10 Eric Carlson [MediaStream, iOS] Don't check authorizationStatusForMediaType when using mock capture devices https://bugs.webkit.org/show_bug.cgi?id=185516 Reviewed by Youenn Fablet. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Don't check +[AVCaptureDevice authorizationStatusForMediaType:] when using mock capture devices. 2018-05-10 Brent Fulgham REGRESSION(r230323): UIProcess needs to notify WebContent process of Accessibility setting changes https://bugs.webkit.org/show_bug.cgi?id=185515 Reviewed by Chris Fleizach. The UIProcess needs to register for relevant Accessibility preference updates so that it can notify the WebContent processes that screen properties have changed. This is represented by NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification. Tested manually with the Accessibility preferences pane. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::registerNotificationObservers): Add notification observer. When the notification is received, call 'screenPropertiesStateChanged' to message the information to the WebContent processes. (WebKit::WebProcessPool::unregisterNotificationObservers): Clean up observer. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::screenPropertiesStateChanged): Added helper function. * UIProcess/WebProcessPool.h: 2018-05-09 Carlos Garcia Campos WebDriver: implement advance user interactions https://bugs.webkit.org/show_bug.cgi?id=174616 Reviewed by Brian Burg. Handle origin in case of mouse move transitions. * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the node in the current browsing context. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location. (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current location and mouse move origin. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions. (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID. (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with viewportInViewCenterPointOfElement() callbacks. (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd or even number. (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks. (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle. (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSessionMacros.h: 2018-05-09 Tim Horton Remove the unused HAVE_OS_ACTIVITY https://bugs.webkit.org/show_bug.cgi?id=185501 Reviewed by Wenson Hsieh. * config.h: 2018-05-09 Chris Dumez Add initial support for 'Cross-Origin-Options' HTTP response header https://bugs.webkit.org/show_bug.cgi?id=184996 Reviewed by Geoff Garen. * Shared/WebPreferences.yaml: Add this as an experimental feature, on by default. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::frameBecameRemote): Make sure we pass the cross-origin options from the local Window to the remote one when transitioning. 2018-05-09 Wenson Hsieh [Extra zoom mode] fast/viewport/extrazoom/viewport-change-min-device-width.html sometimes fails https://bugs.webkit.org/show_bug.cgi?id=185490 Reviewed by Tim Horton. This test is currently flaky due to incorrect logic when computing the unobscured content rect, in the slice of time after a frame load has been committed, and before the first visible content rect update from the UI process after the frame load has been committed. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportConfigurationChanged): In the case where !m_hasReceivedVisibleContentRectsAfterDidCommitLoad, we try to set the unobscured content size to be the view size divided by the initial scale. However, in extra zoom mode, `ViewportConfiguration`'s `minimumLayoutSize()` is the layout size, which is larger than the size of the view by default, so dividing this by the initial scale yields a bogus value. Instead, use `viewLayoutSize()` instead. (WebKit::WebPage::updateViewportSizeForCSSViewportUnits): We also try to divide the view size by the initial scale when computing the effective viewport size for `vw` and `vh`. Additionally, fix the misleading name of a variable (largestUnobscuredRect) that stores a size. 2018-05-09 Brent Fulgham Restrict unarchiving of bundle parameters to a set of known classes https://bugs.webkit.org/show_bug.cgi?id=185489 Reviewed by Ryosuke Niwa. Stop accepting anything derived from NSObject, and instead only agree to unarchive objects from a set of things we actually pass as InjectedBundle parameters. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::setBundleParameter): 2018-05-09 Richard Houle [Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField] https://bugs.webkit.org/show_bug.cgi?id=185260 INPUT element are not considered to be text fields when calling -[WKWebProcessPlugInNodeHandle isTextField] when they are of type number. Reviewed by Tim Horton. * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::isTextField const): 2018-05-09 Youenn Fablet Allow WebResourceLoader to cancel a load served from a service worker https://bugs.webkit.org/show_bug.cgi?id=185274 Reviewed by Chris Dumez. Use FetchIdentifier instead of uint64_t. Add IPC support for cancelling a fetch from WebProcess to service worker process. Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled. No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed. A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load or to abort reading the readable stream. * Scripts/webkit/messages.py: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::cancelFetch): (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::didReceiveFetchResponse): (WebKit::WebSWServerConnection::didReceiveFetchData): (WebKit::WebSWServerConnection::didReceiveFetchFormData): (WebKit::WebSWServerConnection::didFinishFetch): (WebKit::WebSWServerConnection::didFailFetch): (WebKit::WebSWServerConnection::didNotHandleFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didFailFetch): (WebKit::StorageProcess::didNotHandleFetch): (WebKit::StorageProcess::didReceiveFetchResponse): (WebKit::StorageProcess::didReceiveFetchData): (WebKit::StorageProcess::didReceiveFetchFormData): (WebKit::StorageProcess::didFinishFetch): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::remove): * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::create): (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch): (WebKit::ServiceWorkerClientFetch::start): (WebKit::ServiceWorkerClientFetch::cancel): * WebProcess/Storage/ServiceWorkerClientFetch.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): (WebKit::WebSWClientConnection::cancelFetch): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::cancelFetch): (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient): (WebKit::WebServiceWorkerFetchTaskClient::cancel): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): (WebKit::WebServiceWorkerProvider::cancelFetch): (WebKit::WebServiceWorkerProvider::fetchFinished): * WebProcess/Storage/WebServiceWorkerProvider.h: 2018-05-09 Andy Estes [iOS] Consider the annotation bounds when positioning action sheets near long-pressed PDF links https://bugs.webkit.org/show_bug.cgi?id=185472 Reviewed by Daniel Bates. Adopted new PDFHostViewControllerDelegate methods that include annotation rects when URLs and page indices are long-pressed. This allows us to avoid obscuring annotations when positioning action sheet popovers. We also no longer need to convert the press location into host view coordinate space, as PDFKit now does that for us. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]): (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:withAnnotationRect:]): (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:withAnnotationRect:]): (-[WKPDFView _showActionSheetForURL:atLocation:]): Deleted. (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]): Deleted. (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]): Deleted. 2018-05-09 Andy Estes [iOS] Tell PDFHostViewController when animated resizes begin and end https://bugs.webkit.org/show_bug.cgi?id=185477 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): * UIProcess/Cocoa/WKWebViewContentProvider.h: * UIProcess/ios/WKPDFView.mm: (-[WKPDFView web_beginAnimatedResize]): (-[WKPDFView web_endAnimatedResize]): 2018-05-09 Michael Catanzaro Unreviewed. Update OptionsWPE.cmake and NEWS for 2.21.1 release. * wpe/NEWS: Added. Add release notes for 2.21.1. 2018-05-09 Michael Catanzaro [WPE] Build cleanly with GCC 8 and ICU 60 https://bugs.webkit.org/show_bug.cgi?id=185462 Reviewed by Carlos Alberto Lopez Perez. * Platform/IPC/glib/GSocketMonitor.cpp: (IPC::GSocketMonitor::start): Silence -Wcast-function-type warning. * Shared/API/glib/WebKitContextMenu.cpp: (webkit_context_menu_new_with_items): Ditto. 2018-05-08 Sihui Liu Adopt new async _savecookies SPI for keeping networking process active during flushing cookies https://bugs.webkit.org/show_bug.cgi?id=185261 Reviewed by Chris Dumez. By adopting new async SPI _savecookies, we can keep networking process active(not suspended) until cookies are fully synced to disk with process assertion. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didSyncAllCookies): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didClose): (WebKit::NetworkProcessProxy::syncAllCookies): (WebKit::NetworkProcessProxy::didSyncAllCookies): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::syncNetworkProcessCookies): 2018-05-08 Per Arne Vollan Set colorspace in the PDF plugin. https://bugs.webkit.org/show_bug.cgi?id=185445 Reviewed by Simon Fraser. * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::PDFPlugin): 2018-05-08 Megan Gardner Don't clear selection until we are actually interacting with a Node. https://bugs.webkit.org/show_bug.cgi?id=185455 Reviewed by Wenson Hsieh. The presence of TextInteractionAssistant should not be used as a proxy for it we are actually editing content. We need to check to see if we have an active node, and then we should clear the selection. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setSelectedTextRange:]): 2018-05-08 Ryan Haddad Unreviewed, rolling out r231486. Caused service worker LayoutTest failures on macOS Debug WK2. Reverted changeset: "Allow WebResourceLoader to cancel a load served from a service worker" https://bugs.webkit.org/show_bug.cgi?id=185274 https://trac.webkit.org/changeset/231486 2018-05-08 Andy Estes [iOS] _WKWebViewPrintFormatter should return a page count of 0 for PDF documents that do not allow printing https://bugs.webkit.org/show_bug.cgi?id=185133 Reviewed by Andreas Kling. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _ensureDocumentForPrinting]): (-[WKPDFView _wk_pageCountForPrintFormatter:]): (-[WKPDFView _wk_printedDocument]): 2018-05-08 Andy Estes [iOS] WKPDFView remains in the view hierarchy after navigating away https://bugs.webkit.org/show_bug.cgi?id=185449 Reviewed by Tim Horton. WKPDFView removes the PDF host view from the view hierarchy in its -dealloc method, and relies on WKWebView releasing its last reference in -_setHasCustomContentView:loadedMIMEType: when the user navigates. However, WKWPDFView was capturing a strong reference to self in the block passed to +[PDFHostViewController createHostView:forExtensionIdentifier:], and PDFKit (actually UIKit) is retaining this block beyond its being called. This results in the PDF host view remaining as a child of the WKScrollView even after the user navigates to another page. Changed the aforementioned block to a lambda that captures a weak reference to self to prevent WKPDFView from outliving the current navigation. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView retain]): (-[WKPDFView web_setContentProviderData:suggestedFilename:]): 2018-05-08 John Wilander Storage Access API: Make user opt-in sticky https://bugs.webkit.org/show_bug.cgi?id=185454 Reviewed by Alex Christensen. This patch persists the user's choice to opt-in to access under specific domains. Such storage access should age out with the accessing domain's cookies and website data. The opt-in prompt is still an experimental feature. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener): (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal): (WebKit::WebResourceLoadStatisticsStore::hasUserGrantedStorageAccessThroughPrompt const): (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction const): * UIProcess/WebResourceLoadStatisticsStore.h: 2018-05-08 Daniel Bates Do not apply X-Frame-Options and CSP frame-ancestors to Quick Look-applicable responses in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=185442 Reviewed by Andy Estes. Just as we exempt responses in WebContent process that will be handled by Quick Look from the Content Security Policy frame-ancestors directive and X-Frame-Options checking we need to do the same when such checks are performed in NetworkProcess following r231479. HTTP responses that will be previewed using Quick Look are not considered web pages and are subject to the security model for Quick Look documents. That is, they are exempt from Content Security Policy and X-Frame-Options processing. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions): 2018-05-08 Brian Burg REGRESSION(r230743): Mousemove events are not coalesced properly, mousemove/drag is very laggy https://bugs.webkit.org/show_bug.cgi?id=185425 Reviewed by Simon Fraser. When mousemove events come in faster than they can be processed, we should coalesce pending mousemoves that have not yet been sent to WebProcess. This has the effect of processing the most recent mousemove location, which is the old behavior that regressed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleMouseEvent): If there is >1 event in the mouse queue, then the first one is being processed by WebProcess and the second one is eligible for coalescing. Replace it if the last event and new event are both mousemoves. 2018-05-08 Per Arne Vollan The PDF context menu should not be created in the WebContent process. https://bugs.webkit.org/show_bug.cgi?id=185401 Reviewed by Tim Horton. Send a sync IPC message from the WebContent process to the UI process with the necessary context menu information when the menu is requested. The NSMenu will then be created and shown in the UI process. The reply will contain the selected menu item index. * Shared/mac/PDFContextMenu.h: Added. (WebKit::PDFContextMenuItem::encode const): (WebKit::PDFContextMenuItem::decode): (WebKit::PDFContextMenu::encode const): (WebKit::PDFContextMenu::decode): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WebPageProxyMac.mm: (-[WKPDFMenuTarget menuItem]): (-[WKPDFMenuTarget contextMenuAction:]): (WebKit::WebPageProxy::showPDFContextMenu): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::handleContextMenuEvent): 2018-05-08 Dean Jackson System Preview links should trigger a download https://bugs.webkit.org/show_bug.cgi?id=185439 Reviewed by Jon Lee. Encode the new field identifying a system preview. And if you encounter such a resource request, trigger a download. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): 2018-05-08 John Wilander Storage Access API: Add a request roundtrip to check whether prompting is needed https://bugs.webkit.org/show_bug.cgi?id=185368 Reviewed by Alex Christensen and Youenn Fablet. This patch adds an enum WebKit::StorageAccessStatus to handle our three access states: - WebKit::StorageAccessStatus::CannotRequestAccess. This means the domain is blocked from cookie access. - WebKit::StorageAccessStatus::RequiresUserPrompt. This means that access has not been granted yet and a prompt is required. - WebKit::StorageAccessStatus::HasAccess. This either means that this domain does not need to ask for access, access was already granted, or access was granted now. If the call to WebResourceLoadStatisticsStore::requestStorageAccess() comes back as WebKit::StorageAccessStatus::RequiresUserPrompt, the WebPageProxy prompts the user and if the user said yes, calls a direct WebResourceLoadStatisticsStore::grantStorageAccess(). Existing test cases pass because requestStorageAccessConfirm in WKPage.cpp does not have m_client.requestStorageAccessConfirm and thus returns true. * UIProcess/Network/NetworkProcessProxy.messages.in: Added a missing #endif. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestStorageAccess): Here we now handle the various cases encoded in WebKit::StorageAccessStatus. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Now covers the optional prompt case. (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener): (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal): Granting access is broken out to allow WebKit::WebPageProxy to call it directly. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::requestStorageAccess): (WebKit::WebsiteDataStore::grantStorageAccess): Piping through calls from from WebKit::WebResourceLoadStatisticsStore to WebKit::WebPageProxy. * UIProcess/WebsiteData/WebsiteDataStore.h: 2018-05-08 Chris Dumez Unreviewed, rolling out r231376 and r231458. Caused some API tests failures on iOS Reverted changesets: "[iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background" https://bugs.webkit.org/show_bug.cgi?id=185318 https://trac.webkit.org/changeset/231376 "[iOS] Release page load process assertion if the screen is locked" https://bugs.webkit.org/show_bug.cgi?id=185333 https://trac.webkit.org/changeset/231458 2018-05-08 Dean Jackson Use thumbnails in System Previews https://bugs.webkit.org/show_bug.cgi?id=185397 Reviewed by Jon Lee. A system preview that goes through the WKWebViewContentProvider will show a static thumbnail/snapshot of the item, rather than jumping directly to QuickLook. This means we have to link to the AssetViewer framework. That provides a ASVThumbnailView that will trigger QuickLook for us. * Configurations/WebKit.xcconfig: Link to AssetViewer. * UIProcess/ios/WKSystemPreviewView.h: Better macro use. Remove some unneeded protocols. * UIProcess/ios/WKSystemPreviewView.mm: (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Update this to use an ASVThumbnailView, when on the internal SDK (because it is private). (-[WKSystemPreviewView _layoutThumbnailView]): Use the content insets to put the thumbnail in the right place. (-[WKSystemPreviewView thumbnailView:wantsToPresentPreviewController:forItem:]): Delegate method. (-[WKSystemPreviewView web_contentView]): (-[WKSystemPreviewView web_computedContentInsetDidChange]): (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): Deleted. (-[WKSystemPreviewView previewController:previewItemAtIndex:]): Deleted. (-[WKSystemPreviewView previewControllerWillDismiss:]): Deleted. 2018-05-08 Youenn Fablet Allow WebResourceLoader to cancel a load served from a service worker https://bugs.webkit.org/show_bug.cgi?id=185274 Reviewed by Chris Dumez. Use FetchIdentifier instead of uint64_t. Add IPC support for cancelling a fetch from WebProcess to service worker process. Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled. No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed. A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load or to abort reading the readable stream. * Scripts/webkit/messages.py: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::cancelFetch): (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::didReceiveFetchResponse): (WebKit::WebSWServerConnection::didReceiveFetchData): (WebKit::WebSWServerConnection::didReceiveFetchFormData): (WebKit::WebSWServerConnection::didFinishFetch): (WebKit::WebSWServerConnection::didFailFetch): (WebKit::WebSWServerConnection::didNotHandleFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didFailFetch): (WebKit::StorageProcess::didNotHandleFetch): (WebKit::StorageProcess::didReceiveFetchResponse): (WebKit::StorageProcess::didReceiveFetchData): (WebKit::StorageProcess::didReceiveFetchFormData): (WebKit::StorageProcess::didFinishFetch): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::remove): * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::create): (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch): (WebKit::ServiceWorkerClientFetch::start): (WebKit::ServiceWorkerClientFetch::cancel): * WebProcess/Storage/ServiceWorkerClientFetch.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): (WebKit::WebSWClientConnection::cancelFetch): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::cancelFetch): (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient): (WebKit::WebServiceWorkerFetchTaskClient::cancel): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): (WebKit::WebServiceWorkerProvider::cancelFetch): (WebKit::WebServiceWorkerProvider::fetchFinished): * WebProcess/Storage/WebServiceWorkerProvider.h: 2018-05-08 Antti Koivisto Don't use mapped cache files in case of Class A/B protected app https://bugs.webkit.org/show_bug.cgi?id=185422 Reviewed by Chris Dumez. Currently we don't use shared memory maps in these cases. This still leaves us open for crashes in the network process when the device is locked. This patch disables use of blob storage (mapped cache files) in apps that use class A/B protection. Normally we use blobs for resources > 16KB. Since use of shared memory is already disabled, the only optimization lost for these apps is body data deduplication. Any existing cache entries with blobs are ignored and deleted. New entries are created with body data inlined with the metadata. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::store): * NetworkProcess/cache/NetworkCache.h: (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData const): Deleted. * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const): Remove the code the prevented use of shared memory in these cases. Non-mapped Data objects are never shareable. (WebKit::NetworkCache::Entry::setNeedsValidation): * NetworkProcess/cache/NetworkCacheFileSystem.cpp: (WebKit::NetworkCache::isSafeToUseMemoryMapForPath): (WebKit::NetworkCache::canUseSharedMemoryForPath): Deleted. * NetworkProcess/cache/NetworkCacheFileSystem.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::mayContainBlob const): (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob): (WebKit::NetworkCache::shouldStoreBodyAsBlob): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData const): Deleted. 2018-05-07 Carlos Garcia Campos Unreviewed. Add missing exit not included in r231298. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureWebToStorageProcessConnection): 2018-05-07 Daniel Bates Check X-Frame-Options and CSP frame-ancestors in network process https://bugs.webkit.org/show_bug.cgi?id=185410 Reviewed by Ryosuke Niwa. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): Always encode the frame ancestor origins. (WebKit::NetworkResourceLoadParameters::decode): Always decode the frame ancestor origins. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Added. (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions): Added. (WebKit::NetworkResourceLoader::didReceiveResponse): Check if the load needs to be interrupted due to a violation of the CSP frame-ancestors directive or X-Frame-Options. If there is a violation then stop the load. (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Ditto. (NetworkResourceLoader::addConsoleMessage): Added. (NetworkResourceLoader::sendCSPViolationReport): Added. * NetworkProcess/NetworkResourceLoader.h: * Scripts/webkit/messages.py: Teach the generator about data types MessageLevel and MessageSource as they are both defined in file JavaScriptCore/ConsoleTypes.h as opposed to independent headers. Also tell the generator that these types should not be forward declared so that we can use these types without their JSC:: prefix in WebPage.messages.in. * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): Route WebPage messages to the appropriate web page. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Added message StopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): Added. * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::addConsoleMessage): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addConsoleMessage): Added. (WebKit::WebPage::sendCSPViolationReport): Added. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add messages AddConsoleMessage and SendCSPViolationReport for adding a console message to Web Inspector and sending a CSP report, respectively. 2018-05-07 Daniel Bates Abstract logic to log console messages and send CSP violation reports into a client https://bugs.webkit.org/show_bug.cgi?id=185393 Reviewed by Brent Fulgham. For now, build a URL from the source origin associated with the NetworkResourceLoader and pass this to the ContentSecurityPolicy constructor. Additionally, make NetworkLoadChecker::contentSecurityPolicy() non-const since it returns a non-const pointer to a ContentSecurityPolicy object; => callers can mutate this object right from under NetworkLoadChecker. Making this non-const makes this clear to a reader. Also remove the mutable keyword from the definition of NetworkLoadChecker::m_contentSecurityPolicy. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::contentSecurityPolicy): (WebKit::NetworkLoadChecker::contentSecurityPolicy const): Deleted. * NetworkProcess/NetworkLoadChecker.h: 2018-05-07 Alex Christensen WebResourceLoadStatisticsStore::requestStorageAccess should call its completion handler on the main thread https://bugs.webkit.org/show_bug.cgi?id=185403 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): 2018-05-07 Chris Dumez [iOS] Release page load process assertion if the screen is locked https://bugs.webkit.org/show_bug.cgi?id=185333 Reviewed by Geoffrey Garen. We normally take a background process assertion during page loads to allow them to complete even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding is caused by the screen locking. Keeping the process assertion in this case would prevent the whole device from sleeping longer than it should, thus negatively impacting power. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationState): (WebKit::NavigationState::releaseNetworkActivityToken): (WebKit::NavigationState::didChangeIsLoading): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationDidEnterBackground): 2018-05-07 Brent Fulgham Add experimental feature to prompt for Storage Access API use https://bugs.webkit.org/show_bug.cgi?id=185335 Reviewed by Alex Christensen and Youenn Fablet. Create a new experimental feature that gates the ability of WebKit clients to prompt the user when Storage Access API is invoked. Currently this feature doesn't have any user-visible impact. * Shared/API/APIObject.h: * Shared/API/c/WKBase.h: * Shared/WebPreferences.yaml: * UIProcess/API/APIUIClient.h: (API::UIClient::requestStorageAccessConfirm): * UIProcess/API/C/WKPage.cpp: (WebKit::RequestStorageAccessConfirmResultListener::create): (WebKit::RequestStorageAccessConfirmResultListener::~RequestStorageAccessConfirmResultListener): (WebKit::RequestStorageAccessConfirmResultListener::call): (WebKit::RequestStorageAccessConfirmResultListener::RequestStorageAccessConfirmResultListener): (WKPageRequestStorageAccessConfirmResultListenerGetTypeID): (WKPageRequestStorageAccessConfirmResultListenerCall): (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _storageAccessPromptsEnabled]): (-[WKPreferences _setStorageAccessPromptsEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestStorageAccessConfirm): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::update): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestStorageAccess): 2018-05-07 Dean Jackson Use a dark gray for system preview bbackground https://bugs.webkit.org/show_bug.cgi?id=185391 Reviewed by Eric Carlson. Throw some darker shade at this view. * UIProcess/ios/WKSystemPreviewView.mm: (-[WKSystemPreviewView web_initWithFrame:webView:]): 2018-05-07 Don Olmstead [Win] Add missing methods to WebChromeClient https://bugs.webkit.org/show_bug.cgi?id=185325 Reviewed by Brent Fulgham. * WebProcess/WebCoreSupport/WebChromeClient.h: 2018-05-07 Megan Gardner Allow Web Touch events to timeout https://bugs.webkit.org/show_bug.cgi?id=185282 Reviewed by Tim Horton. This is backwards, fixing. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleTouchEventSynchronously): 2018-05-07 Don Olmstead [Win] LoggingWin is missing includes https://bugs.webkit.org/show_bug.cgi?id=185326 Reviewed by Per Arne Vollan. * Platform/win/LoggingWin.cpp: 2018-05-07 Daniel Bates CSP should be passed the referrer https://bugs.webkit.org/show_bug.cgi?id=185367 Reviewed by Per Arne Vollan. Pass the referrer through NetworkLoadChecker so that it can pass it to the ContentSecurityPolicy object it instantiates. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): (WebKit::NetworkLoadChecker::contentSecurityPolicy const): * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::create): * NetworkProcess/NetworkResourceLoader.cpp: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): 2018-05-07 Daniel Bates Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty() https://bugs.webkit.org/show_bug.cgi?id=185170 Reviewed by Per Arne Vollan. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::clearResourceCaches): (WebKit::WebProcess::deleteWebsiteData): 2018-05-07 Brian Burg Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected https://bugs.webkit.org/show_bug.cgi?id=184861 Reviewed by Timothy Hatcher. We need to track how many frontends are attached to the web page (both local and remote). InspectorController propagates this out to WebKit via InspectorClient. This is then kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a new process for a navigation, return early with "no" if any frontends are open for the page being navigated. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::didChangeInspectorFrontendCount): (WebKit::WebPageProxy::inspectorFrontendCount const): * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::frontendCountChanged): * WebProcess/WebCoreSupport/WebInspectorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::inspectorFrontendCountChanged): * WebProcess/WebPage/WebPage.h: 2018-05-04 Tim Horton Shift to a lower-level framework for simplifying URLs https://bugs.webkit.org/show_bug.cgi?id=185334 Reviewed by Dan Bernstein. * Configurations/WebKit.xcconfig: * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController _updateLocationInfo]): 2018-05-04 Per Arne Vollan Shutdown WindowServer connections after checking in with launch services https://bugs.webkit.org/show_bug.cgi?id=185082 Reviewed by Brent Fulgham. When WindowServer access is blocked in the WebContent process, we should shutdown all connections after checking in with launch services. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeProcess): 2018-05-04 Don Olmstead [Win][WebKit] Fix forwarding headers for Windows build https://bugs.webkit.org/show_bug.cgi?id=184412 Reviewed by Alex Christensen. * PlatformWin.cmake: * UIProcess/API/APIAttachment.h: * UIProcess/API/APIContextMenuClient.h: * UIProcess/API/C/WKProcessTerminationReason.h: * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: 2018-05-04 Chris Dumez [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background https://bugs.webkit.org/show_bug.cgi?id=185318 Reviewed by Geoffrey Garen. Whenever there is a page load going on, we take a background process assertion to delay process suspension until this load completes. However, there is also a 3 seconds grace period after a load is complete to allow the app to trigger a new load shortly after. This grace period was introduced to support use cases where a visible app does loads in an offscreen view. However, it can be abused by apps running in the background as they could trigger new page loads while in the background to delay process suspension. This patch tightens the policy so that only apps that are currently visible get to use this grace period. Apps that are in the background get to finish their current load and will then get suspended. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::didChangeIsLoading): 2018-05-04 Per Arne Vollan Adjust sandbox profile for simulator. https://bugs.webkit.org/show_bug.cgi?id=185319 Reviewed by Brent Fulgham. Disable Kerberos rules, as well as rules related to NSApplication initialization. * WebProcess/com.apple.WebProcess.sb.in: 2018-05-04 Tim Horton Wasted time dlopening Lookup when tearing down a WKWebView https://bugs.webkit.org/show_bug.cgi?id=185310 Reviewed by Wenson Hsieh. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (-[WKWindowVisibilityObserver dealloc]): (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]): (WebKit::WebViewImpl::prepareForDictionaryLookup): (-[WKWindowVisibilityObserver startObservingLookupDismissal]): Deleted. Avoid un-registering as a Lookup dismissal observer if we never registered in the first place, because that involves dlopening Lookup. 2018-05-04 Megan Gardner Allow Web Touch events to timeout https://bugs.webkit.org/show_bug.cgi?id=185282 Reviewed by Tim Horton. Web Touch events currently never time out, which blocks the user from interacting with the UI Process at all. We should allow these events to time out so that the user can interact with the rest of the UI. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleTouchEventSynchronously): 2018-05-04 Wenson Hsieh REGRESSION: [ios-simulator] 3 WKWebViewAutofillTests API test failures seen with 11.3 SDK https://bugs.webkit.org/show_bug.cgi?id=184196 Reviewed by Tim Horton. Remove an unnecessary call to NSClassFromString, now that trunk WebKit only supports iOS 11.3+. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertTextSuggestion:]): 2018-05-04 Youenn Fablet NetworkProcessProxy::didReceiveAuthenticationChallenge should take an AuthenticationChallenge r-value https://bugs.webkit.org/show_bug.cgi?id=185302 Reviewed by Geoffrey Garen. Pass AuthenticationChallenge as an r-value since it comes from IPC. No change of behavior. * UIProcess/Authentication/AuthenticationChallengeProxy.cpp: (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy): * UIProcess/Authentication/AuthenticationChallengeProxy.h: (WebKit::AuthenticationChallengeProxy::create): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::didReceiveAuthenticationChallenge): * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): * UIProcess/Network/NetworkProcessProxy.h: 2018-05-04 Sihui Liu Assertion failure in NetworkStorageSession::setCookie: privilege of UI process is not set https://bugs.webkit.org/show_bug.cgi?id=185262 Reviewed by Chris Dumez. Fix an assertion failure by setting UI process privileges in constructor of WebsiteDataStore because UI process may use the cookie API before creating a WebView. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): 2018-05-04 Per Arne Vollan Adjust sandbox rules for simulator. https://bugs.webkit.org/show_bug.cgi?id=185275 Reviewed by Brent Fulgham. Enable rules related to CoreMedia for minimal simulator. * WebProcess/com.apple.WebProcess.sb.in: 2018-05-04 Carlos Garcia Campos [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com https://bugs.webkit.org/show_bug.cgi?id=174730 Reviewed by Michael Catanzaro. The problem is that we don't send any User-Agent HTTP header for downloads started by WebProcessPool::download(). * UIProcess/API/glib/WebKitDownload.cpp: (webkitDownloadUpdateRequest): Helper to update the cached request. (webkitDownloadStarted): Updated the cached request if we have one. (webkit_download_get_request): Use webkitDownloadUpdateRequest(). * UIProcess/API/glib/WebKitDownloadClient.cpp: * UIProcess/API/glib/WebKitDownloadPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::download): Set the User-Agent HTTP header if there isn't any. 2018-05-04 Carlos Garcia Campos [GTK] Some event tests failing after r230817 https://bugs.webkit.org/show_bug.cgi?id=185072 Reviewed by Michael Catanzaro. Do not send mouse move events to the WebProcess for crossing events during testing. WTR never generates crossing events and they can confuse tests. Fixes: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html fast/css/user-drag-none.html fast/events/context-activated-by-key-event.html fast/events/drag-selects-image.html fast/events/dropzone-005.html fast/events/mouse-click-events.html fast/events/mouse-cursor-change.html * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseCrossingNotifyEvent): 2018-05-03 Chris Dumez More aggressively terminate child processes when the connection to their parent process is severed https://bugs.webkit.org/show_bug.cgi?id=177972 Reviewed by Geoff Garen. More aggressively terminate child processes when the connection to their parent process is severed. Previously, we would dispatch to the main thread and then exit the process. This would sometimes cause the process to say alive for 10 seconds until our watchdog would forcefully terminate the process. This could happen in particular when the main thread is blocked on a synchronous IPC. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didClose): Deleted. * NetworkProcess/NetworkProcess.h: * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::didClose): Deleted. * PluginProcess/PluginProcess.h: * Shared/ChildProcess.cpp: (WebKit::ChildProcess::didClose): (WebKit::didCloseOnConnectionWorkQueue): (WebKit::ChildProcess::terminationTimerFired): * Shared/ChildProcess.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didClose): Deleted. * StorageProcess/StorageProcess.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didClose): Deleted. * WebProcess/WebProcess.h: 2018-05-03 Yusuke Suzuki Use default std::optional if it is provided https://bugs.webkit.org/show_bug.cgi?id=185159 Reviewed by Michael Catanzaro. * Shared/SandboxExtension.h: (WebKit::SandboxExtension::Handle::decode): * Shared/TouchBarMenuItemData.cpp: (WebKit::TouchBarMenuItemData::decode): 2018-05-03 Justin Fan [WebGL] Add runtime flag for enabling ASTC support in WebGL https://bugs.webkit.org/show_bug.cgi?id=184840 Reviewed by Myles C. Maxfield. Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented. * Shared/WebPreferences.yaml: 2018-05-03 Keith Rollin Unreviewed build fix after . * NetworkProcess/NetworkActivityTracker.h: 2018-05-03 Wenson Hsieh Ads in NYTimes app are shifted downwards by the scroll view's top content inset https://bugs.webkit.org/show_bug.cgi?id=185251 Reviewed by Tim Horton. The NYTimes app embeds advertisements in each article's WKWebView by adding views in the WKScrollView's view hierarchy. These views are positioned using the bounding client rects of elements in the DOM (via Element ::getBoundingClientRect). Prior to r229641, WebKit would report bounding client rects inset by the content insets of WKScrollView, which means that if a top content inset X is specified on the scroll view, an element that is flush against the top of the viewport will have a bounding client rect top of -X (when it should really be 0). To account for this, NYTimes adds the scroll view content insets back to the bounding client rect when determining the position of each advertisement which, after r229641, causes these views to be shifted downwards by an amount equal to the scroll view content inset top. This new behavior does not affect Safari, since Safari uses SPI to explicitly set obscured insets. As such, we address this by gating the scroll view content inset fix with a linked-on-or-after check. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _computedObscuredInset]): * UIProcess/Cocoa/VersionChecks.h: 2018-05-03 Chris Dumez Load hangs if the WebProcess fails to launch https://bugs.webkit.org/show_bug.cgi?id=185225 Reviewed by Geoff Garen. When a process fails to launch, ChildProcessProxy::didFinishLaunching() gets called with an invalid connection identifier. While NetworkProcessProxy::didFinishLaunching() properly deals with this situation, WebProcessProxy::didFinishLaunching() does not. As a result, we do not attempt to relaunch the process, we do not notify the client and WebPageProxy::m_isValid stays true. This patch thus updates WebProcessProxy::didFinishLaunching() to check if the connection identifier is valid and treats it as a crash. As a result, the WebPageProxies properly reset their state and the client gets notified of the crash so that it can attempt to reload. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _makeNextWebProcessLaunchFailForTesting]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): Add SPI to make the next WebProcess launch fail, for the purpose of API testing. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getLaunchOptions): (WebKit::WebProcessProxy::didClose): (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch): (WebKit::WebProcessProxy::didFinishLaunching): * UIProcess/WebProcessProxy.h: 2018-05-03 Commit Queue Unreviewed, rolling out r231223 and r231288. https://bugs.webkit.org/show_bug.cgi?id=185256 The change in r231223 breaks internal builds, and r231288 is a dependent change. (Requested by ryanhaddad on #webkit). Reverted changesets: "Use default std::optional if it is provided" https://bugs.webkit.org/show_bug.cgi?id=185159 https://trac.webkit.org/changeset/231223 "Use pointer instead of std::optional>" https://bugs.webkit.org/show_bug.cgi?id=185186 https://trac.webkit.org/changeset/231288 2018-05-03 Per Arne Vollan An error message is written to stderr when the WebContent process is blocking WindowServer access. https://bugs.webkit.org/show_bug.cgi?id=184701 Reviewed by Brent Fulgham. Calling 'setApplicationIsDaemon(true)' instead of 'CGSSetDenyWindowServerConnections(true)' to disable access to the WindowServer in the WebContent process, will remove this error message. After this change, the url of the WebContent process is still showing up in Activity Monitor, which previously was a problem when calling 'setApplicationIsDaemon(true)'. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeProcess): 2018-05-03 Ryan Haddad Unreviewed, rolling out r231253. The API test added with this change is crashing on the bots. Reverted changeset: "Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected" https://bugs.webkit.org/show_bug.cgi?id=184861 https://trac.webkit.org/changeset/231253 2018-05-03 Brent Fulgham Re-eneable Network Extension support in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=185236 Reviewed by Eric Carlson. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2018-05-03 Tim Horton REGRESSION (r231014): Entitlements are not applied to XPC services on macOS https://bugs.webkit.org/show_bug.cgi?id=185241 Reviewed by Dan Bernstein. * Configurations/BaseXPCService.xcconfig: * Configurations/WebContentService.Development.xcconfig: * Configurations/WebContentService.xcconfig: 2018-05-03 Carlos Garcia Campos REGRESSION(r222772): [GTK][WPE] WebProcess from WebKitGtk+ 2.19.9x SIGSEVs in WebKit::WebProcess::ensureNetworkProcessConnection() at Source/WebKit/WebProcess/WebProcess.cpp:1127 https://bugs.webkit.org/show_bug.cgi?id=183348 Reviewed by Michael Catanzaro. When connection doesn't exit in case of sync message failure, always exit in case of failing to send GetNetworkProcessConnection or GetStorageProcessConnection messages. This can happen when the WebView is created and destroyed quickly. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureNetworkProcessConnection): (WebKit::WebProcess::ensureWebToStorageProcessConnection): 2018-05-02 Nan Wang AX: Missing kAXSWebAccessibilityEventsEnabledNotification causes a crash https://bugs.webkit.org/show_bug.cgi?id=185237 Reviewed by Dan Bernstein. When libAccessibility.dylib is missing, the compiler would optimize out the global notification and lead to a crash. Fixed it by using the isNullFunction check instead, since we are sure the global notification would be there when the corresponding function is available. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): 2018-05-02 Keith Rollin Add facility for tracking times and results of page and resource loading https://bugs.webkit.org/show_bug.cgi?id=184838 Reviewed by Brent Fulgham. Add NetworkActivityTracker. The idea behind this facility is to create and destroy them around networking activity that we want to track for the purpose of measuring overall network health. They can be created around the loading of pages or individual resources, and can be arranged in a parent/child hierarchy to indicate what pages the resources are part of. The NetworkActivity tracker tracks load times and results. On Cocoa, it can be integrated with CFNetwork in order to associate WebKit activity with low-level networking activity. * CMakeLists.txt: * Configurations/WebKit.xcconfig: * NetworkProcess/NetworkActivityTracker.cpp: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h. (WebKit::NetworkActivityTracker::NetworkActivityTracker): (WebKit::NetworkActivityTracker::~NetworkActivityTracker): (WebKit::NetworkActivityTracker::setParent): (WebKit::NetworkActivityTracker::start): (WebKit::NetworkActivityTracker::complete): * NetworkProcess/NetworkActivityTracker.h: Added. (WebKit::NetworkActivityTracker::getPlatformObject): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didClose): (WebKit::NetworkConnectionToWebProcess::pageLoadCompleted): (WebKit::networkActivityTrackingEnabled): (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad): (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad): (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking): (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage): (WebKit::NetworkConnectionToWebProcess::findRootNetworkActivity): (WebKit::NetworkConnectionToWebProcess::findNetworkActivityTracker): * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::ResourceNetworkActivityTracker::ResourceNetworkActivityTracker): * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::trackNetworkActivity const): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::cleanup): (WebKit::NetworkResourceLoader::abort): (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cocoa/NetworkActivityTrackerCocoa.mm: Added. (WebKit::NetworkActivityTracker::NetworkActivityTracker): (WebKit::NetworkActivityTracker::~NetworkActivityTracker): (WebKit::NetworkActivityTracker::setParent): (WebKit::NetworkActivityTracker::start): (WebKit::NetworkActivityTracker::complete): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationTrackNetworkActivity): (WKContextConfigurationSetTrackNetworkActivity): * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration trackNetworkActivity]): (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::pageLoadCompleted): * WebProcess/Network/WebLoaderStrategy.h: 2018-05-02 Jer Noble Open audio/video sandbox services for minimal simulator https://bugs.webkit.org/show_bug.cgi?id=185217 Reviewed by Per Arne Vollan. * WebKit.xcodeproj/project.pbxproj: * WebProcess/com.apple.WebProcess.sb.in: 2018-05-02 Daniel Bates Cleanup NetworkResourceLoader::didReceiveResponse() https://bugs.webkit.org/show_bug.cgi?id=185209 Reviewed by Chris Dumez. Use early returns to make the control flow easier to read and reason about. Disregarding a From-Origin violation, NetworkResourceLoader::didReceiveResponse() only returns NetworkLoadClient::ShouldContinueDidReceiveResponse::No when the load is for a main resource and hence it must wait for the embedding client to allow the load before continuing with it. With regards to a From-Origin violation, the network process schedules to fail the load in a subsequent turn of the event loop before returning NetworkLoadClient::ShouldContinueDidReceiveResponse::No. It return NetworkLoadClient::ShouldContinueDidReceiveResponse::No solely to tell the NetworkLoadClient to defer assuming the load is allowed (because we will fail it on the next turn of the event loop). Additionally, remove all logging about the return value as we no longer have a need for such logging. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): 2018-05-02 Alex Christensen Add WKWebsiteDataStorePrivate._proxyConfiguration SPI https://bugs.webkit.org/show_bug.cgi?id=185179 Reviewed by Andy Estes. * NetworkProcess/NetworkSessionCreationParameters.h: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::privateSessionParameters): * Shared/cf/ArgumentCodersCF.cpp: (IPC::encode): (IPC::decode): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _setProxyConfiguration:]): (-[WKWebsiteDataStore _proxyConfiguration]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::setProxyConfiguration): (WebKit::WebsiteDataStore::proxyConfiguration): 2018-05-02 Youenn Fablet Use NetworkLoadChecker for navigation loads https://bugs.webkit.org/show_bug.cgi?id=184892 Reviewed by Chris Dumez. Compute whether a response is same origin in no-cors case. This allows providing more precise filtering. In case of navigate loads, set the tainting to basic which will make filtering to the minimum. Pass the sourceOrigin for navigation loads as well. Enable to restrict HTTP response access for navigation load. Content Blockers are disabled for now in NetworkLoadChecker for navigation loads. They should be reenabled as a follow-up. Add a specific case to allow any redirection to about:// URLs. While this does not conform with the spec, this keeps the existing WebKit behavior. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): (WebKit::NetworkLoadChecker::validateResponse): (WebKit::NetworkLoadChecker::continueCheckingRequest): (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::sanitizeResponseIfPossible): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const): We only do security checks if this runtime flag is on. * WebProcess/Network/WebLoaderStrategy.h: 2018-05-02 Jer Noble Make EncryptedMediaAPIEnabled an experimental feature https://bugs.webkit.org/show_bug.cgi?id=185212 Reviewed by Eric Carlson. * Shared/WebPreferences.yaml: 2018-05-02 Per Arne Vollan Adjust sandbox profile in simulator mode. https://bugs.webkit.org/show_bug.cgi?id=185172 Reviewed by Brent Fulgham. Fix some sandbox violations. * WebProcess/com.apple.WebProcess.sb.in: 2018-05-02 Brian Burg Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected https://bugs.webkit.org/show_bug.cgi?id=184861 Reviewed by Ryosuke Niwa. We need to track how many frontends are attached to the web page (both local and remote). InspectorController propagates this out to WebKit via InspectorClient. This is then kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a new process for a navigation, return early with "no" if any frontends are open for the page being navigated. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::didChangeInspectorFrontendCount): (WebKit::WebPageProxy::inspectorFrontendCount const): * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::frontendCountChanged): * WebProcess/WebCoreSupport/WebInspectorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::inspectorFrontendCountChanged): * WebProcess/WebPage/WebPage.h: 2018-05-02 Jer Noble Adopt -destinationWindowToExitFullScreenForWindow: https://bugs.webkit.org/show_bug.cgi?id=185204 Reviewed by Eric Carlson. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController destinationWindowToExitFullScreenForWindow:]): 2018-05-02 Per Arne Vollan Disable Media capture rules in sandbox for simulator. https://bugs.webkit.org/show_bug.cgi?id=185206 Reviewed by Eric Carlson. These rules are not relevant in this case. * WebProcess/com.apple.WebProcess.sb.in: 2018-05-02 Eric Carlson [iOS] Provide audio route information when invoking AirPlay picker https://bugs.webkit.org/show_bug.cgi?id=185199 Reviewed by Jer Noble. * Scripts/webkit/messages.py: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::showPlaybackTargetPicker): Pass route sharing policy and routing context UID. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same. (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID. * UIProcess/ios/forms/WKAirPlayRoutePicker.h: * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same. (-[WKAirPlayRoutePicker showFromView:]): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::showPlaybackTargetPicker): 2018-05-02 Jer Noble Get the WebKit.framework bundle by asking for WKWebView https://bugs.webkit.org/show_bug.cgi?id=185175 Reviewed by Tim Horton. * NetworkProcess/mac/NetworkProcessMac.mm: (WebKit::NetworkProcess::initializeSandbox): * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::initializeSandbox): * StorageProcess/mac/StorageProcessMac.mm: (WebKit::StorageProcess::initializeSandbox): 2018-05-02 Youenn Fablet Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?) https://bugs.webkit.org/show_bug.cgi?id=181009 Reviewed by Eric Carlson. On iOS/IPv6 networks, STUN servers name resolution returns a zero IPv6 IP address. No error is raised which leads to sending STUN requests with that IP address. Once the request times out, the ICE candidate gathering finishes with host candidates only. This patch makes WebRTC DNS resolver to send only IPv4 resolved addresses. STUN is used for NAT traversal which is for IPv4 addresses. Not sending IPv6 addresses allows terminating ICE candidate gathering sooner. Manually tested on iOS with IPv4/IPv6 and IPv6 networks. * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp: (WebKit::resolvedName): 2018-05-02 Youenn Fablet CacheStorage::Engine should keep a list of initialization callback https://bugs.webkit.org/show_bug.cgi?id=185184 Reviewed by Antti Koivisto. Keep each initialize callback in a Vector so as to compute the salt only once. Call all callbacks then in a loop. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::~Engine): (WebKit::CacheStorage::Engine::initialize): * NetworkProcess/cache/CacheStorageEngine.h: 2018-05-02 Jer Noble Pipe volume through PlaybackSessionManager/Proxy. https://bugs.webkit.org/show_bug.cgi?id=185182 Reviewed by Eric Carlson. * UIProcess/Cocoa/PlaybackSessionManagerProxy.h: * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: (WebKit::PlaybackSessionModelContext::setVolume): (WebKit::PlaybackSessionModelContext::volumeChanged): (WebKit::PlaybackSessionManagerProxy::volumeChanged): (WebKit::PlaybackSessionManagerProxy::setVolume): * WebProcess/cocoa/PlaybackSessionManager.h: * WebProcess/cocoa/PlaybackSessionManager.messages.in: * WebProcess/cocoa/PlaybackSessionManager.mm: (WebKit::PlaybackSessionInterfaceContext::volumeChanged): (WebKit::PlaybackSessionManager::volumeChanged): (WebKit::PlaybackSessionManager::setVolume): 2018-05-01 Yusuke Suzuki Use default std::optional if it is provided https://bugs.webkit.org/show_bug.cgi?id=185159 Reviewed by JF Bastien. * Shared/SandboxExtension.h: (WebKit::SandboxExtension::Handle::decode): * Shared/TouchBarMenuItemData.cpp: (WebKit::TouchBarMenuItemData::decode): 2018-05-01 Jer Noble Production build error in Migrate Header phase when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value https://bugs.webkit.org/show_bug.cgi?id=185171 Reviewed by Timothy Hatcher. * Configurations/BaseTarget.xcconfig: 2018-05-01 Per Arne Vollan Use correct runloop type in the WebContent process. https://bugs.webkit.org/show_bug.cgi?id=185140 Reviewed by Brent Fulgham. Use WK_MACOS_* machinery to determine runloop type for the WebContent process. * Configurations/WebContentService.xcconfig: 2018-05-01 Oleksandr Skachkov WebAssembly: add support for stream APIs - JavaScript API https://bugs.webkit.org/show_bug.cgi?id=183442 Reviewed by Yusuke Suzuki and JF Bastien. Add WEBASSEMBLY_STREAMING_API feature flag * Configurations/FeatureDefines.xcconfig: 2018-04-30 Per Arne Vollan Use correct runloop type in the WebContent process. https://bugs.webkit.org/show_bug.cgi?id=185140 Reviewed by Brent Fulgham. The macOS target version should be used to determine the runloop type. * Configurations/WebContentService.xcconfig: 2018-04-30 Michael Saboff Eliminate WebProcessShim.dylib https://bugs.webkit.org/show_bug.cgi?id=185147 Reviewed by Ryosuke Niwa. * Configurations/WebContentService.xcconfig: * Configurations/WebProcessShim.xcconfig: Removed. * WebKit.xcodeproj/project.pbxproj: 2018-04-30 Michael Saboff Remove unused mac/CookieStorageShimLibrary https://bugs.webkit.org/show_bug.cgi?id=185146 Reviewed by Alex Christensen. * Shared/mac/CookieStorageShimLibrary.cpp: Removed. * Shared/mac/CookieStorageShimLibrary.h: Removed. * WebKit.xcodeproj/project.pbxproj: 2018-04-30 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageContextMenuClient getContextMenuFromProposedMenuAsync https://bugs.webkit.org/show_bug.cgi?id=180955 Reviewed by Andy Estes. * UIProcess/API/APIContextMenuClient.h: (API::ContextMenuClient::menuFromProposedMenu): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): 2018-04-30 JF Bastien Use some C++17 features https://bugs.webkit.org/show_bug.cgi?id=185135 Reviewed by Alex Christensen. As discussed here [0] let's move WebKit to a subset of C++17. We now require GCC 6 [1] which means that, according to [2] we can use the following C++17 language features (I removed some uninteresting ones): - New auto rules for direct-list-initialization - static_assert with no message - typename in a template template parameter - Nested namespace definition - Attributes for namespaces and enumerators - u8 character literals - Allow constant evaluation for all non-type template arguments - Fold Expressions - Unary fold expressions and empty parameter packs - __has_include in preprocessor conditional - Differing begin and end types in range-based for - Improving std::pair and std::tuple Consult the Tony Tables [3] to see before / after examples. Of course we can use any library feature if we're willing to import them to WTF (and they don't require language support). [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html [1]: https://trac.webkit.org/changeset/231152/webkit [2]: https://en.cppreference.com/w/cpp/compiler_support [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md * Configurations/Base.xcconfig: * DerivedSources.make: * PlatformMac.cmake: 2018-04-30 Wenson Hsieh [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width https://bugs.webkit.org/show_bug.cgi?id=185132 Reviewed by Tim Horton. Remove the experimental feature for `min-device-width`. * Shared/WebPreferences.yaml: 2018-04-30 Keith Rollin Include breadcrumb for tracking resource loading into CFNetwork https://bugs.webkit.org/show_bug.cgi?id=184837 rdar://problem/39575411 Reviewed by Brent Fulgham. When starting the network-based loading of a resource, log the description provided by NetworkDataTask. On Cocoa, this is implemented to return the description property in NSURLSessionTask. This information better allows us to track a resource load through the WebContent process, the Networking process, and the Cocoa networking layers. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::description const): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::description const): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::description const): 2018-04-30 Andy Estes [iOS] Try to unlock PDF documents before printing them https://bugs.webkit.org/show_bug.cgi?id=185084 Reviewed by Dan Bernstein. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]): Stored the password that successfully unlocked the current PDF document. (-[WKPDFView _wk_printedDocument]): Used the stored password to unlock the CGPDFDocument we create for printing. 2018-04-28 Andy Estes [iOS] Present an action sheet when long-pressing on PDF links https://bugs.webkit.org/show_bug.cgi?id=185093 Reviewed by Dan Bernstein. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView dealloc]): Called -[WKActionSheetAssistant cleanupSheet]. (-[WKPDFView web_setContentProviderData:suggestedFilename:]): Created a WKActionSheetAssistant with the host view as the assistant view and ourselves as the delegate. (-[WKPDFView _URLWithPageIndex:]): Added. Creates a URL to the current page with a page number fragment appended. (-[WKPDFView _goToURL:atLocation:]): Added. Navigates to a URL with a synthetic mouse click at a location in host view coordinates. (-[WKPDFView pdfHostViewController:goToURL:]): (-[WKPDFView pdfHostViewController:goToPageIndex:withViewFrustum:]): Called -_goToURL:atLocation:. Used -_URLWithPageIndex: to construct an NSURL from a page index. (-[WKPDFView _showActionSheetForURL:atLocation:]): Added. Populates _positionInformation with a URL and location and calls -[WKActionSheetAssistant showLinkSheet]. (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]): (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]): Called -_showActionSheetForURL:atLocation:. Used -_URLWithPageIndex: to construct an NSURL from a page index. (-[WKPDFView positionInformationForActionSheetAssistant:]): Returned _positionInformation. (-[WKPDFView actionSheetAssistant:performAction:]): Populated the pasteboard with plain text and URL representations of _positionInformation.url. (-[WKPDFView actionSheetAssistant:openElementAtLocation:]): Called -_goToURL:atLocation. (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]): Created a UIWKSelectionAssistant and called -showShareSheetFor:fromRect:. (-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]): Returned API::UIClient::shouldIncludeAppLinkActionsForElement(). (-[WKPDFView actionSheetAssistant:decideActionsForElement:defaultActions:]): Returned API::UIClient::actionsForElement()l 2018-04-28 Andy Estes [iOS] Allow com.apple.WebKit.Networking to look up com.apple.wifi.manager https://bugs.webkit.org/show_bug.cgi?id=185114 Reviewed by Wenson Hsieh. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2018-04-28 Brent Fulgham Revise sandboxes to allow additional IOKit property access https://bugs.webkit.org/show_bug.cgi?id=185095 Reviewed by Eric Carlson. Update the WebContent and Plugin processes to allow additional IOKit property access. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2018-04-28 Carlos Garcia Campos [GTK] WebProcess from WebKitGtk+ 2.19.92 SIGSEVs in WebCore::TextureMapperGL::~TextureMapperGL https://bugs.webkit.org/show_bug.cgi?id=184040 Reviewed by Michael Catanzaro. This can happen when using single shared process model or when the process limit is reached in multiple process model. In this case, all pages in the same web process with accelerated compositing enabled share the same compositing thread. Every page sets its GL context as current when rendering a frame, but not when invalidating the threaded compositor when the page is closed. So, if a hidden tab is closed, the threaded compositor is invalidated and the GL resources of the current context (the visible page) are destroyed. This is also causing the blank pages issue when closing a tab related to another one, the current one stops rendering anything because its GL context has been released. We should make the threaded compositor context current when invalidating it. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::invalidate): 2018-04-27 Timothy Hatcher REGRESSION: Touch events fail to dispatch to the page in all cases. https://bugs.webkit.org/show_bug.cgi?id=185097 rdar://problem/39731995 Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): Consult internal gesture recognizers, otherwise NO might get returned. 2018-04-26 Ryosuke Niwa PSON: Triggering a navigation to an invalid URL creates a new WebContent process https://bugs.webkit.org/show_bug.cgi?id=185066 Reviewed by Youenn Fablet. Don't create a new WebContent process when the target URL is invalid as well as when the source URL is invalid. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): 2018-04-27 Youenn Fablet Use NetworkLoadChecker for XHR/fetch loads https://bugs.webkit.org/show_bug.cgi?id=184741 Reviewed by Chris Dumez. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didCompleteWithError): Pass the preflight error as completion error if any. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::willPerformHTTPRedirection): Set response source to Network so that checks relying on that are correct. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::validateResponse): Adding Oppaqueredirect tainting. (NetworkLoadChecker::doesNotNeedCORSCheck): Adding a check to only activate CORS checks for CORS enabled schemes. Non CORS enabled schemes loads should have failed in WebProcess already. (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest): Remove Authorization header as done by SubresourceLoader. (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight): If error is cancellation, we still want to call the completion handler. * NetworkProcess/NetworkResourceLoader.cpp: Activate network load checker for all types of loads. (WebKit::NetworkResourceLoader::willSendRedirectedRequest): Handle manual redirection by directly calling didReceiveResponse. 2018-04-27 Wenson Hsieh Add an experimental feature flag for viewport "min-device-width" https://bugs.webkit.org/show_bug.cgi?id=185050 Reviewed by Tim Horton. Add MinDeviceWidthEnabled as a new experimental feature, on by default in extra zoom mode and off elsewhere. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: 2018-04-27 Daniel Bates UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=185079 I inadvertently forgot to move the UIDelegate field webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo outside the PLATFORM(MAC)-guard. * UIProcess/Cocoa/UIDelegate.h: 2018-04-27 Daniel Bates UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=185079 Reviewed by Andy Estes. * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance): 2018-04-27 Wenson Hsieh Rename minimumLayoutSize to viewLayoutSize https://bugs.webkit.org/show_bug.cgi?id=185050 Reviewed by Tim Horton. Renames minimumLayoutSize to viewLayoutSize, since the minimum layout size in ViewportConfiguration is now different from the minimum layout size that is currently pushed down from the UI process (e.g. WKWebView SPI) in the case where `min-device-width` is used to override the minimum layout size. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processDidExit]): (-[WKWebView activeViewLayoutSize:]): (-[WKWebView _dispatchSetViewLayoutSize:]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _minimumLayoutSizeOverride]): (-[WKWebView _setViewLayoutSizeOverride:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): (-[WKWebView _clearOverrideLayoutParameters]): (-[WKWebView _minimumLayoutWidth]): (-[WKWebView _setMinimumLayoutWidth:]): (-[WKWebView activeMinimumLayoutSize:]): Deleted. (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted. (-[WKWebView _setMinimumLayoutSizeOverride:]): Deleted. (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]): Deleted. Remove unused SPI that has been deprecated since iOS 9, has a simple drop-in replacement, and no longer has any internal clients. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setMinimumSizeForAutoLayout): (WebKit::WebViewImpl::minimumSizeForAutoLayout const): (WebKit::WebViewImpl::setIntrinsicContentSize): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::viewLayoutSizeDidChange): (WebKit::DrawingAreaProxy::minimumLayoutSizeDidChange): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::setViewLayoutSize): (WebKit::WebPageProxy::setMinimumLayoutSize): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::viewLayoutSize const): (WebKit::WebPageProxy::minimumLayoutSize const): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): Deleted. * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange): (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry): (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry): (WebKit::TiledCoreAnimationDrawingAreaProxy::minimumLayoutSizeDidChange): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/ViewGestureGeometryCollector.cpp: (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_credentialsMessenger): (WebKit::WebPage::setViewLayoutSize): (WebKit::WebPage::setMinimumLayoutSize): Deleted. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::viewLayoutSize const): (WebKit::WebPage::minimumLayoutSize const): Deleted. * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setViewportConfigurationViewLayoutSize): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): (WebKit::TiledCoreAnimationDrawingArea::updateGeometry): 2018-04-27 Wenson Hsieh [Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode https://bugs.webkit.org/show_bug.cgi?id=185050 Reviewed by Tim Horton. Remove the forceHorizontalViewportShrinkToFit and minimumAllowedLayoutWidth SPI hooks from WebKit, and additionally remove all logic for plumbing viewSize to WebCore. See WebCore/ChangeLog for more information. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode const): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::allowShrinkToFit const): (WebKit::operator==): (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const): Deleted. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView activeMinimumLayoutSize:]): (-[WKWebView _dispatchSetMinimumLayoutSize:]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _setMinimumLayoutSizeOverride:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _minimumAllowedLayoutWidth]): Deleted. (-[WKWebView _setMinimumAllowedLayoutWidth:]): Deleted. (-[WKWebView activeMinimumLayoutSizes:]): Deleted. (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]): Deleted. (-[WKWebView _setForceHorizontalViewportShrinkToFit:]): Deleted. (-[WKWebView _forceHorizontalViewportShrinkToFit]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_credentialsMessenger): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::updateVisibleContentRects): 2018-04-27 Carlos Garcia Campos REGRESSION(r230812): [WPE][GTK] WebKitWebViewSessionState.cpp throws away encoded BackForwardList identifier https://bugs.webkit.org/show_bug.cgi?id=184823 Reviewed by Michael Catanzaro. Bump session sate format version to 2 and stop encoding the backfoward list item identifier, since it's always regenerated. * UIProcess/API/glib/WebKitWebViewSessionState.cpp: (encodeBackForwardListItemState): Always encode version 2. (encodeBackForwardListState): Ditto. (encodeSessionState): Ditto. (decodeBackForwardListItemStateV1): Decode list item state for version 1. (decodeBackForwardListItemState): Receive the version and call decodeBackForwardListItemStateV1() if it's 1 or use the version 2 otherwise. (decodeSessionState): Load data for known formats and use the one that worked to decode it. 2018-04-26 Megan Gardner Add timeout for ensurePositionInformationIsUpToDate https://bugs.webkit.org/show_bug.cgi?id=184567 Reviewed by Wenson Hsieh. We are having long hang times for WebKit, and this is one of the culprits. If we do not get an answer for positionInformation in a reasonable amount of time, we should timeout, so as to not hang the UI. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView ensurePositionInformationIsUpToDate:]): 2018-04-26 Andy Estes Try again to fix the iOS build after r231063. * Configurations/Base.xcconfig: 2018-04-26 Jer Noble WK_COCOA_TOUCH the WK_ACCESSIBILITY_LDFLAGS https://bugs.webkit.org/show_bug.cgi?id=185007 Reviewed by Timothy Hatcher. * Configurations/WebKit.xcconfig: 2018-04-26 Jer Noble Unreviewed build fix; fix iOS TAPI build step after r231063. * Configurations/WebKit.xcconfig: 2018-04-26 Jer Noble WK_COCOA_TOUCH all the things. https://bugs.webkit.org/show_bug.cgi?id=185006 Reviewed by Tim Horton. * Configurations/BaseTarget.xcconfig: * Configurations/WebKit.xcconfig: 2018-04-26 Daniel Bates Remove WebCore::-qualifier in NetworkLoadChecker.cpp https://bugs.webkit.org/show_bug.cgi?id=185037 Reviewed by Youenn Fablet. It is unncesssary to qualify WebCore types in NetworkLoadChecker.cpp as it has a "using namespace WebCore" directive. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): (WebKit::NetworkLoadChecker::checkRedirection): (WebKit::NetworkLoadChecker::validateResponse): (WebKit::NetworkLoadChecker::continueCheckingRequest): Removed extra space character and unnecessary parentheses from the right-hand side of the assignment to m_storedCredentialsPolicy. (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): 2018-04-26 Daniel Bates Rename NetworkLoadChecker::returnError() to NetworkLoadChecker::accessControlErrorForValidationHandler() https://bugs.webkit.org/show_bug.cgi?id=185035 Reviewed by Youenn Fablet. Substitute NetworkLoadChecker::accessControlErrorForValidationHandler() for NetworkLoadChecker::returnError() to better describe that it is a convenience function that returns a wrapped ResourceError object, that represents an access control error, suitable to be passed directly to a validation handler. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkRedirection): Update as needed for renaming. (WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler): Use auto -> syntax to avoid the need to class-qualify the return type. Also renamed parameter from error to message as it represents the message/description for the access control error. (WebKit::NetworkLoadChecker::checkRequest): Update as needed for renaming. Also substitute "message" for "error" to match the argument of accessControlErrorForValidationHandler() with the same name. (WebKit::NetworkLoadChecker::continueCheckingRequest): Update as needed for renaming. (WebKit::NetworkLoadChecker::returnError): Deleted; renamed to accessControlErrorForValidationHandler(). * NetworkProcess/NetworkLoadChecker.h: 2018-04-26 Jiewen Tan Remove access to keychain from the WebContent process https://bugs.webkit.org/show_bug.cgi?id=184428 Part 3. Tighten WebContent Process' sandbox profile to all Security.framework services. Reviewed by Brent Fulgham. * WebProcess/com.apple.WebProcess.sb.in: 2018-04-26 Youenn Fablet Make cross origin redirection error messages consistent between SubresourceLoader and NetworkLoadChecker https://bugs.webkit.org/show_bug.cgi?id=185023 Reviewed by Chris Dumez. Align NetworkLoadChecker with what SubresourceLoader is doing so that we can keep WK1 and WK2 error messages as consistent as possible. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkRedirection): (WebKit::NetworkLoadChecker::validateResponse): 2018-04-25 Megan Gardner Activate selection when interacting with editable content https://bugs.webkit.org/show_bug.cgi?id=185017 Reviewed by Tim Horton. Fixes a regression from r231016 where selection now does not work when interacting with editable content. When we go into editable content, we should turn on the assistant. This fulfills the requirement of user interaction as well, so any javascript selections after this point should be valid. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startAssistingKeyboard]): (-[WKContentView _stopAssistingKeyboard]): 2018-04-26 Per Arne Vollan Disable content filtering in minimal simulator mode https://bugs.webkit.org/show_bug.cgi?id=185027 Reviewed by Jer Noble. * Configurations/FeatureDefines.xcconfig: 2018-04-26 Brady Eidson Add a setting for keeping around all processes and always reusing them per-origin. and https://bugs.webkit.org/show_bug.cgi?id=185020 Reviewed by Andy Estes. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationAlwaysKeepAndReuseSwappedProcesses): (WKContextConfigurationSetAlwaysKeepAndReuseSwappedProcesses): * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration setAlwaysKeepAndReuseSwappedProcesses:]): (-[_WKProcessPoolConfiguration alwaysKeepAndReuseSwappedProcesses]): * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::webProcessDidClose): (WebKit::SuspendedPageProxy::destroyWebPageInWebProcess): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::suspendedPageClosed): (WebKit::WebPageProxy::suspendedPageProcessClosed): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::suspendedPage const): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::shouldTerminate): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::addProcessToOriginCacheSet): (WebKit::WebProcessPool::removeProcessFromOriginCacheSet): (WebKit::WebProcessPool::processForNavigation): If a swap will occur, cache the old process. (WebKit::WebProcessPool::processForNavigationInternal): Consider re-using a previously cached process. * UIProcess/WebProcessPool.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_credentialsMessenger): 2018-04-26 Andy VanWagoner [INTL] Implement Intl.PluralRules https://bugs.webkit.org/show_bug.cgi?id=184312 Reviewed by JF Bastien. Added Intl.PluralRules feature flag. * Configurations/FeatureDefines.xcconfig: 2018-04-26 Zan Dobersek [GTK][WPE] Initial ASYNC_SCROLLING support https://bugs.webkit.org/show_bug.cgi?id=184961 Reviewed by Carlos Garcia Campos. Guard RemoteScrollingCoordinator and RemoteScrollingCoordinatorProxy usage in WebChromeClient and WebPageProxy, respectively, with PLATFORM(COCOA) in addition to the ASYNC_SCROLLING guards. Despite enabling the code at build-time, the feature (as intended) is not yet used because of the DrawingArea rejection in the WebPage constructor. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::initializeWebPage): (WebKit::WebPageProxy::handleWheelEvent): (WebKit::WebPageProxy::updateTouchEventTracking): * UIProcess/WebPageProxy.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createScrollingCoordinator const): 2018-04-25 Michael Catanzaro [WPE] Build and link against latest WPEBackend and WPEBackend-fdo https://bugs.webkit.org/show_bug.cgi?id=184643 Reviewed by Žan Doberšek. Adapt to single-header WPE includes. Null-initialize padding to silence -Wmissing-field-initializers. (Yuck.) * Shared/NativeWebTouchEvent.h: * Shared/wpe/WebEventFactory.cpp: * UIProcess/API/glib/WebKitPrivate.cpp: * UIProcess/API/wpe/CompositingManagerProxy.cpp: * UIProcess/API/wpe/ScrollGestureController.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_backend): * UIProcess/API/wpe/WebKitWebViewBackend.h: * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp: (WebKit::AcceleratedSurfaceWPE::initialize): 2018-04-25 Saam Barati dlopen the bundle's executable before calling -[NSBundle load] since that will also do a bunch of other things we don't need https://bugs.webkit.org/show_bug.cgi?id=184904 Reviewed by Geoffrey Garen. Loading an NSBundle does a lot of work to find the principal class inside the bundle. This means it walks all the objective C class names loaded by the bundle. Doing this is *really* expensive. Some users of the injected bundle define a WKBundleInitialize function. In such a case, we don't need the principal class, so we can skip loading the NSBundle. Now, before we load the bundle, we dlopen and dlsym looking for the WKBundleInitialize function. If we find it, we skip loading the bundle. If we don't find the WKBundleInitialize function, we fall back to loading the bundle and finding the principal class. This speeds up initializeWebProcess by ~70ms on my MBP. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): 2018-04-25 Youenn Fablet Use NetworkLoadChecker for all subresource loads except fetch/XHR https://bugs.webkit.org/show_bug.cgi?id=184870 Reviewed by Chris Dumez. Relax rules to check for non HTTP(s) redirections to throw only when WebProcess says to load it after redirection. This allows WebProcess to load redirected non HTTP(s) URLs, such as data URLs. We keep these checks when WebProcess asks to continue the load and for all PingLoads. Update error messages to be more consistent with WK1. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkRedirection): (WebKit::NetworkLoadChecker::continueCheckingRequest): (WebKit::NetworkLoadChecker::validateResourceResponse): (WebKit::NetworkLoadChecker::continueCheckingRequest): * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::validateResponse): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::shouldUseNetworkLoadChecker): (WebKit::NetworkResourceLoader::continueWillSendRequest): 2018-04-25 Ryosuke Niwa PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank https://bugs.webkit.org/show_bug.cgi?id=184962 Reviewed by Youenn Fablet. Build fix. Revert the change in r231019 to remove the empty URL and about:blank check here. These checks are for the source / originating URL, not the target URL. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): 2018-04-25 Youenn Fablet WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier should use DoNotProcessIncomingMessagesWhenWaitingForSyncReply https://bugs.webkit.org/show_bug.cgi?id=184978 Reviewed by Simon Fraser. Use DoNotProcessIncomingMessagesWhenWaitingForSyncReply to keep a consistent state after the sync IPC call. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier): (WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier): 2018-04-25 Jiewen Tan Remove access to keychain from the WebContent process https://bugs.webkit.org/show_bug.cgi?id=184428 Reviewed by Brent Fulgham. This patch does the followings: 1. Added necessary support to move HTMLKeygenElement's operation from WebContent Process to UI Process. 2. Craft new SPI copySignedPublicKeyAndChallengeString to supply HTMLKeygenElement with dummy data such that WebKitTestRunner tests will not modify the underlying key store (e.g., the macOS Keychain). * UIProcess/API/APINavigationClient.h: (API::NavigationClient::signedPublicKeyAndChallengeString): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageNavigationClient.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::signedPublicKeyAndChallengeString): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const): * WebProcess/WebCoreSupport/WebChromeClient.h: 2018-04-25 Wenson Hsieh [Extra zoom mode] The search field on www.bing.com is missing label text https://bugs.webkit.org/show_bug.cgi?id=184975 Reviewed by Tim Horton. Adds support for displaying the "aria-label" attribute as the input view's label text in extra zoom mode. Also adds support for grabbing the input label's text for testing. Test: fast/forms/extrazoom/form-control-label-text.html * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode const): (WebKit::AssistedNodeInformation::decode): * Shared/AssistedNodeInformation.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView formInputLabel]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView formInputLabel]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2018-04-25 Ryosuke Niwa PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank https://bugs.webkit.org/show_bug.cgi?id=184962 Reviewed by Youenn Fablet. Don't create a new WebContent process when navigating to a blob object URL since doing so can result in a race condition in which the blog URL is removed from the blob registry of the network process by the time the navigation gets commited. This causes a failure in fast/dom/HTMLAnchorElement/anchor-download-unset.html and oher layout tests. In the future, the network process should verify that a given WebContent process has access to a given blob URL. For now, we rely on WebContent process to tell us whether it can navigate to a given blob URL or not. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode const): Encode newly added treatAsSameOriginNavigation. (WebKit::NavigationActionData::decode): Ditto for decoding. * Shared/NavigationActionData.h: (WebKit::NavigationActionData::treatAsSameOriginNavigation): Added. * UIProcess/API/APINavigation.h: (API::Navigation::setTreatAsSameOriginNavigation): Added. (API::Navigation::treatAsSameOriginNavigation const): Added. * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): Use the current process when treatAsSameOriginNavigation is set to true; i.e. when navigating to a blob URL the current document has access. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2018-04-25 Megan Gardner Don't activate Selection Assistant unless it is actually needed. https://bugs.webkit.org/show_bug.cgi?id=184944 Reviewed by Tim Horton. Don't activate the selection unless we need to. Activating on init is overeager and allowing Javascript to activate selections without user input. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView useSelectionAssistantWithGranularity:]): 2018-04-25 Wenson Hsieh Fix entitlements and sandbox configurations in WebKit after r230778 https://bugs.webkit.org/show_bug.cgi?id=184960 Reviewed by Tim Horton. Build fixes for watchOS and tvOS after r230778. * Configurations/BaseXPCService.xcconfig: * Configurations/NetworkService.xcconfig: * Configurations/WebContentService.xcconfig: 2018-04-25 Brent Fulgham Unreviewed build fix after r231008. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): Forgot to remove an unneeded constructor argument. 2018-04-25 Brent Fulgham Don't Block First Party Cookies on Redirects https://bugs.webkit.org/show_bug.cgi?id=184948 Reviewed by Youenn Fablet. Top-level navigations should not be subject to cookie blocking behavior. When performing redirects for main frame navigation we are blocking cookies, leading to site breakage. We need to keep track of which NetworkDataTasks are due to a main frame navigation. When a redirect is performed on the main frame, we should treat the new origin as the 'first party for cookies' and avoid blocking cookies for that URL. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::preconnectTo): Use the correct parameter type. We actually serialize NetworkResourceLoadParameters over IPC, so we should get access to all the members of this child class. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): Pass new 'loadIsForNavigation' flag to create methods. (WebKit::NetworkDataTask::NetworkDataTask): Capture 'loadIsForNavigation' in constructor. * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTask::isTopLevelNavigation const): Added. * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): Accept new constructor argument. * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::willPerformHTTPRedirection): Retain requester value from old request during redirect. * NetworkProcess/NetworkResourceLoadParameters.cpp: (NetworkResourceLoadParameters::decode): Update to pass new flag. (NetworkResourceLoadParameters::encode): Ditto. * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/capture/NetworkDataTaskReplay.cpp: (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay): Accept new constructor argument. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Accept new constructor argument. (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * NetworkProcess/curl/NetworkDataTaskCurl.cpp: (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl): Accept new constructor argument. * NetworkProcess/curl/NetworkDataTaskCurl.h: * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Accept new constructor argument. * NetworkProcess/soup/NetworkDataTaskSoup.h: 2018-04-25 Youenn Fablet Ensure DNT is set for redirections handled in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=184890 Reviewed by Ryosuke Niwa. Compute whether DNT header should be set on requests based on: - request has a DNT header - session is ephemeral (aka private browsing mode) In both cases, we ensure a DNT header is added for any request triggered by a redirection. Covered by http/wpt/fetch/dnt-header-after-redirection.html. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::check): (WebKit::NetworkLoadChecker::prepareRedirectedRequest): * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::continueWillSendRequest): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::willPerformHTTPRedirection): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): 2018-04-25 Michael Catanzaro [WPE] Remove deprecated functions and properties from the API https://bugs.webkit.org/show_bug.cgi?id=179295 Reviewed by Žan Doberšek. * UIProcess/API/glib/WebKitCookieManager.cpp: * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp: * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp: (webkitNavigationPolicyDecisionGetProperty): (webkit_navigation_policy_decision_class_init): * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsSetProperty): (webKitSettingsGetProperty): (webkit_settings_class_init): * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextGetProperty): (webkitWebContextSetProperty): (webkit_web_context_class_init): * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): (webkitWebViewHandleAuthenticationChallenge): (webkitWebViewWebProcessTerminated): * UIProcess/API/wpe/WebKitCookieManager.h: * UIProcess/API/wpe/WebKitFormSubmissionRequest.h: * UIProcess/API/wpe/WebKitNavigationPolicyDecision.h: * UIProcess/API/wpe/WebKitSettings.h: * UIProcess/API/wpe/WebKitWebContext.h: 2018-04-25 Michael Catanzaro Unreviewed, silence -Wreturn-type warning https://bugs.webkit.org/show_bug.cgi?id=184560 * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::shouldCancelCrossOriginLoad): 2018-04-25 Michael Catanzaro [GTK] Miscellaneous build cleanups https://bugs.webkit.org/show_bug.cgi?id=184399 Reviewed by Žan Doberšek. * PlatformGTK.cmake: 2018-04-25 Dean Jackson Make a better flag for system preview, and disable it where necessary https://bugs.webkit.org/show_bug.cgi?id=184968 Reviewed by Eric Carlson. Use USE(SYSTEM_PREVIEW). * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: (-[WKWebViewContentProviderRegistry init]): * UIProcess/ios/WKSystemPreviewView.mm: 2018-04-25 Carlos Garcia Campos [GTK] Implement MouseEvent.buttons https://bugs.webkit.org/show_bug.cgi?id=184913 Reviewed by Žan Doberšek. It's currently returning always 0. * Shared/gtk/WebEventFactory.cpp: (WebKit::pressedMouseButtons): Helper function to get the pressed mouse buttons. (WebKit::WebEventFactory::createWebMouseEvent): Pass presssed mouse buttons to constructor instead of 0. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Include the mouse buttons state in automation synthesized events and update m_currentModifiers with the mouse buttons state. (WebKit::keyCodeForVirtualKey): Do not set the state here. (WebKit::modifiersForKeyCode): Helper to get the modifiers for a key code. (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Initialize the modifiers also when virtualKey is std::nullopt; 2018-04-24 Nan Wang AX: soft link libAccessibility.dylb https://bugs.webkit.org/show_bug.cgi?id=184919 Reviewed by Dan Bernstein. Weakly linked libAccessibility.dylib on macOS. * Configurations/WebKit.xcconfig: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _updateAccessibilityEventsEnabled]): 2018-04-24 Fujii Hironori [WinCairo] Add WKView and WKAPI https://bugs.webkit.org/show_bug.cgi?id=182869 Reviewed by Alex Christensen. Resurrected source files for WebKit for Windows port which was removed in r139003. * PlatformWin.cmake: Renamed the output name of WebKit to WebKit2 not to conflict WebKitLegacy. Added source files and include paths. * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/win/WKAPICastWin.h: Added. * UIProcess/API/C/win/WKView.cpp: Added. (WKViewCreate): (WKViewGetWindow): (WKViewGetPage): (WKViewSetParentWindow): (WKViewWindowAncestryDidChange): (WKViewSetIsInWindow): (WKViewSetScrollOffsetOnNextResize): * UIProcess/API/C/win/WKView.h: Added. * UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Added. (API::WebsiteDataStore::defaultApplicationCacheDirectory): (API::WebsiteDataStore::defaultCacheStorageDirectory): (API::WebsiteDataStore::defaultNetworkCacheDirectory): (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): (API::WebsiteDataStore::defaultLocalStorageDirectory): (API::WebsiteDataStore::defaultMediaKeysStorageDirectory): (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): (API::WebsiteDataStore::defaultDataStoreConfiguration): * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/win/ProcessLauncherWin.cpp: Added. (WebKit::processName): (WebKit::ProcessLauncher::launchProcess): (WebKit::ProcessLauncher::terminateProcess): (WebKit::ProcessLauncher::platformInvalidate): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch): (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess): * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp: Added. (WebKit::WebsiteDataStore::platformInitialize): (WebKit::WebsiteDataStore::platformDestroy): (WebKit::WebsiteDataStore::platformRemoveRecentSearches): * UIProcess/win/PageClientImpl.cpp: Added. (WebKit::PageClientImpl::PageClientImpl): (WebKit::PageClientImpl::createDrawingAreaProxy): (WebKit::PageClientImpl::setViewNeedsDisplay): (WebKit::PageClientImpl::requestScroll): (WebKit::PageClientImpl::viewScrollPosition): (WebKit::PageClientImpl::viewSize): (WebKit::PageClientImpl::isViewWindowActive): (WebKit::PageClientImpl::isViewFocused): (WebKit::PageClientImpl::isViewVisible): (WebKit::PageClientImpl::isViewInWindow): (WebKit::PageClientImpl::PageClientImpl::processDidExit): (WebKit::PageClientImpl::didRelaunchProcess): (WebKit::PageClientImpl::toolTipChanged): (WebKit::PageClientImpl::setCursor): (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves): (WebKit::PageClientImpl::didChangeViewportProperties): (WebKit::PageClientImpl::registerEditCommand): (WebKit::PageClientImpl::clearAllEditCommands): (WebKit::PageClientImpl::canUndoRedo): (WebKit::PageClientImpl::executeUndoRedo): (WebKit::PageClientImpl::convertToDeviceSpace): (WebKit::PageClientImpl::convertToUserSpace): (WebKit::PageClientImpl::screenToRootView): (WebKit::PageClientImpl::rootViewToScreen): (WebKit::PageClientImpl::doneWithKeyEvent): (WebKit::PageClientImpl::createPopupMenuProxy): (WebKit::PageClientImpl::createContextMenuProxy): (WebKit::createColorPicker): (WebKit::PageClientImpl::enterAcceleratedCompositingMode): (WebKit::PageClientImpl::exitAcceleratedCompositingMode): (WebKit::PageClientImpl::updateAcceleratedCompositingMode): (WebKit::PageClientImpl::pageClosed): (WebKit::PageClientImpl::preferencesDidChange): (WebKit::PageClientImpl::didChangeContentSize): (WebKit::PageClientImpl::handleDownloadRequest): (WebKit::PageClientImpl::didCommitLoadForMainFrame): (WebKit::PageClientImpl::fullScreenManagerProxyClient): (WebKit::PageClientImpl::closeFullScreenManager): (WebKit::PageClientImpl::isFullScreen): (WebKit::PageClientImpl::enterFullScreen): (WebKit::PageClientImpl::exitFullScreen): (WebKit::PageClientImpl::beganEnterFullScreen): (WebKit::PageClientImpl::beganExitFullScreen): (WebKit::PageClientImpl::doneWithTouchEvent): (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): (WebKit::PageClientImpl::didFinishLoadingDataForCustomContentProvider): (WebKit::PageClientImpl::navigationGestureDidBegin): (WebKit::PageClientImpl::navigationGestureWillEnd): (WebKit::PageClientImpl::navigationGestureDidEnd): (WebKit::PageClientImpl::willRecordNavigationSnapshot): (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot): (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame): (WebKit::PageClientImpl::didFinishLoadForMainFrame): (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame): (WebKit::PageClientImpl::didChangeBackgroundColor): (WebKit::PageClientImpl::isPlayingAudioWillChange): (WebKit::PageClientImpl::isPlayingAudioDidChange): (WebKit::PageClientImpl::refView): (WebKit::PageClientImpl::derefView): * UIProcess/win/PageClientImpl.h: Added. * UIProcess/win/TextCheckerWin.cpp: Added. (WebKit::checkerState): (WebKit::TextChecker::state): (WebKit::TextChecker::setTestingMode): (WebKit::TextChecker::isTestingMode): (WebKit::TextChecker::isContinuousSpellCheckingAllowed): (WebKit::TextChecker::setContinuousSpellCheckingEnabled): (WebKit::TextChecker::setGrammarCheckingEnabled): (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged): (WebKit::TextChecker::grammarCheckingEnabledStateChanged): (WebKit::TextChecker::uniqueSpellDocumentTag): (WebKit::TextChecker::closeSpellDocumentWithTag): (WebKit::TextChecker::checkSpellingOfString): (WebKit::TextChecker::checkGrammarOfString): (WebKit::TextChecker::spellingUIIsShowing): (WebKit::TextChecker::toggleSpellingUIIsShowing): (WebKit::TextChecker::updateSpellingUIWithMisspelledWord): (WebKit::TextChecker::updateSpellingUIWithGrammarString): (WebKit::TextChecker::getGuessesForWord): (WebKit::TextChecker::learnWord): (WebKit::TextChecker::ignoreWord): (WebKit::TextChecker::requestCheckingOfString): (WebKit::TextChecker::checkTextOfParagraph): * UIProcess/win/WebContextMenuProxyWin.cpp: Added. (WebKit::WebContextMenuProxyWin::show): (WebKit::WebContextMenuProxyWin::showContextMenuWithItems): (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin): (WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin): * UIProcess/win/WebContextMenuProxyWin.h: Added. (WebKit::WebContextMenuProxyWin::create): * UIProcess/win/WebInspectorProxyWin.cpp: Added. (WebKit::WebInspectorProxy::platformCreateFrontendPage): (WebKit::WebInspectorProxy::platformCreateFrontendWindow): (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow): (WebKit::WebInspectorProxy::platformDidCloseForCrash): (WebKit::WebInspectorProxy::platformInvalidate): (WebKit::WebInspectorProxy::platformHide): (WebKit::WebInspectorProxy::platformBringToFront): (WebKit::WebInspectorProxy::platformBringInspectedPageToFront): (WebKit::WebInspectorProxy::platformIsFront): (WebKit::WebInspectorProxy::platformInspectedURLChanged): (WebKit::WebInspectorProxy::inspectorPageURL): (WebKit::WebInspectorProxy::inspectorTestPageURL): (WebKit::WebInspectorProxy::inspectorBaseURL): (WebKit::WebInspectorProxy::platformInspectedWindowHeight): (WebKit::WebInspectorProxy::platformInspectedWindowWidth): (WebKit::WebInspectorProxy::platformAttach): (WebKit::WebInspectorProxy::platformDetach): (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight): (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth): (WebKit::WebInspectorProxy::platformStartWindowDrag): (WebKit::WebInspectorProxy::platformSave): (WebKit::WebInspectorProxy::platformAppend): (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): * UIProcess/win/WebPageProxyWin.cpp: Added. (WebKit::WebPageProxy::platformInitialize): (WebKit::WebPageProxy::standardUserAgent): (WebKit::WebPageProxy::saveRecentSearches): (WebKit::WebPageProxy::loadRecentSearches): (WebKit::WebPageProxy::editorStateChanged): * UIProcess/win/WebPreferencesWin.cpp: Added. (WebKit::WebPreferences::platformInitializeStore): (WebKit::WebPreferences::platformUpdateStringValueForKey): (WebKit::WebPreferences::platformUpdateBoolValueForKey): (WebKit::WebPreferences::platformUpdateUInt32ValueForKey): (WebKit::WebPreferences::platformUpdateDoubleValueForKey): (WebKit::WebPreferences::platformUpdateFloatValueForKey): (WebKit::WebPreferences::platformGetStringUserValueForKey): (WebKit::WebPreferences::platformGetBoolUserValueForKey): (WebKit::WebPreferences::platformGetUInt32UserValueForKey): (WebKit::WebPreferences::platformGetDoubleUserValueForKey): * UIProcess/win/WebProcessPoolWin.cpp: Added. (WebKit::WebProcessPool::platformInitialize): (WebKit::WebProcessPool::platformInitializeNetworkProcess): (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInvalidateContext): (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions): * UIProcess/win/WebView.cpp: Added. (WebKit::WebView::WebViewWndProc): (WebKit::WebView::wndProc): (WebKit::WebView::registerWebViewWindowClass): (WebKit::WebView::WebView): (WebKit::WebView::~WebView): (WebKit::WebView::initialize): (WebKit::WebView::setParentWindow): (WebKit::findTopLevelParentWindow): (WebKit::WebView::windowAncestryDidChange): (WebKit::WebView::onMouseEvent): (WebKit::WebView::onWheelEvent): (WebKit::WebView::onHorizontalScroll): (WebKit::WebView::onVerticalScroll): (WebKit::WebView::onKeyEvent): (WebKit::drawPageBackground): (WebKit::WebView::paint): (WebKit::WebView::onPaintEvent): (WebKit::WebView::onPrintClientEvent): (WebKit::WebView::onSizeEvent): (WebKit::WebView::onWindowPositionChangedEvent): (WebKit::WebView::onSetFocusEvent): (WebKit::WebView::onKillFocusEvent): (WebKit::WebView::onTimerEvent): (WebKit::WebView::onShowWindowEvent): (WebKit::WebView::onSetCursor): (WebKit::WebView::updateActiveState): (WebKit::WebView::updateActiveStateSoon): (WebKit::initCommonControls): (WebKit::WebView::initializeToolTipWindow): (WebKit::WebView::startTrackingMouseLeave): (WebKit::WebView::stopTrackingMouseLeave): (WebKit::WebView::shouldInitializeTrackPointHack): (WebKit::WebView::close): (WebKit::WebView::cursorToShow const): (WebKit::WebView::updateNativeCursor): (WebKit::WebView::setOverrideCursor): (WebKit::WebView::setIsInWindow): (WebKit::WebView::setIsVisible): (WebKit::WebView::isWindowActive): (WebKit::WebView::isFocused): (WebKit::WebView::isVisible): (WebKit::WebView::isInWindow): (WebKit::WebView::setScrollOffsetOnNextResize): (WebKit::WebView::setViewNeedsDisplay): (WebKit::WebView::createColorChooserProxy): (WebKit::WebView::didCommitLoadForMainFrame): (WebKit::WebView::customRepresentationZoomFactor): (WebKit::WebView::setCustomRepresentationZoomFactor): (WebKit::WebView::findStringInCustomRepresentation): (WebKit::WebView::countStringMatchesInCustomRepresentation): (WebKit::WebView::nativeWindow): (WebKit::WebView::windowReceivedMessage): * UIProcess/win/WebView.h: Added. (WebKit::WebView::create): (WebKit::WebView::window const): (WebKit::WebView::page const): (WebKit::WebView::drawingArea): (WebKit::WebView::setWasActivatedByMouseEvent): 2018-04-24 Fujii Hironori Implement Same-Site cookies https://bugs.webkit.org/show_bug.cgi?id=159464 Unreviewed build fix. WinCairo WebKit2 can't compile since r230921. * NetworkProcess/curl/NetworkDataTaskCurl.cpp: (WebKit::NetworkDataTaskCurl::appendCookieHeader): CookieJarCurlDatabase::cookieRequestHeaderFieldValue needs SameSiteInfo. 2018-04-24 Simon Fraser Add a new "color-filter" CSS property as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=184940 Reviewed by Jon Lee. Add the color-filter property as an experimental feature. * Shared/WebPreferences.yaml: 2018-04-24 Saam Barati Keep around a pre-warmed process when doing process swap on navigation https://bugs.webkit.org/show_bug.cgi?id=184765 Reviewed by Ryosuke Niwa and Brady Eidson. This patch makes it so that WebProcessPool prewarms a process when process swap on navigation is turned on. When we do a process swap on navigation, we first try to grab a prewarmed process before creating a new one. We try to be smart about when to create these processes. The initial heuristic that this patch chooses is when we reach the DidFirstVisuallyNonEmptyLayout layout milestone. We're going to try to improve on this heuristic in: https://bugs.webkit.org/show_bug.cgi?id=184899 This is a 40% progression on PLT with process swap on navigation turned on. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _prewarmedWebProcessCount]): (-[WKProcessPool _webProcessCountIgnoringPrewarmed]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::notifyProcessPoolToPrewarm): (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::tryTakePrewarmedProcess): (WebKit::WebProcessPool::warmInitialProcess): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::didReachGoodTimeToPrewarm): (WebKit::WebProcessPool::processForNavigation): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::create): (WebKit::WebProcessProxy::WebProcessProxy): (WebKit::m_isInPrewarmedPool): (WebKit::m_userMediaCaptureManagerProxy): Deleted. * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::isInPrewarmedPool const): (WebKit::WebProcessProxy::setIsInPrewarmedPool): 2018-04-24 Commit Queue Unreviewed, rolling out r230971. https://bugs.webkit.org/show_bug.cgi?id=184939 This fix was not appropriate (Requested by n_wang on #webkit). Reverted changeset: "AX: soft link libAccessibility.dylb" https://bugs.webkit.org/show_bug.cgi?id=184919 https://trac.webkit.org/changeset/230971 2018-04-24 Nan Wang AX: soft link libAccessibility.dylb https://bugs.webkit.org/show_bug.cgi?id=184919 Reviewed by Chris Fleizach. Make sure we soft link the library so that it won't crash if it's missing in the system. * Configurations/WebKit.xcconfig: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _updateAccessibilityEventsEnabled]): 2018-04-24 John Wilander From-Origin: Support for 'same' and 'same-site' response header, nested frame origin check https://bugs.webkit.org/show_bug.cgi?id=184560 Reviewed by Youenn Fablet and Daniel Bates. This patch implements significant parts of https://github.com/whatwg/fetch/issues/687. We consume the From-Origin response header and only load the resource if: - The header is non-existent, empty, or invalid. - The header specifies 'same' and the resource's origin matches the originating document's origin and the origins up the frame tree. - The header specifies 'same-site' and the resource's eTLD+1 matches the originating document's eTLD+1 and the eTLD+1 of the documents up the frame tree. This feature is experimental and off by default. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): Support for the two new load parameters: - shouldEnableFromOriginResponseHeader - frameAncestorOrigins * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::areFrameAncestorsSameSite): (WebKit::areFrameAncestorsSameOrigin): (WebKit::shouldCancelCrossOriginLoad): The three functions above implement the new blocking logic. (WebKit::fromOriginResourceError): Convenience function that returns an error with the From-Origin error message. (WebKit::NetworkResourceLoader::didReceiveResponse): Now checks for a From-Origin response header. (WebKit::NetworkResourceLoader::didFailLoading): Now checks for a From-Origin response header. (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest): Now checks for a From-Origin response header. (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Now checks for a From-Origin response header. (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry): Now checks for a From-Origin response header. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder>>::encode): (IPC::ArgumentCoder>>::decode): Now encodes and decodes vectors of RefPtr. * Shared/WebCoreArgumentCoders.h: * Shared/WebPreferences.yaml: Added From-Origin support as an experimental feature. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetFromOriginResponseHeaderEnabled): (WKPreferencesGetFromOriginResponseHeaderEnabled): * UIProcess/API/C/WKPreferencesRef.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Sets the two new load parameters: - shouldEnableFromOriginResponseHeader - frameAncestorOrigins 2018-04-24 Jer Noble Don't add system framework paths to FRAMEWORK_SEARCH_PATHS https://bugs.webkit.org/show_bug.cgi?id=184786 Reviewed by Tim Horton. * Configurations/BaseTarget.xcconfig: * DerivedSources.make: 2018-04-24 Ryan Haddad Unreviewed, rolling out r230938. Introduced two ProcessSwap API test failures. Reverted changeset: "Keep around a pre-warmed process when doing process swap on navigation" https://bugs.webkit.org/show_bug.cgi?id=184765 https://trac.webkit.org/changeset/230938 2018-04-24 Zan Dobersek [CoordGraphics] Remove dead fixed layer code https://bugs.webkit.org/show_bug.cgi?id=184912 Reviewed by Michael Catanzaro. Drop the unused fixed layer handling code in CoordinatedGraphicsScene. The m_fixedLayers container can be removed, along with the adjustPositionForFixedLayers() method that operated on that container. This was the only method that operated with the m_scrollPosition member variable and the contentsPosition argument that's passed to the CoordinatedGraphicsScene::paintToCurrentGLContext() method. Both of these are removed, along with the scrollPosition attribute on the CoordinatedGraphicsState struct. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): (WebKit::CoordinatedGraphicsScene::setLayerState): (WebKit::CoordinatedGraphicsScene::deleteLayer): (WebKit::CoordinatedGraphicsScene::commitSceneState): (WebKit::CoordinatedGraphicsScene::purgeGLResources): (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers): Deleted. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::renderLayerTree): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::flushPendingLayerChanges): 2018-04-24 Zan Dobersek REGRESSION(r230950): Faulty commit sequencing in CoordinatedGraphicsScene https://bugs.webkit.org/show_bug.cgi?id=184917 Reviewed by Michael Catanzaro. After r230950, current animation state for a given layer is also taken into account when determining whether or not the layer requires a backing store. For that to work properly, all the animation state has to be updated before the backing store work. This patch changes the order of helper method invocations in CoordinatedGraphicsScene::setLayerState() to address that. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::setLayerState): 2018-04-24 Zan Dobersek [CoordGraphics] Remove unused fixed layout functionality https://bugs.webkit.org/show_bug.cgi?id=184908 Reviewed by Carlos Garcia Campos. Ports using the CoordinatedGraphics subsystem don't expose fixed layout support. As such, we're able to remove a lot of unused code and unnecessary USE(COORDINATED_GRAPHICS) special cases in generic sections in both WebCore and WebKit. Remove USE(COORDINATED_GRAPHICS) special-casing from the WebPage::setUseFixedLayout() method. This is not possible to enable for the GTK+ and WPE ports that use the CoordinatedGraphics subsytem via API. Removing all this unlocks removing considerable amounts of dead code and complexities in CoordinatedGraphics. WebChromeClient::delegatedScrollRequested() method is removed, along with the WebPage::pageDidRequestScroll() method that was only called from there. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::delegatedScrollRequested): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setUseFixedLayout): (WebKit::WebPage::pageDidRequestScroll): Deleted. * WebProcess/WebPage/WebPage.h: 2018-04-24 Zan Dobersek [CoordGraphics] Avoid painting backing stores for zero-opacity layers https://bugs.webkit.org/show_bug.cgi?id=184143 Reviewed by Carlos Garcia Campos. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::layerShouldHaveBackingStore): Mirror CoordinatedGraphicsLayer's backing store requirements. 2018-04-23 Daniel Bates Implement Same-Site cookies https://bugs.webkit.org/show_bug.cgi?id=159464 Reviewed by Brent Fulgham. Pass the Same-Site info through the WebKit abstractions. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): (WebKit::NetworkConnectionToWebProcess::getRawCookies): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::logCookieInformation const): (WebKit::logBlockedCookieInformation): (logCookieInformationInternal): (NetworkResourceLoader::logCookieInformation): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::constructRevalidationRequest): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: (WebKit::NetworkCache::SubresourceInfo::encode const): (WebKit::NetworkCache::SubresourceInfo::decode): (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h: (WebKit::NetworkCache::SubresourceInfo::isSameSite const): (WebKit::NetworkCache::SubresourceInfo::isTopSite const): Returns false; subresources do not represent a top-level navigation. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest): (WebKit::updateTaskWithFirstPartyForSameSiteCookies): (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::download): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesForDOM): (WebKit::WebPlatformStrategies::setCookiesFromDOM): (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): (WebKit::WebPlatformStrategies::getRawCookies): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2018-04-23 Youenn Fablet Make WebLoaderStrategy send to NetworkResourceLoader necessary parameters to handle full loads in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=184763 Reviewed by Chris Dumez. Set all required NetworkResourceLoadParameters for asynchronous loads. This includes preflight policy, CSP response headers, SecurityOrigin and content blockers identifier. Update NetworkLoadChecker to handle preflight policy. This is not needed right now since sync XHR and ping loads are using the default ConsiderPreflight policy. But this will be needed for XHR/fetch/EventSource loads. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): (WebKit::NetworkLoadChecker::checkRedirection): (WebKit::NetworkLoadChecker::validateResponse): (WebKit::NetworkLoadChecker::checkCORSRequest): * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::create): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): 2018-04-23 Wenson Hsieh [Extra zoom mode] REGRESSION(230860) Unable to change time input values using UI https://bugs.webkit.org/show_bug.cgi?id=184901 Reviewed by Tim Horton. Fixes the bug by falling back to setting the value of the focused input element in the case where the selection is not editable. Also adds plumbing to make time pickers testable in extra zoom mode. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setTimePickerValueToHour:minute:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setTimePickerValueToHour:minute:]): Add plumbing to make it possible for WebKitTestRunner to simulate picking a time from the given hours and minutes. This is currently only implemented for extra zoom mode, but may be implemented for UIKit's time picker as well in the future by adjusting -[WKContentView setTimePickerValueToHour:minute:]. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setTextAsync): 2018-04-23 Saam Barati Keep around a pre-warmed process when doing process swap on navigation https://bugs.webkit.org/show_bug.cgi?id=184765 Reviewed by Ryosuke Niwa. This patch makes it so that WebProcessPool prewarms a process when process swap on navigation is turned on. When we do a process swap on navigation, we first try to grab a prewarmed process before creating a new one. We try to be smart about when to create these processes. The initial heuristic that this patch chooses is when we reach the DidFirstVisuallyNonEmptyLayout layout milestone. We're going to try to improve on this heuristic in: https://bugs.webkit.org/show_bug.cgi?id=184899 This is a 40% progression on PLT with process swap on navigation turned on. * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::notifyProcessPoolToPrewarm): (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::tryTakePrewarmedProcess): (WebKit::WebProcessPool::warmInitialProcess): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::didReachGoodTimeToPrewarm): (WebKit::WebProcessPool::processForNavigation): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::create): (WebKit::WebProcessProxy::WebProcessProxy): (WebKit::m_isInPrewarmedPool): (WebKit::m_userMediaCaptureManagerProxy): Deleted. * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::isInPrewarmedPool const): (WebKit::WebProcessProxy::setIsInPrewarmedPool): 2018-04-23 Michael Catanzaro [WPE][GTK] Remove WlUniquePtr footgun https://bugs.webkit.org/show_bug.cgi?id=184405 Reviewed by Carlos Garcia Campos. Switch to std::unique_ptr. * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::WaylandCompositor): * UIProcess/gtk/WaylandCompositor.h: (WebKit::WaylandCompositor::DisplayDeleter::operator()): 2018-04-23 Daniel Bates Attempt to fix the Apple Internal build following r230921 (https://bugs.webkit.org/show_bug.cgi?id=159464) Forward declare some SPI. Add availability guard. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: 2018-04-23 Zalan Bujtas [LayoutFormattingContext] Initial commit. https://bugs.webkit.org/show_bug.cgi?id=184896 Reviewed by Antti Koivisto. * Configurations/FeatureDefines.xcconfig: 2018-04-23 Daniel Bates Implement Same-Site cookies https://bugs.webkit.org/show_bug.cgi?id=159464 Reviewed by Brent Fulgham. Pass the Same-Site info through the WebKit abstractions. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): (WebKit::NetworkConnectionToWebProcess::getRawCookies): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::logCookieInformation const): (WebKit::logBlockedCookieInformation): (logCookieInformationInternal): (NetworkResourceLoader::logCookieInformation): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::constructRevalidationRequest): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: (WebKit::NetworkCache::SubresourceInfo::encode const): (WebKit::NetworkCache::SubresourceInfo::decode): (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h: (WebKit::NetworkCache::SubresourceInfo::isSameSite const): (WebKit::NetworkCache::SubresourceInfo::isTopSite const): Returns false; subresources do not represent a top-level navigation. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest): (WebKit::updateTaskWithFirstPartyForSameSiteCookies): (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::download): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesForDOM): (WebKit::WebPlatformStrategies::setCookiesFromDOM): (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): (WebKit::WebPlatformStrategies::getRawCookies): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2018-04-23 Chris Dumez WebProcessProxy frequently re-takes a process assertion for the network process even though is already has one https://bugs.webkit.org/show_bug.cgi?id=184889 Reviewed by Brady Eidson. In ProcessThrottler::updateAssertionNow(), if the new process assertion state is the same as the existing one, then return early. Otherwise, we would end up calling WebProcessProxy::didSetAssertionState() for the same assertion state, which would cause duplicate logging but also some unnecessary work. * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::updateAssertionNow): 2018-04-23 Zan Dobersek [CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, CoordinatedGraphicsLayer https://bugs.webkit.org/show_bug.cgi?id=184881 Reviewed by Michael Catanzaro. The CompositingCoordinator::setVisibleContentsRect() method is always called with a (0,0) FloatPoint value as the trajectory vector parameter, which is already the default value in TiledBackingStore where this ends up. Removing this call chain also enables removing some unnecessary and odd code in the CoordinatedGraphicsLayer class. This doesn't yet touch the trajectory logic in the TiledBackingStore class since it's not yet a given this won't be used in the future. But if that will be necessary, hope is to not use it this way. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::setVisibleContentsRect): (WebKit::CompositingCoordinator::mainContentsLayer): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewport): 2018-04-23 Fujii Hironori [Win][WK2] REGRESSION(r230834) 'getpid': identifier not found https://bugs.webkit.org/show_bug.cgi?id=184877 Reviewed by Yusuke Suzuki. * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItem): Use WTF::getCurrentProcessID() instead of getpid(). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::goToBackForwardItem): Ditto. 2018-04-23 Zan Dobersek [TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore https://bugs.webkit.org/show_bug.cgi?id=184810 Reviewed by Carlos Garcia Campos. CoordinatedBackingStore should inherit directly from RefCounted<> now that TextureMapperBackingStore doesn't anymore. * Shared/CoordinatedGraphics/CoordinatedBackingStore.h: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded): 2018-04-22 Zan Dobersek [CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraphicsState https://bugs.webkit.org/show_bug.cgi?id=184811 Reviewed by Carlos Garcia Campos. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::flushPendingLayerChanges): Stop setting the removed contentsSize and coveredRect attributes. These were only ever set to the appropriate values, but were then never used anywhere. 2018-04-22 Matt Baker Web Inspector: WebInspectorProxy releases WKWebInspectorProxyObjCAdapter without removing corresponding observer https://bugs.webkit.org/show_bug.cgi?id=184865 Reviewed by Brian Burg. Replace the early return removed in https://bugs.webkit.org/show_bug.cgi?id=177661, so that WKWebInspectorProxyObjCAdapter and the view controller can be reused when reopening the Inspector while the WebView is still alive. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformCreateFrontendPage): 2018-04-22 Paul Knight Add -[WKInputDelegate _webView:decidePolicyForFocusedElement:] so clients can request default focusing behavior https://bugs.webkit.org/show_bug.cgi?id=184844 Reviewed by Dan Bernstein. If a client doesn't implement -[_WKInputDelegate _webView:focusShouldStartInputSession:] the default focus behavior only brings up the keyboard if it's already onscreen, the interaction is user driven, and other factors that even depend on what feature flags are enabled. If a client implements _webView:focusShouldStartInputSession:, they don't have a good way to specifiy they'd like to fall back to the default behavior. This makes it difficult for a client to use the default in most cases, but sometimes allow programmatic focus from the page, for example. Add a new delegate method -_webView:decidePolicyForFocusedElement: that returns a new enum type _WKFocusStartsInputSessionPolicy. Clients can return _WKFocusStartsInputSessionPolicyAuto to request the default behavior, or _WKFocusStartsInputSessionPolicyAllow / Disallow to directly control whether the keyboard appears to assist the focused node. * UIProcess/API/Cocoa/_WKInputDelegate.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): 2018-04-21 Jeremy Jones Disable backward and forward navigation swipes while in fullscreen. https://bugs.webkit.org/show_bug.cgi?id=184656 rdar://problem/36057535 Reviewed by Tim Horton. Disable navigation swipes while in fullscreen. * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::canSwipeInDirection const): 2018-04-21 Youenn Fablet Activate NetworkLoadChecker for media loads https://bugs.webkit.org/show_bug.cgi?id=184841 Reviewed by Eric Carlson. Instantiate a NetworkLoadChecker for NetworkResourceLoader for audio/video loads. Move CORS checks for response after handling of 304 checks. For 304 checks, we need to do the CORS checks on the validated cached response, not the 304 received response. Updated ResourceError argument coder to explicitly pass the error type as some errors created by NetworkLoadChecker would otherwise be received as General errors by WebProcess. Updated platform data encoding of ResourceError accordingly. All changes are covered by regular media loading layout tests. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::shouldUseNetworkLoadChecker): (WebKit::NetworkResourceLoader::didReceiveResponse): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): We need to set the type after decoding the NSError as ResourceError tries to guess the type from NSError data. * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2018-04-20 Carlos Garcia Campos [SOUP] Do TLS error checking on GTlsConnection::accept-certificate https://bugs.webkit.org/show_bug.cgi?id=184480 Reviewed by Michael Catanzaro. Connect to GTlsConnection::accept-certificate signal instead of SoupMessage::notify::tls-errors to perform the TLS errors check. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::createRequest): Do not connect to SoupMessage::notify::tls-errors. (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificateCallback): Call tlsConnectionAcceptCertificate() is the task is still ongoing. (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate): Check TLS errors here. (WebKit::NetworkDataTaskSoup::networkEventCallback): Pass the stream to networkEvent. (WebKit::NetworkDataTaskSoup::networkEvent): Connect to GTlsConnection::accept-certificate. * NetworkProcess/soup/NetworkDataTaskSoup.h: 2018-04-20 Timothy Hatcher NULL dereference crash sometimes under [super initWithCoder:] in WebView https://bugs.webkit.org/show_bug.cgi?id=184851 rdar://problem/39611236 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView effectiveAppearanceDidChange]): Added a null check and call the code later in initialization. 2018-04-20 Tim Horton Adjust geolocation feature flag https://bugs.webkit.org/show_bug.cgi?id=184856 Reviewed by Wenson Hsieh. * Configurations/FeatureDefines.xcconfig: 2018-04-20 Chris Dumez Unreviewed attempt to fix GTK build after r230867. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp: (webkit_dom_dom_window_get_self): (webkit_dom_dom_window_get_window): (webkit_dom_dom_window_get_frames): (webkit_dom_dom_window_get_opener): (webkit_dom_dom_window_get_parent): (webkit_dom_dom_window_get_top): 2018-04-20 Commit Queue Unreviewed, rolling out r230873. https://bugs.webkit.org/show_bug.cgi?id=184857 Broke the iOS build (Requested by cdumez on #webkit). Reverted changeset: "Disable backward and forward navigation swipes while in fullscreen." https://bugs.webkit.org/show_bug.cgi?id=184656 https://trac.webkit.org/changeset/230873 2018-04-20 Chris Dumez REGRESSION (r229828): web view doesn’t update or respond to resizing until client calls policy decision handler https://bugs.webkit.org/show_bug.cgi?id=184210 Reviewed by Wenson Hsieh. r229828 tried to have some API tests happy on iOS by freezing the layer tree during the navigation policy decision. However, this is observable by the client application and a regression from when the policy delegate was synchronous. To address the issue, this patch reverts r229828 and instead updates the iOS API tests to wait for the next presentation update after navigating before interacting with the view. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebKit::WebFrameLoaderClient::cancelPolicyCheck): (WebKit::WebFrameLoaderClient::provisionalLoadStarted): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: 2018-04-20 Brent Fulgham Limit cookie header access to Network process https://bugs.webkit.org/show_bug.cgi?id=184764 Reviewed by Youenn Fablet. Revise the handling of cookie request headers so that we don't interact with them in the WebContent process. They are only needed for interaction with the server and the network process, so we should limit their scope to just the Network process. Instead, we should handle a token that represents the cookie headers in the WebContent process, which can be converted to the relevant cookie data in the network process when needed. * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::sendHandshake): * NetworkProcess/NetworkSocketStream.h: * NetworkProcess/NetworkSocketStream.messages.in: * WebProcess/Network/WebSocketStream.cpp: (WebKit::WebSocketStream::networkProcessCrashed): (WebKit::WebSocketStream::platformSendHandshake): (WebKit::WebSocketStream::didSendHandshake): * WebProcess/Network/WebSocketStream.h: * WebProcess/Network/WebSocketStream.messages.in: 2018-04-20 Jeremy Jones Disable backward and forward navigation swipes while in fullscreen. https://bugs.webkit.org/show_bug.cgi?id=184656 rdar://problem/36057535 Reviewed by Tim Horton. Disable navigation swipes while in fullscreen. * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::canSwipeInDirection const): 2018-04-20 Jeremy Jones Element fullscreen, expose WKWebView _fullScreenPlaceholderView as iOS SPI https://bugs.webkit.org/show_bug.cgi?id=184826 rdar://problem/39600825 Reviewed by Tim Horton. Add _fullScreenPlaceholderView for iOS similar to the one for Mac. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView closeFullScreenWindowController]): (-[WKWebView fullScreenPlaceholderView]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h: * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController webViewPlaceholder]): 2018-04-20 Wenson Hsieh [Extra zoom mode] Injected bundle form client should be notified when editing text fields https://bugs.webkit.org/show_bug.cgi?id=184822 Reviewed by Tim Horton. Fixes the bug by making a couple of tweaks: (1) don't use a separate codepath for inserting text in text inputs, and (2) force a user typing gesture when inserting text using this codepath (i.e. WKTextInputListViewController). Also adds plumbing to enable testing text entry with WKTextInputListViewController in extra zoom mode. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateTextEntered:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Introduce testing SPI to simulate text entry. Additionally, add a missing availability annotation around testing SPI added in 2017 to help test drag and drop for iOS 11. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _simulateTextEntered:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setTextAsync): 2018-04-20 Jeremy Jones EnterFullscreen must update the minimum and maximum layout sizes. https://bugs.webkit.org/show_bug.cgi?id=184828 rdar://problem/38435829 Reviewed by Jon Lee. Without this, the WKWebView won't layout to the full size in fullscreen mode. * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController enterFullScreen]): 2018-04-18 Jer Noble Don't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds https://bugs.webkit.org/show_bug.cgi?id=184762 Reviewed by Dan Bernstein. * Configurations/BaseTarget.xcconfig: 2018-04-20 Youenn Fablet Refactor NetworkResourceLoader to check for m_networkLoadChecker presence before using it https://bugs.webkit.org/show_bug.cgi?id=184755 Reviewed by Chris Dumez. Make NetworkResourceLoader always use m_networkLoadChecker if there is one. This is only used now for synchronous loads but will be used in the future for asynchronous loads as well. Since we call didFail asynchronously to make sync/async handling more consistent, We need to keep track of whether we will do clean-up twice. A boolean is added for that purpose in NetworkResourceLoader. There is a small change of behavior in the way we return an error. Instead of returning a platformBadResponseError, we are now returning the error as computed by NetworkLoadChecker. This allows getting some more error logging in the JS console. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): * NetworkProcess/NetworkResourceLoader.h: 2018-04-20 Timothy Hatcher Include missing files in WKContentViewInteraction.{mm,h} https://bugs.webkit.org/show_bug.cgi?id=184832 rdar://problem/35377120 Reviewed by Wenson Hsieh. Some WebDriver files were missing and should be included. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): 2018-04-20 Youenn Fablet WebPage sometimes incorrectly rules out PDF as a mime type that can be showed https://bugs.webkit.org/show_bug.cgi?id=184369 Reviewed by Chris Dumez. Use API to check for plugin availability for response at navigation time. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::canShowResponse const): (WebKit::WebPage::canShowMIMEType const): * WebProcess/WebPage/WebPage.h: 2018-04-20 Daniel Bates Remove Strong Password decoration when text field type changes https://bugs.webkit.org/show_bug.cgi?id=184795 Reviewed by Antti Koivisto. Add injected bundle API and WebKit UI delegate SPI to notify the embedding client when the Strong Password appearance of an HTML input element is resigned. We add C SPI for Safari on Mac. * UIProcess/API/APIUIClient.h: (API::UIClient::didResignInputElementStrongPasswordAppearance): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didResignInputElementStrongPasswordAppearance): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: (API::InjectedBundle::PageUIClient::didResignInputElementStrongPasswordAppearance): * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h: * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::didResignInputElementStrongPasswordAppearance): * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::inputElementDidResignStrongPasswordAppearance): * WebProcess/WebCoreSupport/WebChromeClient.h: 2018-04-20 Megan Gardner Fixes for failing tests associated with switching Text Selection Assistants https://bugs.webkit.org/show_bug.cgi?id=184806 Reviewed by Beth Dakin and Wenson Hsieh. The major fix is the disabling the double tap noneditable text selection gesture. The other fixes are small tweaks that shouldn't even be run into with the fix to the double tap gesture, but they are incorrect, so I am taking the opportunity to fix them now, in case we run into them again. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): We should not be allowing a double tap text gestures in non-editable web content. We didn't have one with the old assistant. Fortunately, this is easily disabled. (-[WKContentView canPerformActionForWebView:withSender:]): We should not allow the lookup action if we do not actually have a selection. It is meaningless without one. (-[WKContentView selectedTextRange]): We should not return a selection to UIKit if all we have is caret selection in non-editable content. We have this for selections on Mac, but UIKit does not know how to properly handle this, and will have incorrect behavior if we return a valid selection. 2018-04-20 Timothy Hatcher WebEvent fails to convert synthetic WebMouseEvent for automation https://bugs.webkit.org/show_bug.cgi?id=184824 rdar://problem/35377120 Reviewed by Brian Burg. Add WebEvent conversions that existed in PlatformEventFactoryIOS for legacy WebKit, but never got added in WebIOSEventFactory and NativeWebMouseEvent for modern WebKit. This affected WebDriver, and some events not being deliverd to the page. * Shared/NativeWebMouseEvent.h: (WebKit::NativeWebMouseEvent::nativeEvent const): * Shared/ios/NativeWebMouseEventIOS.mm: Added. (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): * Shared/ios/WebIOSEventFactory.h: * Shared/ios/WebIOSEventFactory.mm: (WebIOSEventFactory::createWebMouseEvent): * WebKit.xcodeproj/project.pbxproj: 2018-04-20 Michael Catanzaro Unreviewed, fix -Wformat warning * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishLoadForFrame): 2018-04-20 Youenn Fablet Make PluginData cache its web visible plugins https://bugs.webkit.org/show_bug.cgi?id=184421 Reviewed by Chris Dumez. Rename methods. Pass an URL instead of relying on Page URL as the page URL might not always be the URL we want to check against plugins. In particular when navigation is on-going, we want to check the plugins against the being navigated URL. * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::pluginInfo): (WebKit::WebPluginInfoProvider::webVisiblePluginInfo): * WebProcess/Plugins/WebPluginInfoProvider.h: 2018-04-19 Carlos Garcia Campos Unreviewed. Fix GTK+ build after r230830. Add SimulatedInputDispatcher.cpp to the build. * CMakeLists.txt: 2018-04-19 Brady Eidson Make back forward cache work with process swapping. and https://bugs.webkit.org/show_bug.cgi?id=184793 Reviewed by Chris Dumez. We previously saved old processes in "SuspendedPageProxy" objects. Now we reuse them when going back or forward. * Platform/Logging.h: * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::setSuspendedPage): (WebKit::WebBackForwardListItem::loggingString): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::suspendedPage const): Teach Navigation objects their source WebBackForwardListItems: * UIProcess/API/APINavigation.cpp: (API::Navigation::Navigation): (API::Navigation::loggingString const): * UIProcess/API/APINavigation.h: (API::Navigation::create): (API::Navigation::targetItem const): (API::Navigation::fromItem const): (API::Navigation::backForwardListItem): Deleted. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/SuspendedPageProxy.cpp: (WebKit::messageNamesToIgnoreWhileSuspended): (WebKit::SuspendedPageProxy::SuspendedPageProxy): (WebKit::SuspendedPageProxy::~SuspendedPageProxy): (WebKit::SuspendedPageProxy::webProcessDidClose): (WebKit::SuspendedPageProxy::didReceiveMessage): (WebKit::SuspendedPageProxy::loggingString const): * UIProcess/SuspendedPageProxy.h: (WebKit::SuspendedPageProxy::origin const): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::WebBackForwardList): (WebKit::WebBackForwardList::~WebBackForwardList): (WebKit::WebBackForwardList::pageClosed): (WebKit::WebBackForwardList::addItem): (WebKit::WebBackForwardList::goToItem): (WebKit::WebBackForwardList::removeAllItems): (WebKit::WebBackForwardList::clear): (WebKit::WebBackForwardList::restoreFromState): (WebKit::WebBackForwardList::filteredItemStates const): (WebKit::WebBackForwardList::itemStates const): (WebKit::WebBackForwardList::loggingString): * UIProcess/WebBackForwardList.h: * UIProcess/WebNavigationState.cpp: (WebKit::WebNavigationState::createLoadRequestNavigation): (WebKit::WebNavigationState::createBackForwardNavigation): * UIProcess/WebNavigationState.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::maybeCreateSuspendedPage): (WebKit::WebPageProxy::reattachToWebProcessWithItem): (WebKit::WebPageProxy::loadRequest): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::didCreateMainFrame): (WebKit::WebPageProxy::didCreateSubframe): (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::connectionWillOpen): (WebKit::WebPageProxy::attachToProcessForNavigation): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessLifetimeTracker.cpp: (WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess): (WebKit::WebProcessLifetimeTracker::connectionWillOpen): Deleted. * UIProcess/WebProcessLifetimeTracker.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::registerSuspendedPageProxy): (WebKit::WebProcessPool::unregisterSuspendedPageProxy): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::suspendWebPageProxy): (WebKit::WebProcessProxy::updateBackForwardItem): (WebKit::WebProcessProxy::frameCreated): * UIProcess/WebProcessProxy.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::attachDrawingArea): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItemFromUIProcess): (WebKit::WebBackForwardListProxy::addItem): * WebProcess/WebPage/WebBackForwardListProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_credentialsMessenger): (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::goToBackForwardItem): (WebKit::WebPage::restoreSessionInternal): (WebKit::WebPage::restoreSession): (WebKit::WebPage::updateBackForwardListForReattach): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): (WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Force a reattachment of the drawing area from a resumed WebProcess to the UIProcess (to make the page cache work) 2018-04-19 Brian Burg Web Automation: add support for mouse/keyboard interaction sequences https://bugs.webkit.org/show_bug.cgi?id=184603 Reviewed by Timothy Hatcher. Add new protocol methods and WebKit support for implementing the W3C Actions API. This is a generic command for sending low-level mouse, key, and touch events to test page behavior when performing drag-and-drop, gestures, or specific keydown/keyups. To implement this functionality, this patch adds SimulatedInputDispatcher, a class for dispatching input events asynchronously. Similar to the WebDriver specification, this is designed as a keyframing API. Callers set up several "input sources" such as keyboard or mouse, and then specify the states of that input source over time. The dispatcher calculates diffs between the previous and current keyframes and generates the appropriate events that would happen if a user caused the state transition. For example, if a mouse input source's state changes, the dispatcher sends synthetic mousemove, mousedown, or mouseup events depending on the pre- and post-state. This is uninteresting and overcomplicated for simple key and mouse presses, but it's really designed with an eye towards supporting mousemove interpolation and touch event interpolation in later patches. The strategy for dispatching events depends on the input source type; right now, these map directly to the existing platformSimulate{Mouse, Keyboard}Interaction methods. In the future, the dispatch strategy may be elaborated for interpolated mousemove events. This patch depends on support added in bug 184462. No tests yet. When this command is hooked up to a driver, the code will be exercised by W3C actions test suite, which is fairly complex at this point relative to end-user code. * UIProcess/Automation/Automation.json: Add new types and commands. * UIProcess/Automation/SimulatedInputDispatcher.h: Added. (WebKit::SimulatedInputSourceState::emptyState): (WebKit::SimulatedInputSource::create): (WebKit::SimulatedInputSource::SimulatedInputSource): (WebKit::SimulatedInputDispatcher::Client::~Client): Add structs for input source, source state, and keyframe. The dispatcher's client interface is implemented by WebAutomationSession. (WebKit::SimulatedInputDispatcher::create): * UIProcess/Automation/SimulatedInputDispatcher.cpp: Added. (WebKit::SimulatedInputKeyFrame::SimulatedInputKeyFrame): (WebKit::SimulatedInputKeyFrame::maximumDuration const): (WebKit::SimulatedInputKeyFrame::keyFrameFromStateOfInputSources): (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): (WebKit::SimulatedInputDispatcher::SimulatedInputDispatcher): (WebKit::SimulatedInputDispatcher::~SimulatedInputDispatcher): (WebKit::SimulatedInputDispatcher::isActive const): (WebKit::SimulatedInputDispatcher::keyFrameTransitionDurationTimerFired): (WebKit::SimulatedInputDispatcher::isKeyFrameTransitionComplete const): (WebKit::SimulatedInputDispatcher::transitionToNextKeyFrame): (WebKit::SimulatedInputDispatcher::transitionToNextInputSourceState): (WebKit::SimulatedInputDispatcher::transitionBetweenKeyFrames): (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): (WebKit::SimulatedInputDispatcher::run): (WebKit::SimulatedInputDispatcher::cancel): (WebKit::SimulatedInputDispatcher::finishDispatching): The dispatcher handles one interaction at a time. The interaction is described by an array of keyframes, and each keyframe has an array of states. The dispatcher transitions between keyframes by sequentially and asynchronously emitting events that cause each input source state to transition as desired. Keyframe transitions are additionally gated by a "maximum duration" timer. Each step that the dispatcher executes is asynchronous, so the dispatcher keeps most state in members and uses error argument lambdas as completion handlers for various async things. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::WebAutomationSession): (WebKit::WebAutomationSession::inputDispatcherForPage): (WebKit::WebAutomationSession::inputSourceForType const): Add canonical input sources that are used to keep track of state across interaction sequences. (WebKit::WebAutomationSession::isSimulatingUserInteraction const): (WebKit::WebAutomationSession::mouseEventsFlushedForPage): (WebKit::WebAutomationSession::keyboardEventsFlushedForPage): Remove m_simulatingUserInteraction since it can be computed based on other members. (WebKit::WebAutomationSession::willClosePage): If the page is being torn down, stop the dispatcher if needed and cancel any callbacks waiting for mouse/key events to be retired. (WebKit::WebAutomationSession::simulateMouseInteraction): (WebKit::WebAutomationSession::simulateKeyboardInteraction): Add easy-to-use async methods for simulating mouse and key events. These are hooked up to SimulatedInputDispatcher using async completion handlers. (WebKit::protocolMouseButtonToWebMouseEventButton): (WebKit::WebAutomationSession::performMouseInteraction): (WebKit::WebAutomationSession::performKeyboardInteractions): Adjust some naming. (WebKit::simulatedInputSourceTypeFromProtocolSourceType): (WebKit::WebAutomationSession::performInteractionSequence): (WebKit::WebAutomationSession::cancelInteractionSequence): Add command handlers for the new action commands in Automation protocol. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: (WebKit::mouseButtonToGdkButton): (WebKit::WebAutomationSession::platformSimulateMouseInteraction): (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): (WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted. * UIProcess/Automation/ios/WebAutomationSessionIOS.mm: (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): (WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted. Rename the keyboard platform method to match the naming of the mouse platform method. Take advantage of the 'using' alias to make the tedious switches easier to read. * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::WebAutomationSession::platformSimulateMouseInteraction): (WebKit::virtualKeyHasStickyModifier): (WebKit::keyCodeForVirtualKey): (WebKit::eventModifierFlagsForVirtualKey): (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): (WebKit::WebAutomationSession::platformSimulateKeySequence): (WebKit::keyHasStickyModifier): Deleted. (WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted. Allow the keyboard simulation method to take a virtual key and unichar to better match how this is used by the Perform Actions command and its machinery. * WebKit.xcodeproj/project.pbxproj: 2018-04-19 Jiewen Tan Remove access to keychain from the WebContent process https://bugs.webkit.org/show_bug.cgi?id=184428 Reviewed by Brent Fulgham. Part 1. Remove com.apple.identities from WebContent-iOS.entitlements, which is needed to encode/decode NSError’s userInfo[NSErrorClientCertificateChainKey] when the corresponding NSErorr is relayed through WebContent Process from Networking Process to UI Process after a HTTPS client certificate authentication is rejected becuase of bad certificates. This patch implements corresponding workarounds as well. The workaround works for mac, too. Sadly, this change can only be tested manually at this moment. Please refer to the radar for testing steps. * Configurations/WebContent-iOS.entitlements: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::encodeNSError): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitialize): 2018-04-19 David Kilzer Enable Objective-C weak references Reviewed by Dan Bernstein. * Configurations/Base.xcconfig: (CLANG_ENABLE_OBJC_WEAK): Enable. 2018-04-19 Youenn Fablet Web Inspector backend should get headers & cookies from network process separately from resource requests https://bugs.webkit.org/show_bug.cgi?id=184396 Reviewed by Brian Burg. Add support for storing response and network metrics for every resource load. This is made conditional on inspector being activated. NetworkConnectionToWebProcess keeps a response and network metrics for every load. This is cleared when inspector is going away or when a web process requests the data. WebLoaderStrategy gets this data through synchronous IPC. Synchronous IPC is a temporary implementation until Inspector code gets refactored. Updated WebLoaderStrategy to pass the sourceOrigin for every NetworkResourceLoader. This activates additional sanitization based on cross origin status. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled): * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationResponse): (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics): (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationResponse): (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics): (WebKit::NetworkConnectionToWebProcess::removeNetworkLoadInformation): * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::didFailLoading): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier): (WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): 2018-04-19 Wenson Hsieh [Extra zoom mode] Add a mechanism to extend the height of the layout viewport in extra zoom mode https://bugs.webkit.org/show_bug.cgi?id=184782 Reviewed by Tim Horton. In extra zoom mode, at initial scale, fixed position elements may take up a large portion of the viewport. This leaves little room for non-fixed-position elements; to improve this experience, we introduce a mechanism to extend the height of the layout viewport. By default, the layout viewport size is determined by the FrameView's baseLayoutViewportSize, and passed into FrameView::computeUpdatedLayoutViewportRect in the client layer; in extra zoom mode, if the layout viewport is shorter than the document width, we try to double the height of the layout viewport and clamp to the document height if necessary. * Shared/WebPreferences.yaml: Add a new preference to determine the factor by which we should expand the height of the layout viewport. By default, this is 0 (no increase in layout viewport height); in extra zoom mode, this is 1, which means we'll increase the layout viewport's height by 1x the default height. * Shared/WebPreferencesDefaultValues.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView activeMinimumLayoutSizes:]): Fixes a bug when computing the active minimum layout size. If a minimum allowed layout width is specified, we clamp the active layout width (normally the view size) so that it is no less than the minimum allowed layout width. However, the height is currently unaffected, which causes FrameView::baseLayoutViewportSize to return a bogus size, where the width is scaled to 320px but the height isn't. Instead, we should scale the layout height to match the new width here. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeCustomFixedPositionRect const): Expand the base viewport layout size if necessary, given the expansion factor in WebPreferences. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): Expand the base viewport layout size if necessary, given the expansion factor in Settings. 2018-04-19 Brian Burg Web Automation: simulated mouse interactions should not be done until associated DOM events have been dispatched https://bugs.webkit.org/show_bug.cgi?id=184462 Reviewed by Carlos Garcia Campos and Tim Horton. Covered by existing layout tests and actions endpoints in WebDriver test suite. In preparation for implementing the W3C WebDriver command "Perform Actions", we need a way to know when a simulated mouse event has been fully processed by WebProcess and it is okay to continue to dispatch more simulated events. This patch makes mouse events go through a queue as they are delivered to WebPageProxy. The approach is very similar to how key events are handled. In the key event case, lots of WebEvents can come out of typing one keystroke, so these need to be queued up and retired one by one when the WebProcess has finished handling each event. In some mouse event cases---particularly fake mouse moves---there can also be more than one mouse event waiting to be handled by WebProcess. In the past, these queued mouse events were tracked with several member variables as different use cases emerged. These are all replaced with ordinary deque operations, such as peeking or checking the queue length. * Platform/Logging.h: Add logging channel for mouse events. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::AutomationCommandError::toProtocolString): Add type-safe helper class for command errors. In future patches we can hide knowledge of how this is sent over the protocol by relying more on the convenience constructors and .toProtocolString() method. (WebKit::WebAutomationSession::willShowJavaScriptDialog): This section needs adjustments. Since performMouseInteraction now depends on key events being processed prior to returning from the command, we need to abort any key event callbacks that are pending if an alert pops up as a result of sending a mousedown event. Any mouse events that are still queued will be handled when the alert is dismissed and the nested run loop exits. (WebKit::WebAutomationSession::mouseEventsFlushedForPage): (WebKit::WebAutomationSession::keyboardEventsFlushedForPage): Modernize this a bit. Don't spread knowledge about how commands are sent back out into event handling code. Our wrapper callbacks in performXXXInteraction handle the protocol-specific details of the response. (WebKit::WebAutomationSession::performMouseInteraction): Add code similar to performKeyboardInteractions so that the command doesn't finish until the mouse event has been fully handled. Unlike keyboards, sometimes mouse interactions don't turn into WebEvents so we also need to handle the case where there is nothing to be waited on because hit testing did not return a target to deliver the event to. (WebKit::WebAutomationSession::performKeyboardInteractions): Modernize a little bit to use generic callbacks rather than protocol-generated callbacks in the event waiting/handling code. Now it matches the types used for the mouse event case. * UIProcess/Automation/WebAutomationSession.h: (WebKit::AutomationCommandError::AutomationCommandError): Add a helper struct to hold an enumerated error name and an optional free-form error message. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::webMouseEventTypeString): (WebKit::webKeyboardEventTypeString): (WebKit::WebPageProxy::handleMouseEvent): (WebKit::WebPageProxy::processNextQueuedMouseEvent): Split the old method into handleMouseEvent (called by other code) and processNextQueuedMouseEvent. The latter sends the next mouse event to WebProcess, and can be triggered in didReceiveEvent if there are more mouse events to be sent to WebProcess. (WebKit::WebPageProxy::isProcessingMouseEvents const): Added. (WebKit::WebPageProxy::currentlyProcessedMouseDownEvent): Reimplemented on top of the deque. (WebKit::WebPageProxy::didReceiveEvent): Unify the code paths for different mouse event types to all use the deque. They also will notify the automation session if there are no more mouse events to send (i.e., interaction is over). (WebKit::WebPageProxy::resetStateAfterProcessExited): Add handling for new map. 2018-04-19 Andy Estes [iOS] Implement find-in-page in the new WKPDFView https://bugs.webkit.org/show_bug.cgi?id=184654 Reviewed by Tim Horton. This is theoretically covered by existing WKPDFView API tests, but that's currently blocked by . * UIProcess/ios/WKPDFView.mm: (stringCompareOptions): Mapped _WKFindOptions to NSStringCompareOptions. (-[WKPDFView _resetFind]): Cancelled an in-progress search and reset the search state. (-[WKPDFView _findString:withOptions:maxCount:completion:]): Stored the completion block, find string, and max count, then called -[PDFHostViewController findString:withOptions:]. (-[WKPDFView web_countStringMatches:options:maxCount:]): Called -_findString:withOptions:maxCount:completion: with a completion block that calls FindClient::didCountStringMatches() with _findStringCount. (-[WKPDFView _computeFocusedSearchResultIndexWithOptions:didWrapAround:]): Computed the focused search result index, taking _findStringCount and wrap-around into account. There are two interesting cases to mention here: 1. We can't change focus while a search is in progress, because we can't properly handle wrap-around without a _findStringCount. If a search is in progress, store the requested focus change in _focusedSearchResultPendingOffset, which will be applied once the search finishes. 2. If wrap-around is about to happen but the find options do not allow it, we need to call FindClient::didFailToFindString(). Handle this by returning NO, which will tell -_focusOnSearchResultWithOptions: to call didFailToFindString() if a search is not in progress. (-[WKPDFView _focusOnSearchResultWithOptions:]): If -_computeFocusedSearchResultIndexWithOptions:didWrapAround: failed while a search is in progress, just return early. Otherwise, call FindClient::didFailToFindString(). If computing the index did not fail, call -[PDFHostViewController focusOnSearchResultAtIndex:] to change focus and then call FindClient::didFindString() to inform the client. (-[WKPDFView web_findString:options:maxCount:]): If the find string is equal to _findString, change focus. Otherwise, start a new search. (-[WKPDFView web_hideFindUI]): Called -_resetFind. (-[WKPDFView pdfHostViewController:findStringUpdate:done:]): Stored the count in _findStringCount and called _findCompletion once the search is done. 2018-04-17 Filip Pizlo The InternalFunction hierarchy should be in IsoSubspaces https://bugs.webkit.org/show_bug.cgi?id=184721 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::JSNPMethod::subspaceForImpl): * WebProcess/Plugins/Netscape/JSNPMethod.h: (WebKit::JSNPMethod::create): Deleted. (WebKit::JSNPMethod::npIdentifier const): Deleted. (WebKit::JSNPMethod::createStructure): Deleted. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::subspaceForImpl): * WebProcess/Plugins/Netscape/JSNPObject.h: (WebKit::JSNPObject::create): Deleted. (WebKit::JSNPObject::npObject const): Deleted. (WebKit::JSNPObject::createStructure): Deleted. 2018-04-19 Brady Eidson Add globally-unique HistoryItem identifiers (and have WebKit2 adopt them). and https://bugs.webkit.org/show_bug.cgi?id=184750 Reviewed by Ryosuke Niwa. With process swapping, the assumption that "back/forward items belong to a process" is invalid. All HistoryItem/WebBackForwardListItems now need to be uniquely identified across all processes, no matter which process they originated from, so there will never be a collision in the UIProcess. This allows us to: - Have the UIProcess to keep a single process-wide map of all WebBackForwardListItems - Get rid of the per-WebProcess WebBackForwardListItem map - Simplify a lot of WebBackForwardList(Proxy) code that no longer needs to keep that per-process map in sync - Get rid of a lot of other ancillary code * Shared/SessionState.cpp: (WebKit::BackForwardListItemState::decode): * Shared/SessionState.h: * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::WebBackForwardListItem): (WebKit::WebBackForwardListItem::~WebBackForwardListItem): (WebKit::WebBackForwardListItem::itemForID): (WebKit::WebBackForwardListItem::highestUsedItemID): Deleted. * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::itemID const): * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::itemForID): (WebKit::WebBackForwardList::pageClosed): (WebKit::WebBackForwardList::addItem): (WebKit::WebBackForwardList::restoreFromState): (WebKit::generateWebBackForwardItemID): Deleted. * UIProcess/WebBackForwardList.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeCreateSuspendedPage): (WebKit::WebPageProxy::initializeWebPage): (WebKit::WebPageProxy::willGoToBackForwardListItem): (WebKit::WebPageProxy::restoreFromSessionState): (WebKit::WebPageProxy::backForwardAddItem): (WebKit::WebPageProxy::backForwardGoToItem): (WebKit::WebPageProxy::backForwardItemAtIndex): (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::backForwardRemovedItem): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: Explicitly set the UIProcess Process::Identifier so it starts at "1" and then the first child process starts at "2", etc etc. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::removeWebPage): (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess): (WebKit::WebProcessProxy::updateBackForwardItem): (WebKit::WebProcessProxy::webBackForwardItem const): Deleted. (WebKit::WebProcessProxy::registerNewWebBackForwardListItem): Deleted. (WebKit::WebProcessProxy::removeBackForwardItem): Deleted. (WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toBackForwardListItemState): (WebKit::applyFrameState): (WebKit::toHistoryItem): (WebKit::toPageState): Deleted. * WebProcess/WebCoreSupport/SessionStateConversion.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItemFromUIProcess): (WebKit::WK2NotifyHistoryItemChanged): (WebKit::WebBackForwardListProxy::itemForID): (WebKit::WebBackForwardListProxy::removeItem): (WebKit::WebBackForwardListProxy::addItem): Previously this was a two-step process of adding an item to the process and then associating it with the page. Now it's just directly adding it to the page, so we don't need to call updateBackForwardItem first. (WebKit::WebBackForwardListProxy::goToItem): (WebKit::WebBackForwardListProxy::itemAtIndex): (WebKit::WebBackForwardListProxy::close): (WebKit::historyItemToIDMap): Deleted. (WebKit::generateHistoryItemID): Deleted. (WebKit::WebBackForwardListProxy::setHighestItemIDFromUIProcess): Deleted. (WebKit::updateBackForwardItem): Deleted. (WebKit::WebBackForwardListProxy::idForItem): Deleted. * WebProcess/WebPage/WebBackForwardListProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_credentialsMessenger): (WebKit::WebPage::goToBackForwardItem): (WebKit::WebPage::restoreSessionInternal): (WebKit::WebPage::didRemoveBackForwardItem): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2018-04-19 Youenn Fablet NetworkProcess should use CSP/content blockers for sync XHR https://bugs.webkit.org/show_bug.cgi?id=184760 Reviewed by Chris Dumez. Setting CSP/ContentBlockers parameters for sync XHR loads. * NetworkProcess/NetworkResourceLoader.cpp: 2018-04-19 Nan Wang AX: AOM: respect the accessibility setting for dispatching the accessible events https://bugs.webkit.org/show_bug.cgi?id=184619 Reviewed by Ryosuke Niwa. Linked libAccessibility on iOS and macOS to use the platform accessibility settings for allowing dispatching the accessibility events. * Configurations/WebKit.xcconfig: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (accessibilityEventsEnabledChangedCallback): (-[WKWebView _updateAccessibilityEventsEnabled]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateAccessibilityEventsEnabled): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateAccessibilityEventsEnabled): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2018-04-18 Chris Dumez Rename WindowProxyController to WindowProxy https://bugs.webkit.org/show_bug.cgi?id=184756 Reviewed by Sam Weinig. Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation needed use WindowProxyController type, which was a bit confusing. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::windowScriptNPObject): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::frameBecameRemote): 2018-04-18 Youenn Fablet Allow SameOrigin credentials handling for synchronous XHR https://bugs.webkit.org/show_bug.cgi?id=184723 Reviewed by Alex Christensen. In case of SameOrigin credentials, we need to stop the current load in case of cross origin redirection to restart a load with a different session. Covered by updated WK2 tests. Rebased WK1 tests since this is Wk1 only. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::willSendRedirectedRequest): * NetworkProcess/NetworkResourceLoader.h: 2018-04-18 Chris Dumez Set RemoteDOMWindow's initial opener https://bugs.webkit.org/show_bug.cgi?id=184716 Reviewed by Sam Weinig. When a frame becomes remote, transfer the frame opener from the old frame to the new remote one. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::frameBecameRemote): 2018-04-18 Youenn Fablet NetworkResourceLoader should not clean itself inside didReceiveResponse https://bugs.webkit.org/show_bug.cgi?id=184754 Reviewed by Chris Dumez. Delay the cleanup to after the didReceiveResponse call so that NetworkLoad can terminate its work. Covered by XHR sync tests no longer crashing on GuardMalloc bots. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): 2018-04-18 Jer Noble Fix rendering of WKRemoteView layers in the simulator https://bugs.webkit.org/show_bug.cgi?id=184752 Reviewed by Tim Horton. * Platform/mac/LayerHostingContext.mm: (WebKit::LayerHostingContext::createForExternalHostingProcess): 2018-04-18 Jer Noble Fix entitlements and sandboxing for iphoneminimalsimulator https://bugs.webkit.org/show_bug.cgi?id=184692 Reviewed by Tim Horton. Use the correct implementations for ChildProcess and NetworkProcess when building for iphoneminimalsimulator. Stub out imlementations which rely on methods not available in the iphoneminimalsimulator SDK. * Configurations/Network-OSX.entitlements: Added. * Configurations/NetworkService.xcconfig: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::sourceApplicationAuditData const): * NetworkProcess/ios/NetworkProcessIOS.mm: * NetworkProcess/mac/NetworkProcessMac.mm: (WebKit::NetworkProcess::initializeProcessName): (WebKit::overrideSystemProxies): * Shared/ios/ChildProcessIOS.mm: (WebKit::ChildProcess::initializeSandbox): * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::setApplicationIsDaemon): (WebKit::enableSandboxStyleFileQuarantine): (WebKit::ChildProcess::initializeSandbox): (WebKit::ChildProcess::platformStopRunLoop): * Shared/mac/CodeSigning.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeSandbox): 2018-04-18 Commit Queue Unreviewed, rolling out r230743. https://bugs.webkit.org/show_bug.cgi?id=184747 causes mouse clicks to not work on some platforms (Requested by brrian on #webkit). Reverted changeset: "Web Automation: simulated mouse interactions should not be done until associated DOM events have been dispatched" https://bugs.webkit.org/show_bug.cgi?id=184462 https://trac.webkit.org/changeset/230743 2018-04-18 Brent Fulgham Avoid crash if ITP Debug mode is on, but ResourceLoadStatistics are not being used https://bugs.webkit.org/show_bug.cgi?id=184739 Reviewed by David Kilzer. If a user has the ResourceLoadStatistics logic turned off, but has the ITP Debug experimental flag turned on, you can cause a crash. This is because the WebsiteDataStore for the process doesn't bother creating a ResourceLoadStatisticsStore if the statistics machinery is not running. The ITP debug flag was being blindly set without checking if the statistics store exists or not, which can cause a crash. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode): Check if the statistics store exists before calling functions on it. 2018-04-18 Paul Knight Add -[_WKInputDelegateDelegate willStartInputSession:] for clients that want to configure input session before assisting form node https://bugs.webkit.org/show_bug.cgi?id=184662 Reviewed by Beth Dakin. Clients may wish to configure a WKInputSession before we start assisting a node. Add a -[_WKInputDelegateDelegate _webView:willStartInputSession:] callback. For example, clients that wish to present a custom input view will want to configure the WKFormInputSession's customInputView before the keyboard is presented. Otherwise the standard keyboard will begin to animate and then the custom input view will swap in later. * UIProcess/API/Cocoa/_WKInputDelegate.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Call -_webView:willStartInputSession: before assisting the node. Only create the form session if the delegate implements either the willStart or didStartInputSession callbacks. 2018-04-18 Chris Dumez Add support for converting a local window to a remote window https://bugs.webkit.org/show_bug.cgi?id=184515 Reviewed by Ryosuke Niwa. Add initial support for process-swapping when navigating cross-origin as a result of a window.open(). The window object returned by window.open() is initially same origin and is for about:blank. The navigation cross-origin then happens and the JS wrappers for the window then point to a cross-origin window which is remote (i.e. hosted in another WebProcess). The RemoteDOMWindow exposed to JS looks like a regular cross-origin Window with a few exceptions due to our incomplete implementation (e.g. w.location returns null) and most of its API is currently not functional. The RemoteDOMWindow API will be implemented in a follow-up by relying on IPC. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationProcessSwapsOnWindowOpenWithOpener): (WKContextConfigurationSetProcessSwapsOnWindowOpenWithOpener): * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration setProcessSwapsOnWindowOpenWithOpener:]): (-[_WKProcessPoolConfiguration processSwapsOnWindowOpenWithOpener]): Add ProcessPool configuration flag to turn on processSwap on window.open(), even if there is an opener. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): If the navigation was triggered via window.open(), then set up on handler for when a DOMWindow is constructed for the main frame in the new process. (WebKit::WebPageProxy::didCreateWindow): When a Window is constructed for the main frame in a new process on process swap, notify the old process that its representation of the window should become remote and provide it with the Frame / Window identifiers it needs. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): Do process swapping on cross-origin window.open() if the corresponding setting is enabled. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::didCreateWindow): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::frameBecameRemote): This is called when process swapping has happened due to a window.open() navigation cross-origin, when a Frame / Window has been constructed in the new process. We do the following: - Construct a RemoteFrame / RemoteWindow using the provided global identifiers to represent the Frame / Window in the new process. - We transfer the WindowProxies from the old Frame's WindowProxyController to the new RemoteFrame's WindowProxyController. - We update the window proxied by those WindowProxies to be the new RemoteWindow. - We detach the old Frame as it is now remote and represented by the new RemoteFrame object we constructed. - If the old frame was the main frame (always the case currently), we close the page as it is no longer needed. The new RemoteFrame is currently owned by the RemoteWindow which is kept alive by its JS wrappers. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2018-04-18 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.1 release. * gtk/NEWS: Add release notes for 2.21.1. 2018-04-18 Carlos Garcia Campos Unreviewed. Remove symbols from webkitglib-symbols.map. Remove symbols not present in WebKit. * webkitglib-symbols.map: 2018-04-18 Carlos Garcia Campos Unreviewed. Add missing symbols to webkitglib-symbols.map. Add symbols global in JSC and present in WebKit. * webkitglib-symbols.map: 2018-04-18 Fujii Hironori [Win][WebKit] Implement InjectedBundleWin.cpp https://bugs.webkit.org/show_bug.cgi?id=184525 Reviewed by Konstantin Tokarev. * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: (WebKit::InjectedBundle::initialize): 2018-04-17 Wenson Hsieh [Extra zoom mode] Programmatically changing focus when an element already has focus is a confusing experience https://bugs.webkit.org/show_bug.cgi?id=184635 Reviewed by Tim Horton. Currently on iOS, we allow element focus to present UI if the keyboard is already shown. In extra zoom mode, this would lead to a confusing experience when the focus form control overlay is disabled, since fullscreen input view controllers are swapped out from underneath the user. Currently, this also puts the UI process into a bad state where the focused form control overlay is active, but still hidden. This patch makes some tweaks to input view controller handling in the UI process to address these issues, and also adds WebKitTestRunner support for simulating interactions with select menus in extra zoom mode. See comments below for more detail. Test: fast/events/extrazoom/change-focus-during-change-event.html * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add new SPI delegate hooks to notify the UI delegate when view controllers are presented or dismissed in extra zoom mode. See -presentViewControllerForCurrentAssistedNode and -dismissAllInputViewControllers. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::takeBackgroundActivityTokenForFullscreenInput): (WebKit::WebProcessProxy::releaseBackgroundActivityTokenForFullscreenInput): See the comment below -dismissAllInputViewControllers. * UIProcess/WebProcessProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): In extra zoom mode, when changing focus from one assisted node to another, only allow the second node to be assisted if the focused form control overlay is being shown. Otherwise, (i.e. when a fullscreen input view controller is being presented), don't allow focus to start an input session. Additionally, make a minor tweak to allow the previous node to blur, even if we are not showing the keyboard for the new focused element. Without this adjustment, in the case where the page has programmatically focused another element while a fullscreen input view controller is presented, we'll show the old view controller for the new focused element. (-[WKContentView presentViewControllerForCurrentAssistedNode]): (-[WKContentView dismissAllInputViewControllers:]): Currently, when a fullscreen input view controller is presented, the web process gets backgrounded. This prevents event handlers from executing, which leads to strange behaviors in many cases (for instance: if we have a multiple select, and the "change" event handler blurs the select, the user may check or uncheck multiple items, but only the first change will actually take effect). To fix this, we maintain a background activity token while presenting an input view controller. (-[WKContentView focusedFormControlViewDidBeginEditing:]): Start hiding the focused form overlay when re-presenting an input view controller. This allows us to bail from showing fullscreen input UI for another focused element if focus programmatically changes while the current fullscreen input view controller is presented, due to the -isHidden check in -_startAssistingNode:. (-[WKContentView selectFormAccessoryPickerRow:]): Simulate tapping a given row in select menu UI in extra zoom mode. 2018-04-17 Conrad Shultz WebKit::DisplayLink maintains a strong reference to WebPageProxy, creating a reference cycle https://bugs.webkit.org/show_bug.cgi?id=184718 Reviewed by Tim Horton. It turns out that the m_webPageProxy back-reference in DisplayLink, which was creating a reference cycle, wasn't ever read, so we can just remove it. * UIProcess/mac/DisplayLink.cpp: (WebKit::DisplayLink::DisplayLink): * UIProcess/mac/DisplayLink.h: 2018-04-17 Wenson Hsieh [Extra zoom mode] Double tap to zoom should account for text legibility in extra zoom mode https://bugs.webkit.org/show_bug.cgi?id=184631 Reviewed by Tim Horton. Implement the text legibility heuristic alluded to in r230506 by iterating through text runs in the document (up to a maximum of 200) and building a histogram of font sizes that appear in the document, where each tally represents a character. The first and second text legibility zoom scales are then computed based on the zoom scales needed to make 50% and 90% of the text legible, respectively. Here, a zoom scale that makes text legible is such that the text would have an apparent font size of a hard-coded constant (currently, 12) after zooming. This means the first and second text legibility scales may end up being close to one another, or even the same (in the case where there is only a single font size in the entire document). In this case, we just snap the first scale to the second, so that double tapping will only toggle between two zoom scales. In another case where the document has no text (e.g. an image document), we just fall back to a zoom scale of 1. Test: fast/events/extrazoom/double-tap-to-zoom-on-full-width-text.html * WebProcess/WebPage/ViewGestureGeometryCollector.cpp: (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales): 2018-04-17 Megan Gardner Don't activate selection on become first responder https://bugs.webkit.org/show_bug.cgi?id=184719 Reviewed by Tim Horton. If we activate the selection immediately on becoming first responder, we cause the selection view to delete itself since it is not guaranteed to have selection rects immediately due to async/two process architecture. The selection is activated already when the selection rects change, so there is no reason to activate it now. This has likely worked in the past because this selection assistant was only for editable text, which would immediately set a caret, which is a selection. Now that this is for non-editable text as well, activating the selection is problematic. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView becomeFirstResponderForWebView]): 2018-04-11 Brian Burg Web Automation: simulated mouse interactions should not be done until associated DOM events have been dispatched https://bugs.webkit.org/show_bug.cgi?id=184462 Reviewed by Carlos Garcia Campos and Tim Horton. Covered by existing layout tests and actions endpoints in WebDriver test suite. In preparation for implementing the W3C WebDriver command "Perform Actions", we need a way to know when a simulated mouse event has been fully processed by WebProcess and it is okay to continue to dispatch more simulated events. This patch makes mouse events go through a queue as they are delivered to WebPageProxy. The approach is very similar to how key events are handled. In the key event case, lots of WebEvents can come out of typing one keystroke, so these need to be queued up and retired one by one when the WebProcess has finished handling each event. In some mouse event cases---particularly fake mouse moves---there can also be more than one mouse event waiting to be handled by WebProcess. In the past, these queued mouse events were tracked with several member variables as different use cases emerged. These are all replaced with ordinary deque operations, such as peeking or checking the queue length. * Platform/Logging.h: Add logging channel for mouse events. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::AutomationCommandError::toProtocolString): Add type-safe helper class for command errors. In future patches we can hide knowledge of how this is sent over the protocol by relying more on the convenience constructors and .toProtocolString() method. (WebKit::WebAutomationSession::willShowJavaScriptDialog): This section needs adjustments. Since performMouseInteraction now depends on key events being processed prior to returning from the command, we need to abort any key event callbacks that are pending if an alert pops up as a result of sending a mousedown event. Any mouse events that are still queued will be handled when the alert is dismissed and the nested run loop exits. (WebKit::WebAutomationSession::mouseEventsFlushedForPage): (WebKit::WebAutomationSession::keyboardEventsFlushedForPage): Modernize this a bit. Don't spread knowledge about how commands are sent back out into event handling code. Our wrapper callbacks in performXXXInteraction handle the protocol-specific details of the response. (WebKit::WebAutomationSession::performMouseInteraction): Add code similar to performKeyboardInteractions so that the command doesn't finish until the mouse event has been fully handled. Unlike keyboards, sometimes mouse interactions don't turn into WebEvents so we also need to handle the case where there is nothing to be waited on because hit testing did not return a target to deliver the event to. (WebKit::WebAutomationSession::performKeyboardInteractions): Modernize a little bit to use generic callbacks rather than protocol-generated callbacks in the event waiting/handling code. Now it matches the types used for the mouse event case. * UIProcess/Automation/WebAutomationSession.h: (WebKit::AutomationCommandError::AutomationCommandError): Add a helper struct to hold an enumerated error name and an optional free-form error message. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::webMouseEventTypeString): (WebKit::webKeyboardEventTypeString): (WebKit::WebPageProxy::handleMouseEvent): (WebKit::WebPageProxy::processNextQueuedMouseEvent): Split the old method into handleMouseEvent (called by other code) and processNextQueuedMouseEvent. The latter sends the next mouse event to WebProcess, and can be triggered in didReceiveEvent if there are more mouse events to be sent to WebProcess. (WebKit::WebPageProxy::isProcessingMouseEvents const): Added. (WebKit::WebPageProxy::currentlyProcessedMouseDownEvent): Reimplemented on top of the deque. (WebKit::WebPageProxy::didReceiveEvent): Unify the code paths for different mouse event types to all use the deque. They also will notify the automation session if there are no more mouse events to send (i.e., interaction is over). (WebKit::WebPageProxy::resetStateAfterProcessExited): Add handling for new map. 2018-04-17 Adrian Perez de Castro [GTK][WPE] Build failure due to presence of Avahi's header https://bugs.webkit.org/show_bug.cgi?id=184711 Unreviewed build fix. * NetworkProcess/webrtc/NetworkMDNSRegister.h: Set ENABLE_MDNS only for PLATFORM(COCOA). 2018-04-17 Jonathan Bedard Unreviewed rollout of r230632. Regression in memory usage. That bug tracked in https://bugs.webkit.org/show_bug.cgi?id=184569. * Shared/WebPreferences.yaml: 2018-04-17 Timothy Hatcher Always use LayerContentsType::IOSurface in minimal simulator mode https://bugs.webkit.org/show_bug.cgi?id=184710 Reviewed by Simon Fraser. * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): 2018-04-17 Ryosuke Niwa Release assert in InjectedBundle::postSynchronousMessage https://bugs.webkit.org/show_bug.cgi?id=184683 Reviewed by Wenson Hsieh. Some injected bundles sends sync message when it's not safe to execute scripts. Use DoNotProcessIncomingMessagesWhenWaitingForSyncReply option in InjectedBundle::postSynchronousMessage to avoid processing incoming sync IPC messages so that we don't execute arbitrary scripts in those cases. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::postSynchronousMessage): 2018-04-17 Chris Dumez REGRESSION (r229831): CMD-clicking an iCloud web app link unexpectedly opens that link in a new tab and the current tab https://bugs.webkit.org/show_bug.cgi?id=184678 Reviewed by Alex Christensen. Re-introduce synchronous code path which existed pre-r229831 and use it for fragment navigations. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationActionSync): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2018-04-17 Michael Catanzaro [WPE][GTK] GObject introspection annotation fixes: BackForwardList, NetworkProxySettings https://bugs.webkit.org/show_bug.cgi?id=184658 Reviewed by Carlos Garcia Campos. Thanks to Dylan Simon for recommending these annotation fixes. * UIProcess/API/glib/WebKitBackForwardList.cpp: * UIProcess/API/glib/WebKitNetworkProxySettings.cpp: 2018-04-17 Brent Fulgham [macOS] Don't establish unneeded Dock connections (Follow-up) https://bugs.webkit.org/show_bug.cgi?id=184664 Reviewed by Per Arne Vollan. Because the Plugin process is driven by NSApplication's run loop, we aren't setting the 'don't connect to the dock' setting early enough. This patch sets the flag in XPCServiceMain for those services that are linked to AppKit. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializeProcess): Remove unneeded code. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (main): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Remove unneeded code. 2018-04-17 Saam Barati Add system trace points for process launch and for initializeWebProcess https://bugs.webkit.org/show_bug.cgi?id=184669 Reviewed by Simon Fraser. * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::ProcessLauncher): (WebKit::ProcessLauncher::didFinishLaunchingProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2018-04-16 Timothy Hatcher Unreviewed 32-bit build fix for r230673. https://bugs.webkit.org/show_bug.cgi?id=184657 rdar://problem/39463307 * Configurations/PluginProcessShim.xcconfig: Use the correct names. 2018-04-16 Andy Estes [iOS] Enable WKPDFView by default https://bugs.webkit.org/show_bug.cgi?id=184675 Reviewed by Darin Adler. * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: (-[WKWebViewContentProviderRegistry init]): 2018-04-16 Brent Fulgham [macOS] Don't establish unneeded Dock connections https://bugs.webkit.org/show_bug.cgi?id=184664 Reviewed by Simon Fraser. There is no reason for the WebContent or Plugin processes to interact with the Dock. We should tell AppKit that we don't want this connection, and to avoid creating such connections. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializeProcess): Tell NSApplication to not create a Dock connection. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Ditto. 2018-04-16 Megan Gardner Switch to UIWKTextInteractionAssistant for non-editable text https://bugs.webkit.org/show_bug.cgi?id=182834 Reviewed by Beth Dakin. Switch to only using one assistant for text selection. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView useSelectionAssistantWithGranularity:]): 2018-04-16 Youenn Fablet Use NetworkLoadChecker to handle synchronous HTTP loads https://bugs.webkit.org/show_bug.cgi?id=184240 Reviewed by Chris Dumez. For every NetworkResourceLoader synchronous load, we create a NetworkLoadChecker. NetworkLoadChecker handles all security checks in that case. This allows supporting cross-origin loads for synchronous XHR. Updated NetworkCORSPreflightChecker to return the result as a ResourceError. This is used to convey any error message from NetworkProcess to the JS console. Ensure NetworkCORSPreflightChecker computes correctly Access-Control-Request-Headers value by providing the headers set by the application plus Referrer/Origin. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker): (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection): (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge): (WebKit::NetworkCORSPreflightChecker::didCompleteWithError): (WebKit::NetworkCORSPreflightChecker::wasBlocked): (WebKit::NetworkCORSPreflightChecker::cannotShowURL): * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): (WebKit::NetworkResourceLoader::validateCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResourceSynchronously): * WebProcess/Network/WebLoaderStrategy.h: 2018-04-16 Brian Burg [Cocoa] Web Automation: add SPI to terminate automation session and disconnect the remote end https://bugs.webkit.org/show_bug.cgi?id=184523 Reviewed by Simon Fraser. When a user breaks the automation glass pane and chooses "Stop Session", there is no way for Safari to actually disconnect the remote connection using automation-related ObjC SPI. This can lead to sessions getting stuck and safaridriver is unable to request a new session. Expose the -terminate method as SPI. This disconnects the remote connection and then notifies the session delegate that the remote disconnected. At that point, Safari can uninstall the session from the process pool and tear down other session state. * UIProcess/API/Cocoa/_WKAutomationSession.h: * UIProcess/API/Cocoa/_WKAutomationSession.mm: (-[_WKAutomationSession terminate]): 2018-04-16 Timothy Hatcher Clean up OTHER_LDFLAGS for WebKit processes https://bugs.webkit.org/show_bug.cgi?id=184657 Reviewed by Jer Noble. * Configurations/PluginProcessShim.xcconfig: * Configurations/PluginService.32.xcconfig: * Configurations/PluginService.64.xcconfig: * Configurations/WebContentService.xcconfig: 2018-04-15 Michael Catanzaro [WPE] Install files needed for WebKitWebExtensions https://bugs.webkit.org/show_bug.cgi?id=179915 Reviewed by Žan Doberšek. * PlatformWPE.cmake: Install pkg-config file, injected bundle, and API headers. * UIProcess/API/glib/WebKitWebContext.cpp: Load the injected bundle when installed. * wpe/wpe-web-extension.pc.in: Added. 2018-04-14 Carlos Eduardo Ramalho [GTK][WPE] Build is broken after r230640 https://bugs.webkit.org/show_bug.cgi?id=184623 Reviewed by Žan Doberšek. UIProcess/SuspendedPageProxy.cpp was not included to CMake build in r230640. * CMakeLists.txt: Added UIProcess/SuspendedPageProxy.cpp to WebKit_SOURCES. 2018-04-13 Ryan Haddad Unreviewed, rolling out r230447. Caused flaky selection test failures on iOS Reverted changeset: "Switch to UIWKTextInteractionAssistant for non-editable text" https://bugs.webkit.org/show_bug.cgi?id=182834 https://trac.webkit.org/changeset/230447 2018-04-13 Chris Dumez Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame https://bugs.webkit.org/show_bug.cgi?id=184591 Reviewed by Sam Weinig. Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame. RemoteFrames do not need a ScriptController but do need to maintain WindowProxies. This is work towards fixing Bug 184515. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::windowScriptNPObject): 2018-04-13 Brady Eidson Introduce SuspendedPageProxy to keep old web processes around after their WebPageProxy has been swapped to a new one. https://bugs.webkit.org/show_bug.cgi?id=184559 Reviewed by Alex Christensen. Before this patch, when a WebPageProxy navigates and is swapped to a new process, the old process almost always goes away. This is not desirable for a few reasons: 1 - We can't keep the PageCache working for back/forward scenarios 2 - We throw away a "foo.com" web process, meaning the next time we need to host a "foo.com" web page we have to launch and initialize a new web process. This patch adds a SuspendedPageProxy object to keep around the old web process and to manage communication with it. For now, a WebPageProxy keeps exactly one "suspended page" representing the most recently visited page and its process. Additionally, that process is never reused. So no benefit is achieved with this patch, but it enables future benefits. * Platform/Logging.h: * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::setSuspendedPage): * Shared/WebBackForwardListItem.h: New object to represent the state of a WebPageProxy in an old web process that is not currently hosting the view. * UIProcess/SuspendedPageProxy.cpp: Added. (WebKit::SuspendedPageProxy::SuspendedPageProxy): (WebKit::SuspendedPageProxy::~SuspendedPageProxy): (WebKit::SuspendedPageProxy::webProcessDidClose): (WebKit::SuspendedPageProxy::didFinishLoad): (WebKit::SuspendedPageProxy::didReceiveMessage): (WebKit::SuspendedPageProxy::loggingString const): * UIProcess/SuspendedPageProxy.h: Copied from Source/WebKit/Platform/Logging.h. (WebKit::SuspendedPageProxy::create): (WebKit::SuspendedPageProxy::page const): (WebKit::SuspendedPageProxy::process const): (WebKit::SuspendedPageProxy::item const): (WebKit::SuspendedPageProxy::finishedSuspending const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::attachToProcessForNavigation): (WebKit::WebPageProxy::maybeCreateSuspendedPage): (WebKit::WebPageProxy::suspendedPageProcessClosed): (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::didFinishLoadForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::suspendWebPageProxy): (WebKit::WebProcessProxy::suspendedPageWasDestroyed): (WebKit::WebProcessProxy::removeWebPage): (WebKit::WebProcessProxy::didReceiveMessage): Optionally pass WebPageProxy messages along to SuspendedPageProxy objects. (WebKit::WebProcessProxy::didClose): (WebKit::WebProcessProxy::maybeShutDown): (WebKit::WebProcessProxy::canTerminateChildProcess): Don't terminate child processes if they still have suspended pages. * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setIsSuspended): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::isSuspended const): For now, used only by WebProcess::updateActivePages. Will have more uses soon. * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateActivePages): Allow the UIProcess to request an update of the web processes user visible name. 2018-04-13 Daniel Bates Inline NetworkLoad::sharedWillSendRedirectedRequest() into NetworkLoad::willPerformHTTPRedirection() https://bugs.webkit.org/show_bug.cgi?id=184593 Reviewed by Alex Christensen. Following the removal of the pre-Network Session code in r227364, NetworkLoad::sharedWillSendRedirectedRequest() is only referenced from NetworkLoad::willPerformHTTPRedirection(). We should inline its implementation into the NetworkLoad::willPerformHTTPRedirection(), remove a function call, and the cognitive load to follow such a function call when reading the code. No functionality changed. So, no new tests. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::willPerformHTTPRedirection): Moved the implementation of NetworkLoad::sharedWillSendRedirectedRequest() into this function. (WebKit::NetworkLoad::sharedWillSendRedirectedRequest): Deleted. Moved its implementation into NetworkLoad::willPerformHTTPRedirection(). * NetworkProcess/NetworkLoad.h: 2018-04-13 Daniel Bates Inline NetworkLoad::sharedDidReceiveResponse() into NetworkLoad::notifyDidReceiveResponse() https://bugs.webkit.org/show_bug.cgi?id=184592 Reviewed by Alex Christensen. Following the removal of the pre-Network Session code in r227364, NetworkLoad::sharedDidReceiveResponse() is only referenced from NetworkLoad::notifyDidReceiveResponse(). We should inline its implementation into the NetworkLoad::notifyDidReceiveResponse(), remove a function call, and the cognitive load to follow such a function call when reading the code. No functionality changed. So, no new tests. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::notifyDidReceiveResponse): Moved the implementation of NetworkLoad::sharedDidReceiveResponse() into this function. (WebKit::NetworkLoad::sharedDidReceiveResponse): Deleted. Moved its implementation into NetworkLoad::notifyDidReceiveResponse(). * NetworkProcess/NetworkLoad.h: 2018-04-13 Brent Fulgham REGRESSION(r230468): Improper assertion firing under STP Unreviewed, rolling out an improper assertion. I added an assertion in Bug 184322 that should not have been added. I did not notice that this call stack was always used in builds where NSApp is still active. Builds where we stop relying on AppKit runloops uses a different code path to shut down. * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::stopNSAppRunLoop): 2018-04-12 Antoine Quint [Web Animations] Turn CSS Animations and CSS Transitions as Web Animations on by default https://bugs.webkit.org/show_bug.cgi?id=184569 Reviewed by Jon Lee. * Shared/WebPreferences.yaml: 2018-04-13 Xabier Rodriguez Calvar [GStreamer] Convert GStreamerUtilities in GStreamerCommon and include the GStreamer smart pointer traits https://bugs.webkit.org/show_bug.cgi?id=184533 Reviewed by Philippe Normand. Renamed GStreamerUtilities* files into GStreamerCommon* and modified files including them accordingly. Include GRefPtrGStreamer.h and GUniquePtrGStreamer.h in GStreamerCommon.h to avoid problems destroying objects when those files are forgotten to be included. * UIProcess/gtk/WebProcessPoolGtk.cpp: * UIProcess/wpe/WebProcessPoolWPE.cpp: * WebProcess/soup/WebProcessSoup.cpp: 2018-04-12 Beth Dakin Fix the MOBILE_WIFI build https://bugs.webkit.org/show_bug.cgi?id=184571 -and corresponding- Reviewed by Jer Noble. * config.h: 2018-04-12 Beth Dakin Use -iframework to ensure that frameworks from user paths and system paths are ordered appropriately https://bugs.webkit.org/show_bug.cgi?id=184557 -and corresponding- rdar://problem/39386359 Reviewed by Dean Jackson. * Configurations/WebKit.xcconfig: 2018-04-12 Wenson Hsieh [Extra zoom mode] Suppress UI for inputs of type file in extra zoom mode https://bugs.webkit.org/show_bug.cgi?id=184556 Reviewed by Andy Estes. When running in this mode, we don't have the facilities to present document picker UI. For now, just make this feature fail gracefully. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel presentWithParameters:resultListener:]): (-[WKFileUploadPanel platformSupportsPickerViewController]): 2018-04-12 Megan Gardner Remove block selection code https://bugs.webkit.org/show_bug.cgi?id=184470 Reviewed by Timothy Hatcher. Remove block selection code that isn't run and is currently not even used. Had to put this back in for a bug in the mid-year release, but we're past that so it's time for this to go away. * Platform/spi/ios/UIKitSPI.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::stopAssistingNode): (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (toSelectionHandlePosition): Deleted. (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted. (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted. (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::saveImageToLibrary): (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted. (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::rangeAtWordBoundaryForPosition): (WebKit::distanceBetweenRectsForPosition): Deleted. (WebKit::rectsEssentiallyTheSame): Deleted. (WebKit::unionDOMRanges): Deleted. (WebKit::computeEdgeCenter): Deleted. (WebKit::WebPage::expandedRangeFromHandle): Deleted. (WebKit::WebPage::contractedRangeFromHandle): Deleted. (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted. (WebKit::WebPage::rangeForBlockAtPoint): Deleted. (WebKit::shouldExpand): Deleted. (WebKit::WebPage::changeBlockSelection): Deleted. (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted. 2018-04-12 Megan Gardner Don't have selections get stuck in editable elements https://bugs.webkit.org/show_bug.cgi?id=184483 Reviewed by Timothy Hatcher. When selecting in editable elements, if the keyboard does not come up, which is not required, then the selections are stuck in that element. If you try and select something in web content, it will only select in the editable element. By clearing the assisted node when clearing a selection, it no longer sticks. Also, textSelectionAssistant should not be used as if we are currently editing. Change it to the function we created for that purpose in a pervious patch. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView clearSelection]): (-[WKContentView _isInteractingWithAssistedNode]): 2018-04-12 Michael Catanzaro [WPE] Move libWPEWebInspectorResources.so to pkglibdir https://bugs.webkit.org/show_bug.cgi?id=184379 Reviewed by Žan Doberšek. This is important to allow parallel installation. * PlatformWPE.cmake: 2018-04-12 Michael Catanzaro [WPE] Improve include hierarchy https://bugs.webkit.org/show_bug.cgi?id=184376 Reviewed by Žan Doberšek. Install our headers under /usr/include/wpe-webkit-0.1/wpe instead of /usr/include/wpe-0.1/WPE/wpe. Too much WPE, not enough WebKit! * PlatformWPE.cmake: * wpe/wpe-webkit.pc.in: 2018-04-11 Andy Estes [iOS] Add a mechanism for holding Wi-Fi assertions https://bugs.webkit.org/show_bug.cgi?id=184520 Reviewed by Sam Weinig. Add plumbing for holding a Wi-Fi assertion on iOS as long as there are active network data tasks. This functionality is turned off by default right now. * Configurations/Network-iOS.entitlements: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * NetworkProcess/cocoa/WiFiAssertionHolder.cpp: Added. (WebKit::ensureWiFiManagerClient): Create a global WiFiManagerClient when needed. (WebKit::WiFiAssertionHolder::WiFiAssertionHolder): If this is the first active Wi-Fi assertion holder, set the client's type to kWiFiClientTypeBackground. (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder): If the last active Wi-Fi assertion holder is being destroyed, set the client's type back to kWiFiClientTypeNormal. * NetworkProcess/cocoa/WiFiAssertionHolder.h: Added. * Platform/Logging.h: Added a logging channel for Wi-Fi assertions. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * WebKit.xcodeproj/project.pbxproj: 2018-04-12 Carlos Garcia Campos [GTK] Switch to use always complex text code path https://bugs.webkit.org/show_bug.cgi?id=183285 Reviewed by Michael Catanzaro. Now that we have branched for 2.20, it's a good time to try using complex text path always. We can simply force it for GTK+ port and see how it works for the whole release cycle and if we don't notice any issues or performance regressions we release 2.22 with complex text path forced. A debug env variable is added to switch back to auto without having to recompile. After 2.22 is released we can make a final decision and remove the env variable. * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::WebProcessPool::platformInitializeWebProcess): Force complex text code path unless WEBKIT_FORCE_COMPLEX_TEXT is present and set to 0. 2018-04-11 Zan Dobersek [WPE] Make WebKitWebViewBackend object mandatory for webkit_web_view_new*() constructors https://bugs.webkit.org/show_bug.cgi?id=184513 Reviewed by Michael Catanzaro. webkit_web_view_new*() constructors should always expect a non-null WebKitWebViewBackend object, forcing the user to specify how the wpe_view_backend object is managed for the WebKitWebView that's being created. webkitWebViewBackendCreateDefault() and the default _WebKitWebViewBackend() constructor are removed. WPE-specific webkit_web_view_new*() entrypoints are updated to bail if the passed-in WebKitWebViewBackend object is null. Documentation is updated accordingly. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): * UIProcess/API/wpe/WebKitWebViewBackend.cpp: (webkitWebViewBackendCreateDefault): Deleted. * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h: * UIProcess/API/wpe/WebKitWebViewWPE.cpp: (webkit_web_view_new): (webkit_web_view_new_with_context): (webkit_web_view_new_with_related_view): (webkit_web_view_new_with_settings): (webkit_web_view_new_with_user_content_manager): 2018-04-11 Fujii Hironori [curl][WebKit] Implement NetworkDataTaskCurl https://bugs.webkit.org/show_bug.cgi?id=184488 Reviewed by Alex Christensen. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): * NetworkProcess/curl/NetworkDataTaskCurl.cpp: Added. (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl): (WebKit::NetworkDataTaskCurl::~NetworkDataTaskCurl): (WebKit::NetworkDataTaskCurl::resume): (WebKit::NetworkDataTaskCurl::suspend): (WebKit::NetworkDataTaskCurl::cancel): (WebKit::NetworkDataTaskCurl::invalidateAndCancel): (WebKit::NetworkDataTaskCurl::state const): (WebKit::NetworkDataTaskCurl::createCurlRequest): (WebKit::NetworkDataTaskCurl::curlDidSendData): (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse): (WebKit::NetworkDataTaskCurl::curlDidReceiveBuffer): (WebKit::NetworkDataTaskCurl::curlDidComplete): (WebKit::NetworkDataTaskCurl::curlDidFailWithError): (WebKit::NetworkDataTaskCurl::shouldRedirectAsGET): (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection): (WebKit::NetworkDataTaskCurl::tryHttpAuthentication): (WebKit::NetworkDataTaskCurl::restartWithCredential): (WebKit::NetworkDataTaskCurl::appendCookieHeader): (WebKit::NetworkDataTaskCurl::handleCookieHeaders): * NetworkProcess/curl/NetworkDataTaskCurl.h: Added. * PlatformWin.cmake: 2018-04-11 Wenson Hsieh [Extra zoom mode] Support pushing input view controllers onto the navigation stack https://bugs.webkit.org/show_bug.cgi?id=184397 Reviewed by Timothy Hatcher. Currently, all input view controllers in extra zoom mode are presented modally. However, the latest iteration of the HI specification depicts most of these view controllers (with the exception of time pickers) being presented and dismissed via navigation stack. Since WebKit's iOS API surface doesn't force clients to embed WKWebViews within a view controller with a corresponding UINavigationController, we cannot always guarantee that UI presented when focusing form controls in a web view will be pushed onto the navigation stack; as such, the approach taken in this patch will automatically allow WKWebView clients that already embed WKWebViews within a UINavigationController to hook into this behavior, with modal presentation as a fallback. At a high level, this patch makes the following tweaks to implement this behavior: 1. Store the currently presented view controller using a single member variable (_presentedFullScreenInputViewController) instead of having one for each type. This makes bookkeepping around which view controller to present or dismiss much more straightforward. 2. Replace WKFocusedFormControlViewController with just WKFocusedFormControlView. This addresses problems with pushing an input view controller onto the navigation stack after presenting the focused form control view controller modally. Now, we'll only need to present or push one view controller on the navigation stack. 3. Remove -handleWheelEvent: forwarding to date and time pickers. Pushing date picker view controllers onto the navigation stack rather than presenting them modally means that we end up in a state where neither the WKContentView nor WKTimePickerViewController are first responder, which renders time pickers unusable. Instead, have the WKTimePickerViewController actually become first responder when presenting. 4. Lastly, and most importantly: change -presentViewControllerForCurrentAssistedNode and -dismissAllInputViewControllers to try and push onto a navigation stack if possible, and fall back to modal presentation. * UIProcess/ios/WKContentViewInteraction.h: Remove the separate member variables for each type of input view controller, and instead have one to keep track of the current (and only) presented input view controller. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _willStartScrollingOrZooming]): (-[WKContentView _didEndScrollingOrZooming]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): (-[WKContentView _stopAssistingNode]): Boilerplate renaming of _focusedFormControlViewController => _focusedFormControlView. (-[WKContentView reloadContextViewForPresentedListViewController]): Adjust for consolidation of the different input view controller member variables to a single member (see changes in WKContentViewInteraction.h). (-[WKContentView addFocusedFormControlOverlay]): (-[WKContentView removeFocusedFormControlOverlay]): (-[WKContentView presentViewControllerForCurrentAssistedNode]): (-[WKContentView dismissAllInputViewControllers:]): Add an `animated` argument. In the case where a different view controller was presented after presenting the input view controller, this allows us to dismiss the other view controller with animation, and directly reveal the web view or focus overlay underneath. (-[WKContentView focusedFormControlViewDidSubmit:]): (-[WKContentView focusedFormControlViewDidCancel:]): (-[WKContentView focusedFormControlViewDidBeginEditing:]): (-[WKContentView rectForFocusedFormControlView:]): (-[WKContentView nextRectForFocusedFormControlView:]): (-[WKContentView previousRectForFocusedFormControlView:]): (-[WKContentView scrollViewForFocusedFormControlView:]): (-[WKContentView actionNameForFocusedFormControlView:]): (-[WKContentView focusedFormControlViewDidRequestNextNode:]): (-[WKContentView focusedFormControlViewDidRequestPreviousNode:]): (-[WKContentView hasNextNodeForFocusedFormControlView:]): (-[WKContentView hasPreviousNodeForFocusedFormControlView:]): (-[WKContentView focusedFormControllerDidUpdateSuggestions:]): Boilerplate renaming of focus overlay delegate methods. (-[WKContentView _wheelChangedWithEvent:]): Remove event forwarding hacks for date and time inputs, now that they directly become first responder. (-[WKContentView presentFocusedFormControlViewController:]): Deleted. (-[WKContentView dismissFocusedFormControlViewController:]): Deleted. Renamed to -addFocusedFormControlOverlay and -removeFocusedFormControlOverlay. (-[WKContentView dismissAllInputViewControllers]): Deleted. (-[WKContentView focusedFormControlControllerDidSubmit:]): Deleted. (-[WKContentView focusedFormControlControllerDidCancel:]): Deleted. (-[WKContentView focusedFormControlControllerDidBeginEditing:]): Deleted. (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]): Deleted. (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]): Deleted. (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]): Deleted. (-[WKContentView scrollViewForFocusedFormControlController:]): Deleted. (-[WKContentView actionNameForFocusedFormControlController:]): Deleted. (-[WKContentView focusedFormControlControllerDidRequestNextNode:]): Deleted. (-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]): Deleted. (-[WKContentView hasNextNodeForFocusedFormControlController:]): Deleted. (-[WKContentView hasPreviousNodeForFocusedFormControlController:]): Deleted. * UIProcess/ios/forms/WKFocusedFormControlViewController.h: Removed. * UIProcess/ios/forms/WKFocusedFormControlViewController.mm: Removed. Completely remove WKFocusedFormControlViewController; instead, just directly place the focused form overlay in the WKWebView's hierarchy. In the case where we have a navigation stack to push to, we can no longer modally present the focused form overlay as a separate view controller using the UINavigationController, and then immediately push the input view controller on top of the navigation stack, since the navigation stack isn't updated until after the animation of the focused form overlay presentation is complete. Rather than hack around this limitation by dispatch_after-ing after presenting the overlay's view controller, we should just make the overlay a view. This also fixes the case where a client embedding a WKWebView that is smaller than the bounds of the screen will no longer see the entire screen dim when focusing an input, but instead, just the web content. * WebKit.xcodeproj/project.pbxproj: 2018-04-11 Youenn Fablet Pass FetchOptions and SecurityOrigin as load parameters from WebProcess to NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=184374 Reviewed by Chris Dumez. Pass full FetchOptions parameters as part of NetworkResourceLoadParameters. This will allow handling redirection mode as well as credentials in case of cross origin redirections. In case of SameOrigin credentials and there is a redirection from same-origin to cross-origin, we will be able to stop using credentials without going to WebProcess. To handle properly cross-origin checks, we have to be able to use SecurityOrigin as in WebProcess. We make WebProcess sends Origin Access White list information to NetworkProcess. This allows supporting the white list when doing loading in NetworkProcess. This only works consistently if all WebProcesses share the same whitelist. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry): (WebKit::NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry): (WebKit::NetworkConnectionToWebProcess::resetOriginAccessWhitelists): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): (WebKit::NetworkLoadChecker::checkRedirection): (WebKit::NetworkLoadChecker::continueCheckingRequest): (WebKit::NetworkLoadChecker::checkCORSRequest): (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest): (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight): (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const): * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::create): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::willPerformHTTPRedirection): * NetworkProcess/PingLoad.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::addOriginAccessWhitelistEntry): (WebKit::InjectedBundle::removeOriginAccessWhitelistEntry): (WebKit::InjectedBundle::resetOriginAccessWhitelists): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::startPingLoad): 2018-04-11 Michael Catanzaro [GTK] WaylandCompositorDisplay leaks its wl_display https://bugs.webkit.org/show_bug.cgi?id=184406 Reviewed by Carlos Garcia Campos. Since we allocate our own wl_display here, need to chain up to the parent constructor passing NativeDisplayOwned::Yes, or it won't ever be released. Move the initialize call to the create function to ensure it's called after the constructor completes. * WebProcess/gtk/WaylandCompositorDisplay.cpp: (WebKit::WaylandCompositorDisplay::create): Fix a log message (drive-by). (WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay): 2018-04-11 Youenn Fablet Use more r-values in NetworkResourceLoader https://bugs.webkit.org/show_bug.cgi?id=184478 Reviewed by Chris Dumez. Pass load parameters as r-values to remove some unneeded copies. Ditto for ResourceRequest inside NetworkResourceLoader. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::validateCacheEntry): * NetworkProcess/NetworkResourceLoader.h: 2018-04-11 Wenson Hsieh [Extra zoom mode] Missing label when focusing a using date picker UI https://bugs.webkit.org/show_bug.cgi?id=182847 Reviewed by Tim Horton. Add support for presenting date pickers when focusing a date input. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _stopAssistingNode]): (-[WKContentView dismissAllInputViewControllers]): Pull logic to dismiss input view controllers into a single helper. (-[WKContentView presentDatePickerViewController:]): (-[WKContentView dismissDatePickerViewController:]): (-[WKContentView presentViewControllerForAssistedNode:]): (-[WKContentView textInputController:didCommitText:]): (-[WKContentView _wheelChangedWithEvent:]): Delegate wheel events to the date picker. * UIProcess/ios/forms/WKDatePickerViewController.h: Added. * UIProcess/ios/forms/WKDatePickerViewController.mm: Added. Add harness files for the WKDatePickerViewController implementation in WebKitAdditions. * WebKit.xcodeproj/project.pbxproj: 2018-02-15 Youenn Fablet Resources loaded from service workers are not downloadable https://bugs.webkit.org/show_bug.cgi?id=182848 Reviewed by Chris Dumez. Downloads are not supporting resources loaded through service worker. As a temporary solution, we will let network process handle it. Note that this would not work if the URL can only be loaded through service worker. Note also that for navigation loads, if the content type is the default one (application/octet-stream) we are overriding it to text/html as we do not support mime sniffing yet from service worker responses. This might interfere with automatic downloads from navigation. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): 2018-02-15 Megan Gardner Support scrolling for non-editable web-selection and start autoscroll when near screen edges https://bugs.webkit.org/show_bug.cgi?id=182815 Add support for autoscrolling during a selection. This also takes into account the edges of the screen and starts autoscrolling when you get close, while still allowing autoscrolling when you are past the bounds of the WebView. Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView startAutoscroll:]): (-[WKContentView resignFirstResponderForWebView]): (-[WKContentView useSelectionAssistantWithGranularity:]): (-[WKContentView selectedTextRange]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAutoscrollAtPosition): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::startAutoscrollAtPosition): (WebKit::WebPage::cancelAutoscroll): 2018-02-15 John Wilander Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database https://bugs.webkit.org/show_bug.cgi?id=182812 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder): Now does the following: - Logs when there is a model version mismatch. - Does not ingest statistics if the version on disk is newer than the supported one. - Does ingest statistics if the version on disk is older than the supported one. - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode(). 2018-02-15 Jiewen Tan [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting https://bugs.webkit.org/show_bug.cgi?id=181946 Reviewed by Chris Dumez. Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish a message exchange channel between UIProcess and WebProcess. * DerivedSources.make: * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy): (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy): (WebKit::WebCredentialsMessengerProxy::makeCredential): (WebKit::WebCredentialsMessengerProxy::getAssertion): * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added. * UIProcess/WebPageProxy.cpp: (WebKit::m_configurationPreferenceValues): (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. (WebKit::WebCredentialsMessenger::WebCredentialsMessenger): (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger): (WebKit::WebCredentialsMessenger::makeCredential): (WebKit::WebCredentialsMessenger::getAssertion): (WebKit::WebCredentialsMessenger::makeCredentialReply): (WebKit::WebCredentialsMessenger::getAssertionReply): * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_credentialsMessenger): (WebKit::m_cpuLimit): Deleted. * WebProcess/WebPage/WebPage.h: 2018-02-15 Michael Catanzaro [WPE] Unify build of platform-specific files in WebKit layer https://bugs.webkit.org/show_bug.cgi?id=182696 Reviewed by Žan Doberšek. This is easy, because all needed changes were made in the previously-landed patch. * CMakeLists.txt: * PlatformWPE.cmake: 2018-02-15 Don Olmstead WebCore headers should not be included relatively within dependent projects https://bugs.webkit.org/show_bug.cgi?id=182805 Reviewed by Chris Dumez. * NetworkProcess/capture/NetworkCaptureManager.cpp: * NetworkProcess/webrtc/NetworkRTCMonitor.h: * Shared/gtk/WebEventFactory.cpp: * UIProcess/API/gtk/PageClientImpl.cpp: * UIProcess/API/gtk/WebKitWebViewBase.cpp: * UIProcess/gtk/WebPageProxyGtk.cpp: * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: * WebProcess/WebPage/gtk/WebPageGtk.cpp: * WebProcess/WebPage/wpe/WebPageWPE.cpp: 2018-02-15 Matt Lewis Unreviewed, rolling out r228495. This caused mulitple perf tests to fail consistently. Reverted changeset: "Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database" https://bugs.webkit.org/show_bug.cgi?id=182812 https://trac.webkit.org/changeset/228495 2018-02-14 Ross Kirsling Default definition of InjectedBundle::PlatformBundle should not be Windows-specific. https://bugs.webkit.org/show_bug.cgi?id=182810 Reviewed by Michael Catanzaro. This branch was added in r228455, but should not be limited to OS(WINDOWS). * WebProcess/InjectedBundle/InjectedBundle.h: 2018-02-14 Ross Kirsling Default implementations of nativeEvent() should be platform-agnostic. https://bugs.webkit.org/show_bug.cgi?id=182806 Reviewed by Darin Adler. * Shared/NativeWebKeyboardEvent.h: * Shared/NativeWebMouseEvent.h: * Shared/NativeWebWheelEvent.h: 2018-02-14 John Wilander Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database https://bugs.webkit.org/show_bug.cgi?id=182812 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder): Now does the following: - Logs when there is a model version mismatch. - Does not ingest statistics if the version on disk is newer than the supported one. - Does ingest statistics if the version on disk is older than the supported one. - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode(). 2018-02-14 Daniel Bates Disallow cross-origin subresources from asking for credentials https://bugs.webkit.org/show_bug.cgi?id=182579 Reviewed by Andy Estes. Add a private preference to toggle allowing non-mixed content cross-origin subresources to load. WebKitTestRunner toggles this preference when it sees the test option allowCrossOriginSubresourcesToAskForCredential. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAllowCrossOriginSubresourcesToAskForCredentials): (WKPreferencesGetAllowCrossOriginSubresourcesToAskForCredentials): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2018-02-14 John Wilander Make maximumParallelReadCount static to fix lambda capture error in WebKit::NetworkCache::Storage::traverse() https://bugs.webkit.org/show_bug.cgi?id=182797 Reviewed by Tim Horton. This capture was added in r228455 and causes a build failure when run with -Wunused-lambda-capture. Xcode also warns about it. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::traverse): 2018-02-14 Ryosuke Niwa EventDispatcher::wheelEvent uses a wrong enum values in switch https://bugs.webkit.org/show_bug.cgi?id=182796 Reviewed by Chris Dumez. EventDispatcher::wheelEvent is using PlatformWheelEventPhaseBegan and PlatformWheelEventPhaseEnded but the enum type of wheelEvent.phase() is WebWheelEvent::Phase. The enum values are indentical for both so there is no behavioral change. * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::wheelEvent): 2018-02-14 Maureen Daum Add C SPI for support of Website Data Store in Website Policies https://bugs.webkit.org/show_bug.cgi?id=182698 Reviewed by Andy Estes. Expand the API added for _WKWebsitePolicies.websiteDataStore in r225989 and r226325 to be available in the C API. In the ObjC API, we handle setting the website data store in NavigationState::NavigationClient::decidePolicyForNavigationAction. There we throw an exception if setting the website data store isn't supported, and then change the website data store. The equivalent place to do this work in the C API is in WKFramePolicyListenerUseWithPolicies. However, instead of throwing exceptions, release asserts are used. * UIProcess/API/C/WKFramePolicyListener.cpp: (WKFramePolicyListenerUseWithPolicies): If the website policies data contains a website data store, do the same checks that are done in NavigationState::NavigationClient::decidePolicyForNavigationAction. Namely, that it is a valid website data store and it is a policy decision for a main frame navigation. If these checks are met, change the website data store. * UIProcess/API/C/WKPage.cpp: (WKPageUpdateWebsitePolicies): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesGetDataStore): (WKWebsitePoliciesSetDataStore): * UIProcess/API/C/WKWebsitePolicies.h: * UIProcess/WebFrameListenerProxy.cpp: (WebKit::WebFrameListenerProxy::changeWebsiteDataStore): (WebKit::WebFrameListenerProxy::isMainFrame): Expose whether the frame proxy is for a main frame, which is required to verify that website policies only specify a website data store for main frame policy decisions. * UIProcess/WebFrameListenerProxy.h: * UIProcess/WebFramePolicyListenerProxy.cpp: * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::changeWebsiteDataStore): * UIProcess/WebFrameProxy.h: 2018-02-14 Ryan Haddad Unreviewed, rolling out r228444. Introduced API and Layout test failures. Reverted changeset: "[WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting" https://bugs.webkit.org/show_bug.cgi?id=181946 https://trac.webkit.org/changeset/228444 2018-02-13 Yousuke Kimoto [WinCairo] Fix build errors which come from including headers and not suitable implementation for windows https://bugs.webkit.org/show_bug.cgi?id=182679 Reviewed by Michael Catanzaro. * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: (WebKit::NetworkCache::BlobStorage::add): * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::Data::mapToFile const): (WebKit::NetworkCache::mapFile): (WebKit::NetworkCache::adoptAndMapFile): (WebKit::NetworkCache::readOrMakeSalt): * NetworkProcess/cache/NetworkCacheFileSystem.cpp: (WebKit::NetworkCache::directoryEntryType): (WebKit::NetworkCache::traverseDirectory): (WebKit::NetworkCache::fileTimes): (WebKit::NetworkCache::updateFileModificationTimeIfNeeded): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::traverse): * NetworkProcess/win/SystemProxyWin.h: * Platform/IPC/Attachment.h: * Platform/Module.h: * Platform/SharedMemory.h: * PluginProcess/WebProcessConnection.cpp: * Shared/API/c/WKBase.h: * Shared/ChildProcess.cpp: * Shared/WebCoreArgumentCoders.h: * UIProcess/ProcessAssertion.h: * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/WebProcess.cpp: 2018-02-13 Commit Queue Unreviewed, rolling out r228431. https://bugs.webkit.org/show_bug.cgi?id=182766 Regressed CMake build stability (Requested by dolmstead on #webkit). Reverted changeset: "[CMake] Make WebCore headers copies" https://bugs.webkit.org/show_bug.cgi?id=182512 https://trac.webkit.org/changeset/228431 2018-02-13 Jiewen Tan [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting https://bugs.webkit.org/show_bug.cgi?id=181946 Reviewed by Chris Dumez. Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish a message exchange channel between UIProcess and WebProcess. * DerivedSources.make: * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy): (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy): (WebKit::WebCredentialsMessengerProxy::makeCredential): (WebKit::WebCredentialsMessengerProxy::getAssertion): * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added. * UIProcess/WebPageProxy.cpp: (WebKit::m_configurationPreferenceValues): (WebKit::WebPageProxy::reattachToWebProcess): * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. (WebKit::WebCredentialsMessenger::WebCredentialsMessenger): (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger): (WebKit::WebCredentialsMessenger::makeCredential): (WebKit::WebCredentialsMessenger::getAssertion): (WebKit::WebCredentialsMessenger::makeCredentialReply): (WebKit::WebCredentialsMessenger::getAssertionReply): * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h. * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_credentialsMessenger): (WebKit::m_cpuLimit): Deleted. * WebProcess/WebPage/WebPage.h: 2018-02-13 Youenn Fablet Add support for configuring WebsiteDatastore service worker and cache storage path https://bugs.webkit.org/show_bug.cgi?id=182674 Reviewed by Chris Dumez. Beef up WKWebsiteDataStoreConfiguration to easily set the WebsiteDataStore service worker registration and cache storage directory path. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]): (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]): (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]): (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]): 2018-02-13 Brian Burg Web Automation: don't return an error if resizing/moving a window has no effect https://bugs.webkit.org/show_bug.cgi?id=182742 Reviewed by Tim Horton. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Unify the behavior for all ports. Don't raise an error if the command was idempotent (by mistake or not). It should not be an error to re-maximize a window. 2018-02-13 Don Olmstead [CMake] Make WebCore headers copies https://bugs.webkit.org/show_bug.cgi?id=182512 Reviewed by Keith Miller. * CMakeLists.txt: * NetworkProcess/capture/NetworkCaptureManager.cpp: * NetworkProcess/webrtc/NetworkRTCMonitor.h: * PlatformWPE.cmake: * Scripts/generate-forwarding-headers.pl: * Shared/gtk/WebEventFactory.cpp: * UIProcess/API/gtk/PageClientImpl.cpp: * UIProcess/API/gtk/WebKitWebViewBase.cpp: * UIProcess/gtk/WebPageProxyGtk.cpp: * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: * WebProcess/WebPage/gtk/WebPageGtk.cpp: * WebProcess/WebPage/wpe/WebPageWPE.cpp: 2018-02-13 Brent Fulgham [iOS] whitelist iokit-get-properties https://bugs.webkit.org/show_bug.cgi?id=182722 Reviewed by Eric Carlson. Update the iOS sandbox to block access to IOKit properties that are not needed for legitimate WebContent process use. This brings the iOS sandbox in line with the work done under macOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2018-02-12 John Wilander Resource Load Statistics: Classify resources as prevalent based on redirects to other prevalent resources https://bugs.webkit.org/show_bug.cgi?id=182664 Reviewed by Brent Fulgham. * Platform/classifier/ResourceLoadStatisticsClassifier.cpp: (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics): Unique top frame redirects now counts toward classification as prevalent. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom): (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo): (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom): Test infrastructure. * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: Bumped the statistics model to 11 because of the added fields. (WebKit::WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain): This function back traces redirect chains to classify domains that have redirected to a newly classified prevalent resource. (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Now uses the new convenience function WebResourceLoadStatisticsStore::setPrevalentResource(). (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): New convenience function to make sure we always call WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain() and capture redirect chains backward. (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom): (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom): Test infrastructure. * UIProcess/WebResourceLoadStatisticsStore.h: 2018-02-12 Antti Koivisto Update NetworkCache::Storage::lastStableVersion after r226349 https://bugs.webkit.org/show_bug.cgi?id=182723 Reviewed by Ryosuke Niwa. * NetworkProcess/cache/NetworkCacheStorage.h: Allow deleting version 11 caches. 2018-02-12 Wenson Hsieh [Extra zoom mode] Add support for using time picker UI https://bugs.webkit.org/show_bug.cgi?id=182683 Reviewed by Tim Horton. Adds support for showing a time picker when an input of type time is focused in extra zoomed mode. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _stopAssistingNode]): (-[WKContentView presentTimePickerViewController:]): (-[WKContentView dismissTimePickerViewController:]): Add helpers to dismiss and present the time picker view controller. (-[WKContentView presentViewControllerForAssistedNode:]): When focusing InputType::Time, present a time picker. Additionally, tweak the logic here to use the generic text input view controller as a fallback when the other input view controllers (number pads, select menus and time pickers thus far) are not relevant. This prevents us from completely being unable to edit form controls that are currently unsupported. (-[WKContentView textInputController:didCommitText:]): (-[WKContentView textInputControllerDidRequestDismissal:]): Tweak WKContentView for changes to WKTextFormControlViewControllerDelegate. (-[WKContentView actionNameForFocusedFormControlController:]): Adjust this implementation to hide the focused form control "Go" button for selects and time inputs. This currently doesn't work for these form controls because it relies on implicit form submission; this should be fixed by future changes, after which we should revert this adjustment. (-[WKContentView _wheelChangedWithEvent:]): Delegate wheel events to the time picker if needed. (-[WKContentView textInputController:didRequestDismissalWithAction:]): Deleted. Renamed to -textInputControllerDidRequestDismissal:. * UIProcess/ios/forms/WKTimePickerViewController.h: Added. * UIProcess/ios/forms/WKTimePickerViewController.mm: Added. * WebKit.xcodeproj/project.pbxproj: 2018-02-11 Michael Catanzaro [GTK] Unify builds for platform-specific files in WebKit layer https://bugs.webkit.org/show_bug.cgi?id=182450 Reviewed by Carlos Garcia Campos. Add most GTK-specific sources to unified build. API files are exempted, except for the DOM API. Files shared with PluginProcessGTK2 are also exempted. Finally, files with name conflicts in headers, which appears difficult to fix, are also exempted. * CMakeLists.txt: * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp: * NetworkProcess/soup/NetworkDataTaskSoup.cpp: * NetworkProcess/soup/NetworkProcessSoup.cpp: * NetworkProcess/soup/NetworkSessionSoup.cpp: * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: * Platform/classifier/ResourceLoadStatisticsClassifier.cpp: * PlatformGTK.cmake: * PluginProcess/unix/PluginControllerProxyUnix.cpp: * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: * Shared/CoordinatedGraphics/SimpleViewportController.cpp: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: * Shared/Plugins/unix/PluginSearchPath.cpp: * Shared/cairo/ShareableBitmapCairo.cpp: * Shared/glib/WebContextMenuItemGlib.cpp: * Shared/glib/WebErrorsGlib.cpp: * Shared/gtk/ArgumentCodersGtk.cpp: * Shared/gtk/NativeWebKeyboardEventGtk.cpp: * Shared/gtk/ProcessExecutablePathGtk.cpp: * Shared/gtk/WebErrorsGtk.cpp: * Shared/gtk/WebEventFactory.cpp: * Shared/linux/WebMemorySamplerLinux.cpp: * Shared/soup/WebCoreArgumentCodersSoup.cpp: * Shared/soup/WebErrorsSoup.cpp: * SourcesGTK.txt: Added. * UIProcess/AcceleratedDrawingAreaProxy.cpp: * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp: * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: * UIProcess/BackingStore.cpp: * UIProcess/DrawingAreaProxyImpl.cpp: * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp: * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: * UIProcess/WebResourceLoadStatisticsStore.cpp: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: * UIProcess/WebStorage/StorageManager.cpp: * UIProcess/cairo/BackingStoreCairo.cpp: * UIProcess/gtk/AcceleratedBackingStore.cpp: * UIProcess/gtk/DragAndDropHandler.cpp: * UIProcess/gtk/GestureController.cpp: * UIProcess/gtk/HardwareAccelerationManager.cpp: * UIProcess/gtk/InputMethodFilter.cpp: * UIProcess/gtk/TextCheckerGtk.cpp: * UIProcess/gtk/WaylandCompositor.cpp: * UIProcess/gtk/WebColorPickerGtk.cpp: * UIProcess/gtk/WebContextMenuProxyGtk.cpp: * UIProcess/gtk/WebPasteboardProxyGtk.cpp: * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp: (webkit_dom_attr_dom_event_target_init): (webkit_dom_attr_set_property): (webkit_dom_attr_get_property): (webkit_dom_attr_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp: (webkit_dom_cdata_section_dom_event_target_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp: (webkit_dom_css_rule_set_property): (webkit_dom_css_rule_get_property): (webkit_dom_css_rule_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp: (webkit_dom_css_rule_list_get_property): (webkit_dom_css_rule_list_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp: (webkit_dom_css_style_declaration_set_property): (webkit_dom_css_style_declaration_get_property): (webkit_dom_css_style_declaration_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp: (webkit_dom_css_style_sheet_get_property): (webkit_dom_css_style_sheet_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp: (webkit_dom_css_value_set_property): (webkit_dom_css_value_get_property): (webkit_dom_css_value_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp: (webkit_dom_character_data_dom_event_target_init): (webkit_dom_character_data_set_property): (webkit_dom_character_data_get_property): (webkit_dom_character_data_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp: (webkit_dom_client_rect_get_property): (webkit_dom_client_rect_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: (webkit_dom_client_rect_list_get_property): (webkit_dom_client_rect_list_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp: (webkit_dom_comment_dom_event_target_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp: (webkit_dom_dom_selection_get_property): (webkit_dom_dom_selection_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp: (webkit_dom_dom_token_list_set_property): (webkit_dom_dom_token_list_get_property): (webkit_dom_dom_token_list_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp: (webkit_dom_dom_window_dom_event_target_init): (webkit_dom_dom_window_set_property): (webkit_dom_dom_window_get_property): (webkit_dom_dom_window_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp: (webkit_dom_document_dom_event_target_init): (webkit_dom_document_set_property): (webkit_dom_document_get_property): (webkit_dom_document_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp: (webkit_dom_document_fragment_dom_event_target_init): (webkit_dom_document_fragment_get_property): (webkit_dom_document_fragment_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp: (webkit_dom_document_type_dom_event_target_init): (webkit_dom_document_type_get_property): (webkit_dom_document_type_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_dom_event_target_init): (webkit_dom_element_set_property): (webkit_dom_element_get_property): (webkit_dom_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp: (webkit_dom_event_set_property): (webkit_dom_event_get_property): (webkit_dom_event_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp: (webkit_dom_file_get_property): (webkit_dom_file_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp: (webkit_dom_file_list_get_property): (webkit_dom_file_list_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp: (webkit_dom_html_anchor_element_dom_event_target_init): (webkit_dom_html_anchor_element_set_property): (webkit_dom_html_anchor_element_get_property): (webkit_dom_html_anchor_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp: (webkit_dom_html_applet_element_dom_event_target_init): (webkit_dom_html_applet_element_set_property): (webkit_dom_html_applet_element_get_property): (webkit_dom_html_applet_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp: (webkit_dom_html_area_element_dom_event_target_init): (webkit_dom_html_area_element_set_property): (webkit_dom_html_area_element_get_property): (webkit_dom_html_area_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp: (webkit_dom_html_br_element_dom_event_target_init): (webkit_dom_html_br_element_set_property): (webkit_dom_html_br_element_get_property): (webkit_dom_html_br_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp: (webkit_dom_html_base_element_dom_event_target_init): (webkit_dom_html_base_element_set_property): (webkit_dom_html_base_element_get_property): (webkit_dom_html_base_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp: (webkit_dom_html_body_element_dom_event_target_init): (webkit_dom_html_body_element_set_property): (webkit_dom_html_body_element_get_property): (webkit_dom_html_body_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp: (webkit_dom_html_button_element_dom_event_target_init): (webkit_dom_html_button_element_set_property): (webkit_dom_html_button_element_get_property): (webkit_dom_html_button_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp: (webkit_dom_html_canvas_element_dom_event_target_init): (webkit_dom_html_canvas_element_set_property): (webkit_dom_html_canvas_element_get_property): (webkit_dom_html_canvas_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp: (webkit_dom_html_collection_get_property): (webkit_dom_html_collection_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp: (webkit_dom_html_d_list_element_dom_event_target_init): (webkit_dom_html_d_list_element_set_property): (webkit_dom_html_d_list_element_get_property): (webkit_dom_html_d_list_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp: (webkit_dom_html_directory_element_dom_event_target_init): (webkit_dom_html_directory_element_set_property): (webkit_dom_html_directory_element_get_property): (webkit_dom_html_directory_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp: (webkit_dom_html_div_element_dom_event_target_init): (webkit_dom_html_div_element_set_property): (webkit_dom_html_div_element_get_property): (webkit_dom_html_div_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp: (webkit_dom_html_document_dom_event_target_init): (webkit_dom_html_document_set_property): (webkit_dom_html_document_get_property): (webkit_dom_html_document_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp: (webkit_dom_html_element_dom_event_target_init): (webkit_dom_html_element_set_property): (webkit_dom_html_element_get_property): (webkit_dom_html_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp: (webkit_dom_html_embed_element_dom_event_target_init): (webkit_dom_html_embed_element_set_property): (webkit_dom_html_embed_element_get_property): (webkit_dom_html_embed_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp: (webkit_dom_html_field_set_element_dom_event_target_init): (webkit_dom_html_field_set_element_get_property): (webkit_dom_html_field_set_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp: (webkit_dom_html_font_element_dom_event_target_init): (webkit_dom_html_font_element_set_property): (webkit_dom_html_font_element_get_property): (webkit_dom_html_font_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp: (webkit_dom_html_form_element_dom_event_target_init): (webkit_dom_html_form_element_set_property): (webkit_dom_html_form_element_get_property): (webkit_dom_html_form_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp: (webkit_dom_html_frame_element_dom_event_target_init): (webkit_dom_html_frame_element_set_property): (webkit_dom_html_frame_element_get_property): (webkit_dom_html_frame_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp: (webkit_dom_html_frame_set_element_dom_event_target_init): (webkit_dom_html_frame_set_element_set_property): (webkit_dom_html_frame_set_element_get_property): (webkit_dom_html_frame_set_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp: (webkit_dom_html_hr_element_dom_event_target_init): (webkit_dom_html_hr_element_set_property): (webkit_dom_html_hr_element_get_property): (webkit_dom_html_hr_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp: (webkit_dom_html_head_element_dom_event_target_init): (webkit_dom_html_head_element_set_property): (webkit_dom_html_head_element_get_property): (webkit_dom_html_head_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp: (webkit_dom_html_heading_element_dom_event_target_init): (webkit_dom_html_heading_element_set_property): (webkit_dom_html_heading_element_get_property): (webkit_dom_html_heading_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp: (webkit_dom_html_html_element_dom_event_target_init): (webkit_dom_html_html_element_set_property): (webkit_dom_html_html_element_get_property): (webkit_dom_html_html_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp: (webkit_dom_html_iframe_element_dom_event_target_init): (webkit_dom_html_iframe_element_set_property): (webkit_dom_html_iframe_element_get_property): (webkit_dom_html_iframe_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp: (webkit_dom_html_image_element_dom_event_target_init): (webkit_dom_html_image_element_set_property): (webkit_dom_html_image_element_get_property): (webkit_dom_html_image_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp: (webkit_dom_html_input_element_dom_event_target_init): (webkit_dom_html_input_element_set_property): (webkit_dom_html_input_element_get_property): (webkit_dom_html_input_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp: (webkit_dom_html_li_element_dom_event_target_init): (webkit_dom_html_li_element_set_property): (webkit_dom_html_li_element_get_property): (webkit_dom_html_li_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp: (webkit_dom_html_label_element_dom_event_target_init): (webkit_dom_html_label_element_set_property): (webkit_dom_html_label_element_get_property): (webkit_dom_html_label_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp: (webkit_dom_html_legend_element_dom_event_target_init): (webkit_dom_html_legend_element_set_property): (webkit_dom_html_legend_element_get_property): (webkit_dom_html_legend_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp: (webkit_dom_html_link_element_dom_event_target_init): (webkit_dom_html_link_element_set_property): (webkit_dom_html_link_element_get_property): (webkit_dom_html_link_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp: (webkit_dom_html_map_element_dom_event_target_init): (webkit_dom_html_map_element_set_property): (webkit_dom_html_map_element_get_property): (webkit_dom_html_map_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp: (webkit_dom_html_marquee_element_dom_event_target_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp: (webkit_dom_html_menu_element_dom_event_target_init): (webkit_dom_html_menu_element_set_property): (webkit_dom_html_menu_element_get_property): (webkit_dom_html_menu_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp: (webkit_dom_html_meta_element_dom_event_target_init): (webkit_dom_html_meta_element_set_property): (webkit_dom_html_meta_element_get_property): (webkit_dom_html_meta_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp: (webkit_dom_html_mod_element_dom_event_target_init): (webkit_dom_html_mod_element_set_property): (webkit_dom_html_mod_element_get_property): (webkit_dom_html_mod_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp: (webkit_dom_html_o_list_element_dom_event_target_init): (webkit_dom_html_o_list_element_set_property): (webkit_dom_html_o_list_element_get_property): (webkit_dom_html_o_list_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp: (webkit_dom_html_object_element_dom_event_target_init): (webkit_dom_html_object_element_set_property): (webkit_dom_html_object_element_get_property): (webkit_dom_html_object_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp: (webkit_dom_html_opt_group_element_dom_event_target_init): (webkit_dom_html_opt_group_element_set_property): (webkit_dom_html_opt_group_element_get_property): (webkit_dom_html_opt_group_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp: (webkit_dom_html_option_element_dom_event_target_init): (webkit_dom_html_option_element_set_property): (webkit_dom_html_option_element_get_property): (webkit_dom_html_option_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp: (webkit_dom_html_options_collection_set_property): (webkit_dom_html_options_collection_get_property): (webkit_dom_html_options_collection_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp: (webkit_dom_html_paragraph_element_dom_event_target_init): (webkit_dom_html_paragraph_element_set_property): (webkit_dom_html_paragraph_element_get_property): (webkit_dom_html_paragraph_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp: (webkit_dom_html_param_element_dom_event_target_init): (webkit_dom_html_param_element_set_property): (webkit_dom_html_param_element_get_property): (webkit_dom_html_param_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp: (webkit_dom_html_pre_element_dom_event_target_init): (webkit_dom_html_pre_element_set_property): (webkit_dom_html_pre_element_get_property): (webkit_dom_html_pre_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp: (webkit_dom_html_quote_element_dom_event_target_init): (webkit_dom_html_quote_element_set_property): (webkit_dom_html_quote_element_get_property): (webkit_dom_html_quote_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp: (webkit_dom_html_script_element_dom_event_target_init): (webkit_dom_html_script_element_set_property): (webkit_dom_html_script_element_get_property): (webkit_dom_html_script_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp: (webkit_dom_html_select_element_dom_event_target_init): (webkit_dom_html_select_element_set_property): (webkit_dom_html_select_element_get_property): (webkit_dom_html_select_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp: (webkit_dom_html_style_element_dom_event_target_init): (webkit_dom_html_style_element_set_property): (webkit_dom_html_style_element_get_property): (webkit_dom_html_style_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp: (webkit_dom_html_table_caption_element_dom_event_target_init): (webkit_dom_html_table_caption_element_set_property): (webkit_dom_html_table_caption_element_get_property): (webkit_dom_html_table_caption_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp: (webkit_dom_html_table_cell_element_dom_event_target_init): (webkit_dom_html_table_cell_element_set_property): (webkit_dom_html_table_cell_element_get_property): (webkit_dom_html_table_cell_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp: (webkit_dom_html_table_col_element_dom_event_target_init): (webkit_dom_html_table_col_element_set_property): (webkit_dom_html_table_col_element_get_property): (webkit_dom_html_table_col_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp: (webkit_dom_html_table_element_dom_event_target_init): (webkit_dom_html_table_element_set_property): (webkit_dom_html_table_element_get_property): (webkit_dom_html_table_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp: (webkit_dom_html_table_row_element_dom_event_target_init): (webkit_dom_html_table_row_element_set_property): (webkit_dom_html_table_row_element_get_property): (webkit_dom_html_table_row_element_class_init): (webkit_dom_html_table_row_element_insert_cell): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp: (webkit_dom_html_table_section_element_dom_event_target_init): (webkit_dom_html_table_section_element_set_property): (webkit_dom_html_table_section_element_get_property): (webkit_dom_html_table_section_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp: (webkit_dom_html_text_area_element_dom_event_target_init): (webkit_dom_html_text_area_element_set_property): (webkit_dom_html_text_area_element_get_property): (webkit_dom_html_text_area_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp: (webkit_dom_html_title_element_dom_event_target_init): (webkit_dom_html_title_element_set_property): (webkit_dom_html_title_element_get_property): (webkit_dom_html_title_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp: (webkit_dom_html_u_list_element_dom_event_target_init): (webkit_dom_html_u_list_element_set_property): (webkit_dom_html_u_list_element_get_property): (webkit_dom_html_u_list_element_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp: (webkit_dom_keyboard_event_get_property): (webkit_dom_keyboard_event_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp: (webkit_dom_media_list_set_property): (webkit_dom_media_list_get_property): (webkit_dom_media_list_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp: (webkit_dom_mouse_event_get_property): (webkit_dom_mouse_event_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp: (webkit_dom_named_node_map_get_property): (webkit_dom_named_node_map_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp: (webkit_dom_node_dom_event_target_init): (webkit_dom_node_set_property): (webkit_dom_node_get_property): (webkit_dom_node_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp: (webkit_dom_node_iterator_get_property): (webkit_dom_node_iterator_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp: (webkit_dom_node_list_get_property): (webkit_dom_node_list_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp: (webkitDOMObjectSetProperty): (webkit_dom_object_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp: (webkit_dom_processing_instruction_dom_event_target_init): (webkit_dom_processing_instruction_get_property): (webkit_dom_processing_instruction_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp: (webkit_dom_range_get_property): (webkit_dom_range_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp: (webkit_dom_style_sheet_set_property): (webkit_dom_style_sheet_get_property): (webkit_dom_style_sheet_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp: (webkit_dom_style_sheet_list_get_property): (webkit_dom_style_sheet_list_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp: (webkit_dom_text_dom_event_target_init): (webkit_dom_text_get_property): (webkit_dom_text_class_init): (webkit_dom_event_target_init): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp: (webkit_dom_tree_walker_get_property): (webkit_dom_tree_walker_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp: (webkit_dom_ui_event_get_property): (webkit_dom_ui_event_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp: (webkit_dom_wheel_event_get_property): (webkit_dom_wheel_event_class_init): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp: (webkit_dom_xpath_result_get_property): (webkit_dom_xpath_result_class_init): * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp: * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp: * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp: * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp: * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: * WebProcess/WebPage/AcceleratedSurface.cpp: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/DrawingAreaImpl.cpp: * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp: * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp: * WebProcess/WebPage/gtk/WebPageGtk.cpp: * WebProcess/gtk/WaylandCompositorDisplay.cpp: * WebProcess/gtk/WebProcessMainGtk.cpp: 2018-02-05 Carlos Garcia Campos WebDriver: addCookie command should prepend a dot to domain if missing https://bugs.webkit.org/show_bug.cgi?id=182328 Reviewed by Michael Catanzaro. RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot. Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::addSingleCookie): 2018-02-11 Yousuke Kimoto [WinCairo] Add WKBaseWin.h https://bugs.webkit.org/show_bug.cgi?id=182681 Reviewed by Yusuke Suzuki. * PlatformWin.cmake: * Shared/API/c/win/WKBaseWin.h: Added. 2018-02-09 Ross Kirsling Remove invalidated WebPage::handleEditingKeyboardEvent default implementation after r228260. https://bugs.webkit.org/show_bug.cgi?id=182663 Reviewed by Chris Dumez. This would need to be updated to turn `keyEvent` into `underlyingPlatformEvent`; instead, we can remove it, as it's only for Windows, which doesn't yet support WK2. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::handleEditingKeyboardEvent): Deleted. 2018-02-09 Nan Wang AX: Accessibility is not notified when a web process cancels the suspension https://bugs.webkit.org/show_bug.cgi?id=182659 Reviewed by Ryosuke Niwa. We were notifying Accessibility with the web process suspended information in actualPrepareToSuspend and processDidResume. However, the suspension can be canceled during the prepare call. So that we should also post a notification in cancelPrepareToSuspend. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::cancelPrepareToSuspend): 2018-02-09 Brent Fulgham Sandbox violating attempting to read log formatting preference file https://bugs.webkit.org/show_bug.cgi?id=182648 Reviewed by Eric Carlson. Various frameworks attempt to read logging format information from /usr/local/lib/log. The sandbox is blocking this, generating log spam and preventing some logging features from working properly. We should allow read access to this path. * 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: 2018-02-08 Chris Dumez There should be a way to disable [OverrideBuiltins] behavior in a given DOMWrapperWorld https://bugs.webkit.org/show_bug.cgi?id=182524 Reviewed by Ryosuke Niwa. Add C API on WKBundleScriptWorld and Cocoa API on WKWebProcessPlugInScriptWorld to disable the [OverrideBuiltins] behavior on a given script world. The [OverrideBuiltins] behavior [1] is legacy behavior that is needed for Web compatibility but allowing the client to disable this behavior in a given world makes development easier and running injected script on uncontrolled content a lot more reliable. [1] https://heycam.github.io/webidl/#OverrideBuiltins * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm: (-[WKWebProcessPlugInScriptWorld disableOverrideBuiltinsBehavior]): * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp: (WKBundleScriptWorldDisableOverrideBuiltinsBehavior): * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h: * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: (WebKit::InjectedBundleScriptWorld::disableOverrideBuiltinsBehavior): * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: 2018-02-08 Ross Kirsling Remove WebProcessPool::platformInitialize stub. https://bugs.webkit.org/show_bug.cgi?id=182621 Reviewed by Alex Christensen. The #if here could be simplified to PLATFORM(WIN), but Windows too will need a proper implementation as part of WK2 support, so this stub shouldn't need to exist at all. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::platformInitialize): Deleted. 2018-02-08 Michael Catanzaro TestController should not exercise cocoa-specific resource load statistics APIs https://bugs.webkit.org/show_bug.cgi?id=182355 Reviewed by Alex Christensen. Remove the Cocoa testing SPI, since it's redundant with the C API. Also, add a couple missing cookie partitioning callbacks to the C API. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning): (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsSetLastSeen:forHost:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetIsPrevalentResource:forHost:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetHadUserInteraction:forHost:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetIsGrandfathered:forHost:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubframeUnderTopFrameOrigin:forHost:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubresourceUnderTopFrameOrigin:forHost:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubresourceUniqueRedirectTo:forHost:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetTimeToLiveUserInteraction:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetTimeToLiveCookiePartitionFree:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetMinimumTimeBetweenDataRecordsRemoval:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetGrandfatheringTime:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetMaxStatisticsEntries:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetPruneEntriesDownTo:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSubmitTelemetry]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetNotifyPagesWhenDataRecordsWereScanned:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldClassifyResourcesBeforeDataRecordsRemoval:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetNotifyPagesWhenTelemetryWasCaptured:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: 2018-02-08 Don Olmstead Remove JavaScriptCore/ForwardingHeaders directory https://bugs.webkit.org/show_bug.cgi?id=182594 Reviewed by Mark Lam. * PlatformGTK.cmake: 2018-02-08 Tim Horton Make WebKit public headers modules-safe https://bugs.webkit.org/show_bug.cgi?id=182611 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKPreviewElementInfo.h: * UIProcess/API/Cocoa/WKSnapshotConfiguration.h: Import headers without which these WebKit headers can not be used alone. * WebKit.xcodeproj/project.pbxproj: Make WKWindowFeaturesPrivate a private header like it was supposed to be. 2018-02-08 Matt Lewis Unreviewed, rolling out r228262. This broke an internal build alongside r228261. Reverted changeset: "WebDriver: addCookie command should prepend a dot to domain if missing" https://bugs.webkit.org/show_bug.cgi?id=182328 https://trac.webkit.org/changeset/228262 2018-02-08 Miguel Gomez [GTK] WaylandCompositor misusing eglGetProcAddress https://bugs.webkit.org/show_bug.cgi?id=182490 Reviewed by Michael Catanzaro. Check that the appropriate extensions are available before calling eglGetProcAddress, as even getting a non null value from it, the functionality can be disabled at runtime. * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::initializeEGL): 2018-02-08 Frederic Wang Add scrolling node types to distinguish main frames and subframes. https://bugs.webkit.org/show_bug.cgi?id=182533 Reviewed by Simon Fraser. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Replace the case of FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode. (WebKit::encodeNodeAndDescendants): (WebKit::RemoteScrollingCoordinatorTransaction::decode): (WebKit::dump): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Ditto. (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Ditto and pass the node type to the constructor of the frame scrolling node. (WebKit::RemoteScrollingTree::createScrollingTreeNode): * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Replace the case of FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode. (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: In order to determine whether the node is a main frame or subframe, use the node type instead of checking whether the node as a parent. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): 2018-02-05 Carlos Garcia Campos WebDriver: addCookie command should prepend a dot to domain if missing https://bugs.webkit.org/show_bug.cgi?id=182328 Reviewed by Michael Catanzaro. RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot. Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::addSingleCookie): 2018-01-13 Darin Adler Event improvements https://bugs.webkit.org/show_bug.cgi?id=179591 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp: (webkit_dom_wheel_event_init_wheel_event): Updated to call initWebKitWheelEvent. * WebProcess/Plugins/PluginView.cpp: Removed include of ScriptValue.h. * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::WebEditorClient::executePendingEditorCommands): Updated for name change from keyEvent to underlyingPlatformEvent. (WebKit::WebEditorClient::handleInputMethodKeydown): Ditto. * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: (WebKit::WebEditorClient::handleKeyboardEvent): Ditto. (WebKit::WebEditorClient::handleInputMethodKeydown): Ditto. * WebProcess/WebPage/WebPage.cpp: Removed include of ScriptValue.h. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleEditingKeyboardEvent): Updated for name change from keyEvent to underlyingPlatformEvent. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::executeKeypressCommandsInternal): Ditto. (WebKit::WebPage::handleEditingKeyboardEvent): Ditto. 2018-02-07 Antti Koivisto and Youenn Fablet REGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse + 267 https://bugs.webkit.org/show_bug.cgi?id=182532 Reviewed by Chris Dumez. No test case, don't know how to make one. The repro involves multipart HTTP streaming and details are hazy. We were calling a function that was WTFMoved away just a few lines above. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): 2018-02-07 Tim Horton Evernote device management web view sometimes displays at the wrong scale https://bugs.webkit.org/show_bug.cgi?id=182590 Reviewed by Simon Fraser. Evernote implements the WKWebView's scroll view's delegate method viewForZoomingInScrollView: and returns nil. This results in WKScrollView's zoomScale always returning 1, no matter what the WKContentView's actual scale is. This will result in us never updating the WKContentView's scale to 1. When loading a page that has a few scale changes during load but ends up at scale 1, we get stuck at whatever intermediate scale immediately preceded settling on 1. Fix this by not forwarding viewForZoomingInScrollView: to the external WKScrollView delegate; we are in charge of the contents of the scroll view (including which view scrollView's zoomScale should track), and overriding viewForZoomingInScrollView: is only ever going to lead to a broken WebKit. * UIProcess/ios/WKScrollView.mm: (shouldForwardScrollViewDelegateMethodToExternalDelegate): (-[WKScrollViewDelegateForwarder forwardInvocation:]): (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]): 2018-02-07 Wenson Hsieh [Extra zoom mode] Delegate scrolling from the content view to input view controllers https://bugs.webkit.org/show_bug.cgi?id=182534 Reviewed by Tim Horton. Override -_wheelChangedWithEvent: on the content view, and give extra zoomed input view controllers a chance to handle the event. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _wheelChangedWithEvent:]): 2018-02-07 Wenson Hsieh [Extra zoom mode] Implement multiple and single select menus https://bugs.webkit.org/show_bug.cgi?id=182525 Reviewed by Tim Horton. Add support for presenting picker views when focusing single or multiple select elements. See changes below for additional detail. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startAssistingKeyboard]): Move logic for presenting view controllers when focusing elements out of _startAssistingKeyboard, and into _startAssistingNode:(...). This is because _startAssistingKeyboard is only invoked for certain types of focused element types; importantly, this set excludes select elements. Putting the call to present the focused view controller there also didn't make much since, considering that these new view controllers are not tied to keyboards in any way. (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): (-[WKContentView _stopAssistingNode]): Dismiss any select menu that is being presented. (-[WKContentView presentSelectMenuViewController:]): (-[WKContentView dismissSelectMenuViewController:]): Introduce idempotent helpers for presenting and dismissing the select menu view controller. (-[WKContentView presentViewControllerForAssistedNode:]): (-[WKContentView selectMenu:didSelectItemAtIndex:]): For single select menus. Called when the user selects a row. (-[WKContentView didCancelSelectionInSelectMenu:]): (-[WKContentView numberOfItemsInSelectMenu:]): (-[WKContentView selectMenu:displayTextForItemAtIndex:]): Indicates the text value to show at a given index. (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]): For multiple select menus, invoked when an item is checked. The `checked` parameter indicates whether or not the item is now checked. (-[WKContentView selectMenuSupportsMultipleSelection:]): Indicates whether this select menu is single-item-only, or allows multiple items to be selected (checked). (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]): For multiple select menus. Determines whether an option at the given index is checked. (-[WKContentView startingIndexForSelectMenu:]): Determines the index to instantly scroll to when presenting the select menu. * UIProcess/ios/forms/WKSelectMenuViewController.h: Added. * UIProcess/ios/forms/WKSelectMenuViewController.mm: Added. Add new harness files for WKSelectMenuViewController's header and implementation (see WebKitAdditions). * WebKit.xcodeproj/project.pbxproj: 2018-02-07 Brent Fulgham Improve NetworkResourceLoader logging to capture redirect cases https://bugs.webkit.org/show_bug.cgi?id=182573 Reviewed by Chris Dumez. Add logging for cookie partitioning or blocking during redirects. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): 2018-02-07 John Wilander Restrict Referer to just the origin for third parties in private mode and third parties ITP blocks cookies for in regular mode https://bugs.webkit.org/show_bug.cgi?id=182559 Reviewed by Andy Estes. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest): New convenience function. Checks whether the resource shares partition with the first party. (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Now strips the referrer to just the origin for: 1. All third party requests in private mode. 2. Third party requests to domains that ITP blocks cookies for. (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): Now strips the referrer in redirects to just the origin for: 1. All third party requests in private mode. 2. Third party requests to domains that ITP blocks cookies for. 2018-02-07 Daniel Bates Log error when authentication challenge is blocked due to an insecure request https://bugs.webkit.org/show_bug.cgi?id=182358 Reviewed by Andy Estes. Have network process notify the web process when it blocks an authentication challenge. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::completeAuthenticationChallenge): * NetworkProcess/NetworkLoadClient.h: (WebKit::NetworkLoadClient::didBlockAuthenticationChallenge): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didBlockAuthenticationChallenge): * NetworkProcess/NetworkResourceLoader.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didBlockAuthenticationChallenge): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: 2018-02-07 Chris Dumez IndexedDB in service workers is using a memory backed store https://bugs.webkit.org/show_bug.cgi?id=182574 Reviewed by Youenn Fablet. Make sure we pass a proper WebDatabaseProvider to the ServiceWorkerProcess via PageConfiguration. Otherwise, we end up using the default EmptyDatabaseProvider which uses an InProcessIDBServer and a memory-backed store for IndexedDB. * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::start): * UIProcess/WebProcessPool.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection): (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2018-02-07 Michael Catanzaro [GTK] Typo in a translatable string https://bugs.webkit.org/show_bug.cgi?id=182570 Unreviewed. Fix a typo. * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: (webkit_website_data_manager_class_init): 2018-02-06 Don Olmstead Remove WebCore/ForwardingHeaders directory https://bugs.webkit.org/show_bug.cgi?id=182347 Reviewed by Keith Miller. * Platform/mac/StringUtilities.mm: * Shared/Cocoa/WebKit2InitializeCocoa.mm: * Shared/WebKit2Initialize.cpp: * Shared/linux/WebMemorySamplerLinux.cpp: * Shared/mac/WebMemorySampler.mac.mm: * UIProcess/WebProcessPool.cpp: * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h: * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: * WebProcess/Plugins/PluginProcessConnection.cpp: * WebProcess/Plugins/PluginView.cpp: * WebProcess/WebPage/WebInspector.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/cocoa/WebProcessCocoa.mm: 2018-02-06 Chris Dumez Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html is a flaky failure on macOS and iOS https://bugs.webkit.org/show_bug.cgi?id=181392 Reviewed by Youenn Fablet. All tasks from the StorageProcess to the WebContent process to update registrations and service workers state are posted to the runloop. However, the fetch callbacks do not do so. This means that fetch results might come in out of order with regards to the registration / service worker state updates. The test was flaky because an intercepted load would sometimes finish before the task to update the service worker state to "activated" was processed by the runloop. We address the issue by having the ServiceWorkerClientFetch callbacks schedule tasks to the runloop too. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): (WebKit::ServiceWorkerClientFetch::didReceiveData): (WebKit::ServiceWorkerClientFetch::didFinish): (WebKit::ServiceWorkerClientFetch::didFail): (WebKit::ServiceWorkerClientFetch::didNotHandle): 2018-02-06 Brent Fulgham [macOS] Correct sandbox violation triggered by Chase.com https://bugs.webkit.org/show_bug.cgi?id=182519 Reviewed by Eric Carlson. Hitting a sandbox violation when attempting to check status of IOAV*En/Decode support. * WebProcess/com.apple.WebProcess.sb.in: 2018-02-06 Jeff Miller Add WKNavigationDelegate SPI to tell the client when an insecure plug-in is blocked https://bugs.webkit.org/show_bug.cgi?id=182540 Reviewed by Alex Christensen. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didBlockInsecurePluginVersion): Changed to take a dictionary reference. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didBlockInsecurePluginVersion): Added. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): Changed didBlockInsecurePluginVersion() to take a dictionary reference. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Added -_webView:didBlockInsecurePluginVersionWithInfo:. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): Initialize webViewDidBlockInsecurePluginVersionWithInfo. (WebKit::NavigationState::NavigationClient::didBlockInsecurePluginVersion): Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didBlockInsecurePluginVersion): Remove check for PLATFORM(COCOA) (we don't check for this in didFailToInitializePlugin() where we also use createPluginInformationDictionary()) and ENABLE(NETSCAPE_PLUGIN_API) (we're already inside an #if ENABLE(NETSCAPE_PLUGIN_API block) and use auto for pluginInformation. Attempt to use the navigation client before the loader client. 2018-02-06 Youenn Fablet HasServiceWorkerRegistration bit should be sent when creating a new page https://bugs.webkit.org/show_bug.cgi?id=182410 Reviewed by Chris Dumez. Move the bit computation at page creation time. This allows computing the bit based on the web site data store and not only on the pool configuration. WebPage uses that bit to activate service worker registration matching for the whole process. In case there is a service worker process proxy created, the bit is set to true by default. Bit is computed by checking for database file presence. This information is cached in a map for efficiency reasons and cleared when a service worker process proxy is created. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::initializeWebPage): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2018-02-06 Michael Catanzaro Unreviewed, fix format specifiers added in r228116 https://bugs.webkit.org/show_bug.cgi?id=182456 * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::retrieveRecords): (WebKit::CacheStorageEngineConnection::deleteMatchingRecords): (WebKit::CacheStorageEngineConnection::putRecords): (WebKit::CacheStorageEngineConnection::reference): (WebKit::CacheStorageEngineConnection::dereference): 2018-02-05 Chris Dumez Avoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection::sendMessage() after r228001 https://bugs.webkit.org/show_bug.cgi?id=182494 Reviewed by Ryosuke Niwa. Somebody fixed a GC crash in r228001 by allowing RunLoop::current() to be called from a GC thread. However, this is still unnecessarily inefficient. Calling RunLoop::current() will construct RunLoops for background GC threads (WTF::AutomaticThreads). This patches updates the IPC code to call isMainThread() instead of RunLoop::isMain() in Connection::sendMessage(). This should mean the same thing since this code runs in WebKit2 and should be more efficient as it ends up simply calling pthread_main_np(), without constructing a RunLoop. * Platform/IPC/Connection.cpp: (IPC::Connection::sendMessage): 2018-02-05 Ryosuke Niwa Release assertion in inlineVideoFrame https://bugs.webkit.org/show_bug.cgi?id=182513 Reviewed by Zalan Bujtas. Fixed the bug. Don't try to update the layout when there is no live render tree or active DOM objects had been stopped: i.e. during a document destruction. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::inlineVideoFrame): 2018-02-05 Yousuke Kimoto [WinCairo] Refine WebKitLegacy and WebKit build for wincairo https://bugs.webkit.org/show_bug.cgi?id=182478 Reviewed by Alex Christensen. Fixed a typo of forwarding header path for InjectedBundle and copying header method, which should use FLATTENED. * PlatformWin.cmake: Fix a typo of a forwarding header path for InjectedBundle and use FLATTENED. 2018-02-05 Youenn Fablet WebsiteDataStore::resolveDirectoriesIfNecessary() should not overwrite its resolved serviceWorkerRegistrationDirectory if already set https://bugs.webkit.org/show_bug.cgi?id=182514 Reviewed by Chris Dumez. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): 2018-02-05 Brent Fulgham [iOS] Storage process is using the wrong sandbox profile filename https://bugs.webkit.org/show_bug.cgi?id=182500 Reviewed by David Kilzer. The iOS entitlements file was still referencing the old Databases sandbox profile, even though the process has been renamed 'Storage'. * Configurations/Databases-iOS.entitlements: 2018-02-05 Ryosuke Niwa Add DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToScreen https://bugs.webkit.org/show_bug.cgi?id=182458 Reviewed by Chris Dumez. Added DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToScreen which are found to get sent from WebContent process while ScriptDisallowedScope is present by a work-in-progress patch on webkit.org/b/182449. * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::populatePluginCache): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::rootViewToScreen): 2018-02-05 Commit Queue Unreviewed, rolling out r227964 and r228087. https://bugs.webkit.org/show_bug.cgi?id=182508 These introduced an API test failure with URLTest.HostIsIPAddress alongside commit r228086 (Requested by mlewis13 on #webkit). Reverted changesets: "[SOUP] Ensure domain is valid when converting a WebCore Cookie to Soup" https://bugs.webkit.org/show_bug.cgi?id=182328 https://trac.webkit.org/changeset/227964 "WebDriver: addCookie command should prepend a dot to domain if missing" https://bugs.webkit.org/show_bug.cgi?id=182328 https://trac.webkit.org/changeset/228087 2018-02-05 Wenson Hsieh [Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs https://bugs.webkit.org/show_bug.cgi?id=182472 Reviewed by Tim Horton. Allows the user to edit numeric input types using a number pad. See below comments for more detail. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startAssistingKeyboard]): (-[WKContentView _stopAssistingNode]): Dismiss the number pad, if it is present. (-[WKContentView dismissNumberPadViewController:]): (-[WKContentView presentNumberPadViewController:]): Add new helpers for showing and hiding the number pad view controller. (-[WKContentView presentViewControllerForAssistedNode:]): (-[WKContentView textInputController:didRequestDismissalWithAction:]): Dismiss the number pad, if it is present. (-[WKContentView focusedFormControlControllerDidBeginEditing:]): (-[WKContentView shouldPresentTextInputViewController:]): Deleted. Remove -shouldPresentTextInputViewController and replace it with -presentViewControllerForAssistedNode:, which presents the appropriate view controller given "assisted" node information. * UIProcess/ios/forms/WKNumberPadView.h: Added. * UIProcess/ios/forms/WKNumberPadView.mm: Added. * UIProcess/ios/forms/WKNumberPadViewController.h: Added. * UIProcess/ios/forms/WKNumberPadViewController.mm: Added. Add "WebKitAdditions harness" files for the new number pad view and view controller classes. * WebKit.xcodeproj/project.pbxproj: 2018-02-05 Youenn Fablet Add logging to CacheStorageEngineConnection https://bugs.webkit.org/show_bug.cgi?id=182456 Reviewed by Chris Dumez. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::retrieveRecords): (WebKit::CacheStorageEngineConnection::deleteMatchingRecords): (WebKit::CacheStorageEngineConnection::putRecords): (WebKit::CacheStorageEngineConnection::reference): (WebKit::CacheStorageEngineConnection::dereference): * Platform/Logging.h: 2018-02-05 Daniel Bates REGRESSION (r222795): Nike app "Refused to set unsafe header" when adding and viewing cart https://bugs.webkit.org/show_bug.cgi?id=182491 Reviewed by Brent Fulgham. Exempt Nike from the XHR header restrictions in r222795. Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers. However Nike also depends on such functionality. * UIProcess/API/Cocoa/WKWebView.mm: (shouldAllowSettingAnyXHRHeaderFromFileURLs): 2018-02-02 Brent Fulgham Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM' https://bugs.webkit.org/show_bug.cgi?id=182455 Reviewed by Chris Dumez. Refactor "logCookieInformation" so that it can be used for resource loads and DOM cookie manipulation. Place the generally useful logic in a static method that can be invoked from other places in the NetworkProcess. Call the new refactored method from NetworkConnectionToWebProcess::setCookiesFromDOM so we can perform logging there as well. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Call the new logging method (when enabled). * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::shouldLogCookieInformation): Changed to static method. (WebKit::escapeForJSON): Made a static function so it could be shared between multiple methods. (WebKit::NetworkResourceLoader::logCookieInformation const): Refactor into two methods. (WebKit::NetworkResourceLoader::logCookieInformation): Ditto. (WebKit::NetworkResourceLoader::shouldLogCookieInformation const): Deleted. * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Switch to user-enabled release logging to track partitioning and blocking behavior. 2018-02-05 John Wilander Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit https://bugs.webkit.org/show_bug.cgi?id=181601 Reviewed by Alex Christensen. http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html was found to be flaky. With the testRunner.hasStorageAccessEntry() getter it's possible to check access even if a frame doesn't respond timely to postMessage after detach and attach. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::getAllStorageAccessEntries): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _getAllStorageAccessEntries:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getAllStorageAccessEntries): (WebKit::NetworkProcessProxy::allStorageAccessEntriesResult): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::getAllStorageAccessEntries): * UIProcess/WebsiteData/WebsiteDataStore.h: 2018-02-05 Daniel Bates Disallow evaluating JavaScript from NPP_Destroy() in WebKit https://bugs.webkit.org/show_bug.cgi?id=181889 Reviewed by Brent Fulgham. Make the behavior of WebKit match the behavior of WebKitLegacy on Mac. * Shared/Plugins/NPObjectMessageReceiver.cpp: (WebKit::NPObjectMessageReceiver::hasMethod): (WebKit::NPObjectMessageReceiver::invoke): (WebKit::NPObjectMessageReceiver::invokeDefault): (WebKit::NPObjectMessageReceiver::hasProperty): (WebKit::NPObjectMessageReceiver::getProperty): (WebKit::NPObjectMessageReceiver::setProperty): (WebKit::NPObjectMessageReceiver::removeProperty): (WebKit::NPObjectMessageReceiver::enumerate): (WebKit::NPObjectMessageReceiver::construct): Bail out if the plugin is executing NPP_Destroy(). * WebProcess/Plugins/Plugin.cpp: (WebKit::Plugin::destroyPlugin): * WebProcess/Plugins/Plugin.h: (WebKit::Plugin::isBeingDestroyed const): Move bookkeeping of whether the plugin is being destroyed from PluginView to here. This makes it straightforward for NPObjectMessageReceiver to query this information. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::~PluginView): (WebKit::PluginView::destroyPluginAndReset): (WebKit::PluginView::recreateAndInitialize): (WebKit::PluginView::protectPluginFromDestruction): (WebKit::PluginView::unprotectPluginFromDestruction): Move bookkeeping of whether the plugin is being destroyed from here to Plugin. * WebProcess/Plugins/PluginView.h: (WebKit::PluginView::isBeingDestroyed const): Turn around and ask the plugin if it is being destroyed, if we have one. 2018-02-05 Carlos Garcia Campos WebDriver: addCookie command should prepend a dot to domain if missing https://bugs.webkit.org/show_bug.cgi?id=182328 Reviewed by Michael Catanzaro. RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot. Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::addSingleCookie): 2018-02-03 Tim Horton UI process sometimes crashes under -[WKContentView _lookupForWebView:] https://bugs.webkit.org/show_bug.cgi?id=182460 Reviewed by Wenson Hsieh. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _lookupForWebView:]): If you have a range selection, but no rects for the selection, retrieving the 0th element of selectionRects will crash the UI process. To fix, in this case, use the rect for the starting caret instead. It doesn't seem like the presentationRect is actually currently used for the Lookup service, so the only impact is that we shouldn't crash anymore. 2018-02-02 Michael Catanzaro Remove remaining dead !USE(NETWORK_SESSION) code https://bugs.webkit.org/show_bug.cgi?id=182451 Reviewed by Alex Christensen. DownloadCurl.cpp and AuthenticationManagerSoup.cpp have been dead code since NETWORK_SESSION became mandatory. * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Removed. * PlatformGTK.cmake: * PlatformWPE.cmake: * PlatformWin.cmake: * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Removed. 2018-02-02 Youenn Fablet CacheStorage should check for origin file presence when computing the origin of a folder https://bugs.webkit.org/show_bug.cgi?id=182454 Reviewed by Chris Dumez. In case caches is opened for an origin but no cache is added, we do not have a caches name file but we do have an origin filename. We should be checking the origin filename anyway since we will be reading it afterwards. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory): 2018-02-02 Youenn Fablet Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default https://bugs.webkit.org/show_bug.cgi?id=182403 Reviewed by Alex Christensen. * UIProcess/WebProcessPool.cpp: (WebKit::legacyWebsiteDataStoreConfiguration): Setting serviceWorkerRegistrationDirectory for legacy stores. 2018-02-02 Youenn Fablet Clearing all service worker registrations should wait for importing service worker registration to finish https://bugs.webkit.org/show_bug.cgi?id=182407 Reviewed by Chris Dumez. Updating API to take a completion handler. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2018-02-02 Fujii Hironori [Win] MSVC doesn't seem to like "friend class NeverDestroyed" https://bugs.webkit.org/show_bug.cgi?id=182081 Reviewed by Yusuke Suzuki. The template friend class, which belongs to a different namespace, can't access private member if its friend declaration is specified without the namespace and with class keyword. Replaced "friend class NeverDestroyed" with "friend NeverDestroyed". * NetworkProcess/NetworkProcess.h: * NetworkProcess/capture/NetworkCaptureManager.h: * PluginProcess/PluginProcess.h: * Shared/CallbackID.h: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: * StorageProcess/StorageProcess.h: * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/Plugins/gtk/PluginInfoCache.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPasteboardProxy.h: * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: * UIProcess/gtk/HardwareAccelerationManager.h: * UIProcess/gtk/WaylandCompositor.h: * UIProcess/linux/MemoryPressureMonitor.h: * UIProcess/mac/ServicesController.h: * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h: * WebProcess/Plugins/WebPluginInfoProvider.h: * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2018-02-02 Youenn Fablet Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default https://bugs.webkit.org/show_bug.cgi?id=182403 Reviewed by Alex Christensen. WebsiteDataStore is the place to set configuration information such as service worker registration path. This patch updates WebKit code accordingly. By default, the service worker registration path is in a Caches subfolder, similarly to cache API path. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithLegacyOptions): (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): (API::ProcessPoolConfiguration::ProcessPoolConfiguration): (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyServiceWorkerDatabaseDirectory): Deleted. (WKContextConfigurationSetServiceWorkerDatabaseDirectory): Deleted. * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]): (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const): (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory): * UIProcess/gtk/WebProcessPoolGtk.cpp: * UIProcess/gtk/WebProcessPoolWPE.cpp: 2018-02-02 Wenson Hsieh [Extra Zoom Mode] Implement support for indirect mainframe scrolling https://bugs.webkit.org/show_bug.cgi?id=182421 Reviewed by Tim Horton. Makes a few small adjustments to WKScrollView to improve mainframe scrolling, and disable the pinch gesture for zooming. See below for more details. * UIProcess/API/Cocoa/WKWebView.mm: Remove a now-unneeded WebKitAdditions import. * UIProcess/ios/WKScrollView.mm: (-[WKScrollView initWithFrame:]): Add imports for -Before and -After versions of WKScrollViewAdditions. (-[WKScrollView addGestureRecognizer:]): Override -addGestureRecognizer here to prevent touches on the pinch gesture recognizer from being recognized. I chose this approach instead of just disabling the gesture in -initWithFrame: because (1) the pinch gesture recognizer is lazily created when setting minimum or maximum zoom scales, rather than immediately in -initWithFrame:, and (2) even if we set the -enabled to NO, UIKit later resets it to YES in other codepaths. 2018-02-01 Tim Horton WebKit fails to build (_startAssistingNode has conflicting parameters) https://bugs.webkit.org/show_bug.cgi?id=182417 Reviewed by Dan Bernstein. * UIProcess/ios/WKContentViewInteraction.h: Use Big BOOL like in the implementation. 2018-02-01 Brent Fulgham Improve NetworkResourceLogger to report blocked (versus non-partitioned) cookies https://bugs.webkit.org/show_bug.cgi?id=182408 Reviewed by Chris Dumez. Update the logging method to report blocked origins, rather than logging them as non-partitioned loads that have no cookies or other content. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::logCookieInformation const): 2018-02-01 David Kilzer REGRESSION (r222824): UI process crashes in WebKit::WebBackForwardList::backItem const Reviewed by Alex Christensen. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::goToItem): Fix typo so the for loop actually checks each value in m_entries. 2018-02-01 Youenn Fablet Delay service worker process creation until actually needed by SWServer https://bugs.webkit.org/show_bug.cgi?id=182301 Reviewed by Chris Dumez. Do not create a service worker process at creation of the first SWServerConnection. Wait for a WebProcess message that needs it: - postMessage message - fetchEvent message - job scheduling. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorker): (WebKit::WebSWServerConnection::scheduleJobInServer): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::establishSWServerConnection): 2018-02-01 Wenson Hsieh [Extra zoom mode] Implement basic support for interacting with text form controls https://bugs.webkit.org/show_bug.cgi?id=182401 Reviewed by Tim Horton. Add UI support for interacting with and editing text form controls when extra zoom mode is enabled. See below for more details. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _textInteractionGesturesEnabled]): (-[WKWebViewConfiguration _setTextInteractionGesturesEnabled:]): (-[WKWebViewConfiguration _longPressActionsEnabled]): (-[WKWebViewConfiguration _setLongPressActionsEnabled:]): Introduce two new web view configuration flags: `textInteractionGesturesEnabled` and `longPressActionsEnabled`. The former determines whether text interaction gestures (i.e. text selection, moving the caret, showing UI for IME, etc.) are enabled. The latter determines whether or not long press actions (i.e. touch callout, share sheet, etc.) are enabled. These are disabled by default only in extra zoom mode. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setTextAsync): Add a way to set the text value of a currently edited text form control. This will either set the text value of an input, a. la. autofill, or overwrite the contents of a contenteditable area by selecting everything and inserting the given text. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::focusNextAssistedNode): Add a default argument for the completion callback. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView _displayFormNodeInputView]): (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView pointIsNearMarkedText:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView insertionPointColor]): Respect the web view configuration flags above by bailing early from text interaction and long press action sheet methods. (-[WKContentView _startAssistingKeyboard]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Add a flag indicating whether we are in the process of changing focus from one node to another. We use this to decide whether or not we want to present the text input view controller right away, or just reload the focused form control overlay. When we stop "assisting" a node, we also keep the focused form control overlay up if we're only changing focus to another form control. (-[WKContentView _stopAssistingNode]): (-[WKContentView presentFocusedFormControlViewController:]): (-[WKContentView dismissFocusedFormControlViewController:]): (-[WKContentView shouldPresentTextInputViewController:]): (-[WKContentView presentTextInputViewController:]): (-[WKContentView dismissTextInputViewController:]): Introduce helpers for managing presentation of the focused form control overlay and text input view controller. All -present and -dismiss helpers here are idempotent. These view controllers are presented from the content view's view controller for fullscreen presentation. (-[WKContentView textInputController:didCommitText:]): (-[WKContentView textInputController:didRequestDismissalWithAction:]): (-[WKContentView focusedFormControlControllerDidSubmit:]): (-[WKContentView focusedFormControlControllerDidCancel:]): (-[WKContentView focusedFormControlControllerDidBeginEditing:]): (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): (-[WKContentView actionNameForFocusedFormControlController:]): (-[WKContentView focusedFormControlControllerDidRequestNextNode:]): (-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]): (-[WKContentView hasNextNodeForFocusedFormControlController:]): (-[WKContentView hasPreviousNodeForFocusedFormControlController:]): Implement delegate methods for the focused form control and text input view controllers. This mainly involves straightforward plumbing of pieces of AssistedNodeInformation on the content view. (-[WKContentView pointIsInAssistedNode:]): Deleted. Remove a method that was still implemented only for binary compatibility with iOS 10. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setTextAsync): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2018-02-01 Carlos Garcia Campos [GTK] Shift + mouse scroll should scroll horizontally https://bugs.webkit.org/show_bug.cgi?id=181629 Reviewed by Michael Catanzaro. Swap scroll direction when Shift is pressed for consistency with GtkScrolledWindow. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseScrollEvent): 2018-02-01 Carlos Garcia Campos REGRESSION(r227893): fast/events/touch/touch-stale-node-crash.html and other tests crash https://bugs.webkit.org/show_bug.cgi?id=182350 Reviewed by Carlos Alberto Lopez Perez. Ensure events synthesized from touch gestures have a valid window, screen and device. * UIProcess/API/gtk/WebKitWebViewBase.cpp: * UIProcess/gtk/GestureController.h: Add virtual destructor to GestureControllerclient. 2018-01-31 Simon Fraser Use different debug red colors for different contexts https://bugs.webkit.org/show_bug.cgi?id=182362 Reviewed by Tim Horton. Pure red is used elsehwere in the system as a debug color indicator, so use different shades of red for WebKit in the two places where we paint a reddish wash in debug builds, so they are identifiable. * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): 2018-01-31 Don Olmstead [CMake] Make JavaScriptCore headers copies https://bugs.webkit.org/show_bug.cgi?id=182303 Reviewed by Alex Christensen. * CMakeLists.txt: * Scripts/generate-forwarding-headers.pl: 2018-01-31 Alex Christensen Unreviewed, rolling out r227942. r227875 should not have been rolled out. Reverted changeset: "Unreviewed, rolling out r227875." https://bugs.webkit.org/show_bug.cgi?id=182357 https://trac.webkit.org/changeset/227942 2018-01-31 Michael Catanzaro Unreviewed, rolling out r227875. https://bugs.webkit.org/show_bug.cgi?id=182357 Missing cross-platform TestController implementation Reverted changeset: "Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()" https://bugs.webkit.org/show_bug.cgi?id=181958 https://trac.webkit.org/changeset/227875 * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning): (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted. (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains): (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains): (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder): (WebKit::WebResourceLoadStatisticsStore::clearInMemory): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains): * UIProcess/WebResourceLoadStatisticsStore.h: 2018-01-31 Brent Fulgham Follow-up to r227939. https://bugs.webkit.org/show_bug.cgi?id=182354 Make sure the correct sandbox is used on iOS as well. * StorageProcess/ios/StorageProcessIOS.mm: (WebKit::StorageProcess::initializeSandbox): 2018-01-31 Brent Fulgham REGRESSION(r220094): com.apple.WebKit.Storage lost its sandbox https://bugs.webkit.org/show_bug.cgi?id=182354 Reviewed by Ryosuke Niwa. The Database process was renamed to Storage, but it's sandbox was not updated. * Configurations/WebKit.xcconfig: Update for sandbox rename. * DerivedSources.make: Ditto. * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Removed. * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Copied from Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb. * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Removed. * StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Copied from StorageProcess/mac/com.apple.WebKit.Databases.sb.in. * WebKit.xcodeproj/project.pbxproj: Update for sandbox rename. 2018-01-31 Michael Catanzaro REGRESSION(r227223): http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html, http/tests/resourceLoadStatistics/grandfathering.html timing out on GTK, WPE https://bugs.webkit.org/show_bug.cgi?id=182222 Reviewed by Alex Christensen. Add callbacks to notify when resource load statistics deletion is complete. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore): (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2018-01-31 Tim Horton Occasional null deref under WebPageProxy::updateBackingStoreDiscardableState() https://bugs.webkit.org/show_bug.cgi?id=182349 Reviewed by Simon Fraser. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateBackingStoreDiscardableState): m_drawingArea can be null during process launch and relaunch. Cocoa ports don't use the result of setBackingStoreIsDiscardable(), but they do run this code to keep it up to date. 2018-01-31 Michael Catanzaro [GTK] Move gir and typelib generation into ENABLE_INTROSPECTION conditional https://bugs.webkit.org/show_bug.cgi?id=182308 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: 2018-01-31 Youenn Fablet Remove StorageToWebProcessConnection::removeSWServerConnection https://bugs.webkit.org/show_bug.cgi?id=182305 Reviewed by Chris Dumez. * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::removeSWServerConnection): Deleted. * StorageProcess/StorageToWebProcessConnection.h: * StorageProcess/StorageToWebProcessConnection.messages.in: 2018-01-31 Carlos Garcia Campos REGRESSION(r227544): [GTK] contextMenuEvent is NULL on CONTEXT_MENU call https://bugs.webkit.org/show_bug.cgi?id=182224 Reviewed by Michael Catanzaro. Move the gestures handling to WebKitWebViewBase. This patch adds GestureControllerClient class, created and implemented by WebKitWebViewBase and used by GestureController instead of the WebPageProxy. This way we ensure events are handled consistently. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::doneWithTouchEvent): Cast the GdkEvent since GestureController no longer works wirth const GdkEvents. (WebKit::PageClientImpl::zoom): Use webkit_web_view_set_zoom_level() in case of WebKitWebView or WebPageProxy::setPageZoomFactor() otherwise. * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (ClickCounter::currentClickCountForGdkButtonEvent): Receive a GdkEvent to avoid casts. (webkitWebViewBaseHandleMouseEvent): Helper function to handle mouse events. (webkitWebViewBaseButtonPressEvent): Use webkitWebViewBaseHandleMouseEvent. (webkitWebViewBaseButtonReleaseEvent): Ditto. (webkitWebViewBaseHandleWheelEvent): Helper function to handle wheel events. (webkitWebViewBaseScrollEvent): Use webkitWebViewBaseHandleWheelEvent. (webkitWebViewBaseMotionNotifyEvent): Use webkitWebViewBaseHandleMouseEvent. (webkitWebViewBaseCrossingNotifyEvent): Ditto. (webkitWebViewBaseGestureController): Pass the widget and client to GestureController. * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::GestureController): Receives a widget and client now. (WebKit::GestureController::handleEvent): Remove the const. (WebKit::GestureController::Gesture::Gesture): Initialize client. (WebKit::GestureController::Gesture::handleEvent): Remove the const. (WebKit::GestureController::DragGesture::startDrag): Use the client instead of WebPageProxy. (WebKit::GestureController::DragGesture::handleDrag): Ditto. (WebKit::GestureController::DragGesture::handleTap): Ditto. (WebKit::GestureController::DragGesture::begin): Ignore the const returned by gtk_gesture_get_last_event(). (WebKit::GestureController::DragGesture::update): Ditto. (WebKit::GestureController::DragGesture::end): Ditto. (WebKit::GestureController::DragGesture::DragGesture): Receives a widget and client now. (WebKit::GestureController::SwipeGesture::startMomentumScroll): Use the client instead of WebPageProxy. (WebKit::GestureController::SwipeGesture::swipe): Ignore the const returned by gtk_gesture_get_last_event(). (WebKit::GestureController::SwipeGesture::SwipeGesture): Receives a widget and client now. (WebKit::GestureController::ZoomGesture::begin): Start the zoom. (WebKit::GestureController::ZoomGesture::startZoom): Use the client instead of WebPageProxy. (WebKit::GestureController::ZoomGesture::handleZoom): Ditto. (WebKit::GestureController::ZoomGesture::ZoomGesture): Receives a widget and client now. (WebKit::GestureController::LongPressGesture::longPressed): Use the client instead of WebKitWebView. (WebKit::GestureController::LongPressGesture::pressed): Ignore the const returned by gtk_gesture_get_last_event(). (WebKit::GestureController::LongPressGesture::LongPressGesture): Receives a widget and client now. (WebKit::GestureController::Gesture::simulateMouseClick): Deleted. (WebKit::createScrollEvent): Deleted. * UIProcess/gtk/GestureController.h: 2018-01-31 Carlos Garcia Campos Web Automation: cookies returned by automation should have expiry time in seconds https://bugs.webkit.org/show_bug.cgi?id=182293 Reviewed by Brian Burg. When creating a WebCore::Cookie from a WebDriver object we convert the given expiry time to milliseconds, but when creating a WebDriver object from a WebCore::Cookie we are keeping the milliseconds. We should convert to seconds for consistency, so that the WebDriver always handles seconds. Fixes: imported/w3c/webdriver/tests/cookies/get_named_cookie.py::test_get_named_cookie * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::buildObjectForCookie): Convert expiry to seconds. 2018-01-31 Ryosuke Niwa Unreviewed iOS build fix. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: 2018-01-30 John Wilander Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning() https://bugs.webkit.org/show_bug.cgi?id=181958 https://bugs.webkit.org/show_bug.cgi?id=182072 Reviewed by Brent Fulgham. Because of the asynchronous nature of XPC and cookies, we need callbacks in these TestRunner functions so that the layout tests can wait for state changes to finish before checking test conditions. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning): (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains): (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains): (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder): (WebKit::WebResourceLoadStatisticsStore::clearInMemory): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains): * UIProcess/WebResourceLoadStatisticsStore.h: 2018-01-30 Ryosuke Niwa REGRESSION(r227550): Resource timing API is disabled on macOS https://bugs.webkit.org/show_bug.cgi?id=182318 Reviewed by Chris Dumez. Resource timing API should be enabled by default all versions of macOS we support now. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: 2018-01-30 Tim Horton WKWebView layout is sometimes wrong after rotation on iPhone X https://bugs.webkit.org/show_bug.cgi?id=182304 Reviewed by Simon Fraser. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _computedContentInset]): (-[WKWebView _scrollViewSystemContentInset]): (activeMinimumLayoutSize): It turns out that it is not always safe to look at the safe area insets of children from inside layoutSubviews, even after the call to super. Instead, make use of the fact that WKScrollView and WKWebView have identical coordinate spaces, and map WKWebView's safe area insets into the WKScrollView. It's safe to use the scroll view's affected-edges and contentScrollInset, because those aren't updated at the same outside-of-layout time that safe area insets are. We could alternatively move all calls to activeMinimumLayoutSize outside of layoutSubviews, but that seems like a larger and riskier change. All attempts to write a test have failed; this depends heavily on use of autolayout and the mechanism by which the system updates system-owned safe area insets during device rotation. 2018-01-30 Don Olmstead JSExports.h should be included as https://bugs.webkit.org/show_bug.cgi?id=182312 Reviewed by Michael Catanzaro. * config.h: 2018-01-30 Brent Fulgham Add telemetry to track storage access API adoption https://bugs.webkit.org/show_bug.cgi?id=182197 Reviewed by Chris Dumez. Part 2: Add telemetry for the Storage Access API case This change increments a counter when an origin is loaded in a first part context because it was granted Storage Access API permissions. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::logCookieInformation const): Add logging to indicate loads that happened with the Storage Access API enabled. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Increment counter for loads using the new API. 2018-01-30 Megan Gardner Make preserve and restore focus more likely to be symmetrical https://bugs.webkit.org/show_bug.cgi?id=182264 Reviewed by Tim Horton. Keep a stack of if we actually increment the focusState, so that changes to the web content do not result in asymmetric decrements to the focus state. To work around problems associated with . * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _restoreFocusWithToken:]): (-[WKContentView _preserveFocusWithToken:destructively:]): 2018-01-30 Brent Fulgham Add telemetry to track storage access API adoption https://bugs.webkit.org/show_bug.cgi?id=182197 Reviewed by Chris Dumez. This patch also handled aggregating the counts in the UIProcess, which has access to the right data. The original patch assumed the WebContent process kept track of user interaction. This is only tracked in the UIProcess, so we can get rid of some of the logging code adding in r227755. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): Rollout of r227755 changes not needed to track the statistics. (WebKit::WebProcessCreationParameters::decode): Ditto. * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::wasAccessedAsFirstPartyDueToUserInteraction): Moved from the WebContent process, which does not keep track of user interaction. (WebKit::WebResourceLoadStatisticsStore::mergeStatistics): Aggregate counts while processing the statistics. * UIProcess/WebResourceLoadStatisticsStore.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2018-01-30 Chris Dumez Make sure we never create a WebSWClientConnection with an invalid sessionID https://bugs.webkit.org/show_bug.cgi?id=182276 Reviewed by Alex Christensen. Make sure we never create a WebSWClientConnection with an invalid sessionID as this could corrupt our hash tables. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::swServerForSession): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::WebSWClientConnection): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): 2018-01-30 Basuke Suzuki [WinCairo] Fix forwarding header conflict of WebKit on WinCairo https://bugs.webkit.org/show_bug.cgi?id=177202 Reviewed by Alex Christensen. * PlatformWin.cmake: 2018-01-29 Carlos Garcia Campos WebDriver: evaluateJavaScriptFunction should return null when return value is undefined https://bugs.webkit.org/show_bug.cgi?id=180350 Reviewed by Carlos Alberto Lopez Perez. undefined can't be converted to JSON string, in which case JSON.stringify() returns undefined and we handle that case to return an empty string. We currently handle this case for execute script commands, but not in all other cases where we use evaluateJavaScriptFunction. It would be simpler if evaluateJavaScriptFunction returned null, because in that case we wouldn't need to handle it as a special case. 15.2 Executing Script https://w3c.github.io/webdriver/webdriver-spec.html#dfn-json-clone Fixes: imported/w3c/webdriver/tests/state/get_element_property.py::test_element_non_existent * WebProcess/Automation/WebAutomationSessionProxy.js: (let.AutomationSessionProxy.prototype._jsonStringify): Return "null" instead of "" when undefined is given. 2018-01-29 Ryosuke Niwa Release assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsecureContent https://bugs.webkit.org/show_bug.cgi?id=182273 Reviewed by Chris Dumez. The assertion was caused by unrelated sync IPCs being processed while WebContent process is waiting for the reply to WebPageProxy::HasInsecureContent. Since this IPC can be used while creating CachedFrame, it's not safe to execute arbitrary code. Fixed the bug by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply added in r227566. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame): 2018-01-29 Wenson Hsieh Add a build step to copy resources from WebKitAdditions as bundle resources in WebKit https://bugs.webkit.org/show_bug.cgi?id=182268 Reviewed by Tim Horton and Dan Bernstein. Adds a "Copy Additional Resources" phase when building WebKit. This phase copies resources from usr/local/include/WebKitAdditions/WebKit/AdditionalResources in the build directory into the unlocalized resources directory. If the AdditionalResources directory does not exist in the build directory, we fall back to searching the SDK. * WebKit.xcodeproj/project.pbxproj: 2018-01-29 Youenn Fablet ServiceWorkerClientFetch should not consider responses without Location headers as redirection responses https://bugs.webkit.org/show_bug.cgi?id=182134 Reviewed by Chris Dumez. As per fetch spec, a response with a redirection status code but no Location header should not be considered as a redirection. This is also consistent with SubresourceLoader::didReceiveResponse. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): 2018-01-29 Youenn Fablet Cache API should make sure to resolve caches.open promises in the same order as called https://bugs.webkit.org/show_bug.cgi?id=182193 Reviewed by Chris Dumez. Covered by added test. Whenever opening/removing a cache requires writing to disk, wait to finish the task until any disk writing task is done. Applying this strategy when clearing data so that we also clear data that is pending to be written. For removing cache, we now return whether a cache was actually deleted by returning zero as removed cache identifier. WebCore uses that information to return true/false as promise resolution value. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::retrieveCaches): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::clear): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::Caches::writeCachesToDisk): (WebKit::CacheStorage::Caches::cacheInfos): (WebKit::CacheStorage::Caches::cacheInfos const): Deleted. * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::createWeakPtr): 2018-01-29 Alex Christensen Clean up API after bugs 178240 and 176474 https://bugs.webkit.org/show_bug.cgi?id=182259 Reviewed by Dan Bernstein. NS_OPTIONS should be NSUInteger, not NSInteger. This is how all other NS_OPTIONS in WebKit are, and it's necessary if we get really big numbers as options. Changing them won't cause binary incompatibility unless someone does signed integer comparison with currently invalid values. Added availability macros I forgot to add earlier. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2018-01-29 Jiewen Tan [WebAuthN] Add a compile-time feature flag https://bugs.webkit.org/show_bug.cgi?id=182211 Reviewed by Brent Fulgham. * Configurations/FeatureDefines.xcconfig: 2018-01-29 John Wilander Resource Load Statistics: Introduce debug mode as experimental feature https://bugs.webkit.org/show_bug.cgi?id=182199 Reviewed by Alex Christensen. The only changes to default behavior are: - Increased resolution on timestamps which is needed to be able to set shorter timeouts in debug mode. - Only update partitioning and blocking table when needed. This is an optimization which pays off in less XPC with shorter timeouts. * Shared/WebPreferences.yaml: * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::resourceLoadStatisticsDebugMode const): (API::WebsiteDataStore::setResourceLoadStatisticsDebugMode): * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsDebugMode): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]): (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resourceLoadStatisticsDebugMode const): (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode): * UIProcess/WebsiteData/WebsiteDataStore.h: 2018-01-29 Andy Estes [iOS] Restrict synthetic clicks to the origin that handled the underlying touch event https://bugs.webkit.org/show_bug.cgi?id=182252 Reviewed by Tim Horton. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::dispatchTouchEvent): (WebKit::WebPage::updatePotentialTapSecurityOrigin): Record the target frame origin of touch events that are potential taps, are TouchStart events, are targeted in frames that have touch event listeners, and are not handled by those listeners. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::potentialTapAtPosition): (WebKit::WebPage::commitPotentialTap): (WebKit::WebPage::cancelPotentialTapInFrame): Passed the target frame origin to Frame::nodeRespondingToClickEvents() then cleared it. 2018-01-29 Alex Christensen Make policy checks more robust against null pointer dereferencing https://bugs.webkit.org/show_bug.cgi?id=182263 Reviewed by Tim Horton. We're still dereferencing null. Check everything. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): 2018-01-29 Brent Fulgham Add telemetry to track storage access API adoption https://bugs.webkit.org/show_bug.cgi?id=182197 Reviewed by Chris Dumez. Part 1: Add telemetry for the user interaction case This patch adds telemetry to track how frequently third-party cookies are used in a first party context due to user interaction. This will help understand cases where the new Storage Access API can help, and to help us understand if we have considered relevant use cases in its design. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::sortedPrevalentResourceTelemetry): Update for new telemetry. (WebKit::submitTopList): Update for new data types. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Handle the partitioning time passed from the UIProcess. 2018-01-29 Alex Christensen Fix crash when during canAuthenticateAgainstProtectionSpace https://bugs.webkit.org/show_bug.cgi?id=182260 Reviewed by Chris Dumez. If we have a valid network load with no challenge completion handler and we are telling it to continue with the challenge handling, something has gone wrong. Maybe we've just recovered from a crashed network process. If this happens, do nothing. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): 2018-01-29 Zach Li Warning in 32-bit WebKit build when trying to link to SafariSafeBrowsing https://bugs.webkit.org/show_bug.cgi?id=182251 rdar://problem/36964995 Reviewed by Alex Christensen. * Configurations/WebKit.xcconfig: Only link against SafariSafeBrowsing framework in 64-bit architecture. * Platform/spi/Cocoa/SafeBrowsingSPI.h: Guard the Safe Browsing code with WK_API_ENABLED. 2018-01-29 Chris Dumez Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC https://bugs.webkit.org/show_bug.cgi?id=182256 Reviewed by Simon Fraser. Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC as this can lead to crashes such as the one in . * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::WebSWClientConnection): 2018-01-29 Jan-Michael Brummer [GTK] Zooming gesture incorrectly uses scale instead of zoom https://bugs.webkit.org/show_bug.cgi?id=182174 Reviewed by Michael Catanzaro. Switch zooming gesture to use zoom instead of scale function. * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::ZoomGesture::begin): (WebKit::GestureController::ZoomGesture::handleZoom): 2018-01-29 Brady Eidson Make it possible for apps that use both WK1 and WK2 to use MessagePorts. https://bugs.webkit.org/show_bug.cgi?id=182229 Reviewed by Chris Dumez. * UIProcess/UIMessagePortChannelProvider.cpp: (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider): * UIProcess/WebPageProxy.cpp: (WebKit::m_configurationPreferenceValues): The UI process does not need to override the global singleton provider. It can remain the default ProviderImpl to allow WK1 views to work fine, too. 2018-01-29 Carlos Garcia Campos WebDriver: ASSERTION FAILED: !m_loadTimer.isActive() https://bugs.webkit.org/show_bug.cgi?id=182237 Reviewed by Carlos Alberto Lopez Perez. We should stop the load timer when we dispatch the pending navigation callbacks due to an alert open. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::willShowJavaScriptDialog): 2018-01-29 Zan Dobersek [Cairo] Add GraphicsContextImplCairo::createFactory() helpers https://bugs.webkit.org/show_bug.cgi?id=182238 Reviewed by Carlos Garcia Campos. Use GraphicsContextImplCairo::createFactory() helpers throughout the Cairo-specific GraphicsContext constructors in the WebKit layer. * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::createGraphicsContext): * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::BackingStore::incorporateUpdate): * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: (WebKit::WebPrintOperationGtk::renderPage): 2018-01-29 Zan Dobersek [Cairo] Remove the GraphicsContext(cairo_t*) constructor https://bugs.webkit.org/show_bug.cgi?id=182234 Reviewed by Carlos Garcia Campos. Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to instead provide a factory function that returns a fresh GraphicsContextImplCairo object, passing that cairo_t object to its constructor. * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::createGraphicsContext): * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::BackingStore::incorporateUpdate): * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: (WebKit::WebPrintOperationGtk::renderPage): 2018-01-26 Megan Gardner Don't retain focus for input peripheral views https://bugs.webkit.org/show_bug.cgi?id=182204 Reviewed by Tim Horton. Retaining focus on input peripheral views makes it so they cannot dismiss themselves with the current architecture. This should probably be fixed in UIKit, as there is no reason for focus to be retained on these views anyways, as they don't have keyboard input, but this guards against over-aggressive retain requests. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _restoreFocusWithToken:]): (-[WKContentView _preserveFocusWithToken:destructively:]): 2018-01-26 Chris Dumez Make sure service worker code does not launch a StorageProcess unnecessarily https://bugs.webkit.org/show_bug.cgi?id=182192 Reviewed by Geoffrey Garen. When calling WebProcess::existingWebToStorageProcessConnection(), make sure we do not force the creation of a WebProcess connection to the StorageProcess. If there is no WebProcess, just return false right away. * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession): * WebProcess/WebProcess.h: 2018-01-26 Alex Christensen Allow cellular access for default-created ephemeral sessions https://bugs.webkit.org/show_bug.cgi?id=182179 Reviewed by Andy Estes. This makes it so when we recover from a NetworkProcess crash (see r227590) on iOS, we will be able to continue browsing using cell data. * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::privateSessionParameters): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPrivateBrowsingEnabled): 2018-01-26 Alex Christensen Clean up more networking code https://bugs.webkit.org/show_bug.cgi?id=182161 Reviewed by Anders Carlsson. Two cleanups: 1. The WebProcess doesn't need to initialize NetworkSessions. 2. WebFrameNetworkingContext doesn't need to have the NetworkingContext functions to support ResourceHandles in WebKit any more. * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkLoad.h: * NetworkProcess/RemoteNetworkingContext.h: (): Deleted. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp: (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted. (WebKit::RemoteNetworkingContext::isValid const): Deleted. (WebKit::RemoteNetworkingContext::storageSession const): Deleted. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted. (WebKit::RemoteNetworkingContext::isValid const): Deleted. (WebKit::RemoteNetworkingContext::localFileContentSniffingEnabled const): Deleted. (WebKit::RemoteNetworkingContext::storageSession const): Deleted. (WebKit::RemoteNetworkingContext::sourceApplicationAuditData const): Deleted. (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier const): Deleted. (WebKit::RemoteNetworkingContext::blockedError const): Deleted. * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted. (WebKit::RemoteNetworkingContext::isValid const): Deleted. (WebKit::RemoteNetworkingContext::storageSession const): Deleted. * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::clearCachedCredentials): 2018-01-26 Jan-Michael Brummer [GTK] Support using long-tap gesture to open context menu https://bugs.webkit.org/show_bug.cgi?id=140747 Reviewed by Carlos Garcia Campos. Add long press gesture which simulates a secondary mouse press to open context menu. * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::GestureController): (WebKit::GestureController::handleEvent): (WebKit::GestureController::isProcessingGestures const): (WebKit::GestureController::Gesture::simulateMousePress): (WebKit::GestureController::DragGesture::handleTap): (WebKit::GestureController::LongPressGesture::longPressed): (WebKit::GestureController::LongPressGesture::pressed): (WebKit::GestureController::LongPressGesture::LongPressGesture): * UIProcess/gtk/GestureController.h: (WebKit::GestureController::reset): 2018-01-26 Carlos Garcia Campos Unreviewed. REGRESSION(r227647): window.open() is broken in GTK and WPE after r227647. In r227647, API::UIClient::createNewPage() was changed to use CompletionHandler instead of Function. All implementations were updated expect the GLib one, and we didn't notice it because the method doesn't have the final/override mark. * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::createNewPage): 2018-01-25 Sergio Villar Senin [WebVR] Make WebVR available by default for developer builds https://bugs.webkit.org/show_bug.cgi?id=182101 Reviewed by Michael Catanzaro. Moved WebVR setting to the experimental features section and make it available by default for developer builds for GTK and WPE. * Shared/WebPreferences.yaml: 2018-01-25 Alex Christensen REGRESSION (r221899): Web Content process hangs when webpage tries to make a new window if the WKWebView doesn’t have a UI delegate https://bugs.webkit.org/show_bug.cgi?id=182152 Reviewed by Joseph Pecoraro. Call the completion handler of the default API::UIClient::createNewPage. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): 2018-01-25 Wenson Hsieh [iOS] [WK2] Introduce new views and view controllers to support extra-zoomed text form controls https://bugs.webkit.org/show_bug.cgi?id=182000 Reviewed by Tim Horton. Add new files to support text form control editing while extra-zoomed. * UIProcess/ios/forms/WKFocusedFormControlView.h: Added. * UIProcess/ios/forms/WKFocusedFormControlView.mm: Added. * UIProcess/ios/forms/WKFocusedFormControlViewController.h: Added. * UIProcess/ios/forms/WKFocusedFormControlViewController.mm: Added. * UIProcess/ios/forms/WKTextFormControlViewController.h: Added. * UIProcess/ios/forms/WKTextFormControlViewController.mm: Added. * UIProcess/ios/forms/WKTextInputViewController.h: Added. * UIProcess/ios/forms/WKTextInputViewController.mm: Added. * UIProcess/ios/forms/WKTextSuggestionButton.h: Added. * UIProcess/ios/forms/WKTextSuggestionButton.mm: Added. * WebKit.xcodeproj/project.pbxproj: 2018-01-25 Chris Dumez Clients.get(id) should only returns clients in the service worker's origin https://bugs.webkit.org/show_bug.cgi?id=182149 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorker): 2018-01-25 Youenn Fablet WebPluginInfoProvider should handle null host queries https://bugs.webkit.org/show_bug.cgi?id=182112 Reviewed by Chris Dumez. Return early if host is null. * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::populatePluginCache): 2018-01-25 Simon Fraser ASSERT(CGSizeEqualToSize(m_resizeScrollOffset, CGSizeZero)) in WebViewImpl::setFrameAndScrollBy() https://bugs.webkit.org/show_bug.cgi?id=182082 rdar://problem/13971838 Reviewed by Tim Horton. Safari could call WebViewImpl::setFrameAndScrollBy() multiple times with different scroll offsets, triggering this assertion. Rename to m_resizeScrollOffset to m_scrollOffsetAdjustment to reduce confusion with actual scroll offsets. This parameter has no effect on macOS, but is used by the -[WKWebView setFrame:andScrollBy:] so at some point needs to be hooked up to allow synchronous view resize and scroll adjustment (e.g. for the Find bar animation). Remove DrawingAreaProxy's m_layerPosition which was unused, and remove the parameters from the UpdateGeometry message. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setFrameAndScrollBy): (WebKit::WebViewImpl::setDrawingAreaSize): * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::setSize): * UIProcess/DrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry): * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::updateGeometry): * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::updateGeometry): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updateGeometry): 2018-01-25 Keith Rollin Add logging to facilitate binding of WebContent and Network processes to UI process https://bugs.webkit.org/show_bug.cgi?id=182066 Reviewed by Brent Fulgham. When examining sysdiagnose logs and tracing events from one process to another, it would be helpful to know which WebKit processes were related to each other. When Safari, Mail, Messages, etc. are all running at the same time, it may otherwise be difficult to know if a particular Network process, for example was associated with Safari or some other application. Add some logging to the creation of WebContent and Network processes to identify their "presenting process" (parent application). * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * Platform/Logging.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2018-01-25 Youenn Fablet DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker https://bugs.webkit.org/show_bug.cgi?id=182115 Reviewed by Alex Christensen. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): 2018-01-25 Alex Christensen Fix crash when preconnecting while closing private browsing https://bugs.webkit.org/show_bug.cgi?id=182114 Reviewed by Joseph Pecoraro. * NetworkProcess/PreconnectTask.cpp: There is a race condition when destroying a session while a page is initiating a preconnect. If this happens, fail gracefully instead of trying to preconnect with a null session. 2018-01-25 Dan Bernstein [Mac] Enable library validation for Networking & Storage XPC services https://bugs.webkit.org/show_bug.cgi?id=173424 Reviewed by Joseph Pecoraro. * Configurations/BaseXPCService.xcconfig: Moved the definitions of WK_LIBRARY_VALIDATION_ENABLED and WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS from WebContentService.xcconfig to here and made them Mac-only at this level. * Configurations/NetworkService.xcconfig: Also set OTHER_CODE_SIGN_FLAGS to WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS. * Configurations/StorageService.xcconfig: Ditto. * Configurations/WebContentService.xcconfig: Moved definitions from here to BaseXPCService.xcconfig. 2018-01-25 David Hyatt Enable lines clamp support for Apple Mail by default https://bugs.webkit.org/show_bug.cgi?id=182113 Reviewed by Dean Jackson. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebPageProxy.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::appleMailLinesClampEnabled): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): 2018-01-25 Sergio Villar Senin [WebVR][GTK][WPE] Remove the WebVR public API added in r227518 https://bugs.webkit.org/show_bug.cgi?id=182102 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: 2018-01-25 Sergio Villar Senin [WebVR][GTK][WPE] Remove the WebVR public API added in r227518 https://bugs.webkit.org/show_bug.cgi?id=182102 Reviewed by Carlos Garcia Campos. This new public API was not supposed to be included in the patch that added OpenVR to the tree and to the build. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsSetProperty): (webKitSettingsGetProperty): (webkit_settings_class_init): (webkit_settings_get_enable_webvr): Deleted. (webkit_settings_set_enable_webvr): Deleted. * UIProcess/API/gtk/WebKitSettings.h: * UIProcess/API/wpe/WebKitSettings.h: 2018-01-25 Claudio Saavedra [GTK] Fix build with touch events disabled Unreviewed build fix. Explicitly include gtk.h in files that were indirectly getting it only when touch events were enabled. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: * UIProcess/gtk/WaylandCompositor.h: 2018-01-25 Carlos Garcia Campos WebDriver: test imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py crashes in debug https://bugs.webkit.org/show_bug.cgi?id=182096 Reviewed by Carlos Alberto Lopez Perez. It's an assert in HashTable iterators checkValidity(). The problem is that we get the keys to iterate the values and the map is modified inside the loop. We need to use copyToVector to copy the keys. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout): (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout): (WebKit::WebAutomationSession::willShowJavaScriptDialog): 2018-01-24 Alex Christensen Gracefully recover from NetworkProcess crashes in private browsing https://bugs.webkit.org/show_bug.cgi?id=182073 Reviewed by Geoff Garen. If we're using a non-persistent WKWebsiteDataStore and the NetworkProcess crashes and we try to do a load, then the WebProcess restarts the NetworkProcess but doesn't recreate the ephemeral session in the NetworkProcess. When this happens, we've already lost the browsing state in memory in the NetworkProcess, but we don't want to hang. If this is the problem, then just recreate the ephemeral session and continue loading. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame): (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::privateSessionParameters): (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): Deleted. * Shared/WebsiteDataStoreParameters.h: (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): 2018-01-24 Dan Bernstein Enable library validation on the Web Content service Part 1 of https://bugs.webkit.org/show_bug.cgi?id=172365 Reviewed by David Kilzer. This makes the Web Content process signed with the Library Validation flag in production builds. Because doing so would prevent engineering builds of Apple apps that use an injected bundle from working, this also adds a Development version of the service, which does not enforce Library Validation. The UI process chooses to use the Development service iff it would need to load an injected bundle that is not part of the OS. * Configurations/DebugRelease.xcconfig: Disable Library Validation in engineering builds. * Configurations/WebContentService.Development.xcconfig: Added. Like the normal service, but only installed when WebKit is installed in the OS, and uses a Development variant. * Configurations/WebContentService.xcconfig: For the Development variant, append ".Development" to the product name, which is also the service identifier. Enable Library Validation for the Normal variant of the service when WK_LIBRARY_VALIDATION_ENABLED allows it. * UIProcess/Launcher/ProcessLauncher.h: Add nonValidInjectedCodeAllowed member to LaunchOptions, false by default. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): Use the Development variant if nonValidInjectedCodeAllowed is true. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getLaunchOptions): Initialize nonValidInjectedCodeAllowed using the new shouldAllowNonValidInjectedCode(). (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Generic implementation that returns false. * UIProcess/WebProcessProxy.h: Declared shouldAllowNonValidInjectedCode. * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return true if this is system WebKit with a non-system injected bundle. * WebKit.xcodeproj/project.pbxproj: Added new service target. 2018-01-24 Chris Dumez Add a IPC::SendSyncOption indicating we should not process incoming IPC while waiting for the sync reply https://bugs.webkit.org/show_bug.cgi?id=182021 Reviewed by Ryosuke Niwa. Add a new DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption that the caller can set when calling sendSync(). This indicates that the sendSync() should return only when we receive the response to our sync IPC message, and that we should not process ANY incoming IPC in the meantime. This patch also starts using this flag in 3 places where we know processing incoming IPC is an issue and is causing crashes. * Platform/IPC/Connection.cpp: (IPC::Connection::sendSyncMessage): When DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, make sure we set the ShouldDispatchMessageWhenWaitingForSyncReply flag on the encoder. If we did not set this flag then it could cause deadlocks when the destination process is also waiting on a synchronous IPC from us. Normally, this flag already gets set for sync messages because sendSyncMessage() calls sendMessage() with DispatchMessageEvenWhenWaitingForSyncReply SyncOption. However, sendMessage() ignores the DispatchMessageEvenWhenWaitingForSyncReply flag if the m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage flag is set on the connection. Note that this flag is set on the connection from the WebProcess to the UIProcess at the moment, which is why we saw deadlocks on the previous iteration of this patch. (IPC::Connection::waitForSyncReply): If DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, do not process incoming IPC messages while waiting for our sync IPC reply. * Platform/IPC/Connection.h: Add new SendSyncOption. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: Testing infrastructure. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResourceSynchronously): Use new flag. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply): * WebProcess/WebCoreSupport/WebChromeClient.h: Testing infrastructure. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Use new flag. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting): Testing infrastructure. (WebKit::WebProcess::ensureNetworkProcessConnection): Use new flag. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Testing infrastructure. 2018-01-24 Joseph Pecoraro Web Inspector: Remove duplicate preference update for WebAuthentication value https://bugs.webkit.org/show_bug.cgi?id=182058 Reviewed by Brian Burg. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): An identical update already happens in generated code. 2018-01-24 Alex Christensen Remove WebProcess access to QTKit https://bugs.webkit.org/show_bug.cgi?id=182035 Reviewed by Alexey Proskuryakov. * WebProcess/com.apple.WebProcess.sb.in: This isn't needed any more. We only have a little bit of code that uses QTKit which we should remove, and it's only used for fullscreen controls in WebKitLegacy. Let's tighten up the sandbox! 2018-01-24 Alex Christensen Remove pre-Sierra-OS-specific code in WebKit https://bugs.webkit.org/show_bug.cgi?id=182024 Reviewed by Tim Horton. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::encode const): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): * Shared/WebPreferencesDefaultValues.h: * Shared/cg/ShareableBitmapCG.cpp: (WebKit::wantsExtendedRange): * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): * Shared/mac/CodeSigning.mm: (WebKit::codeSigningIdentifier): (WebKit::codeSigningIdentifierForCurrentProcess): * Shared/mac/ColorSpaceData.mm: (WebKit::ColorSpaceData::encode const): * Shared/mac/PasteboardTypes.mm: (WebKit::PasteboardTypes::forURL): * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encodePlatformData): * Shared/mac/WebHitTestResultData.mm: (WebKit::WebHitTestResultData::platformEncode const): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setObject:forBundleParameter:]): (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _handleAcceptedCandidate:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::handleAcceptedCandidate): (WebKit::WebViewImpl::performDragOperation): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): * WebProcess/com.apple.WebProcess.sb.in: 2018-01-24 Alex Christensen Stop using AuthenticationClient in WebKit https://bugs.webkit.org/show_bug.cgi?id=182016 Reviewed by Brady Eidson. It was necessary to support ResourceHandle use in WebKit, but now we're using NetworkSession everywhere in WebKit. * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::useCredentialForSingleChallenge): (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge): (WebKit::AuthenticationManager::cancelSingleChallenge): (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge): (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge): 2018-01-24 Alex Christensen Remove WebProcess authentication code https://bugs.webkit.org/show_bug.cgi?id=182020 Reviewed by Brady Eidson. * Shared/Authentication/AuthenticationManager.cpp: * Shared/Authentication/AuthenticationManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): 2018-01-24 Jan-Michael Brummer [GTK] Page crash after swipe gesture running GNOME3 under wayland https://bugs.webkit.org/show_bug.cgi?id=181996 Reviewed by Michael Catanzaro. Add missing GDK_TOUCH_CANCEL support which fixes page crashes due to cancelled gestures. * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebTouchEvent): * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::doneWithTouchEvent): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (touchPointStateForEvents): (webkitWebViewBaseGetTouchPointsForEvent): (webkitWebViewBaseTouchEvent): * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::handleEvent): 2018-01-24 Alex Christensen Remove unused QTKit preference https://bugs.webkit.org/show_bug.cgi?id=181968 Reviewed by Alexey Proskuryakov. * Shared/API/c/WKDeprecatedFunctions.cpp: (WKPreferencesSetQTKitEnabled): (WKPreferencesGetQTKitEnabled): * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetQTKitEnabled): Deleted. (WKPreferencesGetQTKitEnabled): Deleted. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setQTKitEnabled:]): Deleted. (-[WKPreferences _qtKitEnabled]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2018-01-24 Youenn Fablet Fetch response should copy its url from the request if null https://bugs.webkit.org/show_bug.cgi?id=182048 Reviewed by Chris Dumez. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): 2018-01-24 Sergio Villar Senin Unreviewed build fix after r227518. I forgot to add the function declarations to the WPE header. * UIProcess/API/wpe/WebKitSettings.h: Added webkit_settings_get/set_enable_webvr. 2018-01-24 Youenn Fablet Add Cache Storage engine assertion following on bug 181887 https://bugs.webkit.org/show_bug.cgi?id=181925 Reviewed by Alex Christensen. In a normal environment, the folderPath should be the same as the path computed from the ClientOrigin. Add assertion to verify this. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::clearCachesForOrigin): 2018-01-24 Michael Catanzaro [GTK] Use GDK_EVENT_PROPAGATE and GDK_EVENT_STOP in WebKitWebViewBase.cpp https://bugs.webkit.org/show_bug.cgi?id=182031 Reviewed by Carlos Garcia Campos. No functional changes, this just replaces TRUE with GDK_EVENT_STOP and FALSE with GDK_EVENT_PROPAGATE, to improve readability. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseKeyPressEvent): (webkitWebViewBaseKeyReleaseEvent): (webkitWebViewBaseButtonPressEvent): (webkitWebViewBaseButtonReleaseEvent): (webkitWebViewBaseScrollEvent): (webkitWebViewBaseMotionNotifyEvent): (webkitWebViewBaseCrossingNotifyEvent): (webkitWebViewBaseTouchEvent): 2018-01-23 Eric Carlson Resign NowPlaying status when no media element is eligible https://bugs.webkit.org/show_bug.cgi?id=181914 Reviewed by Jer Noble. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication status. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto. 2018-01-23 Alex Christensen Use CompletionHandlers for ResourceHandleClient::didReceiveResponseAsync https://bugs.webkit.org/show_bug.cgi?id=181961 Reviewed by Michael Catanzaro. * NetworkProcess/Downloads/Download.h: * NetworkProcess/NetworkLoad.cpp: * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkResourceLoadParameters.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: * WebProcess/WebPage/mac/WebPageMac.mm: * WebProcess/WebProcess.cpp: 2018-01-23 Chris Dumez Unreviewed, rollout r227216 as it seems to be causing deadlocks https://bugs.webkit.org/show_bug.cgi?id=182013 * Platform/IPC/Connection.cpp: (IPC::Connection::waitForSyncReply): * Platform/IPC/Connection.h: (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply): Deleted. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::NetworkProcessConnection): * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection): * WebProcess/WebConnectionToUIProcess.cpp: (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::undo): (WebKit::WebEditorClient::redo): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2018-01-23 Commit Queue Unreviewed, rolling out r227437. https://bugs.webkit.org/show_bug.cgi?id=182011 broke build (Requested by alexchristensen on #webkit). Reverted changeset: "Remove unused QTKit preference" https://bugs.webkit.org/show_bug.cgi?id=181968 https://trac.webkit.org/changeset/227437 2018-01-23 Alex Christensen Remove compile guard around beacon API https://bugs.webkit.org/show_bug.cgi?id=182002 Reviewed by Sam Weinig. It's enabled everywhere now. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetBeaconAPIEnabled): (WKPreferencesGetBeaconAPIEnabled): * config.h: 2018-01-23 Alex Christensen Remove unused QTKit preference https://bugs.webkit.org/show_bug.cgi?id=181968 Reviewed by Alexey Proskuryakov. * Shared/API/c/WKDeprecatedFunctions.cpp: (WKPreferencesSetQTKitEnabled): (WKPreferencesGetQTKitEnabled): * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetQTKitEnabled): Deleted. (WKPreferencesGetQTKitEnabled): Deleted. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setQTKitEnabled:]): Deleted. (-[WKPreferences _qtKitEnabled]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2018-01-23 Brent Fulgham [macOS] WebProcess needs TCC entitlements for media capture https://bugs.webkit.org/show_bug.cgi?id=181995 Reviewed by Eric Carlson. * Configurations/WebContent-OSX.entitlements: Add delegated services needed to support media capture features. 2018-01-23 Dan Bernstein [Cocoa] Disable header postprocessing when building for macOS High Sierra https://bugs.webkit.org/show_bug.cgi?id=181972 Reviewed by Anders Carlsson. * Configurations/WebKit.xcconfig: Adopt macOSTargetConditionals.xcconfig helpers and disable postprocessing when building for macOS 10.13. 2018-01-23 Joseph Pecoraro Web Inspector: Window resizing is broken after detaching to separate window https://bugs.webkit.org/show_bug.cgi?id=181992 Reviewed by Brian Burg. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformDetach): Restore the inspector view's autoresizingMask to the initial value that works with a detached window. This gets changed when the view gets attached to bottom/side, so we need to revert it on detaching. 2018-01-23 Brady Eidson Allow passing MessagePorts across processes (e.g. ServiceWorkers). https://bugs.webkit.org/show_bug.cgi?id=181178 Reviewed by Andy Estes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorker): (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::postMessageToServiceWorkerClient): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote): (WebKit::WebProcessProxy::postMessageToRemote): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorker): (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::postMessageToServiceWorker): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2018-01-23 Commit Queue Unreviewed, rolling out r227279 and r227373. https://bugs.webkit.org/show_bug.cgi?id=181988 The LayoutTest crash fix introduced an API test failure. (Requested by ryanhaddad on #webkit). Reverted changesets: "Resign NowPlaying status when no media element is eligible" https://bugs.webkit.org/show_bug.cgi?id=181914 https://trac.webkit.org/changeset/227279 "Resign NowPlaying status when no media element is eligible" https://bugs.webkit.org/show_bug.cgi?id=181914 https://trac.webkit.org/changeset/227373 2018-01-23 Youenn Fablet REGRESSION (r227348): ASSERT_NOT_REACHED in WebKit::ServiceWorkerClientFetch::didFinish() https://bugs.webkit.org/show_bug.cgi?id=181956 Reviewed by Chris Dumez. Covered by test no longer crashing in Debug builds. Reset m_redirectionStatus to None when starting an SW fetch. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::start): (WebKit::ServiceWorkerClientFetch::didFinish): 2018-01-23 Michael Catanzaro [WPE] TestWebKitFindController asserts https://bugs.webkit.org/show_bug.cgi?id=181472 Reviewed by Carlos Garcia Campos. Let's fix this in two independent ways. First, use a GRefPtr to hold ownership of the WebKitWebViewBackend. This way, we don't need to change the order in which WebKitWebView destroys its priv struct members from what is used in WebKitGTK+, which can lead to odd bugs. Additionally, just for good measure, stop resetting the find client when disposing WebKitFindController. This is unnecessary because it will never be destroyed before the WebKitWebView. * UIProcess/API/glib/WebKitFindController.cpp: (webkit_find_controller_class_init): (webkitFindControllerDispose): Deleted. * UIProcess/API/glib/WebKitWebView.cpp: (_WebKitWebViewPrivate::~_WebKitWebViewPrivate): (webkitWebViewSetProperty): (webkitWebViewGetProperty): (webkitWebViewCreatePage): (webkit_web_view_get_backend): * UIProcess/API/wpe/WebKitWebViewBackend.cpp: (webkitWebViewBackendCreateDefault): (WTF::refGPtr): (WTF::derefGPtr): * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h: 2018-01-22 Jon Lee Update title label size https://bugs.webkit.org/show_bug.cgi?id=181962 rdar://problem/36754744 Reviewed by Simon Fraser. * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: (-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]): Move titleLabel properties into createSubviews. (-[_WKFullScreenViewController createSubviews]): Set the title label for both the cancel and location buttons. Refer to a const CGFloat for the font size. 2018-01-22 Megan Gardner Temporarily restore block selection code conditionally https://bugs.webkit.org/show_bug.cgi?id=181895 Reviewed by Tim Horton. We need to restore this code temporarily to avoid a crash. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): 2018-01-22 Zach Li We should not try to link against the Safe Browsing framework on watchOS and tvOS. https://bugs.webkit.org/show_bug.cgi?id=181965. Reviewed by Tim Horton. * Configurations/WebKit.xcconfig: 2018-01-22 Alex Christensen Remove pre-NetworkSession loading code https://bugs.webkit.org/show_bug.cgi?id=181944 Reviewed by Tim Horton. We were keeping it around for El Capitan. * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: (WebKit::LegacyCustomProtocolManager::registerProtocolClass): * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp: (WebKit::LegacyCustomProtocolManager::initialize): * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: * NetworkProcess/Downloads/BlobDownloadClient.cpp: Removed. * NetworkProcess/Downloads/BlobDownloadClient.h: Removed. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::~Download): (WebKit::Download::cancel): (WebKit::Download::didReceiveChallenge): (WebKit::Download::didFinish): (WebKit::Download::isAlwaysOnLoggingAllowed const): (WebKit::Download::start): Deleted. (WebKit::Download::startWithHandle): Deleted. (WebKit::Download::didStart): Deleted. (WebKit::Download::willSendRedirectedRequest): Deleted. (WebKit::Download::didReceiveAuthenticationChallenge): Deleted. (WebKit::Download::didReceiveResponse): Deleted. (WebKit::Download::shouldDecodeSourceDataOfMIMEType): Deleted. (WebKit::Download::decideDestinationWithSuggestedFilename): Deleted. (WebKit::Download::decideDestinationWithSuggestedFilenameAsync): Deleted. (WebKit::Download::didDecideDownloadDestination): Deleted. (WebKit::Download::continueDidReceiveResponse): Deleted. * NetworkProcess/Downloads/Download.h: (WebKit::Download::setBlobFileReferences): Deleted. (WebKit::Download::request const): Deleted. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): (WebKit::DownloadManager::willDecidePendingDownloadDestination): (WebKit::DownloadManager::convertNetworkLoadToDownload): (WebKit::DownloadManager::continueDecidePendingDownloadDestination): (WebKit::DownloadManager::resumeDownload): (WebKit::DownloadManager::cancelDownload): * NetworkProcess/Downloads/DownloadManager.h: (WebKit::DownloadManager::startDownload): * NetworkProcess/Downloads/PendingDownload.cpp: * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed. * NetworkProcess/Downloads/mac/DownloadMac.mm: Removed. * NetworkProcess/NetworkCORSPreflightChecker.cpp: * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): * NetworkProcess/NetworkDataTask.cpp: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::~NetworkLoad): (WebKit::NetworkLoad::setDefersLoading): (WebKit::NetworkLoad::cancel): (WebKit::NetworkLoad::continueWillSendRequest): (WebKit::NetworkLoad::continueDidReceiveResponse): (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics const): (WebKit::NetworkLoad::didReceiveResponseAsync): Deleted. (WebKit::NetworkLoad::didReceiveBuffer): Deleted. (WebKit::NetworkLoad::didFinishLoading): Deleted. (WebKit::NetworkLoad::didFail): Deleted. (WebKit::NetworkLoad::willSendRequestAsync): Deleted. (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted. (WebKit::NetworkLoad::shouldUseCredentialStorage): Deleted. (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Deleted. (WebKit::NetworkLoad::receivedCancellation): Deleted. * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::clearCachedCredentials): (WebKit::NetworkProcess::findPendingDownloadLocation): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/NetworkSession.cpp: * NetworkProcess/NetworkSession.h: * NetworkProcess/PingLoad.cpp: * NetworkProcess/PingLoad.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: * NetworkProcess/mac/NetworkLoadMac.mm: Removed. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): (WebKit::AuthenticationManager::useCredentialForSingleChallenge): (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge): (WebKit::AuthenticationManager::cancelSingleChallenge): (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge): (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge): * Shared/Authentication/AuthenticationManager.h: * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Removed. * Shared/SessionTracker.cpp: (WebKit::SessionTracker::setSession): (WebKit::SessionTracker::destroySession): * Shared/SessionTracker.h: * Shared/mac/CookieStorageShim.h: Removed. * Shared/mac/CookieStorageShim.mm: Removed. * UIProcess/API/APIDownloadClient.h: (API::DownloadClient::didReceiveData): (API::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted. * UIProcess/API/C/WKContext.cpp: (WKContextSetDownloadClient): * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted. * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::willSendRequest): (WebKit::DownloadProxy::didReceiveResponse): (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType): Deleted. (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Deleted. * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Downloads/DownloadProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::clearCachedCredentials): * config.h: 2018-01-22 Youenn Fablet SW: Make sure ServiceWorker loading and requests are correctly cleared by ITP https://bugs.webkit.org/show_bug.cgi?id=181942 Reviewed by Chris Dumez. Add ServiceWorkerRegistrations and DOMCache as persistent data to be cleared according ITP decisions. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes): 2018-01-22 Chris Dumez Add release logging to help debug issues related to service workers https://bugs.webkit.org/show_bug.cgi?id=181935 Reviewed by Brady Eidson. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::didFinishFetch): (WebKit::WebSWServerConnection::didFailFetch): (WebKit::WebSWServerConnection::didNotHandleFetch): 2018-01-22 Brent Fulgham [iOS] REGRESSION (r225763): Allow access to power logging features https://bugs.webkit.org/show_bug.cgi?id=181938 Reviewed by Eric Carlson. I denied access to the powerlog facility in r225763, not realizing that it gets activated in certain logging scenarios. This patch reverts this change. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2018-01-22 Brent Fulgham [macOS, iOS] Allow accss to AVFoundation preference https://bugs.webkit.org/show_bug.cgi?id=181937 Reviewed by Eric Carlson. Grant access to the 'com.apple.avfoundation.frecents' preference. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2018-01-22 Brady Eidson In WebKit2, make the MessagePortChannelRegistry live in the UI process. https://bugs.webkit.org/show_bug.cgi?id=181922 Reviewed by Andy Estes. With all of the work that went into making MessagePorts be fully asynchronous and to be process-aware, formally moving them out-of-process is just a matter of adding WebKit IPC layers. The basic unit of asynchronicity is "MessagePortChannelProvider", and this patch adds both a WebMessagePortChannelProvider and UIMessagePortChannelProvider for each side of the process divide. * UIProcess/UIMessagePortChannelProvider.cpp: Added. (WebKit::UIMessagePortChannelProvider::singleton): (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider): (WebKit::UIMessagePortChannelProvider::~UIMessagePortChannelProvider): (WebKit::UIMessagePortChannelProvider::createNewMessagePortChannel): (WebKit::UIMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote): (WebKit::UIMessagePortChannelProvider::messagePortDisentangled): (WebKit::UIMessagePortChannelProvider::messagePortClosed): (WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort): (WebKit::UIMessagePortChannelProvider::postMessageToRemote): (WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity): (WebKit::UIMessagePortChannelProvider::checkProcessLocalPortForActivity): * UIProcess/UIMessagePortChannelProvider.h: Added. (WebKit::UIMessagePortChannelProvider::registry): * UIProcess/WebPageProxy.cpp: (WebKit::m_configurationPreferenceValues): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::processForIdentifier): (WebKit::m_userMediaCaptureManagerProxy): (WebKit::WebProcessProxy::~WebProcessProxy): (WebKit::WebProcessProxy::shutDown): (WebKit::WebProcessProxy::createNewMessagePortChannel): (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote): (WebKit::WebProcessProxy::messagePortDisentangled): (WebKit::WebProcessProxy::messagePortClosed): (WebKit::WebProcessProxy::takeAllMessagesForPort): (WebKit::WebProcessProxy::didDeliverMessagePortMessages): (WebKit::WebProcessProxy::postMessageToRemote): (WebKit::WebProcessProxy::checkRemotePortForActivity): (WebKit::WebProcessProxy::checkProcessLocalPortForActivity): (WebKit::WebProcessProxy::didCheckProcessLocalPortForActivity): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp: Added. (WebKit::WebMessagePortChannelProvider::singleton): (WebKit::WebMessagePortChannelProvider::WebMessagePortChannelProvider): (WebKit::WebMessagePortChannelProvider::~WebMessagePortChannelProvider): (WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel): (WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote): (WebKit::WebMessagePortChannelProvider::messagePortDisentangled): (WebKit::WebMessagePortChannelProvider::messagePortClosed): (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort): (WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort): (WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity): (WebKit::WebMessagePortChannelProvider::postMessageToRemote): (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity): (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity): * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: Added. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeProcess): (WebKit::WebProcess::didTakeAllMessagesForPort): (WebKit::WebProcess::checkProcessLocalPortForActivity): (WebKit::WebProcess::didCheckRemotePortForActivity): (WebKit::WebProcess::messagesAvailableForPort): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2018-01-22 Youenn Fablet Bump default cache storage quota to 50MB https://bugs.webkit.org/show_bug.cgi?id=181924 Reviewed by Chris Dumez. Existing web sites use more than 20 MB. * UIProcess/WebsiteData/WebsiteDataStore.h: 2018-01-22 Zan Dobersek Unreviewed build fix after r227292. Fixing a bad copy-paste that broke the GTK+ debug builds. * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::convertCairoSurfaceToShareableBitmap): 2018-01-22 Zan Dobersek [Cairo] Refactor PlatformContextCairo::drawSurfaceToContext() into a Cairo operation https://bugs.webkit.org/show_bug.cgi?id=181930 Reviewed by Carlos Garcia Campos. Call sites of the PlatformContextCairo::drawSurfaceToContext() method are adjusted to now call Cairo::drawSurface() and properly pass the PlatformContextCairo object to the function. * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::paint): * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::convertCairoSurfaceToShareableBitmap): 2018-01-21 Carlos Garcia Campos Unreviewed. Fix compile warning. Use #include instead of #import in cross-platform code. * Shared/WebPreferencesDefaultValues.cpp: 2018-01-21 Ryosuke Niwa Turning off custom pasteboard data doesn't actually turn it off in WK2 https://bugs.webkit.org/show_bug.cgi?id=181920 Reviewed by Wenson Hsieh. Moved the code to decide when to enable custom pasteboard data from WebCore since we never enable this feature in WebKit1. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.cpp: (defaultCustomPasteboardDataEnabled): Added. * Shared/WebPreferencesDefaultValues.h: 2018-01-21 Wenson Hsieh Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h https://bugs.webkit.org/show_bug.cgi?id=181918 Reviewed by Tim Horton. Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default). * Configurations/FeatureDefines.xcconfig: 2018-01-21 Eric Carlson Resign NowPlaying status when no media element is eligible https://bugs.webkit.org/show_bug.cgi?id=181914 Reviewed by Jer Noble. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication status. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto. 2018-01-20 Andy Estes [Apple Pay] Stop eagerly loading PassKit.framework https://bugs.webkit.org/show_bug.cgi?id=181911 Reviewed by Tim Horton. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: Removed availablePaymentNetworks from WebPageCreationParameters. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetApplePayEnabled): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): Stopped calling WebPaymentCoordinatorProxy::platformSupportsPayments(). * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks): * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: Added message AvailablePaymentNetworks, which synchronously returns a Vector of payment networks. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): Returned false if PassKitLibrary() fails. (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup): Called completionHandler with false if PassKitLibrary() fails. (WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks): (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks): Renamed availablePaymentNetworks to platformAvailablePaymentNetworks (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments): Deleted. * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Called completionHandler with false if PassKitLibrary() fails. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): Stopped calling WebPaymentCoordinatorProxy::availablePaymentNetworks(). * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::availablePaymentNetworks): (WebKit::WebPaymentCoordinator::validatedPaymentNetwork): * WebProcess/ApplePay/WebPaymentCoordinator.h: Implemented PaymentCoordinatorClient::validatedPaymentNetwork(). m_availablePaymentNetworks starts off as std::nullopt, but is initialized by sending the AvailablePaymentNetworks sync message the first time it's accessed. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Stopped setting PageConfiguration::availablePaymentNetworks. 2018-01-20 Jer Noble Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout https://bugs.webkit.org/show_bug.cgi?id=181840 Reviewed by Simon Fraser. Updating layout while the document is suspended or stopped is unsafe. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::inlineVideoFrame): 2018-01-20 Chris Dumez DOMCache data sometimes not properly removed when clearing data for a given origin https://bugs.webkit.org/show_bug.cgi?id=181887 Reviewed by Youenn Fablet. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::clearCachesForOrigin): This code was iterating through folders on disk, then reading the folder's origin from the origin file on disk. Then, if the origin would match the one we want to delete, it would regenerate the folder path using cachesRootPath(*folderOrigin). I don't know how but on my machine, I was ended up in a state where the path generated by cachesRootPath(*folderOrigin) differed from the actual folder path we read the origin from (Likely a different salt?). To make the code more robust, I updated the code to delete "folderPath", which is the path we read the origin from. 2018-01-19 Zach Li Expose Safe Browsing SPI https://bugs.webkit.org/show_bug.cgi?id=181804 Reviewed by Dan Bernstein. If client is using Apple internal SDK, then we can just import the header; if not, then we declare necessary symbols that client will need. * Configurations/WebKit.xcconfig: Only link against SafariSafeBrowsing framework on macOS High Sierra and iOS 11 and above. Weak link against SafariSafeBrowsing framework because it is not present on the Base system. * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added. * WebKit.xcodeproj/project.pbxproj: Added SafeBrowsingSPI.h. * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd: Added. 2018-01-19 Ryan Haddad Unreviewed build fix, removed unused lambda capture. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): 2018-01-19 John Wilander Resource Load Statistics: Remove unused calls to WebResourceLoadStatisticsStore:logTestingEvent() to fix API test https://bugs.webkit.org/show_bug.cgi?id=181890 Unreviewed API test fix. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): 2018-01-19 Youenn Fablet Do not go to the storage process when registering a service worker client if there is no service worker registered https://bugs.webkit.org/show_bug.cgi?id=181740 Reviewed by Chris Dumez. UIProcess notifies all web processes to register their service worker clients when spinning the service worker process. Add private API to set the number of web processes for testing purposes. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setMaximumNumberOfProcesses:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::registerServiceWorkerClients): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2018-01-19 Dean Jackson REGRESSION (r221092): Swipe actions are hard to perform in FastMail app https://bugs.webkit.org/show_bug.cgi?id=181817 Reviewed by Simon Fraser. Add a linked-on-or-after check to set passive touch listeners on document in WebCore. * CMakeLists.txt: * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.cpp: Copied from Source/WebKit/UIProcess/Cocoa/VersionChecks.h. (defaultPassiveTouchListenersAsDefaultOnDocument): * Shared/WebPreferencesDefaultValues.h: * UIProcess/Cocoa/VersionChecks.h: * WebKit.xcodeproj/project.pbxproj: 2018-01-19 Joseph Pecoraro [Cocoa] _WKNSWindowExtras.h: Add missing availability annotation https://bugs.webkit.org/show_bug.cgi?id=181868 Reviewed by Dan Bernstein. * Shared/API/Cocoa/_WKNSWindowExtras.h: 2018-01-19 John Wilander Resource Load Statistics: Add void to argument list to fix build with -Wstrict-prototypes https://bugs.webkit.org/show_bug.cgi?id=181870 Unreviewed build fix. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: 2018-01-19 Ryan Haddad Unreviewed, rolling out r227211. Breaks iOS Simulator tests. Reverted changeset: "Expose Safe Browsing SPI" https://bugs.webkit.org/show_bug.cgi?id=181804 https://trac.webkit.org/changeset/227211 2018-01-19 John Wilander Resource Load Statistics: Implement callback support for removal of WebsiteDataType::ResourceLoadStatistics https://bugs.webkit.org/show_bug.cgi?id=181822 https://bugs.webkit.org/show_bug.cgi?id=175263 https://bugs.webkit.org/show_bug.cgi?id=178536 https://bugs.webkit.org/show_bug.cgi?id=181223 https://bugs.webkit.org/show_bug.cgi?id=181482 Reviewed by Alex Christensen. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore): (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): Calls the new API with no-op completion handler. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]): New API with completion handler. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Calls the new API with no-op completion handler. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]): New API with completion handler. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses): * UIProcess/WebsiteData/WebsiteDataStore.h: 2018-01-19 Daniel Bates REGRESSION (r223149): Ref WebPageProxy objects before calling their functionality https://bugs.webkit.org/show_bug.cgi?id=181863 Reviewed by Chris Dumez. More fix ups following r223149. When notifying all pages of a process state change we need to take care to ref all the pages before iterating over them and notifying them of the change. Notifying a page of such a state change may ultimately delegate to the embedding client. And the embedding client can do anything, including deallocating one or more pages. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didBecomeUnresponsive): (WebKit::WebProcessProxy::didBecomeResponsive): (WebKit::WebProcessProxy::willChangeIsResponsive): (WebKit::WebProcessProxy::didChangeIsResponsive): (WebKit::WebProcessProxy::requestTermination): 2018-01-19 Chris Dumez The WebContent process should not process incoming IPC while waiting for a sync IPC reply https://bugs.webkit.org/show_bug.cgi?id=181560 Reviewed by Ryosuke Niwa. The WebContent process should not process incoming IPC while waiting for a sync IPC reply. This is causing hard-to-debug crashes because developers often assume the state does not change during a sendSync() call. * Platform/IPC/Connection.cpp: (IPC::Connection::waitForSyncReply): * Platform/IPC/Connection.h: (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::NetworkProcessConnection): * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection): * WebProcess/WebConnectionToUIProcess.cpp: (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::undo): (WebKit::WebEditorClient::redo): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2018-01-19 Keith Miller HaveInternalSDK includes should be "#include?" https://bugs.webkit.org/show_bug.cgi?id=179670 Reviewed by Dan Bernstein. * Configurations/Base.xcconfig: 2018-01-19 Daniel Bates Fix misspelling; substitute willDetachRenderer for willDetatchRenderer. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::willDetachRenderer): (WebKit::PDFPlugin::willDetatchRenderer): Deleted. * WebProcess/Plugins/Plugin.h: (WebKit::Plugin::willDetachRenderer): (WebKit::Plugin::willDetatchRenderer): Deleted. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::willDetachRenderer): (WebKit::PluginView::willDetatchRenderer): Deleted. * WebProcess/Plugins/PluginView.h: 2018-01-19 Zach Li Expose Safe Browsing SPI https://bugs.webkit.org/show_bug.cgi?id=181804 Reviewed by Alex Christensen. If client is using Apple internal SDK, then we can just import the header; if not, then we declare necessary symbols that client will need. * Configurations/WebKit.xcconfig: Only link against SafariSafeBrowsing framework on macOS High Sierra and iOS 11 and above. Weak link against SafariSafeBrowsing framework because it is not present on the Base system. * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added. * WebKit.xcodeproj/project.pbxproj: Added SafeBrowsingSPI.h. * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd: Added. 2018-01-18 Chris Dumez We should be able to terminate service workers that are unresponsive https://bugs.webkit.org/show_bug.cgi?id=181563 Reviewed by Alex Christensen. * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::terminateWorker): Use a 10 second timeout for forcefully exiting the service worker process when the service worker in question fails to terminate. (WebKit::WebSWContextManagerConnection::syncTerminateWorker): Use a 100ms timeout for forcefully exiting the service worker process when the service worker in question fails to terminate. This method is only called from the layout tests, which is why we use a very short timeout. 2018-01-18 Ryan Haddad Unreviewed, suppress deprecation warnings to fix the build with a newer SDK. * UIProcess/ios/WKPDFPageNumberIndicator.mm: (-[WKPDFPageNumberIndicator _makeRoundedCorners]): 2018-01-18 Youenn Fablet Do not go to the storage process when loading a main resource if there is no service worker registered https://bugs.webkit.org/show_bug.cgi?id=181395 Reviewed by Chris Dumez. Add a new web process creation parameter to know whether there is any service worker registered at web process creation time. If there is none, the web process will then start to load HTTP resources from the network. The connection to the storage process is then executed when receiving the first bytes of the main resource. This connection is needed as other web processes may create service workers at any given time. If there is one registered service worker, the web process will wait for its connection to the storage process to be active. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::hasRegisteredServiceWorkers): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.h: (WebKit::WebToStorageProcessConnection::existingServiceWorkerConnectionForSession): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2018-01-18 Chris Dumez Regression(r223149): WebProcessProxy::didClose() no longer refs WebPageProxy objects https://bugs.webkit.org/show_bug.cgi?id=181771 Reviewed by Brady Eidson. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didClose): Use copyToVectorOf>() to maintain pre-r223149 behavior and ref the pages. 2018-01-18 Dan Bernstein [Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions https://bugs.webkit.org/show_bug.cgi?id=181803 Reviewed by Tim Horton. * Configurations/Base.xcconfig: Updated. * Configurations/DebugRelease.xcconfig: Ditto. * Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers. * Configurations/Version.xcconfig: Updated. * Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build settings useful for defining settings that depend on the target macOS version. 2018-01-18 Chris Dumez Service Workers restored from persistent storage have 'redundant' state https://bugs.webkit.org/show_bug.cgi?id=181749 Reviewed by Youenn Fablet. Allow service workers to intercept custom protocol loads as this is useful for API testing. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler): * WebProcess/Network/WebLoaderStrategy.h: 2018-01-18 Brent Fulgham REGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search preferences https://bugs.webkit.org/show_bug.cgi?id=181797 Reviewed by Eric Carlson. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add the read permission for 'com.apple.lookup.shared' to support DataDetectors. 2018-01-17 John Wilander Resource Load Statistics: Block cookies for prevalent resources without user interaction https://bugs.webkit.org/show_bug.cgi?id=177394 Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Now has m_hasBeenSetToUseStatelessCookieStorage to handle cookie blocking. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::statelessCookieStorage): Returns singleton empty, deny-all cookie storage for cookie blocking. The ugly pragma instructions for clang are because the NSString parameter for _initWithIdentifier was not marked nullable pre-Sierra. (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy): Instead of just decision making, this now applies the policy. (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy): New method. (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Now blocks cookies for domains where cookies will be purged anyway. (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): Now blocks cookies for domains where cookies will be purged anyway. (WebKit::shouldChangePartition): Deleted. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): Now downgrades for blocked cookies instead of partitioned cookies. (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Now downgrades for blocked cookies instead of partitioned cookies. 2018-01-17 Stephan Szabo [Curl] Use ResourceRequest::encodeWithPlatformData() https://bugs.webkit.org/show_bug.cgi?id=181768 Reviewed by Alex Christensen. * Shared/curl/WebCoreArgumentCodersCurl.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2018-01-17 Matt Lewis Unreviewed, rolling out r227076. This breaks internal builds Reverted changeset: "Resource Load Statistics: Block cookies for prevalent resources without user interaction" https://bugs.webkit.org/show_bug.cgi?id=177394 https://trac.webkit.org/changeset/227076 2018-01-17 Michael Catanzaro WEBKIT_FRAMEWORK should not modify file-global include directories https://bugs.webkit.org/show_bug.cgi?id=181656 Reviewed by Konstantin Tokarev. * PlatformGTK.cmake: * PlatformWPE.cmake: 2018-01-17 Youenn Fablet Put fetch request keepAlive behind a runtime flag https://bugs.webkit.org/show_bug.cgi?id=181592 Reviewed by Chris Dumez. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetFetchAPIKeepAliveEnabled): (WKPreferencesGetFetchAPIKeepAliveEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2018-01-17 John Wilander Resource Load Statistics: Block cookies for prevalent resources without user interaction https://bugs.webkit.org/show_bug.cgi?id=177394 Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Now has m_hasBeenSetToUseStatelessCookieStorage to handle cookie blocking. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::statelessCookieStorage): Returns singleton empty, deny-all cookie storage for cookie blocking. (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy): Instead of just decision making, this now applies the policy. (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy): New method. (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Now blocks cookies for domains where cookies will be purged anyway. (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): Now blocks cookies for domains where cookies will be purged anyway. (WebKit::shouldChangePartition): Deleted. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): Now downgrades for blocked cookies instead of partitioned cookies. (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Now downgrades for blocked cookies instead of partitioned cookies. 2018-01-17 Daniel Bates REGRESSION (r222795): Cardiogram never signs in https://bugs.webkit.org/show_bug.cgi?id=181693 Reviewed by Ryosuke Niwa. Exempt Cardiogram from the XHR header restrictions in r222795. Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers. However Cardiogram also depends on such functionality. * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKWebView.mm: (shouldAllowSettingAnyXHRHeaderFromFileURLs): (-[WKWebView _initializeWithConfiguration:]): * UIProcess/Cocoa/VersionChecks.h: 2018-01-17 Wenson Hsieh Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content https://bugs.webkit.org/show_bug.cgi?id=181637 Reviewed by Tim Horton. Add new injected bundle SPI, replacementURLForResource, which clients may use to provide a replacement URL to represent an archive resource, given the resource's data and MIME type. * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: (API::InjectedBundle::EditorClient::replacementURLForResource): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h: Add replacementURLForResource, and also bump the current injected bundle editor client version to 2. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: (WebKit::InjectedBundlePageEditorClient::replacementURLForResource): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::replacementURLForResource): * WebProcess/WebCoreSupport/WebEditorClient.h: 2018-01-17 Zan Dobersek [Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo https://bugs.webkit.org/show_bug.cgi?id=181725 Reviewed by Carlos Garcia Campos. * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::paint): Adjust the PlatformContextCairo::drawSurfaceToContext() invocation. * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::convertCairoSurfaceToShareableBitmap): Ditto. 2018-01-17 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release. * gtk/NEWS: Add release notes for 2.19.6. 2018-01-17 Carlos Garcia Campos [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds https://bugs.webkit.org/show_bug.cgi?id=179914 Reviewed by Žan Doberšek. Add symbols detected by check-for-global-bss-symbols-in-webkigtk-libs to the version script. * webkitglib-symbols.map: 2018-01-17 Youenn Fablet Clear Caches volatile storage as a memory optimization. https://bugs.webkit.org/show_bug.cgi?id=181643 Reviewed by Chris Dumez. clearMemoryRepresentation clears m_caches which exposes data potentially stored in m_volatileStorage. Clearing m_volatileStorage allows releasing some memory. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::clearMemoryRepresentation): 2018-01-17 Zan Dobersek [Cairo] Use one-time ShadowBlur objects when performing shadowing https://bugs.webkit.org/show_bug.cgi?id=181720 Reviewed by Carlos Garcia Campos. * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::paint): Adjust the PlatformContextCairo::drawSurfaceToContext() invocation. * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::convertCairoSurfaceToShareableBitmap): Ditto. 2018-01-16 Fujii Hironori [CMake] Remove WebCoreDerivedSources library target https://bugs.webkit.org/show_bug.cgi?id=181664 Reviewed by Carlos Garcia Campos. * CMakeLists.txt: Do not link WebCoreDerivedSources. * PlatformGTK.cmake: Appended WebCore after WebCorePlatformGTK in WebKit_LIBRARIES. * PlatformWin.cmake: Ditto. 2018-01-16 Alex Christensen Merge sync and async code paths for getting context menus https://bugs.webkit.org/show_bug.cgi?id=181423 Reviewed by Joseph Pecoraro. What a mess. We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation. This makes it so there is just one. At the API level we see if there is an asynchronous delegate to call, then synchronous. There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything! * UIProcess/API/APIContextMenuClient.h: (API::ContextMenuClient::getContextMenuFromProposedMenu): (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageContextMenuClient): * UIProcess/API/glib/WebKitContextMenuClient.cpp: * UIProcess/WebContextMenuProxy.h: * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::WebContextMenuProxyGtk::show): (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems): * UIProcess/gtk/WebContextMenuProxyGtk.h: * UIProcess/mac/WebContextMenuProxyMac.h: * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): (WebKit::WebContextMenuProxyMac::showContextMenu): * UIProcess/wpe/WebContextMenuProxyWPE.h: 2018-01-16 Michael Catanzaro Don't link WebKit target directly to JavaScriptCore https://bugs.webkit.org/show_bug.cgi?id=181688 Reviewed by Alex Christensen. It's safer if we only link to the next lower-layered lib in the stack, so let's just link directly to WebCore instead. And WPE doesn't need to specify it twice. * CMakeLists.txt: * PlatformMac.cmake: * PlatformWPE.cmake: 2018-01-16 Eric Carlson AVSampleBufferDisplayLayer should be flushed when application activates https://bugs.webkit.org/show_bug.cgi?id=181623 Reviewed by Darin Adler. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applicationWillResignActive): Call page. (WebKit::WebPage::applicationDidEnterBackground): Ditto, let it call libWebRTCProvider. (WebKit::WebPage::applicationWillEnterForeground): Call page. (WebKit::WebPage::applicationDidBecomeActive): Ditto, let it call libWebRTCProvider. 2018-01-16 Zach Li Add pop-up policy support in website policies. https://bugs.webkit.org/show_bug.cgi?id=181544. rdar://problem/30521400. Reviewed by Alex Christensen. * Shared/WebsitePoliciesData.cpp: Encode and decode pop-up policy. (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): (WebKit::WebsitePoliciesData::applyToDocumentLoader): Apply the pop-up policy from website policies to the document loader. * Shared/WebsitePoliciesData.h: * Shared/WebsitePopUpPolicy.h: Added for declaring enum WebsitePopUpPolicy. * UIProcess/API/APIWforebsitePolicies.cpp: Include pop-up policy in website policies. (API::WebsitePolicies::WebsitePolicies): (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/C/WKWebsitePolicies.cpp: Added C API to get and set pop-up policy on website policies. (WKWebsitePoliciesGetPopUpPolicy): (WKWebsitePoliciesSetPopUpPolicy): * UIProcess/API/C/WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: Added Obj-C API to get and set pop-up policy on website policies. * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setPopUpPolicy:]): (-[_WKWebsitePolicies popUpPolicy]): * WebKit.xcodeproj/project.pbxproj: Added WebsitePopUpPolicy.h. 2018-01-16 Fujii Hironori [CMake][Mac] Fix the build errors https://bugs.webkit.org/show_bug.cgi?id=181665 Reviewed by Alex Christensen. * CMakeLists.txt: Added TouchBarMenuData.cpp and TouchBarMenuItemData.cpp to compile. * PlatformMac.cmake: Added _WKApplicationManifest.mm, WKInspectorWKWebView.mm and WKInspectorWindow.mm to compile. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _webPageContentProcessCount]): Call WebProcessPool::serviceWorkerProxy() only if ENABLE(SERVICE_WORKER). 2018-01-16 Wenson Hsieh [Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted https://bugs.webkit.org/show_bug.cgi?id=181638 Reviewed by Dan Bernstein. Add a `source` parameter to the `didInsertAttachment` codepath for notifying WebKit2 clients when attachment elements are inserted into the document. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didInsertAttachment:withSource:]): (-[WKWebView _didInsertAttachment:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/PageClientImplCocoa.h: * UIProcess/Cocoa/PageClientImplCocoa.mm: (WebKit::PageClientImplCocoa::didInsertAttachment): * UIProcess/PageClient.h: (WebKit::PageClient::didInsertAttachment): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didInsertAttachment): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::didInsertAttachment): * WebProcess/WebCoreSupport/WebEditorClient.h: 2018-01-15 Youenn Fablet ASSERTION FAILED: m_ptr under WebKit::CacheStorage::Caches::writeRecord https://bugs.webkit.org/show_bug.cgi?id=181401 Reviewed by Darin Adler. m_isInitialized is true but m_storage is set to nullptr when calling writeRecord. The only case seems to be if: - We are doing persistent storage - We are traversing the storage to do the initialization. At that point m_storage is set to a correct value. - clearMemoryRepresentation is called, thus setting m_storage to nullptr and m_isInitialized to false. We fix this by making clearMemoryRepresentation a no-op if we are initializing the caches. clearMemoryRepresentation is about cleaning the in-memory information of the caches and the memory representation is empty at init time. Nullifying m_storage is a memory consumption optimization. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::clearMemoryRepresentation): 2018-01-12 Wenson Hsieh Unreviewed, speculative build fix after r226899. Add an empty implementation for PageClient::startDrag. * UIProcess/PageClient.h: (WebKit::PageClient::startDrag): 2018-01-12 Brent Fulgham [iOS] Remove unneeded accessibility-related sandbox rules https://bugs.webkit.org/show_bug.cgi?id=181619 Reviewed by Eric Carlson. Remove a number of sandbox exceptions that were in place for accessibility support. These are not needed in the WebContent process, since Safari (not WebKit) handles the accessibility interactions. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2018-01-12 Keith Rollin Logged JSON should escape "'s and \'s in strings. https://bugs.webkit.org/show_bug.cgi?id=181608 Reviewed by Brent Fulgham. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::logCookieInformation const): 2018-01-12 Megan Gardner Unreviewed, fixing error in UIKitSPI.h. * Platform/spi/ios/UIKitSPI.h: 2018-01-12 Megan Gardner Implement MultiDocument protocol for restoring focus to a WKWebView https://bugs.webkit.org/show_bug.cgi?id=181510 Reviewed by Dan Bernstein. Support the UIKit protocol for restoring focus to a what previously had focus. WebKit already knows what node was previously being focused by the DOM, we merely need to be asked to turn the focus on again. Resubmitting https://trac.webkit.org/changeset/226826 as it broke internal builds * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _restoreFocusWithToken:]): (-[WKContentView _preserveFocusWithToken:destructively:]): 2018-01-12 Youenn Fablet WebProcess should pass the registration identifier and not the worker identifier for fetch events https://bugs.webkit.org/show_bug.cgi?id=181591 Reviewed by Chris Dumez. Use service worker registration identifier to compute the active service worker identifier responsible to handle the fetch event. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::start): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): 2018-01-12 Ryan Haddad Unreviewed, rolling out r226826. Breaks internal builds. Reverted changeset: "Implement MultiDocument protocol for restoring focus to a WKWebView" https://bugs.webkit.org/show_bug.cgi?id=181510 https://trac.webkit.org/changeset/226826 2018-01-12 Wenson Hsieh [WK2] Unify macOS and iOS codepaths in the UI process when starting a drag https://bugs.webkit.org/show_bug.cgi?id=181574 Reviewed by Tim Horton. Rearrange some macOS drag start logic in the UI process so that it uses the same codepaths in WebPageProxy as iOS. Namely, startDrag should just forward the DragItem and drag image handle along to the appropriate views on each platform (WKContentView and WebViewImpl). There should be no change in behavior. * UIProcess/Cocoa/WebPageProxyCocoa.mm: Both macOS and iOS now funnel through this method. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::startDrag): (WebKit::WebViewImpl::dragImageForView): Deleted. Rename dragImageForView to startDrag. Move the call to didStartDrag() here, and call dragCancelled() in the case where we bailed from starting the drag (due to failing to create a drag image). * UIProcess/PageClient.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::setDragImage): Deleted. Rename setDragImage to startDrag. * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::startDrag): (WebKit::PageClientImpl::setDragImage): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::startDrag): Deleted. 2018-01-12 Antoine Quint Add support for the frames() timing function https://bugs.webkit.org/show_bug.cgi?id=181585 Reviewed by Dean. Add the ability to endode and decode the frames() timing function. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::Properties::encode const): (WebKit::PlatformCAAnimationRemote::Properties::decode): 2018-01-11 Keith Miller Rename ENABLE_ASYNC_ITERATION to ENABLE_JS_ASYNC_ITERATION https://bugs.webkit.org/show_bug.cgi?id=181573 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2018-01-11 Brent Fulgham REGRESSION(r219530): ResourceLoadStatisticsPersistentStorage should be read-only in ephemeral sessions https://bugs.webkit.org/show_bug.cgi?id=181136 Re