2017-12-30 Wenson Hsieh [Attachment Support] Remove current macOS support for dragging file-backed attachments https://bugs.webkit.org/show_bug.cgi?id=181188 Reviewed by Dan Bernstein. See WebCore/ChangeLog for more detail. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::setPromisedDataForAttachment): Deleted. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setPromisedDataForAttachment): Deleted. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::setPromisedDataForAttachment): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setPromisedDataForAttachment): Deleted. * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteAttachment): Deleted. 2017-12-28 Brady Eidson Add a ProcessIdentifier, vended from the UI process, to each child process https://bugs.webkit.org/show_bug.cgi?id=181155 Reviewed by Brent Fulgham. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::initialize): Set the process-wide identifier if the initialization parameters have it. Cocoa ASSERTS it exists; non-Cocoa platforms will have to figure this out soon. * Shared/ChildProcess.h: * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::getProcessIdentifier): * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::getLaunchOptions): * UIProcess/ChildProcessProxy.h: (WebKit::ChildProcessProxy::coreProcessIdentifier const): * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): 2017-12-28 Yusuke Suzuki Remove std::chrono if it is not used for ArgumentCoder or PersistentCoder https://bugs.webkit.org/show_bug.cgi?id=181174 Reviewed by Konstantin Tokarev. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::retrieve): * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::initialize): * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::log const): (WebKit::ViewGestureController::SnapshotRemovalTracker::start): * UIProcess/Cocoa/ViewGestureController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::loadCommitTime const): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::registerWithStateDumper): 2017-12-24 David Kilzer WebKit fixes to enable -Wstrict-prototypes for Safari Reviewed by Dan Bernstein. * Shared/API/c/WKGeometry.cpp: (WKSizeGetTypeID): (WKPointGetTypeID): (WKRectGetTypeID): * Shared/API/c/WKGeometry.h: (WKSizeGetTypeID): (WKPointGetTypeID): (WKRectGetTypeID): * Shared/API/c/WKImage.cpp: (WKImageGetTypeID): * Shared/API/c/WKImage.h: (WKImageGetTypeID): - Add 'void' to C function declarations and implementations as necessary. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: - Add 'void' to block declarations as necessary. 2017-12-24 David Kilzer REGRESSION (r224313): Fix build warning when compiling WebKit.xcassets Reviewed by Dan Bernstein. Fixes the following build warning: Opensource/Source/WebKit/WebKit.xcassets: warning: Failed to read file attributes for "Opensource/Source/WebKit/WebKit.xcassets" Failure Reason: No such file or directory * WebKit.xcodeproj/project.pbxproj: Fix relative path with case-insensitive filesystem and repository name assumptions. 2017-12-22 Jeff Miller Update user-visible copyright strings to include 2018 https://bugs.webkit.org/show_bug.cgi?id=181141 Reviewed by Dan Bernstein. * Info.plist: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: * StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: 2017-12-22 Jeff Miller Allow WebsitePolicies API object to be bridged to _WKWebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=181135 Reviewed by Dan Bernstein. _WKWebsitePolicies already wraps WebsitePolicies, we just never hooked this up in newObject(). * Shared/Cocoa/APIObject.mm: (API::Object::newObject): 2017-12-22 Wenson Hsieh Fix build failures due to using deprecated AppKit symbols https://bugs.webkit.org/show_bug.cgi?id=181110 Reviewed by Dan Bernstein and Tim Horton. See WebCore ChangeLog for more details. * Shared/mac/PasteboardTypes.mm: (WebKit::PasteboardTypes::forEditing): (WebKit::PasteboardTypes::forURL): (WebKit::PasteboardTypes::forImages): (WebKit::PasteboardTypes::forImagesWithArchive): (WebKit::PasteboardTypes::forSelection): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): (WebKit::WebViewImpl::setIntrinsicContentSize): (WebKit::WebViewImpl::writeSelectionToPasteboard): (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes): (WebKit::WebViewImpl::validateUserInterfaceItem): (WebKit::WebViewImpl::performDragOperation): (WebKit::WebViewImpl::setFileAndURLTypes): (WebKit::WebViewImpl::setPromisedDataForImage): (WebKit::WebViewImpl::setPromisedDataForAttachment): (WebKit::WebViewImpl::provideDataForPasteboard): * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _drawPDFDocument:page:atPoint:]): (-[WKPrintingView _drawPreview:]): * UIProcess/mac/WKSharingServicePickerDelegate.mm: (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKMenuTarget forwardContextMenuAction:]): (WebKit::WebContextMenuProxyMac::createContextMenuItem): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::searchTheWeb): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::drawPDFPage): 2017-12-22 Chris Dumez [Service Workers] Implement "Soft Update" algorithm https://bugs.webkit.org/show_bug.cgi?id=180702 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-12-22 Michael Catanzaro [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds https://bugs.webkit.org/show_bug.cgi?id=179914 Unreviewed. I messed up a last-minute change, and inverted the conditional that determines whether to use the version script. I did test this change to ensure that it worked properly by checking that the library size was correct, but only in non-developer mode. My test was thwarted by -fvisibility=hidden. It looks like so few internal symbols are exported that missing the version script had little impact on the size of the resulting libraries. That's good, I suppose. * PlatformGTK.cmake: * PlatformWPE.cmake: 2017-12-22 Michael Catanzaro [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds https://bugs.webkit.org/show_bug.cgi?id=179914 Reviewed by Carlos Garcia Campos. Mark a few InjectedBundle symbols with default visibility, so they don't get hidden by -fvisibility=hidden. Also, remove Windows conditionals, since Windows is not supported by any GLib ports. Also, move the symbols map to here, and share it between WPE and GTK. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformWPE.cmake: * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h: * WebProcess/InjectedBundle/API/glib/WebKitInjectedBundleMain.cpp: * webkitglib-symbols.map: Renamed from Source/cmake/gtksymbols.filter. 2017-12-21 Michael Catanzaro [WPE][GTK] Deprecate and replace webkit_form_submission_request_get_text_fields https://bugs.webkit.org/show_bug.cgi?id=176725 Reviewed by Carlos Garcia Campos. The problem is this function returns results in a GHashTable, but many fields can have the same name, or no name at all, and those fields are currently just dropped. It's impossible to fix, since the GHashTable is part of the API, so deprecate it and add a new function that returns two GPtrArrays instead. * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp: (webkitFormSubmissionRequestCreate): (webkit_form_submission_request_get_text_fields): (webkit_form_submission_request_list_text_fields): * UIProcess/API/gtk/WebKitFormSubmissionRequest.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitFormSubmissionRequest.h: 2017-12-21 Youenn Fablet ServiceWorkerThreadProxy should set the correct cookie and cache partitioning options https://bugs.webkit.org/show_bug.cgi?id=181000 Reviewed by Chris Dumez. Update Service Worker WebPreferencesStore based on the first web page added. This allows having the right storage blocking policy. Storing that policy in the context manager to set it properly when creating a new service worker thread proxy. Set up correctly partitioning parameters in the dummy Document used by the service worker. * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::updatePreferencesStore): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): (WebKit::WebProcessPool::pageAddedToProcess): * UIProcess/WebProcessPool.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::getAuthenticationInfo): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updatePreferencesStore): (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-21 Dan Bernstein WKPreferences doesn’t expose editable link behavior https://bugs.webkit.org/show_bug.cgi?id=181111 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKPreferences.mm: (toAPI): Added. Converts WebCore::EditableLinkBehavior to _WKEditableLinkBehavior. (toEditableLinkBehavior): Added. Converts the other way. (-[WKPreferences _editableLinkBehavior]): Added this getter. (-[WKPreferences _setEditableLinkBehavior:]): Ditto. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared new property. 2017-12-21 Andy Estes Address additional review feedback after r226182. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentRequest): 2017-12-21 Jeremy Jones Update FULLSCREEN_API feature defines. https://bugs.webkit.org/show_bug.cgi?id=181015 Reviewed by Tim Horton. Change enabled iphone sdk for FULLSCREEN_API. * Configurations/FeatureDefines.xcconfig: 2017-12-21 John Wilander Storage Access API: Make DocumentLoader::willSendRequest() and WebFrameLoaderClient::detachedFromParent2() tell the network process to get rid of any sub frame access entries https://bugs.webkit.org/show_bug.cgi?id=180728 Reviewed by Youenn Fablet. This change calls the network process to clear any storage access entries when a subframe navigates or is detached. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::removeStorageAccess): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::removeStorageAccess): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::removeStorageAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::hasStorageAccess): (WebKit::WebsiteDataStore::requestStorageAccess): (WebKit::WebsiteDataStore::removeStorageAccess): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::detachedFromParent2): (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-12-21 Jeremy Jones Second Build fix after r226223 https://bugs.webkit.org/show_bug.cgi?id=181089 Unreviewed. * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::setInlineRect): (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): 2017-12-21 Jer Noble Add initial DOM support for Media Capabilities https://bugs.webkit.org/show_bug.cgi?id=181064 Reviewed by Eric Carlson. Add a new preference to enable the (disabled-by-default) Media Capabilities API. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMediaCapabilitiesEnabled): (WKPreferencesGetMediaCapabilitiesEnabled): * UIProcess/API/C/WKPreferencesRef.h: 2017-12-21 Keith Rollin Add optional logging of per-resource cookie information https://bugs.webkit.org/show_bug.cgi?id=180883 Reviewed by Brent Fulgham. In order to support the tracking of the efficacy of Intelligent Tracking Protection, add some logging of the cookie information associated with each loaded resource. This logging is off by default and is enabled with `defaults write -g WebKitLogCookieInformation -bool true`. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::shouldLogCookieInformation const): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::sendResultForCacheEntry): (WebKit::NetworkResourceLoader::shouldLogCookieInformation const): (WebKit::NetworkResourceLoader::logCookieInformation const): * NetworkProcess/NetworkResourceLoader.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2017-12-21 Brent Fulgham Unreviewed Debug build fix after r226217 * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: 2017-12-21 Jeremy Jones Element fullscreen interface should display the location https://bugs.webkit.org/show_bug.cgi?id=181006 rdar://problem/36143176 Reviewed by Simon Fraser. Show a short user visible location string with a lock if secure and green when trusted. Includes other interface cleanup and tweaks. * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: (-[_WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]): (-[_WKFullScreenViewController visualEffectViewWithFrame:]): (mirrorEdgeInsets): (-[_WKFullScreenViewController _updateLayoutMargins]): (-[_WKFullScreenViewController viewDidLayoutSubviews]): (-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]): (-[_WKFullScreenViewController createSubviews]): (-[_WKFullScreenViewController loadView]): (-[_WKFullScreenViewController viewDidAppear:]): (-[_WKFullScreenViewController hideCancelButton]): (-[_WKFullScreenViewController showCancelButton:]): (-[_WKFullscreenRootViewController setShowsStatusBar:]): (-[_WKFullscreenRootViewController prefersStatusBarHidden]): (-[WKFullScreenWindowController _invalidateEVOrganizationName]): (-[WKFullScreenWindowController isSecure]): (-[WKFullScreenWindowController _serverTrust]): (-[WKFullScreenWindowController _EVOrganizationName]): (-[WKFullScreenWindowController updateLocationInfo]): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[_WKFullScreenViewController prefersStatusBarHidden]): Deleted. * WebKit.xcassets/Done.imageset/Contents.json: Removed. * WebKit.xcassets/LockMini.imageset/Contents.json: Added. * WebKit.xcassets/LockMini.imageset/NavigationBarLockMini@2x.pdf: Copied from Source/WebKit/WebKit.xcassets/Done.imageset/Done.pdf. * WebKit.xcassets/LockMini.imageset/NavigationBarLockMini@3x.pdf: Renamed from Source/WebKit/WebKit.xcassets/Done.imageset/Done.pdf. 2017-12-21 Jeremy Jones Enable picture-in-picture from inline element on suspend. https://bugs.webkit.org/show_bug.cgi?id=180942 rdar://problem/34745234 Reviewed by Jer Noble. Add support for video fullscreen standby and imporved fullscreen state transition process. Video fullscreen standby allows a video element to have its fullscreen interface state created and continuously updated so that it can quickly change presentation state on application state. In order to accomplish this, this change allows the fullscreen presentation to decide when it needs an updated inline rect, or the presence of the video layer. This is conditionalized until mac supports this model. * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenModelContext::requestUpdateInlineRect): (WebKit::VideoFullscreenModelContext::requestVideoContentLayer): (WebKit::VideoFullscreenModelContext::returnVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::VideoFullscreenManagerProxy::setInlineRect): (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::requestUpdateInlineRect): (WebKit::VideoFullscreenManagerProxy::requestVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::returnVideoContentLayer): * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::didEnterFullScreen): (WebKit::WebFullScreenManager::willExitFullScreen): * WebProcess/FullScreen/WebFullScreenManager.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::supportsVideoFullscreenStandby): (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/cocoa/VideoFullscreenManager.h: (WebKit::VideoFullscreenInterfaceContext::fullscreenStandby const): (WebKit::VideoFullscreenInterfaceContext::setFullscreenStandby): * WebProcess/cocoa/VideoFullscreenManager.messages.in: * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::supportsVideoFullscreenStandby const): (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::requestUpdateInlineRect): (WebKit::VideoFullscreenManager::requestVideoContentLayer): (WebKit::VideoFullscreenManager::returnVideoContentLayer): (WebKit::VideoFullscreenManager::didSetupFullscreen): (WebKit::VideoFullscreenManager::didExitFullscreen): (WebKit::VideoFullscreenManager::didCleanupFullscreen): 2017-12-20 Eric Carlson [MediaStream] Add screen capture IDL and stub functions https://bugs.webkit.org/show_bug.cgi?id=181070 Reviewed by Youenn Fablet. * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _screenCaptureEnabled]): (-[WKPreferences _setScreenCaptureEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-12-20 Youenn Fablet Crash when clearing std::optional https://bugs.webkit.org/show_bug.cgi?id=181061 Reviewed by Alex Christensen. * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didFinishBlobLoading): moving the object to not destroy 'this' too soon. 2017-12-20 Youenn Fablet Support service worker interception of request with blob body https://bugs.webkit.org/show_bug.cgi?id=181035 Reviewed by Chris Dumez. In case of service worker, remove the connection check to get access to the blob registry. Apply this for cloning blobs registered by another process. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURL): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerBlobURL): 2017-12-20 Daniel Bates Remove Alternative Presentation Button https://bugs.webkit.org/show_bug.cgi?id=180500 Reviewed by Simon Fraser. We no longer need the alternative presentation button. * Configurations/FeatureDefines.xcconfig: * UIProcess/API/APIUIClient.h: (API::UIClient::didClickAlternativePresentationButton): Deleted. * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleAutoFillButtonClick): (WebKit::WebPageProxy::handleAlternativePresentationButtonClick): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: (API::InjectedBundle::PageUIClient::didClickAutoFillButton): (API::InjectedBundle::PageUIClient::didClickAlternativePresentationButton): Deleted. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame substituteElements:withAlternativePresentationButtonWithIdentifier:]): Deleted. (-[WKWebProcessPlugInFrame removeAlternativePresentationButton:]): Deleted. (-[WKWebProcessPlugInFrame elementsReplacedByAlternativePresentationButtonWithIdentifier:]): Deleted. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleFrameFocus): (WKBundleSubstituteWithAlternativePresentationButton): Deleted. (WKBundleRemoveAlternativePresentationButton): Deleted. (WKBundleElementsReplacedByAlternativePresentationButton): Deleted. * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h: * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::didClickAlternativePresentationButton): Deleted. * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleAlternativePresentationButtonClick): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-12-20 Andy Estes [Apple Pay] Tell PassKit whether Apple Pay JS or Payment Request was used to start an Apple Pay session https://bugs.webkit.org/show_bug.cgi?id=181001 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toAPIType): (WebKit::toPKPaymentRequest): 2017-12-20 Ms2ger REGRESSION(r226160) Build broken when MEDIA_STREAM is disabled with MediaStreamRequest namespace confusion https://bugs.webkit.org/show_bug.cgi?id=181026 Unreviewed build fix. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Remove UNUSED_PARAM macros that check for (undefined) members rather than params. 2017-12-19 Myles C. Maxfield Refactor user-installed font setting for clarity https://bugs.webkit.org/show_bug.cgi?id=181013 Reviewed by Simon Fraser. There are no clients of this SPI yet, so we can rename it to remove the grammatical negative. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetShouldAllowUserInstalledFonts): (WKPreferencesGetShouldAllowUserInstalledFonts): (WKPreferencesSetShouldDisallowUserInstalledFonts): Deleted. (WKPreferencesGetShouldDisallowUserInstalledFonts): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _shouldAllowUserInstalledFonts]): (-[WKPreferences _setShouldAllowUserInstalledFonts:]): (-[WKPreferences _shouldDisallowUserInstalledFonts]): Deleted. (-[WKPreferences _setShouldDisallowUserInstalledFonts:]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-12-19 Eric Carlson [MediaStream] Clean up RealtimeMediaSource interfaces https://bugs.webkit.org/show_bug.cgi?id=180934 Reviewed by Youenn Fablet. * Shared/WebCoreArgumentCoders.h: Update CaptureDevice encoder. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Renamed from createRequest. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Update for API change. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Filter the vector returned by getMediaStreamDevices. (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): Update for API change. (WebKit::UserMediaPermissionRequestProxy::allow): Ditto. * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::requestType const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Ditto. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): m_blockedRequests -> m_blockedUserMediaRequests. (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest): Ditto. (WebKit::UserMediaPermissionRequestManager::mediaCanStart): Ditto. (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Ditto. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: 2017-12-19 Jer Noble Playing media elements which call "pause(); play()" will have the play promise rejected. https://bugs.webkit.org/show_bug.cgi?id=180781 Reviewed by Eric Carlson. shouldRequireUserGestureToLoadVideo() should default to false on Mac. * UIProcess/API/Cocoa/WKWebView.mm: (shouldRequireUserGestureToLoadVideo): 2017-12-19 Chris Dumez Handle Fetch should wait for the service worker's state to become activated https://bugs.webkit.org/show_bug.cgi?id=180959 Reviewed by Youenn Fablet. Handle Fetch should wait for the service worker's state to become activated when it is currently activating. Specification: - https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (Step 16) * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): 2017-12-19 Youenn Fablet Service Worker should not clean HTTP headers added by the application or by fetch specification before service worker interception https://bugs.webkit.org/show_bug.cgi?id=180939 Reviewed by Chris Dumez. Passing referrer as an explicit parameter of StartFetch. Cleaning request headers based on ResourceLoaderOptions.httpHeadersToKeep. * 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/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-19 Andy Estes [Apple Pay] Stop maintaining a list of payment networks https://bugs.webkit.org/show_bug.cgi?id=180965 Reviewed by Tim Horton. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: Defined availablePaymentNetworks. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toSupportedNetworks): (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks): Called +[PKPaymentRequest availableNetworks]. (WebKit::toSupportedNetwork): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): Set parameters.availablePaymentNetworks by calling WebPaymentCoordinatorProxy::availablePaymentNetworks. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Set pageConfiguration.availablePaymentNetworks to parameters.availablePaymentNetworks. 2017-12-18 Brady Eidson Add ability to API test Service Workers via a custom protocol. https://bugs.webkit.org/show_bug.cgi?id=180911 Reviewed by Chris Dumez. This adds a set of "Service Workers can handle this" schemes to the scheme registry and most of these WebKit changes are to support getting those values out to all processes. Additionally, WebsiteDataRecords used to be file/http(s)-only. That seems bizarre and definitely got in the way of testing. So I also added a way to allow any scheme to result in a valid record. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::registerURLSchemeServiceWorkersCanHandle const): * Shared/ChildProcess.h: * Shared/ChildProcess.messages.in: * Shared/Storage/StorageProcessCreationParameters.cpp: (WebKit::StorageProcessCreationParameters::encode const): (WebKit::StorageProcessCreationParameters::decode): * Shared/Storage/StorageProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::initializeWebsiteDataStore): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _registerURLSchemeServiceWorkersCanHandle:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore _allowWebsiteDataRecordsForAllOrigins]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::allowWebsiteDataRecordsForAllOrigins): (WebKit::WebsiteDataStore::fetchDataAndApply): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-12-18 Brady Eidson Apps that use both WK1 and WK2 can crash creating a WKWebsiteDataStore. https://bugs.webkit.org/show_bug.cgi?id=180953 Reviewed by Chris Dumez. * UIProcess/WebsiteData/WebsiteDataStore.cpp: Make an isMainThread() asset be an isUIThread() assert. 2017-12-18 Brent Fulgham [macOS, iOS] Add new mach lookup port for CoreMedia remote control https://bugs.webkit.org/show_bug.cgi?id=180938 Reviewed by Eric Carlson. Update the app sandbox to support a new XPC endpoint for CoreMedia. This endpoint exposes existing functions through a new, more-focused interface. This will (hopefully) allow us to remove the more generic endpoints in a future update. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2017-12-18 Megan Gardner Support Autoscrolling in contenteditable for WK2 https://bugs.webkit.org/show_bug.cgi?id=180789 Reviewed by Simon Frasier and Wenson Hsieh. Implements the UIKit protocol for autoscrolling and alerts the Web Process to start (or stop) an autoscroll to the specified position. Allows for scrolling in contenteditable in WebKit2. * Platform/spi/ios/UIKitSPI.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView startAutoscroll:]): (-[WKContentView cancelAutoscroll]): (-[WKContentView scrollSelectionToVisible:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAutoscrollAtPosition): (WebKit::WebPageProxy::cancelAutoscroll): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::startAutoscrollAtPosition): (WebKit::WebPage::cancelAutoscroll): 2017-12-18 Youenn Fablet Add support for response blob given to fetch events https://bugs.webkit.org/show_bug.cgi?id=180894 Reviewed by Darin Adler. In case of blob data, read it from Service Worker process and send it to WebProcess. At some point, web process should be able to read it directly from NetworkProcess. * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient): (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData): (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk): (WebKit::WebServiceWorkerFetchTaskClient::didFinishBlobLoading): (WebKit::WebServiceWorkerFetchTaskClient::didFinish): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: 2017-12-18 Daniel Bates Add SPI to query for the current and last auto fill button type and pass user data object to _webView:focusShouldStartInputSession: https://bugs.webkit.org/show_bug.cgi?id=180774 Reviewed by Tim Horton. Have WKFocusedElementInfo own the optional user data object associated with the focused element as opposed to having WKFormInputSession own it. This allows the Injected Bundle's _webView:focusShouldStartInputSession: delegate callback to make use of this user data to determine whether focus should start a new input session. * UIProcess/API/Cocoa/_WKFocusedElementInfo.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession initWithContentView:focusedElementInfo:]): (-[WKFormInputSession userObject]): (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): (-[WKFocusedElementInfo userObject]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): (-[WKFormInputSession initWithContentView:focusedElementInfo:userObject:]): Deleted. (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:]): Deleted. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (toWKAutoFillButtonType): (-[WKWebProcessPlugInNodeHandle htmlInputElementAutoFillButtonType]): (-[WKWebProcessPlugInNodeHandle htmlInputElementLastAutoFillButtonType]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: (toWKAutoFillButtonType): (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonType): (WKBundleNodeHandleGetHTMLInputElementLastAutoFillButtonType): * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonType const): (WebKit::InjectedBundleNodeHandle::htmlInputElementLastAutoFillButtonType const): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: 2017-12-18 Carlos Garcia Campos [GTK][WPE] Add WebKitWebView::web-process-terminated signal and deprecate web-process-crashed https://bugs.webkit.org/show_bug.cgi?id=180862 Reviewed by Michael Catanzaro. Once the memory pressure web process monitor is enabled in bug #180861 the web process can be killed due to memory limits. We need to expose the reason of the web process termination to allow applications handle the memory limit case. * UIProcess/API/glib/WebKitNavigationClient.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): (webkitWebViewWebProcessTerminated): (webkitWebViewWebProcessCrashed): Deleted. * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitWebView.h: 2017-12-18 Carlos Garcia Campos [GTK][WPE] Enable WebProcess memory monitor https://bugs.webkit.org/show_bug.cgi?id=180861 Reviewed by Michael Catanzaro. For some reason this is only enabled in mac. We want to enable it also in GTK and WPE ports. This runs every 30 seconds to release memory or even kill the process if necessary. Carlos López has realized that in some applications using video tags, the memory grows a lot and it's never released. It seems it's not memory leaked, but simply large memory allocations (I guess it's gst allocating video frames) that make the heap grow. The memory pressure calls malloc_trim that releases all that memory keeping the web process footprint stable. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-12-17 John Wilander Storage Access API: Make document.hasStorageAccess() retrieve current status from the network process https://bugs.webkit.org/show_bug.cgi?id=180681 Reviewed by Alex Christensen. This change makes an asynchronous request to the network process to see if storage access has been granted for this frame, on this page, for this domain. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains): (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::hasStorageAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler): (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): (WebKit::WebsiteDataStore::hasStorageAccess): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::hasStorageAccess): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::hasStorageAccess): * WebProcess/WebPage/WebPage.h: 2017-12-16 Dan Bernstein WKWebView has no equivalent of -[WebView setAlwaysShowVerticalScroller:] https://bugs.webkit.org/show_bug.cgi?id=180613 Reviewed by Geoff Garen. Added _alwaysShowsHorizontalScroller and _alwaysShowsVerticalScroller properties to WKWebView. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): Encode new alwaysShowsHorizontalScroller and alwaysShowsVerticalScroller parameters. (WebKit::WebPageCreationParameters::decode): Decode new parameters. * Shared/WebPageCreationParameters.h: Added new alwaysShowsHorizontalScroller and alwaysShowsVerticalScroller boolean parameters. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _alwaysShowsHorizontalScroller]): New accessor that calls through to the WebPageProxy. (-[WKWebView _setAlwaysShowsHorizontalScroller:]): Ditto. (-[WKWebView _alwaysShowsVerticalScroller]): Ditto. (-[WKWebView _setAlwaysShowsVerticalScroller:]): Ditto. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declare new properties. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller): Update member variable and send a message to the page. (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller): Ditto. (WebKit::WebPageProxy::creationParameters): Initialize new parameters from the new member variables. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::alwaysShowsHorizontalScroller const): New getter. (WebKit::WebPageProxy::alwaysShowsVerticalScroller const): Ditto. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Factor alwaysShowsHorizontalScroller and alwaysShowsVerticalScroller into the initial scroller modes and scroller locks when creating the FrameView. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Initialize new m_alwaysShowsHorizontalScroller and m_alwaysShowsVerticalScroller member variables from the corresponding new creation parameters. (WebKit::WebPage::setAlwaysShowsHorizontalScroller): Update the member variable and set new scrollbar mode on the frame view if needed. (WebKit::WebPage::setAlwaysShowsVerticalScroller): Ditto. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::alwaysShowsHorizontalScroller const): New getter. (WebKit::WebPage::alwaysShowsVerticalScroller const): Ditto. * WebProcess/WebPage/WebPage.messages.in: Added new messages. 2017-12-16 Brady Eidson Implement getting ServiceWorker registrations for the WKWebsiteDataStore API https://bugs.webkit.org/show_bug.cgi?id=180886 Reviewed by Chris Dumez. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::fetchWebsiteData): 2017-12-16 Brent Fulgham Plugin processes are repeatedly spun up to do nothing https://bugs.webkit.org/show_bug.cgi?id=180885 Reviewed by Geoffrey Garen. Tested by TestWebKitAPI. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): Don't ask plugins to remove data when no websites are passed to the function. 2017-12-15 Chris Dumez Support updating a service worker registration's updateViaCache flag https://bugs.webkit.org/show_bug.cgi?id=180888 Reviewed by Brady Eidson. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::setRegistrationUpdateViaCache): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-12-15 Alex Christensen Introduce SPI _WKWebsitePolicies.websiteDataStore https://bugs.webkit.org/show_bug.cgi?id=180880 Reviewed by Andy Estes. The SPI doesn't do anything yet, but it already has some restrictions and tests! WKWebView._updateWebsitePolicies can't be used to update a WKWebsiteDataStore. Only during navigation. Even during navigation, we are only supporting the default and ephemeral data stores right now. This functionality won't be supported in the C API. This is enforced with RELEASE_ASSERTs. If we change our minds, we can change them and add restrictions similar to the ObjC restrictions. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.cpp: (API::WebsitePolicies::WebsitePolicies): (API::WebsitePolicies::setWebsiteDataStore): (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/C/WKFramePolicyListener.cpp: (WKFramePolicyListenerUseWithPolicies): * UIProcess/API/C/WKPage.cpp: (WKPageUpdateWebsitePolicies): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateWebsitePolicies:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies websiteDataStore]): (-[_WKWebsitePolicies setWebsiteDataStore:]): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): 2017-12-15 Alex Christensen Fix GTK build. * UIProcess/API/glib/WebKitPolicyDecision.cpp: (webkit_policy_decision_use): 2017-12-15 Brent Fulgham Avoid waking plugin process up unnecessarily https://bugs.webkit.org/show_bug.cgi?id=180819 Reviewed by Geoffrey Garen. WebKit purges data from origins marked as prevalent on an hourly interval. This includes waking up plugins and removing relevant data stored in those plugins. This causes multiple plugin processes to be spawned, even though the user is not interacting with any plugins. Instead, we should delay removing data from plugins until they are loaded due to the user interacting with a website using a plugin. Make the following changes: 1. When looking for plugin data related to prevalent sites, only examine plugin data if the relevant plugin is already running. 2. When the state of the active plugins changes, trigger a data removal check. * Shared/WebsiteData/WebsiteDataFetchOption.h: Add a new option 'DoNotCreateProcesses' * UIProcess/Plugins/PluginProcessManager.cpp: (WebKit::PluginProcessManager::getPluginProcessConnection): Pass new argument 'Launch', since we always want to launch processes in this case. (WebKit::PluginProcessManager::fetchWebsiteData): Pass a new parameter 'processAccessType' so that the caller can specify if they only want to examine already-active plugins, or if they want to spawn new processes. Call the completion handler if we need to exit early when no process exists. (WebKit::PluginProcessManager::deleteWebsiteData): Always launch new processes. (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames): Ditto. (WebKit::PluginProcessManager::getOrCreatePluginProcess): Accept new parameter indicating if new processes shoudl be launched. Also switch to C++ style loops. * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Use the new 'DoNotCreatePrcesses' access type. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Update the active plugin count when we remove data. (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords const): Return true if the active plugin process count changed since the last time data was removed. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataAndApply): Check fetch option for new 'DoNotCreateProcesses' flag, and tell the PluginProcessManager which mode we are using. 2017-12-15 Brady Eidson Make sure only WebsiteDataStores with valid SessionIDs register themselves. https://bugs.webkit.org/show_bug.cgi?id=180869 Reviewed by Chris Dumez. Some code in WebsiteDataStore assumes an invalid SessionID is a possibility, but we didn't account for that in the map added in r225935. Seems prudent to make sure we're not doing hash table operations with invalid keys. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): (WebKit::WebsiteDataStore::maybeRegisterWithSessionIDMap): (WebKit::WebsiteDataStore::existingNonDefaultDataStoreForSessionID): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-12-14 Simon Fraser Rotating when zoomed in with fingers down can result in a broken tab https://bugs.webkit.org/show_bug.cgi?id=180859 rdar://problem/34532817 Reviewed by Tim Horton. If you zoom in fully, then, with two fingers down, rotate the iPhone and rotate back, then the tab can get into a broken state where the WKContentView has a non-zero position which may push it entirely off-screen. The tab never recovers. This is caused by a bug in UIKit (rdar://problem/36065495) so work around it by always re-setting the position of the content view after zooming. We initialize contentView.frame from self.bounds, so setting the position (via "center") to the bounds origin should always be safe. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): 2017-12-15 Brady Eidson API test WebKit.WebsiteDataStoreCustomPaths is failing https://bugs.webkit.org/show_bug.cgi?id=180870 Reviewed by Chris Dumez. To avoid unintentionally creating the default WebsiteDataStore we need to pass around the relevant SessionID to more places. * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::start): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getStorageProcessConnection): (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getStorageProcessConnection): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::messageSenderConnection): * WebProcess/Databases/WebDatabaseProvider.cpp: (WebKit::WebDatabaseProvider::idbConnectionToServerForSession): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): (WebKit::WebServiceWorkerProvider::handleFetch): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureWebToStorageProcessConnection): (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-12-15 Alex Christensen Move WebKit::WebsitePolicies to API::WebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=180873 Reviewed by Joseph Pecoraro. It's just an API data object now. I need it to be in the API namespace so we can give it references to other API namespace objects without weird layering violations. * CMakeLists.txt: * Shared/WebsiteAutoplayPolicy.h: Added. * Shared/WebsiteAutoplayQuirk.h: Added. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::fromWebsitePolicies): Deleted. * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.cpp: Added. (API::WebsitePolicies::~WebsitePolicies): (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: Copied from Source/WebKit/UIProcess/WebsitePolicies.h. * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKFramePolicyListener.cpp: (WKFramePolicyListenerUseWithPolicies): * UIProcess/API/C/WKPage.cpp: (WKPageUpdateWebsitePolicies): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesGetTypeID): (WKWebsitePoliciesCreate): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateWebsitePolicies:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies dealloc]): (-[_WKWebsitePolicies init]): * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: (WebKit::wrapper): Deleted. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/WebFormSubmissionListenerProxy.cpp: * UIProcess/WebsitePolicies.h: Removed. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: 2017-12-14 Zan Dobersek Unreviewed GTK+ build fix after r225954. * UIProcess/API/glib/WebKitPolicyDecision.cpp: Explicitly include the WebsitePoliciesData.h header, avoiding build failures due to incomplete WebsitePoliciesData type. 2017-12-14 David Kilzer Enable -Wstrict-prototypes for WebKit Rubber-stamped by Joseph Pecoraro. * Configurations/Base.xcconfig: (CLANG_WARN_STRICT_PROTOTYPES): Add. Set to YES. * Platform/spi/ios/UIKitSPI.h: (_UIDragInteractionDefaultLiftDelay): Add 'void' to C function declaration. (UIKeyboardEnabledInputModesAllowOneToManyShortcuts): Ditto. 2017-12-14 Alex Christensen Serialize WebsitePoliciesData instead of WebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=180847 Reviewed by Joseph Pecoraro. No change in behavior. This will allow me to add things to WebsitePolicies that have a different form when serialized to another process. Also, remove API::WebsitePolicies because the wrapper isn't necessary. WebsitePolicies is now the API type that only exists in the UIProcess. * Shared/WebsitePolicies.cpp: Removed. * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::contentBlockersEnabled const): Deleted. (WebKit::WebsitePolicies::setContentBlockersEnabled): Deleted. (WebKit::WebsitePolicies::allowedAutoplayQuirks const): Deleted. (WebKit::WebsitePolicies::setAllowedAutoplayQuirks): Deleted. (WebKit::WebsitePolicies::autoplayPolicy const): Deleted. (WebKit::WebsitePolicies::setAutoplayPolicy): Deleted. (WebKit::WebsitePolicies::customHeaderFields): Deleted. (WebKit::WebsitePolicies::takeCustomHeaderFields): Deleted. (WebKit::WebsitePolicies::setCustomHeaderFields): Deleted. * Shared/WebsitePoliciesData.cpp: Copied from Source/WebKit/Shared/WebsitePolicies.cpp. (WebKit::WebsitePoliciesData::fromWebsitePolicies): (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): (WebKit::WebsitePoliciesData::applyToDocumentLoader): (WebKit::WebsitePolicies::WebsitePolicies): Deleted. (WebKit::WebsitePolicies::encode const): Deleted. (WebKit::WebsitePolicies::decode): Deleted. (WebKit::WebsitePolicies::applyToDocumentLoader): Deleted. * Shared/WebsitePoliciesData.h: Added. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::decidePolicyForNavigationAction): (API::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/API/APIPolicyClient.h: (API::PolicyClient::decidePolicyForNavigationAction): (API::PolicyClient::decidePolicyForNewWindowAction): (API::PolicyClient::decidePolicyForResponse): * UIProcess/API/APIWebsitePolicies.cpp: Removed. * UIProcess/API/APIWebsitePolicies.h: Removed. * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKFramePolicyListener.cpp: (WKFramePolicyListenerUse): (WKFramePolicyListenerUseWithPolicies): * UIProcess/API/C/WKPage.cpp: (WKPageUpdateWebsitePolicies): (WKPageSetPagePolicyClient): (WKPageSetPageNavigationClient): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesGetTypeID): (WKWebsitePoliciesCreate): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateWebsitePolicies:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies dealloc]): (-[_WKWebsitePolicies init]): * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: (WebKit::wrapper): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/WebFrameListenerProxy.cpp: (WebKit::WebFrameListenerProxy::receivedPolicyDecision): * UIProcess/WebFrameListenerProxy.h: * UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::use): (WebKit::WebFramePolicyListenerProxy::download): (WebKit::WebFramePolicyListenerProxy::ignore): * UIProcess/WebFramePolicyListenerProxy.h: * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::receivedPolicyDecision): * UIProcess/WebFrameProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::updateWebsitePolicies): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::applyToDocumentLoader): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): (WebKit::WebPage::updateWebsitePolicies): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-12-14 Ryan Haddad Unreviewed, rolling out r225931. Breaks internal builds. Reverted changeset: "Fix Mac CMake build" https://bugs.webkit.org/show_bug.cgi?id=180835 https://trac.webkit.org/changeset/225931 2017-12-14 Chris Dumez Clearing WebSite data on iOS does not clear the Fetch Cache https://bugs.webkit.org/show_bug.cgi?id=180846 Reviewed by Youenn Fablet. When clearing WebSite data, construct the engine for the given sessionID if missing, instead of not clearing anything when the engine is missing. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): 2017-12-14 Chris Dumez self.importScripts() should obey updateViaCache inside service workers https://bugs.webkit.org/show_bug.cgi?id=180826 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::setRegistrationLastUpdateTime): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-12-14 Yusuke Suzuki Drop Thread::tryCreate https://bugs.webkit.org/show_bug.cgi?id=180808 Reviewed by Darin Adler. We still return bool since IconDatabase::open returns `false` if it is opened twice. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::open): * UIProcess/API/glib/IconDatabase.h: 2017-12-14 Brady Eidson REGRESSION (r225789): API tests WKProcessPool.InitialWarmedProcessUsed and WebKit.WebsiteDataStoreCustomPaths are failing. https://bugs.webkit.org/show_bug.cgi?id=180722 Reviewed by Chris Dumez. - Add a test-only accessor to get the number of WebProcesses hosting WebPages - Have WebsiteDataStore keep track of all instances so they can be looked up by SessionID - When the StorageProcess needs to establish a SW context connection on behalf of a specific SessionID, the UI process will now prefer using the WebsiteDataStore associated with that SessionID. This allows us to continue deferring creation of the default data store if it's not needed. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::connectionToContextProcessWasClosed): (WebKit::StorageProcess::createServerToContextConnection): * StorageProcess/StorageProcess.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::establishSWServerConnection): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _webPageContentProcessCount]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess): (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): (WebKit::WebsiteDataStore::existingDataStoreForSessionID): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-12-14 John Wilander Storage Access API: Implement frame-specific access in the document.cookie layer https://bugs.webkit.org/show_bug.cgi?id=180682 Reviewed by Alex Christensen. CookiesStrategy::cookiesForDOM(), CookiesStrategy::setCookiesFromDOM(), CookiesStrategy::cookieRequestHeaderFieldValue(), and CookiesStrategy::getRawCookies() now take optional parameters for frameID and pageID to allow frame-specific scoping of cookies. This change makes the return values of FrameLoaderClient::frameID() and FrameLoaderClient::pageID() std::optional so that WebCore can call those getters and get the right return values in WebKit and std:nullopt in WebKitLegacy. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): (WebKit::NetworkConnectionToWebProcess::getRawCookies): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): Now handles the fact that FrameLoaderClient::frameID() and FrameLoaderClient::pageID() return an optional. * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::pageID const): (WebKit::WebFrameLoaderClient::frameID const): Now return an optional. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesForDOM): (WebKit::WebPlatformStrategies::setCookiesFromDOM): (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): (WebKit::WebPlatformStrategies::getRawCookies): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-12-14 Alex Christensen Fix Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=180835 Reviewed by Andy Estes. * PlatformMac.cmake: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::ephemeralParametersWithSessionID): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/APIAttachment.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPrivateBrowsingEnabled): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setSessionID): 2017-12-14 Alex Christensen Use move semantics for SandboxExtension::Handle https://bugs.webkit.org/show_bug.cgi?id=180792 Reviewed by Andy Estes. Passing them around as const SandboxExtension::Handle& is wrong because ownership is transferred and they are consumed. It only works now because their contents are mutable, which isn't a good use of mutable. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::decideDestinationWithSuggestedFilename): (WebKit::Download::didDecideDownloadDestination): * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueDecidePendingDownloadDestination): (WebKit::DownloadManager::resumeDownload): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): * NetworkProcess/Downloads/ios/DownloadIOS.mm: (WebKit::Download::resume): * NetworkProcess/Downloads/mac/DownloadMac.mm: (WebKit::Download::resume): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL): (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTask::setPendingDownloadLocation): * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation): * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::resumeDownload): (WebKit::NetworkProcess::continueDecidePendingDownloadDestination): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation): * Shared/SandboxExtension.h: (WebKit::SandboxExtension::create): * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::start): (WebKit::WebMemorySampler::initializeSandboxedLogFile): * Shared/WebMemorySampler.h: * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtension::create): * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): * StorageProcess/StorageProcess.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::performDragOperation): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dragEntered): (WebKit::WebPageProxy::dragUpdated): (WebKit::WebPageProxy::dragExited): (WebKit::WebPageProxy::performDragOperation): (WebKit::WebPageProxy::performDragControllerAction): * UIProcess/WebPageProxy.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::create): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: (WebKit::MediaDeviceSandboxExtensions::operator[]): (WebKit::MediaDeviceSandboxExtensions::operator[] const): Deleted. * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getPathnamesForType): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::goToItem): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): (WebKit::WebPage::reload): (WebKit::WebPage::performDragControllerAction): (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): (WebKit::WebPage::SandboxExtensionTracker::beginLoad): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::startMemorySampler): * WebProcess/WebProcess.h: 2017-12-14 Alex Christensen Make WebsitePolicies a proper class with getters and setters https://bugs.webkit.org/show_bug.cgi?id=180788 Reviewed by Andy Estes. Also introduce WebsitePolicies::applyToDocumentLoader to reduce duplicate code. This has a side-effect of now applying custom http header fields and content blocking enabled status when updating WebsitePolicies. This will result in these being applied when a user updates the per-site settings, and they weren't before. * CMakeLists.txt: * Shared/WebsitePolicies.cpp: Added. (WebKit::WebsitePolicies::WebsitePolicies): (WebKit::WebsitePolicies::encode const): (WebKit::WebsitePolicies::decode): (WebKit::WebsitePolicies::applyToDocumentLoader): * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::contentBlockersEnabled const): (WebKit::WebsitePolicies::setContentBlockersEnabled): (WebKit::WebsitePolicies::allowedAutoplayQuirks const): (WebKit::WebsitePolicies::setAllowedAutoplayQuirks): (WebKit::WebsitePolicies::autoplayPolicy const): (WebKit::WebsitePolicies::setAutoplayPolicy): (WebKit::WebsitePolicies::customHeaderFields): (WebKit::WebsitePolicies::takeCustomHeaderFields): (WebKit::WebsitePolicies::setCustomHeaderFields): (WebKit::WebsitePolicies::encode const): Deleted. (WebKit::WebsitePolicies::decode): Deleted. * UIProcess/API/APIWebsitePolicies.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::applyToDocumentLoader): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateWebsitePolicies): * WebProcess/WebPage/WebPage.h: 2017-12-14 Chris Dumez Enable Service Workers on iOS https://bugs.webkit.org/show_bug.cgi?id=180836 Reviewed by Alex Christensen. * Shared/WebPreferencesDefaultValues.h: * UIProcess/WebProcessPool.cpp: Enable Service Workers on iOS. (WebKit::WebProcessPool::ensureNetworkProcess): Fall back to defaultCacheStorageDirectory() instead of the empty string for the cache storage directory, when we do not have a store. 2017-12-14 Chris Dumez Service worker script fetching currently always uses the network cache https://bugs.webkit.org/show_bug.cgi?id=180816 Reviewed by Alex Christensen. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-12-14 Chris Dumez StorageProcess::deleteWebsiteData() should ensure there is a SWServer for the given sessionID https://bugs.webkit.org/show_bug.cgi?id=180784 Reviewed by Youenn Fablet. StorageProcess::deleteWebsiteData() should ensure there is a SWServer for the given sessionID instead of not clearing anything when no such SWServer exists. This will be useful on iOS once is fully fixed. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): 2017-12-14 Chris Dumez WebsiteDataStore::defaultDataStoreConfiguration() fails to set default value for serviceWorkerRegistrationDirectory https://bugs.webkit.org/show_bug.cgi?id=180794 Reviewed by Youenn Fablet. Set the default IndexedDB and ServiceWorker database paths in WebsiteDataStore::defaultDataStoreConfiguration(). Without this, the client is forced to set the expected path. * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultDataStoreConfiguration): * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: (API::WebsiteDataStore::defaultDataStoreConfiguration): 2017-12-14 Joseph Pecoraro Web Inspector: Cmd-Option-R in docked inspector causes the inspector to reload instead of the inspected page https://bugs.webkit.org/show_bug.cgi?id=180775 Reviewed by Brian Burg. * WebKit.xcodeproj/project.pbxproj: Remove old files add new files. * PlatformMac.cmake: * UIProcess/mac/WKWebInspectorWKWebView.h: Removed. * UIProcess/mac/WKWebInspectorWKWebView.mm: Removed. Remove unused WKWebInspectorWKWebView. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController dealloc]): (-[WKInspectorViewController webView]): (-[WKInspectorViewController inspectorWKWebViewReload:]): (-[WKInspectorViewController inspectorWKWebViewReloadFromOrigin:]): Handle WKWebView IBActions sent to the inspector frontend WKWebView. * UIProcess/mac/WKInspectorWKWebView.h: * UIProcess/mac/WKInspectorWKWebView.mm: (-[WKInspectorWKWebView tag]): (-[WKInspectorWKWebView inspectorWKWebViewDelegate]): (-[WKInspectorWKWebView setInspectorWKWebViewDelegate:]): (-[WKInspectorWKWebView reload:]): (-[WKInspectorWKWebView reloadFromOrigin:]): Move WKInspectorWKWebView into its own file. Include a delegate to handle reload IBActions that will want to override. 2017-12-13 Chris Dumez Fix copy/paste error in ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration() https://bugs.webkit.org/show_bug.cgi?id=180782 Reviewed by Youenn Fablet. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): 2017-12-13 Daniel Bates Add more auto fill button types https://bugs.webkit.org/show_bug.cgi?id=180651 And Reviewed by Brent Fulgham. Adds enumerators for the new auto fill button types. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (toAutoFillButtonType): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: (toAutoFillButtonType): * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: 2017-12-13 Matt Lewis Unreviewed, rolling out r225864. This caused the Layout test step to crash out on Debug testers Reverted changeset: "REGRESSION (r225789): API tests WKProcessPool.InitialWarmedProcessUsed and WebKit.WebsiteDataStoreCustomPaths are failing." https://bugs.webkit.org/show_bug.cgi?id=180722 https://trac.webkit.org/changeset/225864 2017-12-13 Brady Eidson REGRESSION (r225789): API tests WKProcessPool.InitialWarmedProcessUsed and WebKit.WebsiteDataStoreCustomPaths are failing. https://bugs.webkit.org/show_bug.cgi?id=180722 Reviewed by Chris Dumez. - Add a test-only accessor to get the number of WebProcesses hosting WebPages - Have WebsiteDataStore keep track of all instances so they can be looked up by SessionID - When the StorageProcess needs to establish a SW context connection on behalf of a specific SessionID, the UI process will now prefer using the WebsiteDataStore associated with that SessionID. This allows us to continue deferring creation of the default data store if it's not needed. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::connectionToContextProcessWasClosed): (WebKit::StorageProcess::createServerToContextConnection): * StorageProcess/StorageProcess.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::establishSWServerConnection): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _webPageContentProcessCount]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess): (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): (WebKit::WebsiteDataStore::existingDataStoreForSessionID): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-12-13 Per Arne Vollan REGRESSION(225597): Can't select a text box or web view on a page when VO is on. https://bugs.webkit.org/show_bug.cgi?id=180756 Reviewed by Brent Fulgham. * Platform/IPC/mac/ConnectionMac.mm: (IPC::AccessibilityProcessSuspendedNotification): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::shouldLeakBoost): * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeProcess): 2017-12-13 Brent Fulgham [iOS] Further Trim WebContent Process sandbox https://bugs.webkit.org/show_bug.cgi?id=180727 Reviewed by Eric Carlson. Take another pass over the contents of the file and remove addition items that don't have call sites in WebKit. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-12-13 Daniel Bates Move out-parameter in API::FormClient::willBeginInputSession() to the end of the parameter list https://bugs.webkit.org/show_bug.cgi?id=180754 Reviewed by Wenson Hsieh. Group all in-parameters in the signature of API::FormClient::willBeginInputSession() at the front of the parameter list instead of interspersing in- and out- parameters. No functionality changed. So, no new tests. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h: (API::InjectedBundle::FormClient::willBeginInputSession): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::elementDidFocus): 2017-12-13 Chris Dumez [iOS] Take process assertion to prevent the service worker process from getting suspended https://bugs.webkit.org/show_bug.cgi?id=180735 Reviewed by Brady Eidson. Take process assertion to prevent the service worker process from getting suspended while it is still needed. We use the same policy as for the network process, meaning that unsuspended WebContent processes prevent the service worker process from getting suspended. This patch still does not enable service workers on iOS. The demo at https://mdn.github.io/sw-test/ appears to work. However, things are not working as expected for mobile.twitter.com where I see the fetches intercepted by the service worker fail when offline for some reason (unrelated to process suspension). * UIProcess/WebProcessPool.cpp: (WebKit::m_foregroundWebProcessCounter): (WebKit::m_backgroundWebProcessCounter): (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::updateProcessAssertions): (WebKit::WebProcessPool::reinstateNetworkProcessAssertionState): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didSetAssertionState): * UIProcess/WebProcessProxy.h: 2017-12-13 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.3 release. * gtk/NEWS: Add release notes for 2.19.3. 2017-12-12 Daniel Bates [WK] Add modern WebKit SPI to set auto fill button type and query if the auto fill button is enabled https://bugs.webkit.org/show_bug.cgi?id=180686 Reviewed by Alex Christensen. * WebKit.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (-[WKWebProcessPlugInNodeHandle isHTMLInputElementAutoFillButtonEnabled]): (toAutoFillButtonType): (-[WKWebProcessPlugInNodeHandle setHTMLInputElementAutoFillButtonEnabledWithButtonType:]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h: 2017-12-12 John Wilander Storage Access API: Implement frame-specific access in the network storage session layer https://bugs.webkit.org/show_bug.cgi?id=180679 Reviewed by Alex Christensen. This changes adds frameID and pageID to what is communicated for storage access and also stored in the network process' table of partitioning exceptions. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): Now stores frameID and pageID for the task for easy retrieval in the HSTS checks. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): These two methods now submit frameID and pageID to the partitioning query call. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): These two methods now submit frameID and pageID to the partitioning query call. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestStorageAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): (WebKit::WebsiteDataStore::requestStorageAccess): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestStorageAccess): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::requestStorageAccess): * WebProcess/WebPage/WebPage.h: 2017-12-12 Alex Christensen Modernize WebsiteDataStoreParameters and SandboxExtension::Handle decoding https://bugs.webkit.org/show_bug.cgi?id=180621 Reviewed by Youenn Fablet. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::decode): * Shared/LoadParameters.cpp: (WebKit::LoadParameters::decode): * Shared/SandboxExtension.h: (WebKit::decode): (WebKit::SandboxExtension::Handle::decode): Deleted. * Shared/Storage/StorageProcessCreationParameters.cpp: (WebKit::StorageProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::decode): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtension::Handle::decode): (WebKit::SandboxExtension::HandleArray::HandleArray): (WebKit::SandboxExtension::HandleArray::encode const): (WebKit::SandboxExtension::HandleArray::decode): (WebKit::SandboxExtension::SandboxExtension): 2017-12-12 John Wilander Dispatch resource load statistics telemetry on the main thread https://bugs.webkit.org/show_bug.cgi?id=180602 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): Now switches to the main thread for the telemetry submission through a webpage proxy. The reason is that the webpage we use may go away while we're still using it. This kind of telemetry isn't associated with a specific webpage but the infrastructure requires a webpage proxy. 2017-12-12 Myles C. Maxfield IPC code doesn't understand NSDictionaries with non-NSString keys https://bugs.webkit.org/show_bug.cgi?id=180307 Reviewed by Alex Christensen. Variable fonts have a dictionary inside its descriptor which represents the values of all the axes of the variable font. Our IPC code wasn't expecting this. * Shared/mac/ArgumentCodersMac.mm: (IPC::encode): (IPC::decode): 2017-12-12 Brent Fulgham Unreviewed build fix after r225763. Remove dangling close-parentheses character. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-12-12 Zach Li [WK2] Expose image via WKBundleHitTestResult API. https://bugs.webkit.org/show_bug.cgi?id=180552. rdar://problem/23951521 Reviewed by Simon Fraser. * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp: (WKBundleHitTestResultGetImage): * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h: * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: (WebKit::InjectedBundleHitTestResult::image const): Convert from WebCore::Image to WebImage by creating a WebImage and paint the WebCore::Image into its graphics context. For now, only handle bitmap images. * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h: 2017-12-12 Simon Fraser Remove ColorSpaceDeviceRGB and most users of the obsolete deviceRGB colorspace https://bugs.webkit.org/show_bug.cgi?id=180689 Reviewed by Tim Horton. Remove encoding of ColorSpaceDeviceRGB. * Shared/WebCoreArgumentCoders.h: 2017-12-12 Brent Fulgham REGRESSION(r216941): Plugin Process can't access AppStore Plugin Service https://bugs.webkit.org/show_bug.cgi?id=180701 Reviewed by Daniel Bates. The PluginProcess needs access to the AppStore Plugin XPC service. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-12-12 Brady Eidson Make ServiceWorkers follow the DEFAULT_EXPERIMENTAL_FEATURES_ENABLED flag on Mac. and https://bugs.webkit.org/show_bug.cgi?id=180697 Reviewed by Chris Dumez. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: 2017-12-12 Chris Dumez Simplify IPC code between WebProcess and StorageProcess for serviceWorker.postMessage() https://bugs.webkit.org/show_bug.cgi?id=180683 Reviewed by Brady Eidson. Merge the 2 code paths from calling postMessage() from a ServiceWorkerClient and from a ServiceWorker. Also, postMessage() now only IPCs an identifier from the WebContent process to the StorageProcess. The ServiceWorkerClientData is looked up on Storage process side from the identifier before being sent to the context process. * Scripts/webkit/messages.py: (forward_declarations_and_headers): (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorker): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorker): * WebProcess/Storage/WebSWClientConnection.h: 2017-12-12 Yusuke Suzuki [WTF] Thread::create should have Thread::tryCreate https://bugs.webkit.org/show_bug.cgi?id=180333 Reviewed by Darin Adler. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::open): * UIProcess/linux/MemoryPressureMonitor.cpp: (WebKit::MemoryPressureMonitor::MemoryPressureMonitor): 2017-12-11 Zan Dobersek [CoordGraphics] Move UpdateAtlas, AreaAllocator into the platform layer https://bugs.webkit.org/show_bug.cgi?id=180641 Reviewed by Michael Catanzaro. Move the UpdateAtlas and AreaAllocator classes into the platform layer, moving over build targets and adjust UpdateAtlas class references in CompositingCoordinator. * PlatformGTK.cmake: * PlatformWPE.cmake: * PlatformWin.cmake: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 2017-12-11 Alex Christensen Add a WKPageGroupRef setter in WKWebViewConfiguration https://bugs.webkit.org/show_bug.cgi?id=180674 Reviewed by Brady Eidson. There is a Mac app trying to transition to WKWebView, and it uses WKPageGroupRef extensively. To help it transition, we are temporarily giving it an ObjC way to use this organization for its UserContentControllers to be united per PageGroup before it transitions away from SPIs like WKBundleAddUserScript. Make it Mac-only to indicate that this should be transitioned away from, rather than adopted on iOS. No change in behavior for apps not using the new WKWebViewConfiguration._pageGroup SPI. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _pageGroup]): (-[WKWebViewConfiguration _setPageGroup:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2017-12-11 Brent Fulgham [iOS] Remove unused services from WebContent Process sandbox https://bugs.webkit.org/show_bug.cgi?id=180670 Reviewed by Eric Carlson. Pare down the set of sandbox exceptions in the iOS WebContent process sandbox to just those services actually in use: 1. Remove unused code. 2. Instead of defining a 'UIKit-app' function and calling it, just declare the individual sandbox commands inline. This will allow them to be more easily consolidated with other parts of the sandbox in a future step. This update should not change behavior. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-12-11 Chris Dumez Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData https://bugs.webkit.org/show_bug.cgi?id=180669 Reviewed by Youenn Fablet. Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData, for consistency with ServiceWorkerIdentifier / ServiceWorkerData, and start simplifying the postMessage() code. * Scripts/webkit/messages.py: (forward_declarations_and_headers): (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::~WebSWServerConnection): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker): (WebKit::WebSWServerConnection::registerServiceWorkerClient): (WebKit::WebSWServerConnection::unregisterServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::matchAllCompleted): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::registerServiceWorkerClient): (WebKit::WebSWClientConnection::unregisterServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::postMessageToServiceWorker): (WebKit::WebSWContextManagerConnection::matchAllCompleted): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-11 Youenn Fablet RTCPacketOptions::packet_id should be encoded as 32 bits integer. https://bugs.webkit.org/show_bug.cgi?id=180654 Reviewed by Eric Carlson. packet_id is a 16 bit unsigned integer, but it can also take -1 if its value is not set. Before the patch, it was IPC encoded as a 16 bit signed integer which is not large enough. * Shared/RTCPacketOptions.cpp: (WebKit::RTCPacketOptions::encode const): (WebKit::RTCPacketOptions::decode): 2017-12-11 Chris Dumez Layout Test http/tests/workers/service/postmessage-after-sw-process-crash.https.html is flaky https://bugs.webkit.org/show_bug.cgi?id=180659 Reviewed by Youenn Fablet. Fix flaky crash due to capturing an IPC::DataReference in a lambda, which would point to invalid memory when the lambda is called asynchronously. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker): 2017-12-11 Brent Fulgham [iOS] Don't import 'UIKit-apps.sb' to the WebContent process sandbox https://bugs.webkit.org/show_bug.cgi?id=180610 Reviewed by Dean Jackson. Stop including 'system.sb', and just include the portions of that sandbox that we actually use in WebContent Process. This is the first step in some further sandbox tightening. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-12-11 Yusuke Suzuki [WTF] Add Converter traits to StringHasher instead of function pointer https://bugs.webkit.org/show_bug.cgi?id=180656 Reviewed by JF Bastien. * WebProcess/WebProcess.cpp: (WebKit::addCaseFoldedCharacters): 2017-12-11 David Quesada Turn on ENABLE_APPLICATION_MANIFEST https://bugs.webkit.org/show_bug.cgi?id=180562 rdar://problem/35924737 Reviewed by Geoffrey Garen. * Configurations/FeatureDefines.xcconfig: 2017-12-11 Dean Jackson Add a runtime feature flag for ImageBitmap and OffscreenCanvas https://bugs.webkit.org/show_bug.cgi?id=180652 Reviewed by Antoine Quint. Add an experimental feature flag for these interfaces. * Shared/WebPreferences.yaml: 2017-12-10 Stephan Szabo APIClient.h uses things from without including it explicitly https://bugs.webkit.org/show_bug.cgi?id=180609 Reviewed by Darin Adler. * Shared/API/APIClient.h: 2017-12-08 Youenn Fablet Service Worker should use a correct user agent https://bugs.webkit.org/show_bug.cgi?id=180566 Reviewed by Chris Dumez. Addendum to landed patch. This change was removed from the last version of the patch but proves to be needed by Safari. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): Added back setting the user agent at start of service worker in case a page is already created. 2017-12-08 Brady Eidson Delay some service worker operations until after the database import completes. https://bugs.webkit.org/show_bug.cgi?id=180573 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: (WebKit::WebSWOriginStore::importComplete): Tell the Origin Table on all connects that the import is complete. (WebKit::WebSWOriginStore::registerSWServerConnection): * StorageProcess/ServiceWorker/WebSWOriginStore.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const): (WebKit::WebSWClientConnection::setSWOriginTableIsImported): Run deferred tasks! (WebKit::WebSWClientConnection::matchRegistration): If the import isn't complete yet, delay the match registration task until later. (WebKit::WebSWClientConnection::runOrDelayTask): Either send the message now or save off the task to wait until the import is complete. (WebKit::WebSWClientConnection::getRegistrations): If the import isn't complete yet, delay the get registrations task until later. (WebKit::WebSWClientConnection::initializeSWOriginTableAsEmpty): Deleted. * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWOriginTable.cpp: (WebKit::WebSWOriginTable::setSharedMemory): * WebProcess/Storage/WebSWOriginTable.h: (WebKit::WebSWOriginTable::isImported const): (WebKit::WebSWOriginTable::setIsImported): (WebKit::WebSWOriginTable::isInitialized const): Deleted. (WebKit::WebSWOriginTable::initializeAsEmpty): Deleted. 2017-12-08 Youenn Fablet Service Worker should use a correct user agent https://bugs.webkit.org/show_bug.cgi?id=180566 Reviewed by Chris Dumez. Add support to set service worker user agent from UIProcess to service worker process. One user agent is currently supported per service worker process and it can be changed at any given time. Only new service worker will use the new value. Once a service worker is launched, it will stay with the same user agent value. This sets both navigator.userAgent and User-Agent header name used for fetch within a service worker. Compute the service worker process user agent by picking the last user agent set for a web page. * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::start): (WebKit::ServiceWorkerProcessProxy::setUserAgent): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setApplicationNameForUserAgent): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::updateServiceWorkerUserAgent): * UIProcess/WebProcessPool.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): (WebKit::WebSWContextManagerConnection::setUserAgent): (WebKit::WebSWContextManagerConnection::removeFrameLoaderClient): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-07 Simon Fraser Wrong caret position for input field inside a fixed position parent on iOS 11 https://bugs.webkit.org/show_bug.cgi?id=176896 rdar://problem/33726145 Reviewed by Tim Horton. In r219668 I added code to compute a layout viewport rect in the web process, so that after programmatic scrolling, getBoundingClientRect() would return the correct values. However, that computation sometimes used a different visual viewport than the UI process, resulting in a different layout viewport being set. This would happen when the keyboard was visible, and the combination of this and zooming when focusing an input would result in a state where the scrolling tree contained notes computed with the bad layout viewport. This could cause apparently offset fixed elements, and bad caret positioning if those fixed elements contained the focused input. Fix by passing to the web process the same visual viewport rect that the UI process is using, namely "unobscuredContentRectRespectingInputViewBounds". This was already being set in VisibleContentRectUpdateInfo but wasn't encoded/decoded, so fix that. Set it as an optional<> on FrameView when different from the normal visual viewport, and return it from visualViewportRect(). Some other minor logging changes. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode const): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2017-12-06 Simon Fraser When the iPhone keyboard is up, sometimes we never commit a stable update and re-show the caret https://bugs.webkit.org/show_bug.cgi?id=180498 Reviewed by Tim Horton. When the keyboard is showing, we would think that the page was in a rubber-banding state because contentOffsetBoundedInValidRange() would always clamp the content offset to a different value. This happened because scrollView.contentInset don't change when the keyboard is showing, but UIKit actually consults scrollView.adjustedContentInset, which does. If we use scrollView.adjustedContentInset in this computation, we'll get a correct answer. Also rewrote the clamping logic to be more similar to what UIKit does internally when computing min/max content offset. * UIProcess/API/Cocoa/WKWebView.mm: (contentOffsetBoundedInValidRange): 2017-12-08 Chris Dumez Clearing all Website Data should remove service worker registrations on disk https://bugs.webkit.org/show_bug.cgi?id=180558 Reviewed by Youenn Fablet. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): 2017-12-08 Youenn Fablet WebServiceWorkerProvider should use Cancellation error to notify DTL that it cannot handle a fetch https://bugs.webkit.org/show_bug.cgi?id=180584 Reviewed by Alex Christensen. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): 2017-12-08 Youenn Fablet Service Worker should use a correct SessionID https://bugs.webkit.org/show_bug.cgi?id=180585 Reviewed by Alex Christensen. Store SessionID in SWServer and send it as part of service worker instantiation. Use it when creating service worker thread in service worker process. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::installServiceWorkerContext): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::swServerForSession): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-08 Youenn Fablet FetchResponse should keep unfiltered ResourceResponse so that it can be used in Service Worker https://bugs.webkit.org/show_bug.cgi?id=179641 Reviewed by Alex Christensen. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): In case of opaque redirected response, handle it as a regular response. 2017-12-08 Alex Christensen Remove unused code in WebPageGroup https://bugs.webkit.org/show_bug.cgi?id=180604 Reviewed by Youenn Fablet. * UIProcess/WebPageGroup.cpp: (WebKit::WebPageGroup::userContentController): (WebKit::WebPageGroup::createNonNull): Deleted. (WebKit::WebPageGroup::preferencesDidChange): Deleted. * UIProcess/WebPageGroup.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): 2017-12-08 Alex Christensen Modernize APIWebsiteDataStore.h and WebProcessPool.h https://bugs.webkit.org/show_bug.cgi?id=180588 Reviewed by Chris Dumez. pragma once, Ref instead of RefPtr, initializer list in header instead of literals in constructor. * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): * UIProcess/WebProcessPool.h: 2017-12-08 Yusuke Suzuki Remove pthread_once in favor of dispatch_once https://bugs.webkit.org/show_bug.cgi?id=180591 Reviewed by Saam Barati. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::shouldCallRealDebugger): (WebKit::initShouldCallRealDebugger): Deleted. 2017-12-08 Chris Dumez ProcessPoolConfiguration::copy() fails to copy the service worker path https://bugs.webkit.org/show_bug.cgi?id=180595 Reviewed by Brady Eidson. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): 2017-12-08 Chris Dumez Different WebKitTestRunner instances should use different service worker registrations databases https://bugs.webkit.org/show_bug.cgi?id=180589 Reviewed by Brady Eidson. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyServiceWorkerDatabaseDirectory): (WKContextConfigurationSetServiceWorkerDatabaseDirectory): * UIProcess/API/C/WKContextConfigurationRef.h: 2017-12-08 Alex Christensen Pass std::optional instead of WebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=180563 Reviewed by Andy Estes. WebsitePolicies are only passed along when a decidePolicyForNavigationAction SPI completion handler is called with a valid _WKWebsitePolicies object. In other cases, we don't have one. Rather than making WebsitePolicies have a default value for everything that won't change policies, pass a std::optional which indicates better when we don't have new policies. No change in behavior, but this will enable me to add things to WebsitePolicies that have no default value. * Shared/WebsitePolicies.h: Make WebsitePolicies a class with public members because the IPC code generators don't understand std::optional * UIProcess/API/C/WKAPICast.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::tryAppLink): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/WebFrameListenerProxy.cpp: (WebKit::WebFrameListenerProxy::receivedPolicyDecision): * UIProcess/WebFrameListenerProxy.h: * UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::use): * UIProcess/WebFramePolicyListenerProxy.h: * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::receivedPolicyDecision): * UIProcess/WebFrameProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-12-08 Yusuke Suzuki [WTF] Remove remaining use of Mutex https://bugs.webkit.org/show_bug.cgi?id=180579 Reviewed by Alex Christensen. Remove unused "BinarySemaphore.h". * Platform/IPC/win/ConnectionWin.cpp: 2017-12-08 Michael Catanzaro [GTK] WebInspectorProxyClient needs a virtual destructor https://bugs.webkit.org/show_bug.cgi?id=180533 Reviewed by Carlos Garcia Campos. Otherwise the derived class portion of the object, WebKitInspectorClient, is not destroyed. * UIProcess/gtk/WebInspectorProxyClient.h: 2017-12-07 Yousuke Kimoto [WinCairo] Fix ResourceError handling in ArgumentCoder for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=180483 Reviewed by Alex Christensen. * Shared/curl/WebCoreArgumentCodersCurl.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2017-12-07 Youenn Fablet StartFetch should take a ServiceWorkerIdentifier https://bugs.webkit.org/show_bug.cgi?id=180478 Reviewed by Brady Eidson. Before the patch, StartFetch was taking an optional ServiceWorkerIdentifier. Now that every navigation fetch is querying its matching registration, it can no longer be optional. In the case there is a problem in running the service worker at start fetch time, answer to the WebProcess to go to network so that the request does not get stalled. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-07 Saam Barati We need to grab the JSLock in InjectedBundle::createWebDataFromUint8Array https://bugs.webkit.org/show_bug.cgi?id=180492 Reviewed by Alex Christensen. InjectedBundle::createWebDataFromUint8Array calls into WebCore APIs that allocate out of the JS heap. It's only legal to allocate out of the JS heap when holding the JS lock. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::createWebDataFromUint8Array): 2017-12-07 Simon Fraser Propagate WebKit2Logging channels to the Web Process https://bugs.webkit.org/show_bug.cgi?id=180517 Reviewed by Tim Horton. If you set WebKit2Logging, you want those channels active in both the UI process and the web process, but without tricky 'defaults' gyrations, setting them in the web process was hard. Instead, send them through to the process via WebProcessCreationParameters, as we do for WebCoreLogging channels. * Platform/LogInitialization.h: * Platform/Logging.cpp: (WebKit::initializeLogChannelsIfNecessary): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2017-12-07 Simon Fraser Add logging for EditorState in RemoteLayerTree transactions https://bugs.webkit.org/show_bug.cgi?id=180515 Reviewed by Wenson Hsieh. Make EditorState TextStream-able, and dump it in layer tree transactions. * Shared/EditorState.cpp: (WebKit::operator<<): * Shared/EditorState.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::description const): 2017-12-07 Youenn Fablet CacheStorage Cache should not remove any disk entry when clearing its memory representation https://bugs.webkit.org/show_bug.cgi?id=180546 Reviewed by Brady Eidson. * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::clearMemoryRepresentation): 2017-12-07 Myles C. Maxfield [Cocoa] Add SPI to disallow user-installed fonts https://bugs.webkit.org/show_bug.cgi?id=180062 Reviewed by Simon Fraser. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetShouldDisallowUserInstalledFonts): (WKPreferencesGetShouldDisallowUserInstalledFonts): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _shouldDisallowUserInstalledFonts]): (-[WKPreferences _setShouldDisallowUserInstalledFonts:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-12-07 David Quesada [Web App Manifest] Support display-mode media feature https://bugs.webkit.org/show_bug.cgi?id=180376 rdar://problem/35837993 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/_WKApplicationManifest.h: * UIProcess/API/Cocoa/_WKApplicationManifest.mm: (-[_WKApplicationManifest initWithCoder:]): (-[_WKApplicationManifest encodeWithCoder:]): (-[_WKApplicationManifest displayMode]): 2017-12-07 Chris Dumez Unreviewed build fix after r225622. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker): 2017-12-06 Chris Dumez We should be able to recover after a Service Worker process crash https://bugs.webkit.org/show_bug.cgi?id=180477 Reviewed by Brady Eidson and Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker): Update calls to SWServer::runServiceWorkerIfNecessary() that that it is asynchronous and takes in a lambda. * StorageProcess/ServiceWorker/WebSWServerConnection.h: (WebKit::WebSWServerConnection::ipcConnection const): Add getter for the underlying IPC connection. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didClose): (WebKit::StorageProcess::connectionToContextProcessWasClosed): Move some code to connectionToContextProcessWasClosed() to avoid duplication. Also, relaunch the Service Worker process if it has exited but we still have SWServer connections to regular Web Processes. (WebKit::StorageProcess::needsServerToContextConnection const): Utility function to determine if we still need the service worker process. The current rule is that we need the service worker (aka "context") process if we still have SWServer connections to regular Web Processes. * StorageProcess/StorageProcess.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didClose): If didClose() is called for the connection to the service worker context, let the StorageProcess know so that it can clear its state and relaunch the process if necessary. * UIProcess/API/C/WKContext.cpp: (WKContextTerminateServiceWorkerProcess): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _terminateServiceWorkerProcess]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Add SPI to terminate the service worker process. * UIProcess/WebProcessPool.cpp: (WebKit::m_serviceWorkerProcessTerminationTimer): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::terminateServiceWorkerProcess): * UIProcess/WebProcessPool.h: We used to shutdown the ServiceWorker process right away as soon as the last regular WebProcess was gone. We now give it a grace period of 5 seconds in case a new WebProcess gets launched shortly after. 2017-12-02 Darin Adler Modernize some aspects of text codecs, eliminate WebKit use of strcasecmp https://bugs.webkit.org/show_bug.cgi?id=180009 Reviewed by Alex Christensen. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::initializeProtectionSpace): Use equalLettersIgnoringASCIICase instead of strcasecmp. 2017-12-06 David Quesada [Web App Manifest] Add SPI for applying a manifest to a top-level browsing context https://bugs.webkit.org/show_bug.cgi?id=180368 rdar://problem/34748067 Reviewed by Geoffrey Garen. Add a new property WKWebViewConfiguration._applicationManifest to specify manifest to apply to application contexts (aka. top-level browsing contexts, i.e. web views). The manifest is ultimately stored on the MainFrame of the Pages created from the web view configuration. No new tests, no change in behavior. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy const): (API::PageConfiguration::applicationManifest const): (API::PageConfiguration::setApplicationManifest): * UIProcess/API/APIPageConfiguration.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _applicationManifest]): (-[WKWebViewConfiguration _setApplicationManifest:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): 2017-12-06 Jeff Miller -[WKWebViewConfiguration copyWithZone] doesn't copy _groupIdentifier https://bugs.webkit.org/show_bug.cgi?id=180504 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): Copy _groupIdentifier. 2017-12-06 David Quesada [Web App Manifest] Add SPI for fetching the manifest https://bugs.webkit.org/show_bug.cgi?id=180294 rdar://problem/34747968 Reviewed by Geoffrey Garen. Add a new method -[WKWebView _getApplicationManifestWithCompletionHandler:] to request the manifest associated with the current page. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/APIApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h. Add a new API object type for application manifests. * UIProcess/API/C/WKPage.cpp: (WKPageGetApplicationManifest_b): Add a C version of this SPI for WebKitTestRunner. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _getApplicationManifestWithCompletionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h. * UIProcess/API/Cocoa/_WKApplicationManifest.mm: Added. (-[_WKApplicationManifest initWithCoder:]): (-[_WKApplicationManifest encodeWithCoder:]): (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]): (-[_WKApplicationManifest _apiObject]): (nullableNSString): (-[_WKApplicationManifest name]): (-[_WKApplicationManifest shortName]): (-[_WKApplicationManifest applicationDescription]): (-[_WKApplicationManifest scope]): (-[_WKApplicationManifest startURL]): * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h. (API::wrapper): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::applicationManifestCallback): (WebKit::WebPageProxy::getApplicationManifest): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::finishedLoadingApplicationManifest): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::getApplicationManifest): (WebKit::WebPage::didFinishLoadingApplicationManifest): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-12-06 Per Arne Vollan The WebProcess should use the NSRunLoop runloop type. https://bugs.webkit.org/show_bug.cgi?id=179804 Reviewed by Brent Fulgham. * Platform/IPC/mac/ConnectionMac.mm: (IPC::AccessibilityProcessSuspendedNotification): * Shared/ChildProcess.h: * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::launchServicesCheckIn): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::shouldLeakBoost): * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeProcess): 2017-12-06 Nan Wang AX: [iOS] Post accessibility notification when a web process changes its suspended state https://bugs.webkit.org/show_bug.cgi?id=180458 Reviewed by Chris Dumez. Post accessibility notification with the pid information when a web process becomes suspended or resumes running. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::actualPrepareToSuspend): (WebKit::WebProcess::processDidResume): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::accessibilityProcessSuspendedNotification): 2017-12-06 Ryan Haddad Unreviewed build fix, removed unused lambda capture. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): 2017-12-06 John Wilander Storage Access API: Make document.hasStorageAccess a function and always allow access for same-origin iframes https://bugs.webkit.org/show_bug.cgi?id=176944 Reviewed by Brent Fulgham. This change introduces document.hasStorageAccess() as a function which returns a promise instead of being a property. Since cookie access can be due to both a granted request and recent user interaction as first party, the WebKit::WebResourceLoadStatisticsStore needs to be consulted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::hasStorageAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Now adds an entry for granted access. A bug found through testing. Switched from WTF::Function to WTF::CompletionHandler. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::hasStorageAccess): (WebKit::WebsiteDataStore::requestStorageAccess): Switched from WTF::Function to WTF::CompletionHandler. * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::hasStorageAccess): (WebKit::WebChromeClient::requestStorageAccess): Switched from WTF::Function to WTF::CompletionHandler. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::hasStorageAccess): (WebKit::WebPage::requestStorageAccess): Switched from WTF::Function to WTF::CompletionHandler. * WebProcess/WebPage/WebPage.h: 2017-12-06 Youenn Fablet CacheStorageEngineConnection should protect its IPC Connection when doing asynchronous tasks https://bugs.webkit.org/show_bug.cgi?id=180461 Reviewed by Chris Dumez. Protecting the IPC connection instead of the CacheStorageEngineConnection since CacheStorageEngineConnection only keeps a reference to the NetworkConnectionToWebProcess. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::retrieveRecords): (WebKit::CacheStorageEngineConnection::deleteMatchingRecords): (WebKit::CacheStorageEngineConnection::putRecords): (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation): 2017-12-06 Zan Dobersek [CoordGraphics] Introduce Nicosia::PaintingContext, add Cairo implementation https://bugs.webkit.org/show_bug.cgi?id=180239 Reviewed by Michael Catanzaro. With Nicosia::Buffer now only providing the memory area into which the tile content was rasterized, we can simplify the BitmapTexture update greatly -- we don't have to create a BitmapImage anymore and retrieve memory pointer from the contained cairo_surface_t object. Instead, we just copy to GPU the memory that Nicosia::Buffer controls. * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::swapBuffers): 2017-12-05 Brent Fulgham Limit user agent versioning to an upper bound https://bugs.webkit.org/show_bug.cgi?id=180365 Reviewed by Joseph Pecoraro. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::standardUserAgent): Don't pass the WebKit bundle version when creatin the User Agent string. (WebKit::webKitBundleVersionString): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::standardUserAgent): Ditto. (WebKit::webKitBundleVersionString): Deleted. 2017-12-05 Alex Christensen Fix crash when loading a file URL that does not have a fileSystemPath representation https://bugs.webkit.org/show_bug.cgi?id=180448 Reviewed by Chris Dumez. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::assumeReadAccessToBaseURL): Check if a String is null before adding it to a HashSet. 2017-12-05 Youenn Fablet Implement https://w3c.github.io/ServiceWorker/#clients-claim https://bugs.webkit.org/show_bug.cgi?id=180261 Reviewed by Chris Dumez. Add IPC plumbery for clients claim between ServiceWorker process and Storage process. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::claimCompleted): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::claim): (WebKit::WebSWContextManagerConnection::claimCompleted): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-05 Chris Dumez Add support for ServiceWorkerContainer.prototype.ready https://bugs.webkit.org/show_bug.cgi?id=180383 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::whenRegistrationReady): (WebKit::WebSWServerConnection::resolveRegistrationReadyRequests): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::matchRegistration): (WebKit::WebSWClientConnection::whenRegistrationReady): (WebKit::WebSWClientConnection::registrationReady): (WebKit::WebSWClientConnection::getRegistrations): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-12-05 Youenn Fablet Implement setting of service worker to client in SWServer without going to WebProcess https://bugs.webkit.org/show_bug.cgi?id=180382 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::registerServiceWorkerClient): (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): Deleted. (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): Deleted. * WebProcess/Storage/WebSWClientConnection.h: 2017-12-04 Chris Dumez Support container.getRegistration() / getRegistrations() inside service workers https://bugs.webkit.org/show_bug.cgi?id=180360 Reviewed by Youenn Fablet. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::didMatchRegistration): (WebKit::WebSWClientConnection::didGetRegistrations): (WebKit::WebSWClientConnection::matchRegistration): (WebKit::WebSWClientConnection::getRegistrations): 2017-12-04 Brady Eidson Followup to: Get a directory path to SWServers for storing ServiceWorker registrations https://bugs.webkit.org/show_bug.cgi?id=180362 Unreviewed. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::swServerForSession): Change this ASSERT which is invalid in private browsing sessions. 2017-12-04 Simon Fraser Minor DisplayRefreshMonitor-related cleanup https://bugs.webkit.org/show_bug.cgi?id=179802 Reviewed by Sam Weinig. Use RunLoopObserver::WellKnownRunLoopOrders. We want to fire before layer flushing. * UIProcess/WebPageProxy.cpp: (WebKit::m_configurationPreferenceValues): 2017-12-04 Brent Fulgham Don't force creation of process pool when enabling resource load statistics https://bugs.webkit.org/show_bug.cgi?id=180374 Reviewed by Alex Christensen. Pass appropriate arguments to the 'processPool' accessor so that we only get the set of existing process pools. We don't want to pay the cost of launching new process pools just to set this flag. The flag will be properly set when the pools are created as soon as a WebView is instantiated. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): 2017-12-04 David Quesada Add a class for parsing application manifests https://bugs.webkit.org/show_bug.cgi?id=177973 rdar://problem/34747949 Reviewed by Geoffrey Garen. * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag. 2017-12-04 Wenson Hsieh Rename a static helper in TouchBarMenuItemData.cpp to match style guidelines. https://bugs.webkit.org/show_bug.cgi?id=180305 Reviewed by Andy Estes. Style guidelines state that we should use bare words for getters, so getItemType should just be itemType. Since this collides with the itemType member variable, this patch also renames that member variable to the more concise "type". No change in behavior. * Shared/TouchBarMenuItemData.cpp: (WebKit::itemType): (WebKit::TouchBarMenuItemData::TouchBarMenuItemData): (WebKit::TouchBarMenuItemData::encode const): (WebKit::TouchBarMenuItemData::decode): (WebKit::getItemType): Deleted. * Shared/TouchBarMenuItemData.h: (WebKit::operator==): 2017-12-04 Brian Burg Web Automation: add flag to preserve legacy page screenshot behavior https://bugs.webkit.org/show_bug.cgi?id=180313 Reviewed by Joseph Pecoraro. For compatibility with JSON Wire Protocol implemented by Safari, we need to retain the ability to perform whole page contents snapshots using Automation.takeScreenshot. Add an extra flag, clipToViewport, which can be used by W3C-conforming drivers. * UIProcess/Automation/Automation.json: Add new flag. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::takeScreenshot): * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::snapshotRectForScreenshot): (WebKit::WebAutomationSessionProxy::takeScreenshot): If the flag is false, take a screenshot of the whole page contents. 2017-12-04 JF Bastien Update std::expected to match libc++ coding style https://bugs.webkit.org/show_bug.cgi?id=180264 Reviewed by Alex Christensen. Update various uses of Expected, mostly renaming valueOr and hasValue to the STL naming convention. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::retrieveCaches): (WebKit::CacheStorage::Engine::retrieveRecords): (WebKit::CacheStorage::Engine::putRecords): (WebKit::CacheStorage::Engine::deleteMatchingRecords): (WebKit::CacheStorage::Engine::fetchEntries): (WebKit::CacheStorage::Engine::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord): (WebKit::CacheStorage::Cache::updateRecordToDisk): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::readCachesFromDisk): * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createResolver): * Platform/IPC/ArgumentCoders.h: 2017-12-04 Brady Eidson Get a directory path to SWServers for storing ServiceWorker registrations. https://bugs.webkit.org/show_bug.cgi?id=180362 Reviewed by Chris Dumez. This gets all of the plumbing in place for specifying a ServiceWorker registration storage path in a particular WebsiteDataStore. * Shared/Storage/StorageProcessCreationParameters.cpp: (WebKit::StorageProcessCreationParameters::encode const): (WebKit::StorageProcessCreationParameters::decode): * Shared/Storage/StorageProcessCreationParameters.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::initializeWebsiteDataStore): (WebKit::StorageProcess::swServerForSession): * StorageProcess/StorageProcess.h: * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithLegacyOptions): (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): (API::ProcessPoolConfiguration::ProcessPoolConfiguration): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): (WebKit::WebsiteDataStore::storageProcessParameters): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const): * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory): * UIProcess/wpe/WebProcessPoolWPE.cpp: (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory): 2017-12-04 Frederic Wang Make ScrollingTreeNode::enclosingFrameNode return the node itself for frame nodes https://bugs.webkit.org/show_bug.cgi?id=180353 Reviewed by Antonio Gomes. This function was introduced in bug 175135 to solve a rendering bug with fixed positioned nodes in overflow nodes. For a frame node, the reference frame to use for fixed nodes is actually the frame node itself or otherwise we will get the same rendering bug. This patch makes enclosingFrameNode return the node itself when it is a frame node and renames it to clarify this behavior. Currently, enclosingFrameNode is not used for frame nodes so the behavior is unchanged. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Use auto* and the new function name. 2017-12-04 Michael Catanzaro [GTK] Implement PAL::SleepDisabler https://bugs.webkit.org/show_bug.cgi?id=178485 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseDispose): (webkitWebViewBaseEnterFullScreen): (webkitWebViewBaseExitFullScreen): (screenSaverInhibitedCallback): Deleted. (webkitWebViewBaseSendInhibitMessageToScreenSaver): Deleted. (screenSaverProxyCreatedCallback): Deleted. (webkitWebViewBaseInhibitScreenSaver): Deleted. (webkitWebViewBaseUninhibitScreenSaver): Deleted. 2017-12-03 Yusuke Suzuki WTF shouldn't have both Thread and ThreadIdentifier https://bugs.webkit.org/show_bug.cgi?id=180308 Reviewed by Darin Adler. * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/GenericCallback.h: (WebKit::GenericCallback::~GenericCallback): (WebKit::GenericCallback::performCallbackWithReturnValue): 2017-12-03 Chris Dumez Support serviceWorker.postMessage() inside service workers https://bugs.webkit.org/show_bug.cgi?id=180328 Reviewed by Darin Adler. Support serviceWorker.postMessage() inside service workers. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorker): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromClient): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromServiceWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-03 Chris Dumez Implement self.skipWaiting() inside service workers https://bugs.webkit.org/show_bug.cgi?id=180329 Reviewed by Darin Adler. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::didFinishSkipWaiting): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::skipWaiting): (WebKit::WebSWContextManagerConnection::didFinishSkipWaiting): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-02 Youenn Fablet Implement https://w3c.github.io/ServiceWorker/#clients-getall https://bugs.webkit.org/show_bug.cgi?id=180276 Reviewed by Chris Dumez. Add IPC plumbery for clients.matchAll between ServiceWorker process and Storage process. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::matchAllCompleted): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::matchAll): (WebKit::WebSWContextManagerConnection::matchAllCompleted): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-02 Joseph Pecoraro Remote Web Inspector window always shows up at the default size https://bugs.webkit.org/show_bug.cgi?id=180284 Reviewed by Brian Burg. * UIProcess/mac/RemoteWebInspectorProxyMac.mm: (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): Give remote web inspector windows an autosave name so that their frame can be automatically saved and restored by the system. 2017-12-02 Simon Fraser Add a log channel for viewports https://bugs.webkit.org/show_bug.cgi?id=180295 Reviewed by Zalan Bujtas. Add a "Viewports" log channel to log viewport scaling information, and enhance the WebKit "VisibleRects" channel to log additional data for the same reason. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]): (-[WKWebView _dispatchSetMinimumLayoutSize:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _resizeWhileHidingContentWithUpdates:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setFixedLayoutSize): (WebKit::WebPage::mainFrameDidLayout): (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::scaleAfterViewportWidthChange): (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::resetViewportDefaultConfiguration): (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::updateVisibleContentRects): 2017-12-02 Carlos Garcia Campos WebDriver: handle user prompts shown while executing scripts https://bugs.webkit.org/show_bug.cgi?id=179979 Reviewed by Brian Burg. * UIProcess/Automation/Automation.json: Add UnexpectedAlertOpen error. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::willShowJavaScriptDialog): Finish pending evaluateJavaScriptFunction operations with UnexpectedAlertOpen error. 2017-12-02 Wenson Hsieh Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData https://bugs.webkit.org/show_bug.cgi?id=180305 Reviewed by Joseph Pecoraro. Mark some methods and parameters as const, use the default constructor in more places, and also remove a few extraneous imported headers. * Shared/TouchBarMenuData.cpp: (WebKit::TouchBarMenuData::TouchBarMenuData): Add a FIXME regarding the use of the 'id' attribute. (WebKit::TouchBarMenuData::decode): * Shared/TouchBarMenuData.h: (WebKit::TouchBarMenuData::items const): (WebKit::TouchBarMenuData::setID): (WebKit::TouchBarMenuData::isPageCustomized const): (WebKit::TouchBarMenuData::items): Deleted. (WebKit::TouchBarMenuData::isPageCustomized): Deleted. * Shared/TouchBarMenuItemData.cpp: (WebKit::getItemType): Change a helper method from a static class function to a static function in the implementation file. (WebKit::TouchBarMenuItemData::TouchBarMenuItemData): (WebKit::TouchBarMenuItemData::encode const): (WebKit::TouchBarMenuItemData::decode): (WebKit::TouchBarMenuItemData::getItemType): Deleted. * Shared/TouchBarMenuItemData.h: (WebKit::operator==): Remove the commandName member variable, since it doesn't make sense to propagate an event handler attribute from WebCore to the client layer. * UIProcess/WebPageProxy.messages.in: 2017-12-01 Zan Dobersek Unreviewed GTK+ debug build fix. Replace ASSERT_UNUSED() with UNUSED_PARAM() in WebKit::WebPage methods that used to operate on HTMLMenuElement pointer values (which have been converted to references). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didInsertMenuElement): (WebKit::WebPage::didRemoveMenuElement): (WebKit::WebPage::didInsertMenuItemElement): (WebKit::WebPage::didRemoveMenuItemElement): 2017-12-01 Simon Fraser Reduce the number of calls to ViewportConfiguration::updateConfiguration() https://bugs.webkit.org/show_bug.cgi?id=180299 Reviewed by Zalan Bujtas. There are several calls to ViewportConfiguration::setDefaultConfiguration() during loading with the same arguments. We can avoid unnecessary calls to updateConfiguration() by returning early if the configuration hasn't changed. Also move the fetching of ViewportConfiguration::xhtmlMobileParameters() from didReceiveMobileDocType() into resetViewportDefaultConfiguration() where we grab all the other default configs. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::didReceiveMobileDocType): (WebKit::WebPage::resetViewportDefaultConfiguration): 2017-12-01 Aishwarya Nirmal [Touch Bar Web API] Object representing Touch Bar Menu to send between Web and UI Processes https://bugs.webkit.org/show_bug.cgi?id=179714 Reviewed by Wenson Hsieh. These changes define the TouchBarMenuData and TouchBarMenuItemData objects which draw information from touch bar HTMLMenuElement and HTMLMenuItemElement. These objects represent the contents of the page-customized touch bar. Changes to the html elements representing the touch bar are sent to the UI process. * Shared/TouchBarMenuData.cpp: Copied from Source/WebCore/html/HTMLMenuItemElement.cpp. (WebKit::TouchBarMenuData::TouchBarMenuData): (WebKit::TouchBarMenuData::addMenuItem): (WebKit::TouchBarMenuData::removeMenuItem): (WebKit::TouchBarMenuData::encode const): (WebKit::TouchBarMenuData::decode): * Shared/TouchBarMenuData.h: Copied from Source/WebCore/html/HTMLMenuItemElement.h. (WebKit::TouchBarMenuData::items): (WebKit::TouchBarMenuData::isPageCustomized): (WebKit::TouchBarMenuData::setIsPageCustomized): * Shared/TouchBarMenuItemData.cpp: Added. (WebKit::TouchBarMenuItemData::getItemType): (WebKit::TouchBarMenuItemData::TouchBarMenuItemData): (WebKit::TouchBarMenuItemData::encode const): (WebKit::TouchBarMenuItemData::decode): * Shared/TouchBarMenuItemData.h: Added. (WebKit::operator<): (WebKit::operator>): (WebKit::operator<=): (WebKit::operator>=): (WebKit::operator==): (WebKit::operator!=): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::touchBarMenuDataChanged): (WebKit::WebPageProxy::touchBarMenuItemDataAdded): (WebKit::WebPageProxy::touchBarMenuItemDataRemoved): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::touchBarMenuData const): * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didInsertMenuElement): (WebKit::WebChromeClient::didRemoveMenuElement): (WebKit::WebChromeClient::didInsertMenuItemElement): (WebKit::WebChromeClient::didRemoveMenuItemElement): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didInsertMenuElement): (WebKit::WebPage::didRemoveMenuElement): (WebKit::WebPage::didInsertMenuItemElement): (WebKit::WebPage::didRemoveMenuItemElement): (WebKit::WebPage::sendTouchBarMenuDataRemovedUpdate): (WebKit::WebPage::sendTouchBarMenuDataAddedUpdate): (WebKit::WebPage::sendTouchBarMenuItemDataAddedUpdate): (WebKit::WebPage::sendTouchBarMenuItemDataRemovedUpdate): * WebProcess/WebPage/WebPage.h: 2017-12-01 Daniel Bates Alternative Presentation Button: Provide a way to query for the replaced elements https://bugs.webkit.org/show_bug.cgi?id=180114 Reviewed by Tim Horton. Add SPI to query for the elements that were replaced by an Alternative Presentation Button. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame elementsReplacedByAlternativePresentationButtonWithIdentifier:]): Added. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleElementsReplacedByAlternativePresentationButton): Added. * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: 2017-12-01 Youenn Fablet Implement https://w3c.github.io/ServiceWorker/#clients-get https://bugs.webkit.org/show_bug.cgi?id=180167 Reviewed by Chris Dumez. Add IPC plumbery for clientFromId between ServiceWorker process and Storage process. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::clientFromIdCompleted): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::findClientByIdentifier): (WebKit::WebSWContextManagerConnection::findClientByIdentifierCompleted): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-01 Brian Burg Web Inspector: move Inspector::Protocol::Array to JSON namespace https://bugs.webkit.org/show_bug.cgi?id=173662 Reviewed by Joseph Pecoraro. Adopt new type names. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::getNextContext): (WebKit::WebAutomationSession::getBrowsingContexts): (WebKit::buildArrayForCookies): (WebKit::WebAutomationSession::getSessionPermissions): * UIProcess/Automation/WebAutomationSession.h: 2017-12-01 Wenson Hsieh [Attachment Support] Implement SPI for clients to update a given attachment's data https://bugs.webkit.org/show_bug.cgi?id=180184 Reviewed by Tim Horton. Add plumbing to the web process for setting the attachment data (and optionally, the content type and/or file name) of a given attachment. See WebCore ChangeLog for more detail. Changes covered by new API tests. * UIProcess/API/APIAttachment.cpp: (API::Attachment::setDataAndContentType): * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/_WKAttachment.h: Add nullability annotations around _WKAttachment SPI methods. * UIProcess/API/Cocoa/_WKAttachment.mm: (-[_WKAttachment setData:newContentType:newFilename:completion:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setAttachmentDataAndContentType): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setAttachmentDataAndContentType): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-12-01 Brady Eidson Add Internals.terminateServiceWorker, and the ability to restart service workers for postMessage. https://bugs.webkit.org/show_bug.cgi?id=180170 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::syncTerminateWorker): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveSyncMessage): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::syncTerminateWorker): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::terminateWorker): (WebKit::WebSWContextManagerConnection::syncTerminateWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveSyncMessage): * WebProcess/Storage/WebToStorageProcessConnection.h: 2017-12-01 Youenn Fablet Clear WebSWClientConnection in case storage process IPC connection is closing https://bugs.webkit.org/show_bug.cgi?id=180210 Reviewed by Chris Dumez. Clear the sw connection maps when connection is closing. Call related completion handlers for each connection. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::connectionToServerLost): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didClose): (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: 2017-12-01 Eric Carlson [MediaStream] Use CaptureDevice instead of device ID to identify devices https://bugs.webkit.org/show_bug.cgi?id=180206 Reviewed by Youenn Fablet. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::allow): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-12-01 Carlos Garcia Campos WebDriver: link and partial links queries don't work in xhtml documents https://bugs.webkit.org/show_bug.cgi?id=180191 Reviewed by Brian Burg. We convert the queries to use xpath, which works for html documents, but it doesn't work for xhtml. In case of xhtml we would need to provide a namespace resolver and elements would need to be prefixed with 'xhtml:'. It's easier to simply iterate the link elements and compare the text. Fixes: imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[link text-full link text] imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[partial link text-link text] imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[link text-full link text] imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[partial link text-link text] imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[link text-full link text] imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[partial link text-link text] imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[link text-full link text] imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[partial link text-link text] * UIProcess/Automation/atoms/FindNodes.js: (switch): (tryToFindNode): 2017-11-30 Alex Christensen REGRESSION (r224791): cookies are shared between ephemeral sessions in the same process pool https://bugs.webkit.org/show_bug.cgi?id=180235 Reviewed by Joseph Pecoraro. In r224791 I assumed that uiProcessCookieStorageIdentifier would be empty in the ephemeral session initialization message. This is not the case. We did not catch this because almost all of our ephemeral session testing uses the legacyPrivateSessionID. I add checks for if the SessionID is ephemeral like we already have in WebFrameNetworkingContext::ensureWebsiteDataStoreSession. I also add an API test that makes sure cookies are not shared between ephemeral sessions the way they are made through the API. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): 2017-11-30 Stephan Szabo Make LegacyCustomProtocolManager optional for network process https://bugs.webkit.org/show_bug.cgi?id=176230 Reviewed by Alex Christensen. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): (WebKit::NetworkProcess::initializeNetworkProcess): * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): (WebKit::NetworkProcessProxy::didClose): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient): (WebKit::WebProcessPool::registerSchemeForCustomProtocol): (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): 2017-11-30 Ryan Haddad Unreviewed build fix, suppress deprecation warnings. * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtensionImpl::sandboxExtensionForType): 2017-11-30 Daniel Bates Expose SPI didClickAlternativePresentationButtonWithUserInfo on iOS https://bugs.webkit.org/show_bug.cgi?id=180218 Reviewed by Alex Christensen. We want to support the SPI didClickAlternativePresentationButtonWithUserInfo on Cocoa platforms. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): 2017-11-30 Joseph Pecoraro [Cocoa] Web Automation: _WKAutomationSessionConfiguration leak https://bugs.webkit.org/show_bug.cgi?id=180222 Reviewed by Brian Burg. * UIProcess/Cocoa/AutomationClient.mm: (WebKit::AutomationClient::requestAutomationSessionWithCapabilities): 2017-11-30 Joseph Pecoraro Fix some NSOperationQueue leaks https://bugs.webkit.org/show_bug.cgi?id=180221 Reviewed by Wenson Hsieh. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::performDragOperation): 2017-11-30 Brian Burg Web Automation: computeElementLayout does not correctly translate iframe client coordinates to main frame coordinates https://bugs.webkit.org/show_bug.cgi?id=180213 Reviewed by Simon Fraser. The current implementation computes points in terms of the frame in which the element is located. However, WebDriver expects coordinates to be relative to the top-level document since these coordinates are used for generating click events, among other things. To convert from frame client coordinates to main frame client coordinates, round-trip both inViewCenterPoint and elementBounds to root view coordinates and back to the main frame's contents/client coordinates. Then convert this to page coordinates if needed. This progresses several tests in the Selenium Python test suite: - event_firing_webdriver_tests.py::test_should_fire_navigation_events - frame_switching_tests.py::testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFrameIndex - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWebelement - frame_switching_tests.py::testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs - position_and_size_tests.py::testShouldGetCoordinatesOfAnInvisibleElement * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::computeElementLayout): Get both the frame and main frame FrameViews and convert coordinates to the root view. This is somewhat lossy as clientToDocument* deals with FloatPoints but contentsToRootView deals with IntPoints. For the purposes of WebDriver, lossiness is not a problem since integer values are expected anyway. The imperative nature of the coordinate calculations is difficult to debug, so I converted this function to only assign to each variable once. 2017-11-30 Alex Christensen WKURLSchemeHandler.request should include HTTPBody https://bugs.webkit.org/show_bug.cgi?id=180220 Reviewed by Brady Eidson. * Shared/URLSchemeTaskParameters.cpp: Added. (WebKit::URLSchemeTaskParameters::encode const): (WebKit::URLSchemeTaskParameters::decode): * Shared/URLSchemeTaskParameters.h: Added. * UIProcess/API/Cocoa/WKURLSchemeTask.mm: (-[WKURLSchemeTaskImpl request]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startURLSchemeTask): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::create): (WebKit::WebURLSchemeTask::WebURLSchemeTask): * UIProcess/WebURLSchemeTask.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: (WebKit::WebURLSchemeTaskProxy::startLoading): 2017-11-30 Darin Adler [Mac] remove unneeded RetainPtr use introduced in r225142 https://bugs.webkit.org/show_bug.cgi?id=180202 Reviewed by Tim Horton. * WebProcess/Plugins/PDF/PDFPlugin.h: Got rid of unnecessary RetainPtr. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::lookupTextAtLocation const): Ditto. * WebProcess/WebPage/WebPage.h: Ditto. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Ditto. (WebKit::WebPage::performDictionaryLookupForSelection): Ditto. (WebKit::WebPage::performImmediateActionHitTestAtLocation): Ditto. (WebKit::WebPage::lookupTextAtLocation): Ditto. 2017-11-30 Zan Dobersek [CoordGraphics] Move CoordinatedGraphicsLayer painting behind Nicosia::PaintingEngine https://bugs.webkit.org/show_bug.cgi?id=180141 Reviewed by Carlos Garcia Campos. CompositingCoordinator must implement the paintingEngine() method now that the method's been added to the CoordinatedGraphicsLayerClient interface. The CompositingCoordinator manages the Nicosia::PaintingEngine object through the new m_paintingEngine member variable, and returns the reference to this object in the paintingEngine() method. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::CompositingCoordinator): (WebKit::CompositingCoordinator::paintingEngine): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: Drop unnecessary typedefs. 2017-11-29 Wenson Hsieh [Attachment Support] Implement SPI for clients to make an attachment element display in-place https://bugs.webkit.org/show_bug.cgi?id=180153 Reviewed by Tim Horton. Add new WebKit SPI, -[_WKAttachment setDisplayOptions:completion:], and add plumbing for attachment display options to the web content process. Changes covered by 4 new API tests. * Scripts/webkit/messages.py: (headers_for_type): * UIProcess/API/APIAttachment.cpp: (API::Attachment::setDisplayOptions): * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): Respect given display options when inserting a new attachment. * UIProcess/API/Cocoa/_WKAttachment.h: * UIProcess/API/Cocoa/_WKAttachment.mm: (-[_WKAttachmentDisplayOptions coreDisplayOptions]): Introduce a helper to convert from the Cocoa _WKAttachmentDisplayOptions object to platform-agnostic AttachmentDisplayOptions. (-[_WKAttachment setDisplayOptions:completion:]): (WebKit::if): Deleted. * UIProcess/API/Cocoa/_WKAttachmentInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::insertAttachment): (WebKit::WebPageProxy::setAttachmentDisplayOptions): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertAttachment): (WebKit::WebPage::requestAttachmentData): (WebKit::WebPage::setAttachmentDisplayOptions): (WebKit::WebPage::attachmentElementWithIdentifier const): Pull common logic to retrieve an attachment element matching a given identifier out into a helper. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-11-29 Brent Fulgham Part 2: Adopt updated NSKeyed[Un]Archiver API when available https://bugs.webkit.org/show_bug.cgi?id=180127 Reviewed by Simon Fraser. The API that accepts a user-allocated NSMutableData is deprecated. Switch (for macOS 10.12 and newer) to the modern API. Use the original API for macOS builds prior to 10.12. * 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/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): * 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/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): 2017-11-29 Brady Eidson When managing context startups, make ServiceWorkerJobDataIdentifier's optional. https://bugs.webkit.org/show_bug.cgi?id=180166 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage): (WebKit::WebSWContextManagerConnection::didFinishInstall): * WebProcess/Storage/WebSWContextManagerConnection.h: 2017-11-29 Youenn Fablet Add support for service worker generated redirections https://bugs.webkit.org/show_bug.cgi?id=179498 Reviewed by Darin Adler. Small refactoring to allow a service worker redirected fetch to follow the redirection through the service worker. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): Make use of the loader request in case a network load is needed after a service worker redirection. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::create): (WebKit::ServiceWorkerClientFetch::~ServiceWorkerClientFetch): (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch): (WebKit::ServiceWorkerClientFetch::start): (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Check for response. Generate redirected request if needed and call loader callback to process the redirection. Adding some states so that if didFinish is called before the willSendRequest callback, redirection is followed. (WebKit::ServiceWorkerClientFetch::didFinish): In case redirection should be followed, wait for didFinish to follow it. This simplifies the model although introducing some limited latency. * WebProcess/Storage/ServiceWorkerClientFetch.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): 2017-11-29 Youenn Fablet Add support for FetchEvent.clientId https://bugs.webkit.org/show_bug.cgi?id=180052 Reviewed by Chris Dumez. Using FetchOption persistency coders for cache API and modernizing IPC FetchOptions decoding. * WebKit/Shared/WebCoreArgumentCoders.cpp: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::encode): (WebKit::CacheStorage::Cache::decodeRecordHeader): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): 2017-11-29 Alex Christensen Make WebFrameLoaderClient more robust against null pointer dereferencing https://bugs.webkit.org/show_bug.cgi?id=180157 Reviewed by Tim Horton. There has always been rare null pointer crashes in this code, but they have become more common now that we are waiting for completion handlers for redirects, which makes it more likely that we are hitting this code after we have detached from the core frame. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::page const): 2017-11-29 Alex Christensen Fix Mac CMake build. * PlatformMac.cmake: 2017-11-29 Chris Dumez StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection https://bugs.webkit.org/show_bug.cgi?id=180147 Reviewed by Brady Eidson. StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection. Otherwise, we have with 2 IPC::Connections between the StorageProcess and the ServiceWorker (aka Context) process, which makes synchronization of IPC messages difficult. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::createStorageToWebProcessConnection): (WebKit::StorageProcess::createServerToContextConnection): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::start): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::getStorageProcessConnection): (WebKit::StorageProcessProxy::didFinishLaunching): (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getStorageProcessConnection): (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getStorageProcessConnection): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::isServiceWorkerProcess const): * UIProcess/WebProcessProxy.messages.in: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didReceiveMessage): (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-11-29 Chris Dumez ensure*Connection() methods on WebProcess should return a reference https://bugs.webkit.org/show_bug.cgi?id=180149 Reviewed by Alex Christensen. ensure*Connection() methods on WebProcess should return a reference instead of not returning anything. Also get rid of the non-ensure variants which called "ensure" internally and are no longer needed. * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::connection): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::messageSenderConnection): (WebKit::preregisterSandboxExtensionsIfNecessary): * WebProcess/Databases/WebDatabaseProvider.cpp: (WebKit::WebDatabaseProvider::idbConnectionToServerForSession): * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL): (WebKit::BlobRegistryProxy::registerBlobURL): (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked): (WebKit::BlobRegistryProxy::unregisterBlobURL): (WebKit::BlobRegistryProxy::registerBlobURLForSlice): (WebKit::BlobRegistryProxy::blobSize): (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles): * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::remove): (WebKit::WebLoaderStrategy::setDefersLoading): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::preconnectTo): (WebKit::WebLoaderStrategy::storeDerivedDataToCache): (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::messageSenderConnection): * WebProcess/Network/WebSocketStream.cpp: (WebKit::WebSocketStream::WebSocketStream): (WebKit::WebSocketStream::messageSenderConnection): * WebProcess/Network/webrtc/LibWebRTCResolver.cpp: (WebKit::sendOnMainThread): * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::sendOnMainThread): * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket): (WebKit::LibWebRTCSocketFactory::CreateUdpSocket): (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket): (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::sendOnMainThread): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): (WebKit::WebServiceWorkerProvider::handleFetch): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesForDOM): (WebKit::WebPlatformStrategies::setCookiesFromDOM): (WebKit::WebPlatformStrategies::cookiesEnabled): (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): (WebKit::WebPlatformStrategies::getRawCookies): (WebKit::WebPlatformStrategies::deleteCookie): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::startDownload): (WebKit::WebFrame::convertMainResourceLoadToDownload): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess): (WebKit::WebProcess::ensureNetworkProcessConnection): (WebKit::WebProcess::ensureWebToStorageProcessConnection): (WebKit::WebProcess::prefetchDNS): * WebProcess/WebProcess.h: 2017-11-29 Alex Christensen Modernize API::SerializedScriptValue https://bugs.webkit.org/show_bug.cgi?id=180115 Reviewed by Brady Eidson. Also remove some SPI that hasn't been used anywhere since Mountain Lion. * Shared/API/APISerializedScriptValue.h: (API::SerializedScriptValue::create): (API::SerializedScriptValue::internalRepresentation): (API::SerializedScriptValue::SerializedScriptValue): * Shared/API/c/WKSerializedScriptValue.cpp: (WKSerializedScriptValueDeserialize): (WKSerializedScriptValueCreateWithInternalRepresentation): Deleted. (WKSerializedScriptValueGetInternalRepresentation): Deleted. * Shared/API/c/WKSerializedScriptValuePrivate.h: Removed. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]): * WebKit.xcodeproj/project.pbxproj: 2017-11-29 Michael Catanzaro REGRESSION(r218064): [GTK] Broke entering fullscreen mode in debug builds https://bugs.webkit.org/show_bug.cgi?id=180120 Reviewed by Carlos Garcia Campos. These assertions need to be swapped. Fixes /webkit2/WebKitWebView/fullscreen in debug mode. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseEnterFullScreen): (webkitWebViewBaseExitFullScreen): 2017-11-29 Zan Dobersek [CoordGraphics] Rename CoordinatedBuffer to Nicosia::Buffer https://bugs.webkit.org/show_bug.cgi?id=180135 Reviewed by Carlos Garcia Campos. Adjust code to the CoordinatedBuffer -> Nicosia::Buffer transition. * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::setBackBuffer): (WebKit::CoordinatedBackingStore::updateTile): * Shared/CoordinatedGraphics/CoordinatedBackingStore.h: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): (WebKit::CoordinatedGraphicsScene::updateImageBacking): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::updateImageBacking): (WebKit::CompositingCoordinator::createUpdateAtlas): (WebKit::CompositingCoordinator::getCoordinatedBuffer): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::UpdateAtlas): (WebKit::UpdateAtlas::getCoordinatedBuffer): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: 2017-11-28 Brent Fulgham Adopt updated NSKeyed[Un]Archiver API when available https://bugs.webkit.org/show_bug.cgi?id=180127 Reviewed by Alex Christensen. Switch to new NSKeyed[Un]Archiver methods when available. We do not attempt to adopt secure coding in places we were not under the original API. * Platform/ios/AccessibilityIOS.mm: (WebKit::newAccessibilityRemoteToken): Use secure-by-default API. * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::encode const): Ditto. (WebKit::DataDetectionResult::decode): Ditto. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): Ditto. (WebKit::InteractionInformationAtPosition::decode): Ditto. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. * Shared/mac/WebHitTestResultData.mm: (WebKit::WebHitTestResultData::platformEncode const): Ditto. (WebKit::WebHitTestResultData::platformDecode): Ditto. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setObject:forBundleParameter:]): Ditto. (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): Ditto. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startAssistingNode): Ditto. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): Ditto. (WebKit::InjectedBundle::setBundleParameter): Ditto. (WebKit::InjectedBundle::setBundleParameters): Ditto. 2017-11-28 Youenn Fablet NetworkCache::Storage should protect itself when removing operations from its maps https://bugs.webkit.org/show_bug.cgi?id=180118 Reviewed by Antti Koivisto. The operations can contain ref to the Storage object and removing them from the map may destroy the Storage object * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::remove): (WebKit::NetworkCache::Storage::finishReadOperation): (WebKit::NetworkCache::Storage::finishWriteOperation): (WebKit::NetworkCache::Storage::traverse): 2017-11-28 Youenn Fablet Register Documents as ServiceWorker clients to the StorageProcess https://bugs.webkit.org/show_bug.cgi?id=180047 Reviewed by Brady Eidson. Adding IPC to register/unregister clients to the storage process. This will be used to enable service worker termination, and implementation of Clients API. WebSWServerConnection keeps a hash map of all its related clients. This allows unregistering these clients if the corresponding web process crashes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::~WebSWServerConnection): (WebKit::WebSWServerConnection::registerServiceWorkerClient): (WebKit::WebSWServerConnection::unregisterServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::registerServiceWorkerClient): (WebKit::WebSWClientConnection::unregisterServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: 2017-11-28 Said Abou-Hallawa [CG] PostScript images should be supported if they are sub-resource images https://bugs.webkit.org/show_bug.cgi?id=178502 Reviewed by Simon Fraser. Make convertPostScriptDataToPDF() be as static function of PDFDocumentImage in WebCore. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::convertPostScriptDataIfNeeded): (WebKit::convertPostScriptDataToPDF): Deleted. 2017-11-28 Alex Christensen Add SPI for adding strings directly to a _WKVisitedLinkStore https://bugs.webkit.org/show_bug.cgi?id=180100 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/_WKVisitedLinkStore.h: * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm: (-[_WKVisitedLinkStore addVisitedLinkWithString:]): This is a performance optimization for rdar://problem/16321391 2017-11-28 Joseph Pecoraro REGRESSION: Web Inspector: context menu actions "Download Image" and "Open Image in New Window" don't work https://bugs.webkit.org/show_bug.cgi?id=178808 Reviewed by Brian Burg. * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController _webView:contextMenu:forElement:]): Continue to hide the image context menu actions like we used to. Investigating making these context menus work can be done as a follow-up task. * UIProcess/mac/WKWebInspectorWKWebView.mm: (-[WKWebInspectorWKWebView initWithFrame:configuration:]): Use nullptr instead of 0. 2017-11-14 Carlos Garcia Campos Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h https://bugs.webkit.org/show_bug.cgi?id=173793 Reviewed by Joseph Pecocaro. Based on patch by Brian Burg. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout): (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout): (WebKit::WebAutomationSession::navigationOccurredForFrame): (WebKit::WebAutomationSession::documentLoadedForFrame): (WebKit::WebAutomationSession::inspectorFrontendLoaded): (WebKit::WebAutomationSession::keyboardEventsFlushedForPage): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): (WebKit::WebAutomationSession::setFilesToSelectForFileUpload): (WebKit::WebAutomationSession::addSingleCookie): (WebKit::WebAutomationSession::setSessionPermissions): (WebKit::WebAutomationSession::performMouseInteraction): (WebKit::WebAutomationSession::performKeyboardInteractions): * UIProcess/Automation/WebAutomationSession.h: 2017-11-28 Daniel Bates [Cocoa] First pass at implementing alternative presentation button element https://bugs.webkit.org/show_bug.cgi?id=179785 Part of Reviewed by Brent Fulgham. Expose SPI to substitute the alternative presentation button for one or more elements and remove the alternative presentation button. Add a private delegate callback when the alternative presentation button is clicked. * UIProcess/API/APIUIClient.h: (API::UIClient::didClickAlternativePresentationButton): Added. * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Wired up delegate callback. (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleAlternativePresentationButtonClick): Added. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: (API::InjectedBundle::PageUIClient::didClickAlternativePresentationButton): Added. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame substituteElements:withAlternativePresentationButtonWithIdentifier:]): Added. (-[WKWebProcessPlugInFrame removeAlternativePresentationButton:]): Added. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleSubstituteWithAlternativePresentationButton): Added. (WKBundleRemoveAlternativePresentationButton): Added. * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h: * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::didClickAlternativePresentationButton): Added. * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleAlternativePresentationButtonClick): Added. * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-11-27 Chris Dumez ASSERTION FAILED: addResult.isNewEntry WebCore::SWServerRegistration::addClientUsingRegistration(WebCore::ServiceWorkerClientIdentifier const&) + 141 https://bugs.webkit.org/show_bug.cgi?id=180049 Reviewed by Brady Eidson. * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer): (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer): (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): * WebProcess/Storage/WebSWClientConnection.h: 2017-11-27 Jeremy Jones downcast to WebKit::FullscreenClient can sometimes fail. https://bugs.webkit.org/show_bug.cgi?id=179849 Reviewed by Darin Adler. There are cases during teardown where fullscreenClient() has been cleared back to an API::FullscreenClient. Because those cases, WKWebView should test before downcasting to WebKit::FullscreenClient. This is causing a crash when fullscreen delegate is cleared after a page is closed. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): 2017-11-27 Chris Dumez Give Document a strongly typed identifier instead of a uint64_t https://bugs.webkit.org/show_bug.cgi?id=180041 Reviewed by Youenn Fablet. Give Document a strongly typed identifier instead of a uint64_t, for clarity. * Platform/IPC/ArgumentCoders.h: * Scripts/webkit/messages.py: (forward_declarations_and_headers): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::notifyClientsOfControllerChange): (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-27 Yacine Bandou [GTK][WPE] Add "enable-encrypted-media" property to WebKitWebSettings https://bugs.webkit.org/show_bug.cgi?id=18005 Reviewed by Michael Catanzaro. EncryptedMedia is an experimental JavaScript API for playing encrypted media in HTML. This property will only work as intended if the EncryptedMedia feature is enabled at build time with the ENABLE_ENCRYPTED_MEDIA flag. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsSetProperty): (webKitSettingsGetProperty): (webkit_settings_class_init): (webkit_settings_get_enable_encrypted_media): (webkit_settings_set_enable_encrypted_media): * UIProcess/API/gtk/WebKitSettings.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitSettings.h: 2017-11-27 Tim Horton One too many zeroes in macOS version number in FeatureDefines https://bugs.webkit.org/show_bug.cgi?id=180011 Reviewed by Dan Bernstein. * Configurations/FeatureDefines.xcconfig: 2017-11-27 Zan Dobersek [CoordGraphics] Prettify ID value handling in UpdateAtlas and UpdateAtlas::Client https://bugs.webkit.org/show_bug.cgi?id=180038 Reviewed by Carlos Garcia Campos. In the UpdateAtlas class, provide an ID type that aliases to uint32_t. The m_id member variable (ex-m_ID) uses this type, and it's also now used in the Client interface. While poking around, the header is modified to use '#pragma once', and m_id is moved to the more logical first position among member variables. The static ID variable is modified to use the new type, and renamed to s_nextID. Comment alongside the namespace scope closure is fixed to use the appropriate name. createUpdateAtlas() and removeUpdateAtlas() methods in the CompositingCoordinator class are modified to use the UpdateAtlas::ID type, and the former has the second parameter changed from RefPtr<> to Ref<>. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::createUpdateAtlas): (WebKit::CompositingCoordinator::removeUpdateAtlas): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::UpdateAtlas): (WebKit::UpdateAtlas::~UpdateAtlas): (WebKit::UpdateAtlas::getCoordinatedBuffer): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: 2017-11-27 Zan Dobersek [CoordGraphics] CompositingCoordinator: clean up Client vtable, GraphicsLayerClient overrides https://bugs.webkit.org/show_bug.cgi?id=180037 Reviewed by Carlos Garcia Campos. Remove the CompositingCoordinator::Client::paintLayerContents() method since the only implementation in CoordinatedLayerTreeHost was empty. Subsequently, the CompositingCoordinator::paintContents() override of the GraphicsLayerClient method can also be removed. The notifyAnimationStarted() override is empty, just like the base method, so it's removed as well. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::deviceScaleFactor const): Bring method up to the notifyFlushRequired() code, since both are overrides of the GraphicsLayerClient-inherited methods. (WebKit::CompositingCoordinator::pageScaleFactor const): Ditto. (WebKit::CompositingCoordinator::notifyAnimationStarted): Deleted. (WebKit::CompositingCoordinator::paintContents): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::paintLayerContents): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: 2017-11-27 Carlos Garcia Campos REGRESSION(r223073): disk cache directory is no longer copied in ProcessPoolConfiguration::copy() https://bugs.webkit.org/show_bug.cgi?id=180031 Reviewed by Youenn Fablet. This has caused GTK/WPE test /webkit2/WebKitWebsiteData/configuration to fail, and the wrong directory is used by the network process. I think it was removed by mistake in r223073. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): Copy m_diskCacheDirectory too. 2017-11-27 Adrian Perez de Castro [WPE][GTK] Improve contents of pkg-config .pc files https://bugs.webkit.org/show_bug.cgi?id=180032 Reviewed by Carlos Garcia Campos. * gtk/webkit2gtk-web-extension.pc.in: Add URL, edit Name and Description. * gtk/webkit2gtk.pc.in: Add URL, edit Name. * wpe/wpe-webkit.pc.in: Add URL, edit Name and Description. 2017-11-23 Darin Adler Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby https://bugs.webkit.org/show_bug.cgi?id=179981 Reviewed by Sam Weinig. * WebProcess/Plugins/PDF/PDFPlugin.h: Use some references instead of pointers. Made more things final and private. Changed functions with multiple return values to use tuples instead of out arguments for clarity, especially because some were using pointers and it was ambiguous whether the pointers could be nullptr. Tweaked formatting. Moved initialization of data members into the class definition. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::create): Take a reference. (WebKit::PDFPlugin::PDFPlugin): Ditto. Also moved some initialization to the class definition. (WebKit::PDFPlugin::countFindMatches): Added comment about ignored maxMatchCount argument. (WebKit::PDFPlugin::findString): Use contains instead of & to check bits in options. Simplified slightly confusing match count code that was doing some unnecessary comparisons with the maximum match count. Use auto a bit. (WebKit::coreCursor): Renamed from pdfLayerControllerCursorTypeToCursor since this is C++ and overloading works based on the argument type. (WebKit::PDFPlugin::notifyCursorChanged): Updated for name change. (WebKit::PDFPlugin::lookupTextAtLocation const): Return a tuple instead of using two out arguments and use a RetainPtr so we don't leak the options dictionary. * WebProcess/Plugins/PluginProxy.h: Removed unneeded include of FindOptions.h. * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: (WebKit::WebContextMenuClient::lookUpInDictionary): Pass a reference. * WebProcess/WebPage/FindController.cpp: (WebKit::core): Use |= instead of | to build up a FindOptions. (WebKit::FindController::FindController): Initialize data members in the class definition. (WebKit::pluginViewForFrame): Deleted. Callers now use WebPage::pluginViewForFrame. (WebKit::FindController::updateFindUIAfterPageScroll): Added a FIXME about some peculiar code. (WebKit::FindController::findString): Use |= rather than | to add in an option. (WebKit::FindController::hideFindUI): Use { } rather than 0 for no options. * WebProcess/WebPage/FindController.h: Moved initialization to the header. Exported the core function that converts WebKit::FindOptions to WebCore::FindOptions. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::handlesPageScaleGesture const): Use WebPage::pluginViewForFrame. (WebKit::WebFrame::requiresUnifiedScaleFactor const): Use WebPage::pluginViewForFrame. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Removed unneeded local variable and UNUSED_PARAM. (WebKit::WebPage::focusedPluginViewForFrame): Use pluginViewForFrame. (WebKit::WebPage::pluginViewForFrame): Added a null check since this takes a pointer. Use is/downcast insteadof more ad hoc coding style. (WebKit::WebPage::findStringFromInjectedBundle): Call core to convert WebKit::FindOptions to WebCore::FindOptions. Before, this was accidentally relying on the bits from the two enumrations matching! The stricter type checking of OptionSet helps us catch mistakes like this. * WebProcess/WebPage/WebPage.h: Updated for the above. Also flattened out nested #if statements, made forward declarations unconditional, and re-sorted them. Changed the Mac-specific lookupTextAtLocation to return a tuple (see below). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupForSelection): Take a reference instead of a pointer. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::rangeNearPositionMatchesText): Use { } rather than 0 for no options. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Use RetainPtr to fix code that used to leak. (WebKit::WebPage::performDictionaryLookupForSelection): Ditto. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Use a reference. (WebKit::WebPage::dictionaryPopupInfoForRange): Updated for changed argument types. (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Ditto. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::WebPage::performImmediateActionHitTestAtLocation): Updated to handle the tuple result from the lookupTextAtLocation functions. (WebKit::WebPage::lookupTextAtLocation): Changed to return a tuple and use RetainPtr for the NSDictionary to help fix the leak. 2017-11-24 Zan Dobersek [CoordGraphics] CoordinatedGraphicsLayer::updateContentBuffers() should always assume a non-null CoordinatedBuffer https://bugs.webkit.org/show_bug.cgi?id=179977 Reviewed by Carlos Garcia Campos. Make CompositingCoordinator::getCoordinatedBuffer() return a Ref value. In case an UpdateAtlas with enough free area is found, its CoordinatedBuffer is dereferenced into the return value. In case a new UpdateAtlas is created, the returned CoordinatedBuffer pointer is asserted to be non-null and dereferenced. The retrieved CoordinatedBuffer pointer on a newly-created UpdateAtlas should never be null since the tiles are smaller in size than the UpdateAtlas area. The assert is done in release configurations as well since the code in CoordinatedGraphicsLayer assumes the returned pointer will be non-null, so it's just a matter of where to crash first in case somehow a null value is returned. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::getCoordinatedBuffer): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 2017-11-24 Zan Dobersek [CoordGraphics] UpdateAtlas constructor should receive an IntSize, not a dimension value https://bugs.webkit.org/show_bug.cgi?id=179976 Reviewed by Carlos Garcia Campos. Have the UpdateAtlas constructor receive an IntSize object that specifies the desired size for the CoordinatedBuffer. Passing in a dimension doesn't really make sense since this value isn't dynamically configurable, and the only value that is passed in is already a power-of-two. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::getCoordinatedBuffer): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::UpdateAtlas): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: 2017-11-23 Sam Weinig Remove unneeded ScriptController::processingUserGesture() forwarding functions https://bugs.webkit.org/show_bug.cgi?id=179954 Reviewed by Darin Adler. Replace ScriptController::processingUserGesture() and ScriptController::processingUserGestureForMedia() with direct calls to the corresponding UserGestureIndicator functions. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::isProcessingUserGesture): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addResourceRequest): 2017-11-23 Chris Dumez WebSWServerConnection should register/unregister itself with the StorageProcess https://bugs.webkit.org/show_bug.cgi?id=179965 Reviewed by Darin Adler. WebSWServerConnection should register/unregister itself with the StorageProcess instead of relying on StorageToWebProcessConnection to do so on its behalf. This is less error-prone. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::~WebSWServerConnection): * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::removeSWServerConnection): 2017-11-23 Darin Adler Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII https://bugs.webkit.org/show_bug.cgi?id=179907 Reviewed by Sam Weinig. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::isMediaMIMEType): Use startsWithLettersIgnoringASCIICase. * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::hashString): Use isAllASCII.. * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetCustomHeaderFields): Use startsWithLettersIgnoringASCIICase.. * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setCustomHeaderFields:]): Ditto. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): Use endsWithIgnoringASCIICase. * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::WebPreferences): Initialize m_identifier explicitly. Somehow changing the String default constructor to be "= default" led to a warning that we otherwise did not get about not initializing m_identifier. Arguably a compiler bug, but legitimately strange that the copy constructor does not copy m_identifier and so nice to be explicit about it, I guess. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Use endsWithIgnoringASCIICase. (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Ditto. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState const): Use isAllSpecialCharacters. 2017-11-23 Zan Dobersek [CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates https://bugs.webkit.org/show_bug.cgi?id=179972 Reviewed by Carlos Garcia Campos. In CompositingCoordinator, add the getCoordinatedBuffer() method, replacing paintToSurface(). The new method traverses the list of UpdateAtlases and returns any CoordinatedBuffer object that was free to use. If none exist, a new UpdateAtlas object is created, and its CoordinatedBuffer is returned. In UpdateAtlas, the paintOnAvailableBuffer() method is replaced with getCoordinatedBuffer(). The latter allocates the necessary area but then returns a reference to the CoordinatedBuffer buffer, along with the atlas ID and the allocated rectangle information, and does not invoke any painting operation like paintOnAvailableBuffer() did. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::getCoordinatedBuffer): (WebKit::CompositingCoordinator::paintToSurface): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::getCoordinatedBuffer): (WebKit::UpdateAtlas::paintOnAvailableBuffer): Deleted. * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: 2017-11-23 Zan Dobersek [CoordGraphics] Remove relay CoordinatedBuffer::Client implementations https://bugs.webkit.org/show_bug.cgi?id=179970 Reviewed by Carlos Garcia Campos. Drop the helper UpdateAtlasSurfaceClient class and instead directly use the CoordinatedBuffer's GraphicsContext to perform clip and translation operations based on the allocated rectangle, to pre-fill the target rect with transparent color in case the alpha channel is supported, and to then invoke CoordinatedBuffer::Client::paintToSurfaceContext() method, passing the GraphicsContext as the argument. * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::paintOnAvailableBuffer): (): Deleted. 2017-11-23 Zan Dobersek [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer https://bugs.webkit.org/show_bug.cgi?id=179967 Reviewed by Carlos Garcia Campos. Replace uses of CoordinatedSurface class with CoordinatedBuffer. The ThreadSafeCoordinatedSurface class is removed, along with the code in CoordinatedLayerTreeHost that established a CoordinatedSurface factory. * PlatformGTK.cmake: * PlatformWPE.cmake: * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::swapBuffers): (WebKit::CoordinatedBackingStoreTile::setBackBuffer): (WebKit::CoordinatedBackingStore::updateTile): * Shared/CoordinatedGraphics/CoordinatedBackingStore.h: Rename m_surface to m_buffer, m_surfaceOffset to m_bufferOffset. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): (WebKit::CoordinatedGraphicsScene::updateImageBacking): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: Removed. * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h: Removed. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::updateImageBacking): (WebKit::CompositingCoordinator::createUpdateAtlas): (WebKit::CompositingCoordinator::paintToSurface): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::UpdateAtlas): (WebKit::UpdateAtlas::~UpdateAtlas): (WebKit::UpdateAtlas::paintOnAvailableBuffer): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: Rename m_surface to m_buffer. (WebKit::UpdateAtlas::size const): (WebKit::UpdateAtlas::supportsAlpha const): 2017-11-22 Ali Juma Implement VisualViewport API attributes https://bugs.webkit.org/show_bug.cgi?id=179385 Reviewed by Frédéric Wang. Add a VisualViewportAPI experimental feature. * Shared/WebPreferences.yaml: 2017-11-22 Tim Horton and Michael Catanzaro Remove build-webkit's notion of feature flags having a default value https://bugs.webkit.org/show_bug.cgi?id=177338 Reviewed by Carlos Alberto Lopez Perez. Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime experimental features. * Shared/WebPreferencesDefaultValues.h: 2017-11-22 Commit Queue Unreviewed, rolling out r225093. https://bugs.webkit.org/show_bug.cgi?id=179938 Compilation failed on WinCairo 64-bit Release (Requested by fredw on #webkit). Reverted changeset: "Implement VisualViewport API attributes" https://bugs.webkit.org/show_bug.cgi?id=179385 https://trac.webkit.org/changeset/225093 2017-11-21 Ali Juma Implement VisualViewport API attributes https://bugs.webkit.org/show_bug.cgi?id=179385 Reviewed by Frédéric Wang. Add a VisualViewportAPI experimental feature. * Shared/WebPreferences.yaml: 2017-11-21 Christopher Reid [PAL] Remove FileSystem's dependency on WebCoreNSStringExtras https://bugs.webkit.org/show_bug.cgi?id=179504 Reviewed by Darin Adler. * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: 2017-11-21 Carlos Garcia Campos [WPE] WPEWebProcess: Couldn't find current GLX or EGL context https://bugs.webkit.org/show_bug.cgi?id=179883 Reviewed by Žan Doberšek. I'm seeing that message quite often when running the unit tests. The problem seems to be that some tests run so fast that the web process never renders the first frame, so the context is created but never made current. I've checked with apitrace that there are calls to eglQueryContext with null display, causing a EGL_BAD_DISPLAY, but I don't know where those calls are originated. Making the context current right after it's created fixes the problem. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::createGLContext): Always call makeContextCurrent() right after the context is created. 2017-11-20 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.2 release. * gtk/NEWS: Add release notes for 2.19.2. 2017-11-20 Don Olmstead Add declspec within WebKit API https://bugs.webkit.org/show_bug.cgi?id=179893 Reviewed by Darin Adler. * Shared/API/c/WKDeclarationSpecifiers.h: 2017-11-20 Mario Sanchez Prada [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager https://bugs.webkit.org/show_bug.cgi?id=177932 Reviewed by Carlos Garcia Campos. Added new API to WebKitCookieManager to add, retrieve and delete complete cookies into/out-of a running session, and updated documentation sections. * UIProcess/API/glib/WebKitCookieManager.cpp: (webkit_cookie_manager_add_cookie): New function. (webkit_cookie_manager_add_cookie_finish): Ditto. (webkit_cookie_manager_get_cookies): Ditto. (webkit_cookie_manager_get_cookies_finish): Ditto. (webkit_cookie_manager_delete_cookie): Ditto. (webkit_cookie_manager_delete_cookie_finish): Ditto. * UIProcess/API/gtk/WebKitCookieManager.h: Added new functions. * UIProcess/API/wpe/WebKitCookieManager.h: Ditto. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Ditto. 2017-11-20 Carlos Garcia Campos [WPE] webkit_web_view_new() should enable specifying wpe_view_backend object https://bugs.webkit.org/show_bug.cgi?id=178655 Reviewed by Michael Catanzaro. Update all WebKitWebView constructors to receive a WebKitWebViewBackend as argument. It's now required to provide a backend to create a web view, but it can be NULL to use the default one. WebKitWebViewBackend is a boxed type wrapping a struct wpe_view_backend* used as construct only property of WebKitWebView. The view always takes the ownership of the WebKitWebViewBackend which owns the struct wpe_view_backend*. An optional GDestroyNotify and user data pointer can be passed to the WebKitWebViewBackend constructor to provide a custom deleter for the backend. In the C API the struct wpe_view_backend* is also mandatory now, but it can't be NULL and it's owned by the caller, not the view. * PlatformWPE.cmake: * UIProcess/API/C/wpe/WKView.cpp: (WKViewCreate): * UIProcess/API/C/wpe/WKView.h: * UIProcess/API/glib/WebKitWebView.cpp: (_WebKitWebViewPrivate::~_WebKitWebViewPrivate): (webkitWebViewConstructed): (webkitWebViewSetProperty): (webkitWebViewGetProperty): (webkit_web_view_class_init): (webkitWebViewCreatePage): (webkit_web_view_get_backend): * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_backend): (WKWPE::View::~View): * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/WebKitWebViewBackend.cpp: Added. (_WebKitWebViewBackend::_WebKitWebViewBackend): (_WebKitWebViewBackend::~_WebKitWebViewBackend): (webkitWebViewBackendRef): (webkitWebViewBackendUnref): (webkitWebViewBackendCreateDefault): (webkit_web_view_backend_new): (webkit_web_view_backend_get_wpe_backend): * UIProcess/API/wpe/WebKitWebViewBackend.h: Added. * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h: Added. * 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): * UIProcess/API/wpe/webkit.h: 2017-11-20 Carlos Garcia Campos [GTK][WPE] webkit_cookie_manager_delete_all_cookies doesn't delete the cookies if called before a web process is running https://bugs.webkit.org/show_bug.cgi?id=175265 Reviewed by Michael Catanzaro. This is what happens: 1- We create our WebKitWebContext that creates its WebProcessPool. 2- We set a persistent cookies storage. 3- We ask the website data store to delete all cookies, but since website data store is a web process observer and we haven't spawned any web process yet, it creates a new WebProcessPool with the default configuration (no persistent cookies) and sends the message to delete the cookies there. 4- The network process of the second process pool does nothing because it doesn't have cookies at all. We need to set the primary data store of the WebProcessPool when WebKitWebContext is constructed to ensure that one is used before the web process is launched. * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): 2017-11-19 Tim Horton Remove unused TOUCH_ICON_LOADING feature flag https://bugs.webkit.org/show_bug.cgi?id=179873 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2017-11-19 Tim Horton Remove unused LEGACY_VENDOR_PREFIXES feature flag https://bugs.webkit.org/show_bug.cgi?id=179872 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: 2017-11-18 Chris Dumez ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier) https://bugs.webkit.org/show_bug.cgi?id=179846 Reviewed by Darin Adler. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::rejectJobInClient): (WebKit::WebSWServerConnection::resolveRegistrationJobInClient): (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient): (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage): (WebKit::WebSWContextManagerConnection::didFinishInstall): * WebProcess/Storage/WebSWContextManagerConnection.h: 2017-11-18 Tim Horton Rename some Network Capture debugging defines https://bugs.webkit.org/show_bug.cgi?id=179870 Reviewed by Darin Adler. * NetworkProcess/capture/NetworkCaptureLogging.h: * NetworkProcess/capture/NetworkCaptureManager.cpp: (WebKit::NetworkCapture::Manager::findMatch): (WebKit::NetworkCapture::Manager::fuzzyMatchURLs): These shouldn't have WTF in their name - they have nothing to do with WTF. These shouldn't use ENABLE(), since they're not features, just debugging macros. 2017-11-17 Chris Dumez [Service Workers] Implement "Notify Controller Change" algorithm https://bugs.webkit.org/show_bug.cgi?id=179822 Reviewed by Youenn Fablet. * Scripts/webkit/messages.py: (class_template_headers): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::notifyClientsOfControllerChange): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-17 Chris Dumez Use a strongly typed identifier for SWServer::Connection https://bugs.webkit.org/show_bug.cgi?id=179848 Reviewed by Brady Eidson. Use a strongly typed identifier for SWServer::Connection, for clarity. * Scripts/webkit/messages.py: (forward_declarations_and_headers): (forward_declarations_and_headers.templates): (headers_for_type): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): * 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: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::removeSWServerConnection): (WebKit::generateIDBConnectionToServerIdentifier): (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): * StorageProcess/StorageToWebProcessConnection.h: * StorageProcess/StorageToWebProcessConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: 2017-11-17 John Wilander Storage Access API: UI process should update network process about granted access https://bugs.webkit.org/show_bug.cgi?id=176943 Reviewed by Alex Christensen. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): Updates storage access on the session. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): (WebKit::NetworkProcess::setStorageAccessAPIEnabled): * UIProcess/API/C/WKCookieManager.cpp: (WKCookieManagerSetStorageAccessAPIEnabled): * UIProcess/API/C/WKCookieManager.h: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _isStorageAccessAPIEnabled]): (-[WKProcessPool _setStorageAccessAPIEnabled:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]): Test infrastructure. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): (WebKit::WebProcessPool::setStorageAccessAPIEnabled): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::nextRequestStorageAccessContextId): (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): Sends a message to the network process to update storage access. (WebKit::NetworkProcessProxy::storageAccessRequestResult): Receives a message from the network process that storage access was updated. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::setStorageAccessAPIEnabled): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebProcessPool.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction): Test infrastructure. (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Now makes the API call even if the only operation is to clear first. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): Propagates the storage access directive to the network process proxy. (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-11-16 Yousuke Kimoto [WinCairo] Add network (curl) files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=179474 Reviewed by Alex Christensen. * Shared/curl/WebCoreArgumentCodersCurl.cpp: (IPC::ArgumentCoder::decode): Fidex return value since currently no operation is needed for wincairo webkit. (IPC::ArgumentCoder::decodePlatformData): Fidex return value since currently no operation is needed for wincairo webkit. * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp. (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h. 2017-11-16 Don Olmstead [WinCairo] Update WinCairoRequirements https://bugs.webkit.org/show_bug.cgi?id=179790 Reviewed by Alex Christensen. * PlatformWin.cmake: 2017-11-16 Youenn Fablet Service Worker should get the body of intercepted requests https://bugs.webkit.org/show_bug.cgi?id=179776 Reviewed by Alex Christensen. Pass a FormDataReference when starting fetch IPC. Convert this FormDataReference in a FormData and using it to set the FetchRequest body properly in Service Worker process. Forbid fetch interception when URL is not HTTP/HTTPS. * Platform/IPC/FormDataReference.h: (IPC::FormDataReference::FormDataReference): (IPC::FormDataReference::takeData): (IPC::FormDataReference::encode const): (IPC::FormDataReference::decode): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): 2017-11-16 Daniel Bates Add feature define for alternative presentation button element https://bugs.webkit.org/show_bug.cgi?id=179692 Part of Reviewed by Andy Estes. Only enabled on Cocoa platforms by default. * Configurations/FeatureDefines.xcconfig: 2017-11-16 Chris Dumez [Service Worker] Implement "Try Clear Registration" algorithm https://bugs.webkit.org/show_bug.cgi?id=179791 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): * WebProcess/Storage/WebSWClientConnection.h: 2017-11-16 Michael Catanzaro REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState https://bugs.webkit.org/show_bug.cgi?id=179797 Reviewed by Simon Fraser. r224179 introduced a performance regression. The newly-added code in WebPage::editorState is part of a performance-critical path. (The editor state is computed and sent to the UI process during the layer flush.) Calls to Editor::canUndo and Editor::canRedo were added, but these calls are both implemented with sync IPC calls to WebPageProxy in the UI process. WebPageProxy passes them along to PageClientImpl to compute the availability of the commands. That's all pointless because this code only exists for the purpose of getting editing command availability to the UI process. In the case of undo and redo, it's not needed at all. I did not realize that when writing the code. So canUndo and canRedo should be removed from EditorState. This ought to be sufficient to avoid the perf regression. No changes are needed to the GTK/WPE WebKitEditorState API. The API is reimplemented using WebPageProxy::canUndoRedo instead of EditorState. There should be no changes in behavior, only performance. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: * UIProcess/API/glib/WebKitEditorState.cpp: (webkitEditorStateCreate): (webkitEditorStateChanged): * UIProcess/API/glib/WebKitEditorStatePrivate.h: * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_get_editor_state): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::canUndo): (WebKit::WebPageProxy::canRedo): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): 2017-11-16 Megan Gardner Remove allowBlockSelection as block selection is not supported anymore https://bugs.webkit.org/show_bug.cgi?id=179738 Reviewed by Tim Horton. Remove all instances of the alloweBlockSelection flag. Blocks selection is fully disabled and thus this flag will do nothing. This was only added as a debug measure last year, and nothing ever actually used it. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _allowsBlockSelection]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _allowsBlockSelection]): Deleted. (-[WKWebViewConfiguration _setAllowsBlockSelection:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::allowsBlockSelection): Deleted. * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: 2017-11-16 Brent Fulgham Whitelist additional IOKit properties based on customer feedback https://bugs.webkit.org/show_bug.cgi?id=179782 Reviewed by Dean Jackson. Expand the IOKit property whitelist to recognize a few more properties as valid based on review of logs from customer systems and our test infrastructure. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-15 Brady Eidson Implement basics of "Terminate Service Worker" algorithm. https://bugs.webkit.org/show_bug.cgi?id=179551 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::terminateWorker): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::terminateWorker): (WebKit::WebSWContextManagerConnection::workerTerminated): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-15 Brent Fulgham Remove access to 'com.apple.mediaaccessibility.public' preferences in WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=179747 Reviewed by Dean Jackson. The 'mediaaccessibilityd' process handles access to MediaAccessibility preferences. We don't need to grant the WebContent Process sandbox access to them. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-15 Alex Christensen Revert r224885 https://bugs.webkit.org/show_bug.cgi?id=179719 * UIProcess/API/APIContentRuleListStore.cpp: (API::compiledToFile): r224885 was a speculative fix that did not fix anything on the bots. 2017-11-15 Brent Fulgham Unreviewed build fix after r224830. * WebProcess/com.apple.WebProcess.sb.in: Add missing sysctl-read permissions needed to support testing on Mac Mini hardware. 2017-11-15 Youenn Fablet Add ServiceWorker to WebProcess plumbery for FormData fetch responses https://bugs.webkit.org/show_bug.cgi?id=179694 Reviewed by Alex Christensen. Added plumbery from Service Worker up to Web Process to pass form data response bodies. A follow-up patch should read the data from Network Process and send it to the ResourceLoader. * Platform/IPC/FormDataReference.h: Added. (IPC::FormDataReference::FormDataReference): (IPC::FormDataReference::takeData): (IPC::FormDataReference::encode const): (IPC::FormDataReference::decode): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::didReceiveFetchFormData): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didReceiveFetchFormData): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveFormData): * WebProcess/Storage/ServiceWorkerClientFetch.h: * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: 2017-11-15 Alex Christensen Move a compiled WKContentRuleList to its destination before calling mmap https://bugs.webkit.org/show_bug.cgi?id=179719 Reviewed by Brady Eidson. Right now we compile a WKContentRuleList to a temporary file, call mmap, close the file, then move it. Sometimes, especially on bots running tests, the move fails because the temporary file doesn't exist any more. Moving the file before mmaping and closing the file might prevent this failure. * UIProcess/API/APIContentRuleListStore.cpp: (API::compiledToFile): 2017-11-15 Chris Dumez [Service Workers] Implement Client API https://bugs.webkit.org/show_bug.cgi?id=179709 Reviewed by Alex Christensen. * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-15 Ryan Haddad Unreviewed, rolling out r224863. Introduced LayoutTest crashes on iOS Simulator. Reverted changeset: "Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h" https://bugs.webkit.org/show_bug.cgi?id=173793 https://trac.webkit.org/changeset/224863 2017-11-14 Brent Fulgham Remove access to "com.apple.pbs.fetch_services" from WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=179689 Reviewed by Per Arne Vollan. WebKit's WebContent process should not have any need to interact with the fetch_services API exposed to the system. These interactions (if needed) should be happening in the UIProcess, so we should prevent the untrusted Web Content Process from being able to connect. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-15 Michael Catanzaro Remove GTK web inspector images https://bugs.webkit.org/show_bug.cgi?id=179716 Reviewed by Carlos Garcia Campos. * InspectorGResources.cmake: 2017-11-15 Gabriel Ivascu [GTK] Automatically adjust font size when gtk-xft-dpi changes https://bugs.webkit.org/show_bug.cgi?id=142673 Some follow-up fixes for the previous patch. Reviewed by Carlos Garcia Campos. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsDispose): (webKitSettingsConstructed): 2017-11-14 Nan Wang AX: AOM: Implement AccessibleNode class and support label and role attributes https://bugs.webkit.org/show_bug.cgi?id=179494 Reviewed by Ryosuke Niwa. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAccessibilityObjectModelEnabled): (WKPreferencesGetAccessibilityObjectModelEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2017-11-14 Carlos Garcia Campos Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h https://bugs.webkit.org/show_bug.cgi?id=173793 Reviewed by Brian Burg. Based on patch by Brian Burg. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout): (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout): (WebKit::WebAutomationSession::navigationOccurredForFrame): (WebKit::WebAutomationSession::documentLoadedForFrame): (WebKit::WebAutomationSession::inspectorFrontendLoaded): (WebKit::WebAutomationSession::keyboardEventsFlushedForPage): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): (WebKit::WebAutomationSession::setFilesToSelectForFileUpload): (WebKit::WebAutomationSession::addSingleCookie): (WebKit::WebAutomationSession::setSessionPermissions): (WebKit::WebAutomationSession::performMouseInteraction): (WebKit::WebAutomationSession::performKeyboardInteractions): * UIProcess/Automation/WebAutomationSession.h: 2017-11-14 Chris Dumez [Service Workers] Implement container.getRegistrations() https://bugs.webkit.org/show_bug.cgi?id=179672 Reviewed by Brady Eidson. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::getRegistrations): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::didGetRegistrations): (WebKit::WebSWClientConnection::getRegistrations): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-14 Youenn Fablet Implement ServiceWorker handle fetch for navigation loads https://bugs.webkit.org/show_bug.cgi?id=179404 Reviewed by Alex Christensen and Chris Dumez. Update handle fetch algorithm to support navigation requests. In case of navigation requests, set service worker response mime type to text/html if none is provided. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): (WebKit::WebServiceWorkerProvider::handleFetch): 2017-11-14 Alex Christensen Remove Cocoa CFURLConnection loading code https://bugs.webkit.org/show_bug.cgi?id=179688 Reviewed by Antti Koivisto. * NetworkProcess/Downloads/Download.h: 2017-11-14 Daniel Bates Update comment in FeatureDefines.xcconfig to reflect location of Visual Studio property files for feature defines Following r195498 and r201917 the Visual Studio property files for feature defines have moved from directory WebKitLibraries/win/tools/vsprops to directory Source/cmake/tools/vsprops. Update the comment in FeatureDefines.xcconfig to reflect the new location and names of these files. * Configurations/FeatureDefines.xcconfig: 2017-11-14 Brent Fulgham Whitelist some IOKIt properties to avoid sandbox violations on YouTube https://bugs.webkit.org/show_bug.cgi?id=179683 Reviewed by Dean Jackson. YouTube video playback on some hardware (and some video encodings) generates sandbox violations. Add whitelist entries for the relevant IOKit properties needed to support these activities. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-14 Daniel Bates Mark WebChromeClient::requestStorageAccess() as final https://bugs.webkit.org/show_bug.cgi?id=179673 Reviewed by Sam Weinig. Mark WebChromeClient::requestStorageAccess() as final so that it overrides the virtual function in ChromeClient with the same name and hence we actually call it through a ChromeClient pointer. * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-11-14 Youenn Fablet WebSWClientConnection should do IPC to StorageProcess if its WebSWOriginTable is not yet initialized https://bugs.webkit.org/show_bug.cgi?id=179668 Reviewed by Chris Dumez. There may be cases where the origin table is not initialized and we would think there is no service worker registration. In such a case, we should go to the StorageProcess. StorageProcess is now sending an IPC message back to each registered SW connection so that WebProcess will know whether its map is correctly initialized or not. Renaming hasServiceWorkerRegisteredForOrigin in mayHaveServiceWorkerRegisteredForOrigin. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const): (WebKit::WebSWClientConnection::matchRegistration): (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const): Deleted. * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWOriginTable.h: (WebKit::WebSWOriginTable::isInitialized const): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): 2017-11-14 Brent Fulgham Consolidate sysctl-read rules in WebProcess sandbox https://bugs.webkit.org/show_bug.cgi?id=179674 Reviewed by Dean Jackson. Consolidate the various calls to 'allow sysctl-read' imported during Bug 179548 into the main function in the sandbox profile. Remove the statement to grant global sysctl-read permissions that was copied into this sandbox profile in an earlier checkin. We started blocking the blanket read permissions in macOS 10.13, and want to continue to do so. The earlier "grant global read access" in 'system.sb' apparently allowed some sysctl reads to occur before we hit the block declaration in the WebContent sandbox. Now that we are consistently blocking systcl reads from the start, we need to add whitelist entries for a few more entries to avoid creating new sandbox violations. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-14 Alex Christensen Remove WebKit CFURLConnection code https://bugs.webkit.org/show_bug.cgi?id=179645 Reviewed by Alexey Proskuryakov. The CFURLConnection code is Windows-specific now. Nobody can use it in modern WebKit. * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/mac/DownloadMac.mm: * NetworkProcess/NetworkLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::serverTrustCredential): * NetworkProcess/mac/NetworkLoadMac.mm: * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::useCredentialForSingleChallenge): (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge): (WebKit::AuthenticationManager::cancelSingleChallenge): (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge): (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge): * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: * Shared/Authentication/mac/AuthenticationManager.mac.mm: (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * config.h: 2017-11-14 Alex Christensen Remove assertions added in r224791 https://bugs.webkit.org/show_bug.cgi?id=178751#c10 * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): I had added assertions that sandbox extension handle consumption succeeds. In the API test IndexedDB.StructuredCloneBackwardCompatibility we get a sandbox extension handle to give access to a directory that does not exist and consumption fails. We want it to fail, so my optimistic addition of a success assertion was incorrect. The test passes without it and behaves like it used to. 2017-11-14 Tim Horton Don't use -[NSString stringWithFormat:] to build defaults keys https://bugs.webkit.org/show_bug.cgi?id=179680 Reviewed by Simon Fraser. * UIProcess/mac/WebPreferencesMac.mm: (WebKit::makeKey): (WebKit::debugUserDefaultsValue): Use string concatenation instead of stringWithFormat to build preference keys. This wasn't a huge cost, but it shaves a few milliseconds off process launch. 2017-11-14 Alex Christensen Clean up old URL parser remnants https://bugs.webkit.org/show_bug.cgi?id=179573 Reviewed by Darin Adler. * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::searchWithGoogle): Use https if we do end up searching with google. 2017-11-14 Antti Koivisto Enable display:contents by default https://bugs.webkit.org/show_bug.cgi?id=179655 Reviewed by Sam Weinig. * Shared/WebPreferences.yaml: Make non-experimental and enabled. 2017-11-10 Brent Fulgham Consolidate mach-lookup calls in WebProcess sandbox https://bugs.webkit.org/show_bug.cgi?id=179650 Reviewed by Dean Jackson. Consolidate the various calls to 'allow mach-lookup' imported during Bug 179548 into the main function in the sandbox profile. Remove some entries that are not needed by WebKit. Remove the statement to grant global permission to perform mach-lookup for any xpc service name that was copied into this sandbox profile in Bug 179548. We started blocking this in macOS 10.13 and want to continue to do so. The earlier "grant global permission" in 'system.sb' apparently allowed some xpc lookups to occur before we hit the block declaration in the WebContent sandbox. Now that we are consistently blocking mach lookups we need to add whitelist entries for a few more services to avoid creating new sandbox violations. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-14 Tim Horton Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet https://bugs.webkit.org/show_bug.cgi?id=179646 Reviewed by Simon Fraser. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showImageSheet]): (-[WKActionSheetAssistant showLinkSheet]): (-[WKActionSheetAssistant showDataDetectorsSheet]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): Make use of canBePresentedByDataDetectors with our WebCore URL instead of (sometimes unsucessfully) reparsing the URL with NSURL's parser. Also, avoid a few unnecessary round-trips through String when converting from URL to NSURL. 2017-11-14 Brent Fulgham REGRESSION(r224799): WebKit crashes on Sierra due to sandbox violation https://bugs.webkit.org/show_bug.cgi?id=179656 Unreviewed build fix. * WebProcess/com.apple.WebProcess.sb.in: Switch to Dan's recommended version check. 2017-11-13 Joseph Pecoraro Give a ServiceWorker WebContentProcess a different display name https://bugs.webkit.org/show_bug.cgi?id=179653 Reviewed by Brady Eidson. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::create): Call connect after construction so virtual methods will use subclass implementations. * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::create): Copy the pattern from WebProcessProxy to ensure connect() gets called after construction. (WebKit::ServiceWorkerProcessProxy::getLaunchOptions): Set a launch option to signal this is a Service Worker process. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeProcessName): Consume the launch option to configuration the process name. 2017-11-13 Ryosuke Niwa REGRESSION(r224799): WebKit crashes at launch on macOS Sierra due to a sandbox violation https://bugs.webkit.org/show_bug.cgi?id=179656 Unreviewed. Revert r224799 on macOS Sierra. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-13 Chris Dumez Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers https://bugs.webkit.org/show_bug.cgi?id=179649 Reviewed by Brady Eidson. * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::updateRegistrationStateInClient): (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-13 Brady Eidson Massive "Server-process-to-context-process" connection overhaul. https://bugs.webkit.org/show_bug.cgi?id=179554 Reviewed by Chris Dumez. * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::sendToContextProcess): (WebKit::WebSWServerConnection::installServiceWorkerContext): Deleted. (WebKit::WebSWServerConnection::fireInstallEvent): Deleted. (WebKit::WebSWServerConnection::fireActivateEvent): Deleted. (WebKit::WebSWServerConnection::setContextConnection): Deleted. * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServerWorker.cpp. (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection): (WebKit::WebSWServerToContextConnection::messageSenderConnection): (WebKit::WebSWServerToContextConnection::messageSenderDestinationID): (WebKit::WebSWServerToContextConnection::connectionClosed): (WebKit::WebSWServerToContextConnection::installServiceWorkerContext): (WebKit::WebSWServerToContextConnection::fireInstallEvent): (WebKit::WebSWServerToContextConnection::fireActivateEvent): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerTypes.h. (WebKit::WebSWServerToContextConnection::create): (WebKit::WebSWServerToContextConnection::ipcConnection const): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didClose): (WebKit::StorageProcess::didReceiveMessage): (WebKit::StorageProcess::globalServerToContextConnection): (WebKit::StorageProcess::createServerToContextConnection): (WebKit::StorageProcess::didGetWorkerContextProcessConnection): (WebKit::StorageProcess::workerContextProcessConnection): Deleted. (WebKit::StorageProcess::createWorkerContextProcessConnection): Deleted. (WebKit::StorageProcess::serviceWorkerContextFailedToStart): Deleted. (WebKit::StorageProcess::serviceWorkerContextStarted): Deleted. (WebKit::StorageProcess::didFinishServiceWorkerInstall): Deleted. (WebKit::StorageProcess::didFinishServiceWorkerActivation): Deleted. (WebKit::StorageProcess::setServiceWorkerHasPendingEvents): Deleted. * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage): (WebKit::WebSWContextManagerConnection::fireInstallEvent): (WebKit::WebSWContextManagerConnection::fireActivateEvent): (WebKit::WebSWContextManagerConnection::didFinishInstall): (WebKit::WebSWContextManagerConnection::didFinishActivation): (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-13 Brent Fulgham WebContent sandbox should not include 'system.sb' https://bugs.webkit.org/show_bug.cgi?id=179548 Reviewed by Darin Adler. Stop including 'system.sb', and just include the portions of that sandbox that we actually use in WebContent Process. This is the first step in some further sandbox tightening. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-13 Simon Fraser When navigating back to a page, compositing layers may not use accelerated drawing https://bugs.webkit.org/show_bug.cgi?id=178749 rdar://problem/35158946 Reviewed by Dean Jackson. Avoid assertions when a test enables accelerated drawing (which we can't support in the iOS simulator). * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::ensureBackingStore): 2017-11-13 Youenn Fablet matchRegistration does not need to go to StorageProcess if no service worker is registered https://bugs.webkit.org/show_bug.cgi?id=179480 Reviewed by Chris Dumez. Removed origin store handling from StorageProcess since it is now handled within SWServer. Updated clearing of web site data accordingly. Optimized matchRegistration by looking at the origin store before doing any IPC. Do IPC to the StorageProcess if the origin store is not yet initialized on the WebProcess. * StorageProcess/ServiceWorker/WebSWOriginStore.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::resolveRegistrationJobInClient): (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient): * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): (WebKit::StorageProcess::swServerForSession): (WebKit::StorageProcess::swOriginStoreForSession): (WebKit::StorageProcess::registerSWServerConnection): (WebKit::StorageProcess::unregisterSWServerConnection): (WebKit::StorageProcess::ensureSWOriginStoreForSession): Deleted. (WebKit::StorageProcess::swOriginStoreForSession const): Deleted. * StorageProcess/StorageProcess.h: * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: (WebKit::WebSWOriginStore::addToStore): (WebKit::WebSWOriginStore::removeFromStore): (WebKit::WebSWOriginStore::clearStore): (WebKit::WebSWOriginStore::add): Deleted. (WebKit::WebSWOriginStore::remove): Deleted. (WebKit::WebSWOriginStore::clear): Deleted. * StorageProcess/ServiceWorker/WebSWOriginStore.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::matchRegistration): 2017-11-13 Alex Christensen Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type https://bugs.webkit.org/show_bug.cgi?id=178751 Reviewed by Brady Eidson. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::ensurePrivateBrowsingSession): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted. * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): * Shared/WebsiteDataStoreParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::pageAddedToProcess): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPrivateBrowsingEnabled): * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setSessionID): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensurePrivateBrowsingSession): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-11-13 Alex Christensen Add logs to debug content extension test failures https://bugs.webkit.org/show_bug.cgi?id=179624 Reviewed by Chris Dumez. * UIProcess/API/APIContentRuleListStore.cpp: (API::compiledToFile): Right now I'm seeing this log: "Rule list compilation failed: Unspecified error during compile." I need more information to debug what is failing on the bots. 2017-11-07 Brian Burg Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates https://bugs.webkit.org/show_bug.cgi?id=179129 Reviewed by Simon Fraser. When computing the in view center point per W3C specification, the top content inset is inadvertently added back in when converting to the root view coordinate system. This patch reworks the protocol command so that it explicitly requests a coordinate system, with options for "Page" (root / contents), "LayoutViewport", and "VisualViewport". The latter is not implemented in this patch, since it is intended for use on iOS someday. * UIProcess/Automation/Automation.json: Change usesViewport to CoordinateSystem. Add a new coordinate system enum type and use it. Fix relevant comments for Automation.computElementLayout. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::protocolStringToCoordinateSystem): (WebKit::WebAutomationSession::computeElementLayout): Parse the requested coordinate system and send it in the message to the web process. * WebKit.xcodeproj/project.pbxproj: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::computeElementLayout): Rework the implementation. Get the element bounds and in-view center point in client coordinates and convert back to root view coordinates for CoordinateSystem::Page. 2017-11-08 Keith Miller Async iteration should only fetch the next method once and add feature flag https://bugs.webkit.org/show_bug.cgi?id=179451 Reviewed by Geoffrey Garen. Add feature flag for Async iteration. * Configurations/FeatureDefines.xcconfig: 2017-11-13 Mark Lam Add more overflow check book-keeping for MarkedArgumentBuffer. https://bugs.webkit.org/show_bug.cgi?id=179634 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::construct): (WebKit::NPJSObject::invoke): 2017-11-13 Timothy Horton Address some post-landing review comments from r224728 https://bugs.webkit.org/show_bug.cgi?id=179576 * Platform/IPC/mac/MachMessage.h: (IPC::MachMessage::setMessageReceiverName): (IPC::MachMessage::setMessageName): More moving! 2017-11-13 Tim Horton Occasional MobileSafari crash under -[WKPDFView web_setMinimumSize:] https://bugs.webkit.org/show_bug.cgi?id=179628 Reviewed by Simon Fraser. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _computePageAndDocumentFrames]): Similar to r223444, avoid propagating null CGRects into the view hierarchy. In this case, the null rect comes from applying margins to a rect that is smaller than the margins. We could check for that specifically, but a more-general check for a null rect seems reasonable. 2017-11-13 Tim Horton Use the real mach type instead of reinterpret_casting in MachMessage https://bugs.webkit.org/show_bug.cgi?id=179629 Reviewed by Dan Bernstein. * Platform/IPC/mac/MachMessage.cpp: (IPC::MachMessage::header): * Platform/IPC/mac/MachMessage.h: Just use mach_msg_header_t proper, and avoid the reinterpret_cast. This also corrects the alignment of the struct on platforms where alignof(mach_msg_header_t) != alignof(uint8_t). 2017-11-13 Gabriel Ivascu [GTK] Automatically adjust font size when gtk-xft-dpi changes https://bugs.webkit.org/show_bug.cgi?id=142673 Reviewed by Michael Catanzaro. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsDispose): (webKitSettingsConstructed): (webkit_settings_class_init): 2017-11-13 Chris Dumez Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms https://bugs.webkit.org/show_bug.cgi?id=179618 Reviewed by Brady Eidson. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::setServiceWorkerHasPendingEvents): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents): * WebProcess/Storage/WebSWContextManagerConnection.h: 2017-11-13 Wenson Hsieh [Attachment Support] Implement SPI for clients to request data for a given attachment https://bugs.webkit.org/show_bug.cgi?id=179586 Reviewed by Darin Adler. Adds support in WebKit for fetching data for a given attachment element. See WebCore/ChangeLog for more details. Most of the changes here are boilerplate plumbing of -requestAttachmentData through the client layers. Test coverage by augmenting existing API tests in WKAttachmentTests, and adding 3 new tests. * UIProcess/API/APIAttachment.cpp: (API::Attachment::requestData): * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/_WKAttachment.h: * UIProcess/API/Cocoa/_WKAttachment.mm: (-[_WKAttachment requestData:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sharedBufferCallback): Add a new IPC callback helper type, SharedBufferCallback. This is similar to the existing DataCallback, but instead of deserializing to an API::Data, we convert to a SharedBuffer instead. Additionally, SharedBufferCallback is able to draw a distinction between null data and empty data. This allows -requestData: to distinguish between cases where (for instance) the data for a given attachment is an empty blob, and when the attachment doesn't exist at all. (WebKit::WebPageProxy::dataCallback): (WebKit::WebPageProxy::insertAttachment): (WebKit::WebPage::invokeSharedBufferCallback): (WebKit::WebPageProxy::requestAttachmentData): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::requestAttachmentData): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-11-12 Darin Adler More is<> and downcast<>, less static_cast<> https://bugs.webkit.org/show_bug.cgi?id=179600 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp: (WebKit::wrap): Use is/downcast. * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::WebEditorClient::handleKeyboardEvent): Ditto. * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: (WebKit::WebEditorClient::handleKeyboardEvent): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::handleEditingKeyboardEvent): Ditto. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::frameForEvent): Ditto. 2017-11-12 Gabriel Ivascu [GTK] Add functionality to handle font sizes in points https://bugs.webkit.org/show_bug.cgi?id=179285 Reviewed by Carlos Garcia Campos and Michael Catanzaro. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_class_init): (webkit_settings_font_size_to_points): (webkit_settings_font_size_to_pixels): * UIProcess/API/gtk/WebKitSettings.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: 2017-11-11 Tim Horton Increase the alignment requirement of WKObject's wrapped C++ object https://bugs.webkit.org/show_bug.cgi?id=179518 Reviewed by Dan Bernstein. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::allocateWKObject): (API::Object::fromWKObjectExtraSpace): (API::Object::newObject): * Shared/Cocoa/WKObject.mm: (-[WKObject dealloc]): (-[WKObject _apiObject]): * UIProcess/API/Cocoa/WKConnection.mm: (-[WKConnection dealloc]): (-[WKConnection _apiObject]): (-[WKConnection _connection]): Increase the alignment of the C++ object stored inside WKObject's extra space to 8-bytes, for platforms where some types require greater-than-pointer alignment. To achieve this, increase the size of the extra-space allocation by the difference between 8 bytes and pointer-alignment, and then align within that. 2017-11-11 Tim Horton Avoid composing the message + recipient name for crash logs until a failure actually occurs https://bugs.webkit.org/show_bug.cgi?id=179576 Reviewed by Dan Bernstein. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::sendMessage): (IPC::Connection::sendOutgoingMessage): * Platform/IPC/mac/MachMessage.h: (IPC::MachMessage::messageReceiverName const): (IPC::MachMessage::setMessageReceiverName): (IPC::MachMessage::messageName const): (IPC::MachMessage::setMessageName): Store the message name and receiver name separately on MachMessage, only composing them into a string if the message is unhandled. This makes the time spent composing the string in sendOutgoingMessage completely disappear. In absolute terms, it wasn't huge, but if you do enough IPC it starts to add up. 2017-11-10 Chris Dumez [Service Workers] Implement "Try Activate" / "Activate" algorithms https://bugs.webkit.org/show_bug.cgi?id=179436 Reviewed by Brady Eidson. Implement proper "Try Activate" / "Activate" algorithms as per: - https://w3c.github.io/ServiceWorker/#try-activate-algorithm - https://w3c.github.io/ServiceWorker/#activation-algorithm * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::fireActivateEvent): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didFinishServiceWorkerActivation): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::fireActivateEvent): (WebKit::WebSWContextManagerConnection::didFinishActivation): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-10 John Wilander Ignore HSTS for partitioned, cross-origin subresource requests https://bugs.webkit.org/show_bug.cgi?id=178993 Reviewed by Brent Fulgham. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (downgradeRequest): Convenience function to downgrade a request if CFNetwork as already upgraded it during canonicalization. This allows the rest of WebKit's processing to function, such as UIR and mixed content blocking. (updateIgnoreStrictTransportSecuritySettingIfNecessary): Adds and removed the ignore request accordingly. (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. 2017-11-10 Alex Christensen _WKThumbnailView initialization with WKWebView needs to call correct initWithFrame https://bugs.webkit.org/show_bug.cgi?id=179537 Reviewed by Darin Adler. I introduced this in r223439 and made an ObjC mistake. This is what I get for adding SPI with no tests. I fixed this by making the existing WKView/_WKThumbnailView API tests work with WKWebView. * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView initWithFrame:fromWKWebView:]): 2017-11-10 Carlos Garcia Campos [GTK][WPE] Switch to use API::NavigationClient https://bugs.webkit.org/show_bug.cgi?id=178720 Reviewed by Alex Christensen. Replace WebKitLoaderClient and WebKitPolicyClient with WebKitNavigationClient that implements API::NavigationClient. * PlatformGTK.cmake: * PlatformWPE.cmake: * UIProcess/API/APINavigationAction.h: Add new constructor that receives a target frame name instead of a target frame info. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didDisplayInsecureContent): Added. (API::NavigationClient::didRunInsecureContent): Added. (API::NavigationClient::decidePolicyForNavigationResponse): Change NavigationResponse parameter to be a Ref&& instead of a NavigationResponse&. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): Update NavigationResponse parameter. * UIProcess/API/glib/WebKitBackForwardList.cpp: (webkitBackForwardListChanged): * UIProcess/API/glib/WebKitBackForwardListPrivate.h: * UIProcess/API/glib/WebKitNavigationAction.cpp: (webkitNavigationActionCreate): Wrap the given API::NavigationAction. (webkit_navigation_action_get_navigation_type): Use the wrapped API::NavigationAction. (webkit_navigation_action_get_mouse_button): Ditto. (webkit_navigation_action_get_modifiers): Ditto. (webkit_navigation_action_get_request): Ditto. (webkit_navigation_action_is_user_gesture): Ditto. (webkit_navigation_action_is_redirect): Ditto. * UIProcess/API/glib/WebKitNavigationActionPrivate.h: (_WebKitNavigationAction::_WebKitNavigationAction): * UIProcess/API/glib/WebKitNavigationClient.cpp: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.cpp. (NavigationClient::NavigationClient): (attachNavigationClientToView): * UIProcess/API/glib/WebKitNavigationClient.h: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.h. * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp: (webkit_navigation_policy_decision_get_frame_name): Add FIXME. (webkitNavigationPolicyDecisionCreate): Get the target frame name from the API::NavigationAction. * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h: * UIProcess/API/glib/WebKitPolicyClient.cpp: Removed. * UIProcess/API/glib/WebKitPolicyClient.h: Removed. * UIProcess/API/glib/WebKitPolicyDecision.cpp: (webkitPolicyDecisionSetListener): Remove the madePolicyDecision boolean member, we can null-check the listener instead. (webkit_policy_decision_use): Ensure listener is nullptr after being invoked to prevent the decision from being made more than once. (webkit_policy_decision_ignore): Ditto. (webkit_policy_decision_download): Ditto. * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h: * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: (webkit_response_policy_decision_get_request): Use the wrapped API::NavigationResponse. (webkit_response_policy_decision_get_response): Ditto. (webkit_response_policy_decision_is_mime_type_supported): Ditto. (webkitResponsePolicyDecisionCreate): Wrap the given API::NavigationResponse. * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h: * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::createNewPage): Create the WebKitNavigationAction from a new API::NavigationAction. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): Attach navigation client. * UIProcess/Cocoa/NavigationState.h: Update API::NavigationResponse parameter of decidePolicyForNavigationResponse. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): Notify the navigation client if it's used. (WebKit::WebPageProxy::didRunInsecureContentForFrame): Ditto. (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Use the new API::NavigationAction constructor to pass the target frame name, instead of a null target frame info. (WebKit::WebPageProxy::decidePolicyForResponse): Move the API::NavigationResponse. 2017-11-09 Chris Dumez Unreviewed, rolling out r224661. Broke build on several internal Mac/iOS bots Reverted changeset: "Ignore HSTS for partitioned, cross-origin subresource requests" https://bugs.webkit.org/show_bug.cgi?id=178993 https://trac.webkit.org/changeset/224661 2017-11-09 Chris Dumez ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects https://bugs.webkit.org/show_bug.cgi?id=179517 Reviewed by Brady Eidson. * Scripts/webkit/messages.py: (forward_declarations_and_headers): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::updateRegistrationStateInClient): (WebKit::WebSWServerConnection::fireUpdateFoundEvent): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer): (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-09 John Wilander Ignore HSTS for partitioned, cross-origin subresource requests https://bugs.webkit.org/show_bug.cgi?id=178993 Reviewed by Brent Fulgham. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (downgradeRequest): Convenience function to downgrade a request if CFNetwork as already upgraded it during canonicalization. This allows the rest of WebKit's processing to function, such as UIR and mixed content blocking. (updateIgnoreStrictTransportSecuritySettingIfNecessary): Adds and removed the ignore request accordingly. (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. 2017-11-09 Chris Dumez Implement real post 'install' event steps of the Install algorithm (steps 14+) https://bugs.webkit.org/show_bug.cgi?id=179401 Reviewed by Brady Eidson. Implement step 14+ of Install algorithm, as per: - https://w3c.github.io/ServiceWorker/#installation-algorithm * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::resolveRegistrationJobInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::didResolveRegistrationPromise): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-09 Megan Gardner Clean out unused selection items from UIKitSPI https://bugs.webkit.org/show_bug.cgi?id=179459 Reviewed by Tim Horton. Many of these should have been removed from previous commits, but they were missed. None of these enums or methods are being used by WebKit anymore, and removing them will keep things clean and allow UIKit to remove things that are not used at all by anyone anymore. * Platform/spi/ios/UIKitSPI.h: 2017-11-09 Christopher Reid Use enum classes within FileSystem https://bugs.webkit.org/show_bug.cgi?id=175172 Reviewed by Darin Adler. * NetworkProcess/Downloads/BlobDownloadClient.cpp: * NetworkProcess/NetworkDataTaskBlob.cpp: * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/capture/NetworkCaptureManager.cpp: * NetworkProcess/capture/NetworkCaptureRecorder.cpp: * Shared/WebMemorySampler.cpp: * UIProcess/API/APIContentRuleListStore.cpp: * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: 2017-11-09 Youenn Fablet ServiceWorkerClientFetch should create not null ResourceError https://bugs.webkit.org/show_bug.cgi?id=179485 Reviewed by Darin Adler. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): 2017-11-09 Andy Estes [iOS] Adopt UIPreviewDataAttachmentListIsContentManaged https://bugs.webkit.org/show_bug.cgi?id=179458 Reviewed by Dan Bernstein. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dataForPreviewItemController:atPosition:type:]): 2017-11-08 Joseph Pecoraro Include a more complete block signature in public headers to avoid potential -Wstrict-prototypes warnings https://bugs.webkit.org/show_bug.cgi?id=179466 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKHTTPCookieStore.h: * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: (-[WKHTTPCookieStore setCookie:completionHandler:]): (-[WKHTTPCookieStore deleteCookie:completionHandler:]): 2017-11-08 Jeremy Jones Make WKFullScreenWidnowController more robust against modification by the embedding app. https://bugs.webkit.org/show_bug.cgi?id=179413 rdar://problem/35408061 Reviewed by Darin Adler. Present fullscreen UViewController in a separate UIWindow to prevent interaction with the embedding app's UIViewController hierarchy. Immediately tear down the fullscreen interface if the embedding app removes the WKWebView from the fullscreen window. This prevents the fullscreen interface from getting into an invalid state. Preserve scrollView.zoomScale because it is not effectively preserved by the more indirect _viewScale. Use a custom root view controller to allow hiding of the status bar. Remove the no-longer-necessary dispatch_after calls during enter and exit fullscreen. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView removeFromSuperview]): * UIProcess/ios/WKFullScreenWindowControllerIOS.h: * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: (WebKit::WKWebViewState::applyTo): (WebKit::WKWebViewState::store): (-[_WKFullScreenViewController loadView]): (-[_WKFullscreenRootViewController prefersStatusBarHidden]): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController completedExitFullScreen]): (-[WKFullScreenWindowController exitFullscreenImmediately]): (-[WKFullScreenWindowController close]): (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]): (-[_WKFullScreenViewController viewDidDisappear:]): Deleted. 2017-11-08 Jeremy Jones HTMLMediaElement should not use element fullscreen on iOS https://bugs.webkit.org/show_bug.cgi?id=179418 rdar://problem/35409277 Reviewed by Eric Carlson. Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not. * Configurations/FeatureDefines.xcconfig: 2017-11-08 Wenson Hsieh [Attachment Support] Implement delegate hooks for attachment element insertion and removal https://bugs.webkit.org/show_bug.cgi?id=179016 Reviewed by Tim Horton. See WebCore/ChangeLog for more details. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didInsertAttachment:]): (-[WKWebView _didRemoveAttachment:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/PageClientImplCocoa.h: * UIProcess/Cocoa/PageClientImplCocoa.mm: (WebKit::PageClientImplCocoa::didInsertAttachment): (WebKit::PageClientImplCocoa::didRemoveAttachment): * UIProcess/PageClient.h: (WebKit::PageClient::didInsertAttachment): (WebKit::PageClient::didRemoveAttachment): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didInsertAttachment): (WebKit::WebPageProxy::didRemoveAttachment): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::didInsertAttachment): (WebKit::WebEditorClient::didRemoveAttachment): * WebProcess/WebCoreSupport/WebEditorClient.h: 2017-11-08 Carlos Garcia Campos REGRESSION(r223773): [GTK] WebKitWebInspector bring-to-front signal is emitted right after open-window https://bugs.webkit.org/show_bug.cgi?id=179365 Reviewed by Michael Catanzaro. In the GTK+ API, open-window already implies presenting the window to bring it to the front, so it's not expected that bring-to-front is emitted on open. This is happening since r223773 that moved common code from platform specific inspector files to the main file, but in the case of open the mac implementation was not exactly the same as the GTK+ one. This broke /webkit2/WebKitWebInspector/default and /webkit2/WebKitWebInspector/manual-attach-detach. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::open): Set m_isOpening for the scope of the function. * UIProcess/WebInspectorProxy.h: Add m_isOpening. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformBringToFront): Return early if m_isOpening is true. 2017-11-07 Carlos Garcia Campos REGRESSION(r224179): [GTK] Several WebViewEditor tests are failing since r224179 https://bugs.webkit.org/show_bug.cgi?id=179366 Reviewed by Michael Catanzaro. In r224179, webkit_web_view_can_execute_editing_command() was optimized to use the sync path for commands supported by the WebViewEditorState, but the state requires a redraw to be up to date. We can't know if WebViewEditorState is in sync, when webkit_web_view_can_execute_editing_command() is called, so we always need to ask the web process. * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_can_execute_editing_command): 2017-11-07 Carlos Garcia Campos [GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script https://bugs.webkit.org/show_bug.cgi?id=179317 Reviewed by Michael Catanzaro. This is the script used by Apple and it has several advantages: - It allows to combine and minify most of the js and css files, which improves performance and binary size. - It removes the debug resources and assertions in production builds. - It allows to remove the test resources in production builds. The patch also moves the common cmake code to generate the resources to a new file InspectorGResources.cmake included by GTK+ and WPE platform cmake files. * InspectorGResources.cmake: Added. * PlatformGTK.cmake: * PlatformWPE.cmake: 2017-11-07 Jeremy Jones Add downcast support for FullscreenClient. https://bugs.webkit.org/show_bug.cgi?id=178824 Reviewed by Simon Fraser. Add SPECIALIZE_TYPE_TRAITS macros for API::FullscreenClient and WebKit::Fullscreen client so downcasts can be done safely. * UIProcess/API/APIFullscreenClient.h: (API::FullscreenClient::isType const): * UIProcess/API/C/mac/WKPagePrivateMac.mm: (WKPageSetFullscreenDelegate): (WKPageGetFullscreenDelegate): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): * UIProcess/Cocoa/FullscreenClient.h: (isType): * UIProcess/Cocoa/FullscreenClient.mm: 2017-11-07 Brady Eidson Implement "UpdateWorkerState" and use it https://bugs.webkit.org/show_bug.cgi?id=179318 Reviewed by Chris Dumez. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::updateWorkerStateInClient): (WebKit::WebSWServerConnection::installServiceWorkerContext): (WebKit::WebSWServerConnection::setContextConnection): (WebKit::WebSWServerConnection::updateServiceWorkerContext): Deleted. * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): (WebKit::WebSWContextManagerConnection::updateServiceWorker): Deleted. * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-07 Commit Queue Unreviewed, rolling out r224512 and r224521. https://bugs.webkit.org/show_bug.cgi?id=179388 An API test added with this change is failing an assertion on the bots. (Requested by ryanhaddad on #webkit). Reverted changesets: "[Attachment Support] Implement delegate hooks for attachment element insertion and removal" https://bugs.webkit.org/show_bug.cgi?id=179016 https://trac.webkit.org/changeset/224512 "Remove stray logging from a newly added API test" https://trac.webkit.org/changeset/224521 2017-11-07 Chris Dumez [Service Workers] Add support for "install" event https://bugs.webkit.org/show_bug.cgi?id=179338 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::firePostInstallEvents): (WebKit::WebSWServerConnection::fireInstallEvent): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didFinishServiceWorkerInstall): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::fireInstallEvent): (WebKit::WebSWContextManagerConnection::didFinishInstall): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-07 Youenn Fablet Support the case of fetch events that are not responded https://bugs.webkit.org/show_bug.cgi?id=179336 Reviewed by Chris Dumez. * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: 2017-11-06 Alex Christensen Make ResourceLoader::willSendRequestInternal asynchronous https://bugs.webkit.org/show_bug.cgi?id=179251 Reviewed by Andy Estes. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResource): (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::Stream::start): 2017-11-06 Wenson Hsieh [Attachment Support] Implement delegate hooks for attachment element insertion and removal https://bugs.webkit.org/show_bug.cgi?id=179016 Reviewed by Tim Horton. Adds boilerplate plumbing to WebEditorClient, WebPage, and the usual machinery in the UI process to notify WebKit2 clients when attachment elements have been inserted or removed from the document. See the WebCore ChangeLog for more details about the implementation, or the Tools ChangeLog for more information about new API tests. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didInsertAttachment:]): (-[WKWebView _didRemoveAttachment:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/PageClientImplCocoa.h: * UIProcess/Cocoa/PageClientImplCocoa.mm: (WebKit::PageClientImplCocoa::didInsertAttachment): (WebKit::PageClientImplCocoa::didRemoveAttachment): * UIProcess/PageClient.h: (WebKit::PageClient::didInsertAttachment): (WebKit::PageClient::didRemoveAttachment): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didInsertAttachment): (WebKit::WebPageProxy::didRemoveAttachment): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::didInsertAttachment): (WebKit::WebEditorClient::didRemoveAttachment): * WebProcess/WebCoreSupport/WebEditorClient.h: 2017-11-06 Jeremy Jones iOS element fullscreen should use a UIGestureRecognizer to detect user interaction. https://bugs.webkit.org/show_bug.cgi?id=179029 rdar://problem/35307882 Reviewed by Simon Fraser. Replace _WKTapDelegatingView with a UILongPressGestureRecognizer. When set with a duration of 0, it effectively recognizes UITouchBegin events. * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: (-[_WKFullScreenViewController loadView]): (-[_WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[_WKTapDelegatingView setTarget:action:]): Deleted. (-[_WKTapDelegatingView hitTest:withEvent:]): Deleted. 2017-11-06 Chris Dumez [Service Workers] Add proper implementation for 'updatefound' event https://bugs.webkit.org/show_bug.cgi?id=179302 Reviewed by Brady Eidson. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::fireUpdateFoundEvent): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-06 Christopher Reid Use enum classes within FileSystem https://bugs.webkit.org/show_bug.cgi?id=175172 Reviewed by Myles C. Maxfield. * NetworkProcess/Downloads/BlobDownloadClient.cpp: * NetworkProcess/NetworkDataTaskBlob.cpp: * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/capture/NetworkCaptureManager.cpp: * NetworkProcess/capture/NetworkCaptureRecorder.cpp: * Shared/WebMemorySampler.cpp: * UIProcess/API/APIContentRuleListStore.cpp: * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: 2017-11-06 Michael Catanzaro [WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target https://bugs.webkit.org/show_bug.cgi?id=179097 Reviewed by Žan Doberšek. * PlatformWPE.cmake: 2017-11-05 Yusuke Suzuki JIT call inline caches should cache calls to objects with getCallData/getConstructData traps https://bugs.webkit.org/show_bug.cgi?id=144458 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::JSNPMethod::JSNPMethod): (WebKit::JSNPMethod::getCallData): Deleted. * WebProcess/Plugins/Netscape/JSNPMethod.h: (WebKit::JSNPMethod::createStructure): 2017-11-04 Chris Dumez REGRESSION(r223718): Leaking WebProcessPool after reconfiguration https://bugs.webkit.org/show_bug.cgi?id=179123 Reviewed by Geoff Garen. Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses go away at there is no use keeping it running at this point. Also, this prevents leaking the WebProcessPool since the WebProcessProxy holds a strong reference to the WebProcessPool. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::disconnectProcess): 2017-11-01 Darin Adler Simplify event dispatch code and make it a bit more consistent https://bugs.webkit.org/show_bug.cgi?id=178991 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp: (webkit_dom_event_get_src_element): Call target instead of srcElement. 2017-11-04 Aishwarya Nirmal [Touch Bar Web API] Add support for menuitem tag https://bugs.webkit.org/show_bug.cgi?id=179020 Reviewed by Ryosuke Niwa. Adds in the MenuItemElementEnabled flag so that the menu item element is a runtime- enabled feature. It has a default value of false. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMenuItemElementEnabled): (WKPreferencesGetMenuItemElementEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2017-11-03 Chris Dumez Unreviewed, rolling out r224438. Has caused assertions on the bots Reverted changeset: "REGRESSION(r223718): Leaking WebProcessPool after reconfiguration" https://bugs.webkit.org/show_bug.cgi?id=179123 https://trac.webkit.org/changeset/224438 2017-11-03 Youenn Fablet Requests handled by Service Worker should not go through preflighting https://bugs.webkit.org/show_bug.cgi?id=179250 Reviewed by Alex Christensen. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): 2017-11-03 Chris Dumez REGRESSION(r223718): Leaking WebProcessPool after reconfiguration https://bugs.webkit.org/show_bug.cgi?id=179123 Reviewed by Geoffrey Garen. Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses go away at there is no use keeping it running at this point. Also, this prevents leaking the WebProcessPool since the WebProcessProxy holds a strong reference to the WebProcessPool. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::disconnectProcess): 2017-11-03 Youenn Fablet Implement Service Worker Matching Registration algorithm https://bugs.webkit.org/show_bug.cgi?id=178882 Reviewed by Chris Dumez. Added IPC plumbery for matchRegistration request and response. Added some limited clearing of workers and registrations. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::matchRegistration): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::didMatchRegistration): (WebKit::WebSWClientConnection::matchRegistration): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebServiceWorkerProvider.h: 2017-11-03 Jeremy Jones Element fullscreen should use FloatRects instead of IntRects in beganEnterFullScreenWithInitialFrame https://bugs.webkit.org/show_bug.cgi?id=179033 rdar://problem/35309279 Reviewed by Darin Adler. Screen coordinates are floats, so use NSRect instead of IntRect on Mac. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): 2017-11-03 Chris Dumez Use a single identifier type to identify Service Workers https://bugs.webkit.org/show_bug.cgi?id=179192 Reviewed by Brady Eidson. Use a single identifier type to identify Service Workers. We had both a String identifier and a uint64_t identifier for each service worker. We now consistently use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a uint64_t. * Scripts/webkit/messages.py: (forward_declarations_and_headers): (forward_declarations_and_headers.templates): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::serviceWorkerContextFailedToStart): (WebKit::StorageProcess::serviceWorkerContextStarted): (WebKit::StorageProcess::postMessageToServiceWorkerClient): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updateServiceWorker): (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage): (WebKit::WebSWContextManagerConnection::startFetch): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-03 Antti Koivisto Enable display:contents by default as experimental feature https://bugs.webkit.org/show_bug.cgi?id=179239 Reviewed by Darin Adler. We pass most of the WPT tests. What remains is mostly flexbox related edge cases. * Shared/WebPreferences.yaml: 2017-11-03 Frederic Wang Use WK_IOS_TBA instead of WK_MAC_TBA to indicate availability of private functions on iOS https://bugs.webkit.org/show_bug.cgi?id=179238 Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: 2017-11-02 Maciej Stachowiak Don't try to guess plugin MIME type from a file extension in a URL (no observable effect) https://bugs.webkit.org/show_bug.cgi?id=178333 Reviewed by Darin Adler. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginDidReceiveUserInteraction): loadedMIMEType --> serviceType * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): ditto 2017-11-02 Brady Eidson SW: Implement "Update Registration State" algorithm (unused for now) https://bugs.webkit.org/show_bug.cgi?id=179186 Reviewed by Chris Dumez. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::updateRegistrationStateInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer): (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-02 Alex Christensen Use CompletionHandlers for redirects https://bugs.webkit.org/show_bug.cgi?id=179163 Reviewed by Tim Horton. * NetworkProcess/Downloads/BlobDownloadClient.cpp: (WebKit::BlobDownloadClient::willSendRequestAsync): * NetworkProcess/Downloads/BlobDownloadClient.h: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::~NetworkLoad): (WebKit::NetworkLoad::continueWillSendRequest): (WebKit::NetworkLoad::willSendRequestAsync): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): * UIProcess/API/APIDownloadClient.h: (API::DownloadClient::willSendRequest): * UIProcess/API/C/WKContext.cpp: (WKContextSetDownloadClient): * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::willSendRequest): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::Stream::~Stream): (WebKit::PluginView::Stream::continueLoad): (WebKit::PluginView::Stream::willSendRequest): * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: 2017-11-02 Christopher Reid Add a FileSystem namespace to FileSystem.cpp https://bugs.webkit.org/show_bug.cgi?id=179063 Reviewed by Darin Adler. * NetworkProcess/Downloads/BlobDownloadClient.cpp: * NetworkProcess/Downloads/BlobDownloadClient.h: * NetworkProcess/NetworkDataTaskBlob.cpp: * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkProcess.cpp: * NetworkProcess/cache/CacheStorageEngine.cpp: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: * NetworkProcess/cache/NetworkCacheData.cpp: * NetworkProcess/cache/NetworkCacheFileSystem.cpp: * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: * NetworkProcess/cache/NetworkCacheStatistics.cpp: * NetworkProcess/cache/NetworkCacheStorage.cpp: * NetworkProcess/capture/NetworkCaptureManager.cpp: * NetworkProcess/capture/NetworkCaptureManager.h: * NetworkProcess/capture/NetworkCaptureRecorder.cpp: * NetworkProcess/capture/NetworkCaptureResource.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: * NetworkProcess/soup/NetworkProcessSoup.cpp: * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: * Shared/Plugins/unix/PluginSearchPath.cpp: * Shared/WebMemorySampler.cpp: * Shared/WebMemorySampler.h: * Shared/gtk/ProcessExecutablePathGtk.cpp: * Shared/ios/ChildProcessIOS.mm: * Shared/mac/ChildProcessMac.mm: * Shared/mac/SandboxExtensionMac.mm: * Shared/wpe/ProcessExecutablePathWPE.cpp: * StorageProcess/StorageProcess.cpp: * UIProcess/API/APIContentRuleListStore.cpp: * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/API/glib/WebKitFaviconDatabase.cpp: * UIProcess/API/glib/WebKitFileChooserRequest.cpp: * UIProcess/API/glib/WebKitWebContext.cpp: * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: * UIProcess/Automation/WebAutomationSession.cpp: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: * UIProcess/Plugins/gtk/PluginInfoCache.cpp: * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp: * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: * UIProcess/WebStorage/LocalStorageDatabase.cpp: * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: * UIProcess/WebsiteData/WebsiteDataStore.cpp: * UIProcess/gtk/WebProcessPoolGtk.cpp: * UIProcess/mac/WebPageProxyMac.mm: * UIProcess/wpe/WebProcessPoolWPE.cpp: * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp: * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp: * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/WebCoreSupport/SessionStateConversion.cpp: 2017-11-02 Joseph Pecoraro Make ServiceWorker a Remote Inspector debuggable target https://bugs.webkit.org/show_bug.cgi?id=179043 Reviewed by Brian Burg. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h: * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (debuggableTypeString): Provide a way to start a Remote Web Inspector frontend for a ServiceWorker target type. 2017-11-02 Ryan Haddad Unreviewed, rolling out r224353. Breaks internal builds. Reverted changeset: "Ignore HSTS for partitioned, cross-origin subresource requests" https://bugs.webkit.org/show_bug.cgi?id=178993 https://trac.webkit.org/changeset/224353 2017-11-02 John Wilander Ignore HSTS for partitioned, cross-origin subresource requests https://bugs.webkit.org/show_bug.cgi?id=178993 Reviewed by Brent Fulgham and Alex Christensen. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (downgradeRequest): Convenience function to downgrade a request if CFNetwork as already upgraded it during canonicalization. This allows the rest of WebKit's processing to function, such as UIR and mixed content blocking. (updateIgnoreStrictTransportSecuritySettingIfNecessary): Adds and removed the ignore request accordingly. (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. 2017-11-02 Yousuke Kimoto [WinCairo] Add IPC files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=177919 Reviewed by Alex Christensen. * Platform/IPC/Attachment.cpp: * Platform/IPC/Attachment.h: (IPC::Attachment::Attachment): (IPC::Attachment::handle): * Platform/IPC/Connection.h: (IPC::Connection::identifierIsNull): (IPC::Connection::sendWithReply): * Platform/IPC/win/AttachmentWin.cpp: Added. (IPC::Attachment::encode const): (IPC::getDuplicatedHandle): (IPC::Attachment::decode): * Platform/IPC/win/ConnectionWin.cpp: Added. (IPC::Connection::createServerAndClientIdentifiers): (IPC::Connection::platformInitialize): (IPC::Connection::platformInvalidate): (IPC::Connection::readEventHandler): (IPC::Connection::writeEventHandler): (IPC::Connection::open): (IPC::Connection::platformCanSendOutgoingMessages const): (IPC::Connection::sendOutgoingMessage): (IPC::Connection::willSendSyncMessage): (IPC::Connection::didReceiveSyncReply): * PlatformWin.cmake: 2017-11-02 Megan Gardner Early out selection update when data is not present https://bugs.webkit.org/show_bug.cgi?id=179084 Reviewed by Ryosuke Niwa. We should early out of a selection update when we do not have the data that is necessary to make that update. This mostly helps avoid debug asserts, but will be helpful with the selection changes that are ongoing. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _updateChangedSelection:]): 2017-11-02 Eric Carlson [MediaStream] audioTrack.label is always empty on macOS https://bugs.webkit.org/show_bug.cgi?id=179175 Reviewed by Youenn Fablet. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): Pass settings.label to Source constructor. 2017-11-02 Frederic Wang Add references to bug 179167 in FIXME comments https://bugs.webkit.org/show_bug.cgi?id=179168 Reviewed by Daniel Bates. * Configurations/FeatureDefines.xcconfig: 2017-11-01 Jeremy Jones Implement WKFullscreenWindowController for iOS. https://bugs.webkit.org/show_bug.cgi?id=178924 rdar://problem/34697120 Reviewed by Simon Fraser. Plumb relevant calls through WKWebView and PageClientImplIOS. This forms the base implementation for element fullscreen. This will animate an element into fullscreen and back to inline. It does this by replacing the WKWebView with a placeholder image and presenting the WKWebView with a fullscreen view controller. This also attempts to preserve UI state of the WKWebView when it is placed back inline. To enable _WKFullscreenDelegate for iOS, this adds an iOS version of the delegate methods that passes WKWebView instead of NSView. The iOS version of these functions are renamed to be more specific and disambiguate them from the video fullscreen delegate methods. This also adds an image asset for the done button. * Configurations/FeatureDefines.xcconfig: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView hasFullScreenWindowController]): (-[WKWebView fullScreenWindowController]): (-[WKWebView closeFullScreenWindowController]): (-[WKWebView fullScreenPlaceholderView]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: * UIProcess/Cocoa/FullscreenClient.h: * UIProcess/Cocoa/FullscreenClient.mm: (WebKit::FullscreenClient::FullscreenClient): (WebKit::FullscreenClient::setDelegate): (WebKit::FullscreenClient::willEnterFullscreen): (WebKit::FullscreenClient::didEnterFullscreen): (WebKit::FullscreenClient::willExitFullscreen): (WebKit::FullscreenClient::didExitFullscreen): * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::closeFullScreenManager): (WebKit::PageClientImpl::isFullScreen): (WebKit::PageClientImpl::enterFullScreen): (WebKit::PageClientImpl::exitFullScreen): (WebKit::PageClientImpl::beganEnterFullScreen): (WebKit::PageClientImpl::beganExitFullScreen): * UIProcess/ios/WKContentView.mm: * UIProcess/ios/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKFullscreenDelegate.h. * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Added. (WebKit::replaceViewWithView): (WebKit::WKWebViewState::applyTo): (WebKit::WKWebViewState::store): (-[_WKTapDelgatingView setTarget:action:]): (-[_WKTapDelgatingView hitTest:withEvent:]): (-[_WKFullScreenViewController dealloc]): (-[_WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]): (+[_WKFullScreenViewController configureView:withBackgroundFillOfColor:opacity:filter:]): (-[_WKFullScreenViewController _updateTransparencyOfVisualEffectView:]): (-[_WKFullScreenViewController createVisualEffectViewWithFrame:]): (-[_WKFullScreenViewController loadView]): (-[_WKFullScreenViewController viewWillAppear:]): (-[_WKFullScreenViewController viewDidDisappear:]): (-[_WKFullScreenViewController cancelAction:]): (-[_WKFullScreenViewController hideCancelButton]): (-[_WKFullScreenViewController showCancelButton]): (-[_WKFullScreenViewController setTarget:action:]): (-[_WKFullScreenViewController prefersStatusBarHidden]): (-[WKFullscreenAnimationController transitionDuration:]): (-[WKFullscreenAnimationController animateTransition:]): (-[WKFullscreenAnimationController animationEnded:]): (-[WKFullScreenWindowController initWithWebView:page:]): (-[WKFullScreenWindowController dealloc]): (-[WKFullScreenWindowController isFullScreen]): (-[WKFullScreenWindowController webViewPlaceholder]): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController completedEnterFullScreen]): (-[WKFullScreenWindowController exitFullScreen]): (-[WKFullScreenWindowController requestExitFullScreen]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController completedExitFullScreen]): (-[WKFullScreenWindowController close]): (-[WKFullScreenWindowController _manager]): (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]): (-[WKFullScreenWindowController animationControllerForDismissedController:]): * WebKit.xcassets/Contents.json: Added. * WebKit.xcassets/Done.imageset/Contents.json: Added. * WebKit.xcassets/Done.imageset/Done.pdf: Added. * WebKit.xcodeproj/project.pbxproj: * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::willEnterFullScreen): (WebKit::WebFullScreenManager::willExitFullScreen): 2017-11-01 Daniel Bates XMLHttpRequest should not sniff content encoding https://bugs.webkit.org/show_bug.cgi?id=175597 Reviewed by Alex Christensen. Fixes an issue where the body of an HTTP response with headers "Content-Type: application/octet-stream" and "Content-Encoding: gzip" associated with an XHR request to a .gz file would not be automatically gzipped decompressed. Specifically, such a response would be treated analogous to a response with headers "Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform to the behavior of the Content-Encoding header as defined in the HTTP 1.1 and later specs. Moreover this behavior breaks the Epic Zen Garden demo: . On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can selectively opt out of content encoding sniffing for other network requests. This will be done in subsequent commits to make it straightforward to identify site breakage (if any). * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::start): Enable content encoding sniff to match existing behavior. (WebKit::Download::startWithHandle): Ditto. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): Pass through the content encoding sniffing policy. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): Ditto. * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): Encode content encoding sniffing policy. (WebKit::NetworkResourceLoadParameters::decode): Decode content encoding sniffing policy. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): Enable content encoding sniff to match existing behavior. We should look to disable content encoding sniffing in a subsequent change. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): Added helper function to apply sniffing policies and bind request to interface, if applicable. (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Modified to take the content encoding sniffing policy. Calls applySniffingPoliciesAndBindRequestToInferfaceIfNeeded() to apply this policy. Also use convenience function URL::isLocalFile() to determine if the URL is a file URL. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Pass through the content encoding sniffing policy. * NetworkProcess/soup/NetworkDataTaskSoup.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Pass through the content encoding sniffing policy. (WebKit::WebLoaderStrategy::loadResourceSynchronously): Enable content encoding sniff to match existing behavior. 2017-11-01 Brady Eidson Plumbing for handling SW scripts failing to evaluate https://bugs.webkit.org/show_bug.cgi?id=178926 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::updateServiceWorkerContext): (WebKit::WebSWServerConnection::setContextConnection): (WebKit::WebSWServerConnection::startServiceWorkerContext): Deleted. * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updateServiceWorker): (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage): (WebKit::WebSWContextManagerConnection::startServiceWorker): Deleted. * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-01 Frederic Wang Make iOS Find UI reveal matches in scrollable elements https://bugs.webkit.org/show_bug.cgi?id=178789 Reviewed by Tim Horton. * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::didFindString): Reveal selection up to the main frame. The main frame is handled by the SmartMagnificationController. 2017-11-01 Michael Catanzaro REGRESSION(r224192): [WPE] Fix WebEventFactory::createWebWheelEvent https://bugs.webkit.org/show_bug.cgi?id=179098 Reviewed by Sam Weinig. * Shared/wpe/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebWheelEvent): 2017-10-31 Tim Horton Clean up some drag and drop feature flags https://bugs.webkit.org/show_bug.cgi?id=179082 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2017-10-31 Wenson Hsieh Followup to r224238: API::Attachment should generate a _WKAttachment ObjC wrapper https://bugs.webkit.org/show_bug.cgi?id=179080 Reviewed by Tim Horton. Fixes a failing API test. The new Attachment object type added in r224238 was not actually being handled in Object::newObject, so a plain WKObject Objective C wrapper was being created; fix this by allocating a new _WKAttachment object for Type::Attachment. * Shared/Cocoa/APIObject.mm: (API::Object::newObject): 2017-10-31 Tim Horton Fix up some content filtering feature flags https://bugs.webkit.org/show_bug.cgi?id=179079 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2017-10-31 Youenn Fablet rwt should allow service worker to load localhost HTTPS resources with any certificate https://bugs.webkit.org/show_bug.cgi?id=179018 Reviewed by Chris Dumez. Allowing ServiceWorkerProcessProxy to handle authentication challenge. Temporarily adding a boolean flag through WebProcessPool to lower the SSL certificate verifications for service workers. This allows reducing flakiness in our layout tests for rwt. Future work should be done to expose a correct API for the application level to handle authentication challenges properly. * UIProcess/API/C/WKContext.cpp: (WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setAllowsAnySSLCertificateForServiceWorker:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebProcessPool.h: 2017-10-31 Joseph Pecoraro Web Inspector: UIProcess ASSERT in ~RemoteWebInspectorProxy when InspectorProcess crashes https://bugs.webkit.org/show_bug.cgi?id=179044 Reviewed by Alex Christensen. * UIProcess/RemoteWebInspectorProxy.cpp: (WebKit::RemoteWebInspectorProxy::frontendDidClose): Add a protector to keep the proxy alive for the duration of this method. 2017-10-31 Youenn Fablet Crash in: com.apple.WebKit: WebKit::CacheStorage::Caches::initializeSize(WTF::Function&&)>&&) + 30 (CacheStorageEngineCaches.cpp:163) https://bugs.webkit.org/show_bug.cgi?id=179037 Reviewed by Chris Dumez. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initializeSize): the storage backend may be cleared when clearing caches by the UI Process. Returning early in that case. A web application will typically fail to open a cache in this case. On retry, the cache should be opened. 2017-10-31 Wenson Hsieh [Attachment Support] Implement WKWebView SPI for inserting attachment elements https://bugs.webkit.org/show_bug.cgi?id=179013 Reviewed by Tim Horton. Adds native SPI to insert attachment elements given a filename, an optional MIME type, and a data blob. See change-by-change comments below for more detail. Covered by a new API test. * PlatformMac.cmake: * Shared/API/APIObject.h: * Shared/API/Cocoa/WebKitPrivate.h: * UIProcess/API/APIAttachment.cpp: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h. (API::Attachment::create): (API::Attachment::Attachment): (API::Attachment::~Attachment): Introduce API::Attachment, which represents a platform-agnostic Attachment. * UIProcess/API/APIAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): Adds support for inserting a new attachment element. Calls out to WebPageProxy to insert the attachment from the given data blob, and creates a new API-object-backed _WKAttachment. (-[WKWebView _executeEditCommand:argument:completion:]): Support passing in a nil completion block. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h. * UIProcess/API/Cocoa/_WKAttachment.mm: Copied from Source/WebCore/html/HTMLAttachmentElement.h. Introduces _WKAttachment, an Objective C wrapper around the API::Attachment. (-[_WKAttachment _apiObject]): (-[_WKAttachment isEqual:]): (-[_WKAttachment uniqueIdentifier]): (-[_WKAttachment hash]): Add _WKAttachment, a WebKit SPI object that wraps an attachment element unique identifier. Also, allow _WKAttachment to be used as a hashable NSDictionary key. (-[_WKAttachment description]): * UIProcess/API/Cocoa/_WKAttachmentInternal.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h. (API::wrapper): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::insertAttachment): Implement IPC support for inserting an attachment. * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertAttachment): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-10-31 Alex Christensen Fix custom header field setting with reloads and asynchronous navigation action policy decisions https://bugs.webkit.org/show_bug.cgi?id=179064 Reviewed by Tim Horton. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::applyToDocumentLoader): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): 2017-10-31 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.1 release. * gtk/NEWS: Add release notes for 2.19.1. 2017-10-31 Carlos Garcia Campos Unreviewed. Fix GTK+ make distcheck. Include WebCore/TextEncodingRegistry.h to ensure the forwarding header is generated. * UIProcess/API/glib/WebKitSettings.cpp: 2017-10-31 Commit Queue Unreviewed, rolling out r223884. https://bugs.webkit.org/show_bug.cgi?id=179055 It broke GTK+ make distcheck (Requested by KaL on #webkit). Reverted changeset: "[GTK][WPE] generate-forwarding-headers.pl should also scan derived sources in WebKit framework" https://bugs.webkit.org/show_bug.cgi?id=178579 https://trac.webkit.org/changeset/223884 2017-10-30 Fujii Hironori Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames https://bugs.webkit.org/show_bug.cgi?id=175118 Reviewed by Alex Christensen. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp: (WebKit::wrap): 2017-10-27 Megan Gardner Correctly determine affinity when inserting text via Keyboard Suggestions https://bugs.webkit.org/show_bug.cgi?id=178969 Reviewed by Ryosuke Niwa. Use the logic of VisiblePosition to correctly determine cursor affinity. We were defaulting to upstream, but that in incorrect and resulted in hitting asserts that we should not. This should give us the correct affinity in all cases. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::syncApplyAutocorrection): 2017-10-30 Commit Queue Unreviewed, rolling out r224078. https://bugs.webkit.org/show_bug.cgi?id=179026 MotionMark regression (Requested by shallawa on #webkit). Reverted changeset: "When navigating back to a page, compositing layers may not use accelerated drawing" https://bugs.webkit.org/show_bug.cgi?id=178749 https://trac.webkit.org/changeset/224078 2017-10-30 Sam Weinig [Setting] Only expose experimental features that are compiled in https://bugs.webkit.org/show_bug.cgi?id=179023 Reviewed by Tim Horton. * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb: Update template to conditionally expose experimental features based on their 'condition' option in WebPreferences.yaml 2017-10-30 Michael Catanzaro [WPE] Fix build warnings https://bugs.webkit.org/show_bug.cgi?id=178899 Reviewed by Carlos Alberto Lopez Perez. * PlatformWPE.cmake: 2017-10-30 Sam Weinig [Settings] Replace macro driven experimental features code with generated code https://bugs.webkit.org/show_bug.cgi?id=178994 Reviewed by Simon Fraser. As a first step toward allowing experimental features to vary based on compile time flags, replace the macro driven implementation of the WebPreferences part of experimental features, with one generated from a template file. * CMakeLists.txt: * DerivedSources.make: * Scripts/GeneratePreferences.rb: * WebKit.xcodeproj/project.pbxproj: Generate the new template. * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb: Added. * UIProcess/WebPreferences.cpp: (WebKit::createExperimentalFeaturesVector): Deleted. (WebKit::WebPreferences::experimentalFeatures): Deleted. (WebKit::WebPreferences::isEnabledForFeature const): Deleted. (WebKit::WebPreferences::setEnabledForFeature): Deleted. (WebKit::WebPreferences::enableAllExperimentalFeatures): Deleted. Replace macro implementation with template generated one. 2017-10-30 Michael Catanzaro [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target https://bugs.webkit.org/show_bug.cgi?id=178964 Reviewed by Carlos Alberto Lopez Perez. * PlatformWPE.cmake: 2017-10-30 Michael Catanzaro [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState https://bugs.webkit.org/show_bug.cgi?id=168219 Reviewed by Ryosuke Niwa. Expose canCut, canCopy, canPaste, canUndo, and canRedo in EditorState::PostLayouData. Add corresponding new WPE/GTK API. Remove allowsCopy from WebKitTestResultData. It's unused, does not work correctly in all circumstances, and irritates Ryosuke. Also, remove a bunch of #ifs guarding post layout data, since it's now used on all ports. * Shared/EditorState.cpp: (WebKit::EditorState::encode const): (WebKit::EditorState::decode): (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: (WebKit::EditorState::postLayoutData const const): * Shared/WebHitTestResultData.cpp: (WebKit::WebHitTestResultData::WebHitTestResultData): (WebKit::WebHitTestResultData::encode const): (WebKit::WebHitTestResultData::decode): * Shared/WebHitTestResultData.h: * UIProcess/API/APIHitTestResult.h: (API::HitTestResult::allowsCopy const): Deleted. * UIProcess/API/glib/WebKitEditorState.cpp: (webkitEditorStateChanged): (webkit_editor_state_is_cut_available): (webkit_editor_state_is_copy_available): (webkit_editor_state_is_paste_available): (webkit_editor_state_is_undo_available): (webkit_editor_state_is_redo_available): * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_can_execute_editing_command): * UIProcess/API/gtk/WebKitEditorState.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitEditorState.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performImmediateActionHitTestAtLocation): 2017-10-27 Sam Weinig [Settings] Generate more of the WebKit preferences code https://bugs.webkit.org/show_bug.cgi?id=178945 Reviewed by Chris Dumez. Generate WebPreferencesKeys.{h,cpp} and WebPreferencesStoreDefaultsMap.cpp * CMakeLists.txt: * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: * Scripts/GeneratePreferences.rb: Generate new files. * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Update include. * Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb: Added. * Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb: Added. * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb: Added. Add template files for new generated files. * Shared/WebPreferencesDefaultValues.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitionsBase.h. * Shared/WebPreferencesDefinitionsBase.h: Renamed WebPreferencesDefinitionsBase.h to WebPreferencesDefaultValues.h to better indicate what it is. * Shared/WebPreferencesKeys.cpp: Removed. * Shared/WebPreferencesKeys.h: Removed. Replaced with generated versions. * Shared/WebPreferencesStore.cpp: (WebKit::defaults): Deleted. * Shared/WebPreferencesStore.h: Replace macro driven defaults map with generated WebPreferencesStoreDefaultsMap.cpp. 2017-10-28 Chris Dumez self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker https://bugs.webkit.org/show_bug.cgi?id=178976 Reviewed by Sam Weinig. Actually enable the Service Worker RuntimeEnabledFeature in the Service Worker WebProcess. * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updatePreferences): 2017-10-28 Joseph Pecoraro Make postprocess-framework-headers.sh a little easier to read https://bugs.webkit.org/show_bug.cgi?id=178971 Reviewed by Sam Weinig. * mac/postprocess-framework-headers.sh: 2017-10-27 Daniel Bates Attempt to fix the Apple El Capitan build following (https://bugs.webkit.org/show_bug.cgi?id=178919) Move definition of NetworkLoad::isAllowedToAskUserForCredentials() outside of USE(NETWORK_SESSION)-guarded section. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const): 2017-10-27 Daniel Bates Only allow non-mixed content protected subresources to ask for credentials https://bugs.webkit.org/show_bug.cgi?id=178919 Reviewed by Alex Christensen. Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful to allow protected mixed-content subresources to ask for credentials. * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::PendingDownload): Initialize m_isAllowedToAskUserForCredentials based on the specified resource load parameters or NetworkLoad object. * NetworkProcess/Downloads/PendingDownload.h: Add override for NetworkLoadClient::isAllowedToAskUserForCredentials(). * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const): Added. (WebKit::NetworkLoad::completeAuthenticationChallenge): Ask NetworkLoadClient whether the load is allowed to prompt for credentials. (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Ditto. * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize m_isAllowedToAskUserForCredentials based on the specified resource load parameters. (WebKit::NetworkResourceLoader::willSendRedirectedRequest): We do not support prompting for credentials for synchronous loads. (WebKit::NetworkResourceLoader::continueWillSendRequest): Modified to take an argument as to whether the load is allowed to ask the user for credentials and updates state. * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/NetworkResourceLoader.messages.in: Modified message ContinueWillSendRequest to take a boolean as to whether the load is allowed to ask the user for credentials. * NetworkProcess/PreconnectTask.h: Override NetworkLoadClient::isAllowedToAskUserForCredentials() such that we never ask for credentials. This matches our current behavior. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): Query ResourceLoader as to whether the load is allowed to ask the user for credentials and pass this state to NetworkResourceLoader. 2017-10-27 Adrian Perez de Castro [GTK][CMake] Incorrect conditional check when adding build dir to GIR runtime library path https://bugs.webkit.org/show_bug.cgi?id=178936 Reviewed by Michael Catanzaro. * PlatformGTK.cmake: Fix spelling of variable used in conditional. 2017-10-27 Chris Dumez Add initial support for serviceWorkerClient.postMessage() https://bugs.webkit.org/show_bug.cgi?id=178794 Reviewed by Youenn Fablet. Add initial support for serviceWorkerClient.postMessage(): - https://w3c.github.io/ServiceWorker/#client-postmessage It is now possible to do bi-directional communication with a service worker via postMessage(). * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): (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: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-10-27 David Kilzer REGRESSION (r224077): DeprecatedGlobalSettings::setAVKitEnabled() not protected by HAVE(AVKIT) Unreviewed build fix. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Fix build. 2017-10-26 Jeremy Jones Implement seek tolerance methods in WebAVPlayerController. https://bugs.webkit.org/show_bug.cgi?id=178838 rdar://problem/33781777 Reviewed by Eric Carlson. This implementes additional methods on WebAVPlayerController that allows AVKit more control over seeking. * UIProcess/Cocoa/PlaybackSessionManagerProxy.h: * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: (WebKit::PlaybackSessionModelContext::seekToTime): (WebKit::PlaybackSessionManagerProxy::seekToTime): * WebProcess/cocoa/PlaybackSessionManager.h: * WebProcess/cocoa/PlaybackSessionManager.messages.in: * WebProcess/cocoa/PlaybackSessionManager.mm: (WebKit::PlaybackSessionManager::seekToTime): 2017-10-26 Brian Burg Web Automation: denying user permission for getUserMedia doesn't work https://bugs.webkit.org/show_bug.cgi?id=178895 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): The ordering of special cases is incorrect. Safari configures its automation views to allow mock devices and never prompt for them. These checks were before the check for the automation session's getUserMedia permission. Switch these checks. Also change the deny reason so that subsequent requests are also denied. This matches behavior when a user denies a permission request on a real dialog. With this change, the DOM error changes from SecurityError to NotAllowedError, which makes more sense. 2017-10-26 Michael Catanzaro Unreviewed, fix GCC warning spam after r224077 https://bugs.webkit.org/show_bug.cgi?id=178823 Need to leave a blank line at the bottom of the file. * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: 2017-10-25 Simon Fraser When navigating back to a page, compositing layers may not use accelerated drawing https://bugs.webkit.org/show_bug.cgi?id=178749 rdar://problem/35158946 Reviewed by Dean Jackson. Avoid assertions when a test enables accelerated drawing (which we can't support in the iOS simulator). * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::ensureBackingStore): 2017-10-26 Sam Weinig [Settings] Generate the bulk of WebPage::updatePreferences(...) https://bugs.webkit.org/show_bug.cgi?id=178823 Reviewed by Tim Horton. * CMakeLists.txt: * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: Add new file generation. * Scripts/GeneratePreferences.rb: Replace 'webkitOnly' boolean option with a new 'webcoreBinding' option. 'webcoreBinding' supports the following values: - none (same as webkit only) - custom (means that you do bind to a webcore concept, but currently it must be done in a custom manner) - DeprecatedGlobalSettings (binds to a DeprecatedGlobalSettings setting) - RuntimeEnabledFeatures (binds to a RuntimeEnabledFeatures setting) If 'webcoreBinding' is not provided, the preference binds to WebCore Setting of either the same name or the override name provided by the new 'webcoreName' option (we should try to remove the need for 'webcoreName' by unifying with WebCore on preference/setting naming). A 'condition' option was also added to indicate that the preference is only available when that macro condition is true. Since we are generating most of WebPage::updatePreferences, we can simplify the macros in WebPreferencesDefinitions.h to only have normal/debug/experimental variants and remove the need for per-type macros, which were only used in WebPage::updatePreferences. * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb: Added. Generates bindings from WebPreferences to WebCore::Settings/DeprecatedGlobalSettings/RuntimeEnabledFeatures. Does not generate a binding if the 'webcoreBinding' option is set to either 'none' or 'custom'. * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Simplify down to just normal/debug/experimental macros. * Shared/WebPreferences.yaml: Annotate perferences with new optional 'webcoreBinding', 'webcoreName', and 'condition' options. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Replace a ton of hand written preference to settings bindings with a call to updatePreferencesGenerated(). * WebProcess/WebPage/WebPage.h: Add declaration of updatePreferencesGenerated, remove platformPreferencesDidChange. * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformPreferencesDidChange): Deleted. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformPreferencesDidChange): Deleted. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformPreferencesDidChange): Deleted. * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::platformPreferencesDidChange): Deleted. * WebProcess/WebPage/wpe/WebPageWPE.cpp: (WebKit::WebPage::platformPreferencesDidChange): Deleted. Remove all the empty platformPreferencesDidChange functions. 2017-10-26 Alex Christensen Move WKWebViewConfiguration validation to WKWebView construction https://bugs.webkit.org/show_bug.cgi?id=178840 Reviewed by Tim Horton. I'm trying to remove WKWebViewConfigurationInternal methods so I can make WKWebViewConfiguration a wrapper around an APIObject like all the other API objects. A small step towards making this easier is to remove the unnecessary method _validate and move its logic to its one callsite. I added an API test that ensures no change in behavior. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _validate]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h: 2017-10-26 Megan Gardner Remove unneeded block selection calculation code https://bugs.webkit.org/show_bug.cgi?id=178889 Reviewed by Tim Horton. Removing more block selection code. Much of this should have been removed before, as the only things that were using these functions were removed in the last patch. Also remove the code decided if you should move to block mode or not, as the answer now is always NO. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateSelectionWithTouches): (WebKit::WebPage::rangeForBlockAtPoint): Deleted. (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::switchToBlockSelectionAtPoint): Deleted. (WebKit::WebPage::shouldSwitchToBlockModeForHandle): Deleted. 2017-10-26 Jeremy Jones Call setFullscreenClient on iOS. https://bugs.webkit.org/show_bug.cgi?id=178089 Reviewed by Simon Fraser. This was only being set for MacOS. * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): 2017-10-26 Eric Carlson NowPlayingInfo should contain a unique identifier https://bugs.webkit.org/show_bug.cgi?id=178872 Reviewed by Jer Noble. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Take a completion handler. (-[WKWebView _requestActiveNowPlayingSessionInfo]): Deleted. (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo): Ditto. (WebKit::WebPageProxy::nowPlayingInfoCallback): Lookup and call completion handler. (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse const): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted. * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Take callback ID. Pass unique ID. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-10-26 Andy Estes [Payment Request] Enable Payment Request whenever Apple Pay is enabled https://bugs.webkit.org/show_bug.cgi?id=178880 Reviewed by Tim Horton. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPaymentRequestEnabled): Deleted. (WKPreferencesGetPaymentRequestEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-10-26 Chris Dumez Bring back SWContextManager abstraction in WebCore https://bugs.webkit.org/show_bug.cgi?id=178876 Reviewed by Geoffrey Garen. Bring back SWContextManager abstraction in WebCore. It was killed in but is actually useful when the ServiceWorker wants to message the storage process. * CMakeLists.txt: * DerivedSources.make: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startServiceWorkerContext): (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWContextManagerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.cpp. (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection): (WebKit::WebSWContextManagerConnection::updatePreferences): (WebKit::WebSWContextManagerConnection::startServiceWorker): (WebKit::WebSWContextManagerConnection::startFetch): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWContextManagerConnection.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h. * WebProcess/Storage/WebSWContextManagerConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.messages.in. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didReceiveMessage): (WebKit::WebProcess::getWorkerContextConnection): * WebProcess/WebProcess.h: 2017-10-26 Alexey Proskuryakov Remove deprecated WebKit symbols https://bugs.webkit.org/show_bug.cgi?id=178875 rdar://problem/31139070 Reviewed by Dan Bernstein. * PlatformMac.cmake: * Shared/API/c/WKDeprecatedFunctions.cpp: (WKContextSetProcessModel): (WKPageGroupCopyIdentifier): Deleted. (WKPageGroupAddUserContentFilter): Deleted. (WKPageGroupRemoveUserContentFilter): Deleted. * UIProcess/API/C/WKPageGroup.h: * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm: Removed. * UIProcess/API/Cocoa/_WKVisitedLinkStore.h: * WebKit.xcodeproj/project.pbxproj: 2017-10-26 Ryan Haddad Unreviewed, rolling out r223984. Caused LayoutTest assertion failures. Reverted changeset: "When navigating back to a page, compositing layers may not use accelerated drawing" https://bugs.webkit.org/show_bug.cgi?id=178749 https://trac.webkit.org/changeset/223984 2017-10-26 Megan Gardner Remove code to update block selection https://bugs.webkit.org/show_bug.cgi?id=178843 Reviewed by Tim Horton. Removes code for updating block selection, which has been disabled. This code is being slowly pruned to avoid regressions and accidental removal of code that is being used. * 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::didUpdateBlockSelectionWithTouch): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (toSelectionHandlePosition): Deleted. (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted. (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted. (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::shouldExpand): Deleted. (WebKit::WebPage::changeBlockSelection): Deleted. (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted. 2017-10-26 Ryan Haddad Unreviewed, rolling out r223994. The LayoutTest for this change is failing. Reverted changeset: "Add service worker handle fetch support for all subresource requests" https://bugs.webkit.org/show_bug.cgi?id=178769 https://trac.webkit.org/changeset/223994 2017-10-26 Ryan Haddad Unreviewed, rolling out r223908. Causes LayoutTest crashes with newer SDKs. Reverted changeset: "Adopt new secure coding APIs" https://bugs.webkit.org/show_bug.cgi?id=178484 https://trac.webkit.org/changeset/223908 2017-10-26 Christopher Reid Remove scopeguard from platform https://bugs.webkit.org/show_bug.cgi?id=178681 Reviewed by Brady Eidson. * Shared/mac/ChildProcessMac.mm: 2017-10-25 Per Arne Vollan Network process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge. https://bugs.webkit.org/show_bug.cgi?id=160234 rdar://problem/30675510 Reviewed by Geoffrey Garen. An exception is raised because we call the method rejectProtectionSpaceAndContinueWithChallenge on the CFNetwork challenge sender, which does not implement this optional method. The methods on the authentication challenge sender are deprecated when network session is used, so we should not call them in that case. * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::useCredentialForSingleChallenge): (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge): (WebKit::AuthenticationManager::cancelSingleChallenge): (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge): (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge): * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: (WebKit::AuthenticationManager::receivedCredential): (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential): (WebKit::AuthenticationManager::receivedCancellation): (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling): (WebKit::AuthenticationManager::receivedChallengeRejection): * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: 2017-10-25 Youenn Fablet Move DNS resolution outside of NetworkRTCProvider https://bugs.webkit.org/show_bug.cgi?id=178796 Reviewed by Geoffrey Garen. Tested through manual testing on external STUN servers. Moving NetworkRTCProvider::Resolver into NetworkRTCResolver. Updating the implementation to use a completion handler. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createResolver): * NetworkProcess/webrtc/NetworkRTCProvider.h: * NetworkProcess/webrtc/NetworkRTCResolver.cpp: (WebKit::NetworkRTCResolver::NetworkRTCResolver): (WebKit::NetworkRTCResolver::~NetworkRTCResolver): (WebKit::NetworkRTCResolver::start): (WebKit::NetworkRTCResolver::stop): (WebKit::NetworkRTCResolver::completed): (WebKit::NetworkRTCProvider::Resolver::~Resolver): Deleted. (WebKit::NetworkRTCProvider::stop): Deleted. (WebKit::NetworkRTCProvider::resolutionCompleted): Deleted. * NetworkProcess/webrtc/NetworkRTCResolver.h: * WebKit.xcodeproj/project.pbxproj: 2017-10-25 Eric Carlson [MediaStream] Clear cached gUM prompt state https://bugs.webkit.org/show_bug.cgi?id=178754 Reviewed by Youenn Fablet. * Shared/WebPreferences.yaml: Define new settings. * Shared/WebPreferencesDefinitionsBase.h: New default values. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetInactiveMediaCaptureSteamRepromptIntervalInMinutes): New. (WKPreferencesGetInactiveMediaCaptureSteamRepromptIntervalInMinutes): Ditto. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _inactiveMediaCaptureSteamRepromptIntervalInMinutes]): Ditto. (-[WKPreferences _setInactiveMediaCaptureSteamRepromptIntervalInMinutes:]): Ditto. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize the timer. (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Remove unneeded namespace. (WebKit::toWebCore): Remove unneeded breaks. (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Remove unneeded namespace. (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Set the watchdog timer to the correct interval based on capture state. (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear cached state. * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2017-10-25 Simon Fraser When navigating back to a page, compositing layers may not use accelerated drawing https://bugs.webkit.org/show_bug.cgi?id=178749 rdar://problem/35158946 Reviewed by Dean Jackson. Avoid assertions when a test enables accelerated drawing (which we can't support in the iOS simulator). * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::ensureBackingStore): 2017-10-25 Youenn Fablet Enable ServiceWorker to fetch resources https://bugs.webkit.org/show_bug.cgi?id=178673 Reviewed by Brady Eidson. ServiceWorkerContextManager makes use of the new ServiceWorkerThreadProxy. It creates the necessary environment for the thread to make use of network loads, web sockets and cache storage. Fetch is functional with these changes. ServiceWorkerProcessProxy is introduced as a UIProcess proxy to the service worker process. This process proxy is responsible to give the pageID used by all service worker thread instances for network loads. ServiceWorkerContextManager is responsible to give a unique frameID for all service worker threads. This is necessary as these two ids are currently needed for any network load. ServiceWorkerThreadProxy creates its own FrameLoaderClient which is now used to get pageID, frameID and sessionID. * UIProcess/ServiceWorkerProcessProxy.cpp: Added. (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy): (WebKit::m_serviceWorkerPageID): (WebKit::ServiceWorkerProcessProxy::~ServiceWorkerProcessProxy): (WebKit::ServiceWorkerProcessProxy::start): * UIProcess/ServiceWorkerProcessProxy.h: Added. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getWorkerContextProcessConnection): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::generatePageID): * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::startPingLoad): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Storage/ServiceWorkerContextManager.cpp: (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): (WebKit::ServiceWorkerContextManager::startServiceWorker): (WebKit::ServiceWorkerContextManager::startFetch): * WebProcess/Storage/ServiceWorkerContextManager.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::pageID const): (WebKit::WebFrameLoaderClient::frameID const): (WebKit::WebFrameLoaderClient::sessionID const): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-25 Yousuke Kimoto [WinCairo] Add WebKit platform files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=178000 Reviewed by Alex Christensen. * Platform/Module.h: * Platform/SharedMemory.h: (WebKit::SharedMemory::handle const): * Platform/win/LoggingWin.cpp: Added. It is based on Source/WebCore/platform/win/LoggingWin.cpp (WebKit::logLevelString): * Platform/win/ModuleWin.cpp: Added. (WebKit::Module::load): (WebKit::Module::unload): (WebKit::Module::platformFunctionPointer const): * Platform/win/SharedMemoryWin.cpp: Added. (WebKit::SharedMemory::Handle::Handle): (WebKit::SharedMemory::Handle::~Handle): (WebKit::SharedMemory::Handle::isNull const): (WebKit::SharedMemory::Handle::encode const): (WebKit::SharedMemory::Handle::clear): (WebKit::getDuplicatedHandle): (WebKit::SharedMemory::Handle::decode): (WebKit::protectAttribute): (WebKit::SharedMemory::allocate): (WebKit::SharedMemory::create): (WebKit::accessRights): (WebKit::SharedMemory::map): (WebKit::SharedMemory::adopt): (WebKit::SharedMemory::~SharedMemory): (WebKit::SharedMemory::createHandle): (WebKit::SharedMemory::systemPageSize): * PlatformWin.cmake: 2017-10-25 Chris Dumez Add support for unregistering a service worker https://bugs.webkit.org/show_bug.cgi?id=178735 Reviewed by Brady Eidson. Add support for unregistering a service worker: - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::resolveRegistrationJobInClient): (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-10-25 Chris Dumez Make SharedStringHashTable less error prone https://bugs.webkit.org/show_bug.cgi?id=178764 Reviewed by Youenn Fablet. SharedStringHashTable is backed by SharedMemory and this SharedMemory may be readonly (and is when used in the WebContent process). As a result, some of the operations on SharedStringHashTable that write to this shared memory will crash if called and the SharedMemory is readonly. To make this less error prone, introduce a new SharedStringHashTableReadOnly base class for SharedStringHashTable and only keep the operations that write to the shared memory on SharedStringHashTableReadOnly (namely, add() / remove() / clear(). Update VisitedLinkTableController and WebSWOriginTable to use SharedStringHashTableReadOnly since they are instantiated in the WebContent process and use readonly shared memory. * Shared/SharedStringHashTable.cpp: (WebKit::SharedStringHashTableReadOnly::SharedStringHashTableReadOnly): (WebKit::SharedStringHashTableReadOnly::~SharedStringHashTableReadOnly): (WebKit::SharedStringHashTableReadOnly::setSharedMemory): (WebKit::doubleHash): (WebKit::SharedStringHashTableReadOnly::contains const): (WebKit::SharedStringHashTableReadOnly::findSlot const): (WebKit::SharedStringHashTable::SharedStringHashTable): (WebKit::SharedStringHashTable::~SharedStringHashTable): (WebKit::SharedStringHashTable::add): (WebKit::SharedStringHashTable::remove): (WebKit::SharedStringHashTable::clear): * Shared/SharedStringHashTable.h: * WebProcess/Storage/WebSWOriginTable.h: * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::removeAllVisitedLinks): * WebProcess/WebPage/VisitedLinkTableController.h: 2017-10-25 Adrian Perez de Castro [WPE] Remove GLib API functions which use Cairo https://bugs.webkit.org/show_bug.cgi?id=178205 Reviewed by Michael Catanzaro. Add PLATFORM(GTK) guards for the parts of of the GLib API which use cairo_surface_t (web page snapshots and favicons), and remove the affected function prototypes from public API headers. This way, the WPE version of the API is not tied to Cairo. * PlatformWPE.cmake: * UIProcess/API/glib/WebKitFaviconDatabase.cpp: * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h: * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewGetProperty): (webkitWebViewDispose): (webkit_web_view_class_init): (webkitWebViewLoadChanged): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/wpe/WebKitFaviconDatabase.h: * UIProcess/API/wpe/WebKitWebView.h: * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (webkitWebPageDidReceiveMessage): 2017-10-25 Zan Dobersek Make SERVICE_WORKER feature buildable on GTK, WPE https://bugs.webkit.org/show_bug.cgi?id=178574 Reviewed by Carlos Garcia Campos. * CMakeLists.txt: Add missing files to the build. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didGetWorkerContextProcessConnection): IPC::Attachment object should be accessed through an rvalue reference, making it mutable and enabling releasing the file descriptor. * StorageProcess/StorageProcess.h: Adjust the method signature. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Explicitly include the ResourceError header from WebCore (using a forwarding header). * WebProcess/Storage/WebServiceWorkerProvider.cpp: Include the CachedResource header from WebCore (again using a forwarding header). * WebProcess/Storage/WebServiceWorkerProvider.h: Forward-declare the WebCore::CachedResource type. 2017-10-24 Youenn Fablet ServiceWorkerClientFetch should return an error that is not null in case of failure https://bugs.webkit.org/show_bug.cgi?id=178761 Reviewed by Geoffrey Garen. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didFail): Generating a General error. 2017-10-24 Youenn Fablet Enable service worker to use cache storage api https://bugs.webkit.org/show_bug.cgi?id=178684 Reviewed by Brady Eidson. Passing the WebPreferences store of the default page group of the WebProcessPool to its ServiceWorker process. ServiceWorkerContextManager then uses it to initialize the preferences accordingly. Patch is covered by new test which is using cache api previously disabled and now enabled through the store. Made use of the new ServiceWorkerThreadProxy in ServiceWorkerContextManager to enable a cache storage connection. Fixed the default size of quota in WebsiteDataStore. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getWorkerContextProcessConnection): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/Storage/ServiceWorkerContextManager.cpp: (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): (WebKit::ServiceWorkerContextManager::updatePreferences): (WebKit::ServiceWorkerContextManager::startServiceWorker): (WebKit::ServiceWorkerContextManager::startFetch): * WebProcess/Storage/ServiceWorkerContextManager.h: (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): Deleted. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-24 Alex Christensen Selecting and right-clicking URL-like strings with IDNA-disallowed characters in host or authority causes rendering engine crash https://bugs.webkit.org/show_bug.cgi?id=174267 Reviewed by Tim Horton. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageCanHandleRequest): 2017-10-24 Chris Dumez Add initial implementation for serviceWorker.postMessage() https://bugs.webkit.org/show_bug.cgi?id=178534 Reviewed by Youenn Fablet. Add initial implementation for serviceWorker.postMessage(): - https://w3c.github.io/ServiceWorker/#service-worker-postmessage * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/ServiceWorkerContextManager.cpp: (WebKit::ServiceWorkerContextManager::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/ServiceWorkerContextManager.h: * WebProcess/Storage/ServiceWorkerContextManager.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWClientConnection.h: 2017-10-24 Brent Fulgham Adopt new secure coding APIs https://bugs.webkit.org/show_bug.cgi?id=178484 Reviewed by Tim Horton. Switch to new NSKeyed[Un]Archiver methods that active and use NSSecureCoding by default. * Platform/ios/AccessibilityIOS.mm: (WebKit::newAccessibilityRemoteToken): Use secure-by-default API. * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::encode const): Ditto. (WebKit::DataDetectionResult::decode): Ditto. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): Ditto. (WebKit::InteractionInformationAtPosition::decode): Ditto. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. * Shared/mac/WebHitTestResultData.mm: (WebKit::WebHitTestResultData::platformEncode const): Ditto. (WebKit::WebHitTestResultData::platformDecode): Ditto. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setObject:forBundleParameter:]): Ditto. (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): Ditto. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startAssistingNode): Ditto. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): Ditto. (WebKit::InjectedBundle::setBundleParameter): Ditto. (WebKit::InjectedBundle::setBundleParameters): Ditto. 2017-10-24 Sam Weinig [Settings] Add initial support for generating preferences related code https://bugs.webkit.org/show_bug.cgi?id=178656 Reviewed by Dean Jackson. As a first step towards getting off the macros in WebPreferencesDefinitions.h and reducing the overhead of adding a preference, this change generates adds WebPreferences.yaml where preference changes will go, and generates much of WebPreferencesDefinitions.h from it (all the custom defaults moved to WebPreferencesDefinitionsBase.h). Subsequent changes will remove the need for the macros in WebPreferencesDefinitions.h entirely. * CMakeLists.txt: * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: Add new files / rules to generate WebPreferencesDefinitions.h. * Scripts/GeneratePreferences.rb: Added. * Scripts/PreferencesTemplates: Added. * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Added. Add scripts and template to generate WebPreferencesDefinitions.h from WebPreferences.yaml. * Shared/WebPreferences.yaml: Added. Configuration file for preferences. * Shared/WebPreferencesDefinitions.h: Removed. * Shared/WebPreferencesDefinitionsBase.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitions.h. Moved custom defaults to new WebPreferencesDefinitionsBase.h. Removed the need for FOR_EACH_WEBKIT_STRING_PREFERENCE by using custom defaults for the font family values. 2017-10-24 Matt Lewis Unreviewed, rolling out r223889. This caused multiple crashes on all platforms Reverted changeset: "Adopt new secure coding APIs" https://bugs.webkit.org/show_bug.cgi?id=178484 https://trac.webkit.org/changeset/223889 2017-10-24 Youenn Fablet ASSERTION FAILED: !m_serviceWorkerManager in WebProcess::getWorkerContextConnection() on API tests https://bugs.webkit.org/show_bug.cgi?id=178586 Reviewed by Brady Eidson. Covered by API tests no longer crashing. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getWorkerContextProcessConnection): Sending a worker context process connection message only at creation of the service worker process. 2017-10-24 Brent Fulgham Adopt new secure coding APIs https://bugs.webkit.org/show_bug.cgi?id=178484 Reviewed by Tim Horton. Switch to new NSKeyed[Un]Archiver methods that active and use NSSecureCoding by default. * Platform/ios/AccessibilityIOS.mm: (WebKit::newAccessibilityRemoteToken): Use secure-by-default API. * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::encode const): Ditto. (WebKit::DataDetectionResult::decode): Ditto. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): Ditto. (WebKit::InteractionInformationAtPosition::decode): Ditto. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. * Shared/mac/WebHitTestResultData.mm: (WebKit::WebHitTestResultData::platformEncode const): Ditto. (WebKit::WebHitTestResultData::platformDecode): Ditto. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setObject:forBundleParameter:]): Ditto. (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): Ditto. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startAssistingNode): Ditto. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): Ditto. (WebKit::InjectedBundle::setBundleParameter): Ditto. (WebKit::InjectedBundle::setBundleParameters): Ditto. 2017-10-24 Zan Dobersek [GTK][WPE] generate-forwarding-headers.pl should also scan derived sources in WebKit framework https://bugs.webkit.org/show_bug.cgi?id=178579 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: When generating forwarding headers, derived sources should be scanned as well. The DERIVED_SOURCES_WEBKIT_DIR value has to be passed as an include path to the generate-forward-headers.pl script to achieve that. This target then also has to depend on all the derived source files to be generated before this can be performed. * PlatformWPE.cmake: Ditto. 2017-10-23 Brian Burg [Cocoa] Web Automation: add SPI to tell whether the automation session is currently simulating user interactions https://bugs.webkit.org/show_bug.cgi?id=178616 Reviewed by Joseph Pecoraro. This is needed to disambiguate whether an action (such as selectAll:) came from a user clicking on "Edit > Select All" in a menu or whether it was produced by simulating the keystrokes to produce the chord for "Command + a". Some clients, such as Safari, would allow the latter but not the former during automation. * UIProcess/API/Cocoa/_WKAutomationSession.h: * UIProcess/API/Cocoa/_WKAutomationSession.mm: (-[_WKAutomationSession isSimulatingUserInteraction]): Add new SPI property that's backed by the same WebAutomationSession method. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::keyboardEventsFlushedForPage): (WebKit::WebAutomationSession::performMouseInteraction): (WebKit::WebAutomationSession::performKeyboardInteractions): Set m_simulatingUserInteraction prior to sending the synthesized events. It will be cleared when keyboardEventsFlushedForPage() is called by WebPageProxy. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): Notify the automation session that the key event queue was flushed *after* giving delegates a chance to do something with the key event. This is necessary so that any actions that are created from the NSEvent by the delegates are handled prior to the automation session finishing its keyboard interaction command. 2017-10-23 Brian Burg [Mac] Web Automation: key modifiers for synthesized NSEvents are incorrect https://bugs.webkit.org/show_bug.cgi?id=178615 Reviewed by Joseph Pecoraro. In both PLATFORM(MAC) platform methods for simulating keyboard interactions, we errantly relied on +[NSEvent modifierFlags] to get the current state of sticky modifiers when creating synthesized events. This is incorrect for two reasons: modifierFlags is never updated when simulating a sequence of events (because all the events are synthesized before any are delivered); and the NSEvent class method only reflects the modifier state of the primary physical keyboard, which is not affected by synthesized NSEvents that happen to have modifier flags. Instead, just keep our own m_currentModifiers state in the session and compute the necessary NSEventModifierFlags to put on each synthesized event. This aligns the implementation with the treatment of sticky keys in the iOS and GTK platform methods. * UIProcess/Automation/WebAutomationSession.h: Every port gets this variable now. * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::WebAutomationSession::platformSimulateKeyStroke): (WebKit::WebAutomationSession::platformSimulateKeySequence): Use and update m_currentModifiers. 2017-10-23 Alex Christensen Fix ASAN test after r222824 https://bugs.webkit.org/show_bug.cgi?id=178688 Reviewed by Tim Horton. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::clear): Resizing a list of Ref after we've WTFMoved all the elements doesn't make ASAN happy. 2017-10-23 Tim Horton Stop using _UIApplicationUsesLegacyUI() https://bugs.webkit.org/show_bug.cgi?id=178680 Reviewed by Dan Bernstein. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]): (-[WKSelectPopover initWithView:hasGroups:]): Resolve _UIApplicationUsesLegacyUI to false and simplify. 2017-10-23 Ryan Haddad Unreviewed, suppress deprecation warnings to fix the build. * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]): (-[WKSelectPopover initWithView:hasGroups:]): 2017-10-23 Youenn Fablet TestController should clear all fetch caches when resetting its state https://bugs.webkit.org/show_bug.cgi?id=178486 Reviewed by Chris Dumez. Adding a new DidNotHandle message to disambiguate with the DidFail fetch case. With DidNotHandle, the loading should go the network process. With DidFail, the loading should return a network error. On receiving an order to start a fetch, ServiceWorkerThread will dispatch a fetch event. The client of this event will retrieve the response and return it to the WebProcess through IPC. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::didNotHandleFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didNotHandleFetch): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didFail): (WebKit::ServiceWorkerClientFetch::didNotHandle): * WebProcess/Storage/ServiceWorkerClientFetch.h: * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: * WebProcess/Storage/ServiceWorkerContextManager.cpp: (WebKit::ServiceWorkerContextManager::startFetch): * WebProcess/Storage/ServiceWorkerContextManager.h: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Added. (WebKit::WebServiceWorkerFetchTaskClient::~WebServiceWorkerFetchTaskClient): (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient): (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse): (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData): (WebKit::WebServiceWorkerFetchTaskClient::didFail): (WebKit::WebServiceWorkerFetchTaskClient::didFinish): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: Added. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::startFetchInServiceWorker): * WebProcess/WebProcess.h: 2017-10-22 Wenson Hsieh [iOS] WebProcess::initializeWebProcess spends ~150ms spinning up AVSystemController on some devices https://bugs.webkit.org/show_bug.cgi?id=178640 Reviewed by Youenn Fablet. In r213933, we added a mechanism to allow the web process to drive media capture, by setting an attribute on the shared AVSystemController. This requires us to fault in the Celestial framework, which is a slight performance hit on some hardware. Instead of doing this at the start of every web process launch, we can just do this work lazily, the first time the web process requests permissions for user media access. * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: (WebKit::WebUserMediaClient::requestUserMediaAccess): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2017-10-21 Michael Catanzaro Unreviewed, silence a -Wunused-but-set-variable warning * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::wheelEvent): 2017-10-20 Alex Christensen Add FIXME comment after r223803 https://bugs.webkit.org/show_bug.cgi?id=178418 * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): We need some work to better support customized persistent data stores. Add a comment indicating such. 2017-10-20 Alex Christensen Fix API tests after r223791. https://bugs.webkit.org/show_bug.cgi?id=178418 * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Whatever NetworkSessionInitializationParameters we send with the NetworkProcess initialization message, that's the default session. This is needed for WebKit.WebsiteDataStoreCustomPaths. (WebKit::WebProcessPool::createNewWebProcess): Don't change behavior or NetworkProcess initialization like I did in r223791. 2017-10-20 Alex Christensen Fix download tests on El Capitan after r223730 https://bugs.webkit.org/show_bug.cgi?id=178547 * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Revert to original behavior. This uses suggestedFilename, which may have come from places like the download attribute, instead of always using the filename from CFNetwork. 2017-10-20 Alex Christensen Expose _boundInterfaceIdentifier and _allowsCellularAccess to WKWebsiteDataStorePrivate https://bugs.webkit.org/show_bug.cgi?id=178418 Reviewed by Tim Horton. In r213747 I introduced allowsCellularAccess to _WKProcessPoolConfiguration because there was no way to add parameters to the default (and other) NetworkSession constructors. Since clients have not adopted this SPI, we can introduce such a way in NetworkSessionCreationParameters and move the SPI to WKWebsiteDataStore, which is where it and other NetworkSession properties ought to be instead of making them WKProcessPool global. We also need to expose access to NSURLRequest.boundInterfaceIdentifier. Instead of serializing and deserializing that property for each NSURLRequest and then having subresources mysteriously jump back to having no bound interface identifiers, I'm adding this to WKWebsiteDataStore, too, to make it a session networking property. I manually verified that these properties are being set properly with a custom test app and added logs. Unfortunately, these properties don't do anything under circumstances anywhere close to what we test. The architecture change of having NetworkSessionCreationParameters is verified to not have a change in behavior by existing tests, such as any test that uses TestProtocol (which we should eventually remove). * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::clearCachedCredentials): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::create): (WebKit::NetworkSession::defaultSession): Deleted. * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.h: Added. (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier): (WebKit::NetworkSessionCocoa::create): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Deleted. (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Deleted. (WebKit::NetworkSessionCocoa::defaultSession): Deleted. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/SessionTracker.cpp: (WebKit::SessionTracker::networkSession): (WebKit::SessionTracker::setSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]): (-[WKWebsiteDataStore _boundInterfaceIdentifier]): (-[WKWebsiteDataStore _setAllowsCellularAccess:]): (-[WKWebsiteDataStore _allowsCellularAccess]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration allowsCellularAccess]): (-[_WKProcessPoolConfiguration setAllowsCellularAccess:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier): (WebKit::WebsiteDataStore::boundInterfaceIdentifier): (WebKit::WebsiteDataStore::setAllowsCellularAccess): (WebKit::WebsiteDataStore::allowsCellularAccess): * WebKit.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPrivateBrowsingEnabled): * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensurePrivateBrowsingSession): (WebKit::WebProcess::clearCachedCredentials): 2017-10-20 Alex Christensen Add ObjC SPI to _WKDownloadDelegate missing from WKContextDownloadClient https://bugs.webkit.org/show_bug.cgi?id=178566 Reviewed by Brady Eidson. * UIProcess/API/Cocoa/_WKDownloadDelegate.h: * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::didReceiveAuthenticationChallenge): (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType): (WebKit::DownloadClient::didCreateDestination): (WebKit::DownloadClient::processDidCrash): 2017-10-20 Youenn Fablet ResourceResponse should have a ServiceWorker source https://bugs.webkit.org/show_bug.cgi?id=178593 Reviewed by Alex Christensen. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): setting response source to ServiceWorker. * WebProcess/Storage/ServiceWorkerClientFetch.h: 2017-10-20 Antoine Quint [Web Animations] Provide basic timeline and animation interfaces https://bugs.webkit.org/show_bug.cgi?id=178526 Reviewed by Dean Jackson. Remove the WEB_ANIMATIONS compile-time flag. * Configurations/FeatureDefines.xcconfig: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): (WebKit::InjectedBundle::setWebAnimationsEnabled): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-10-02 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. Move setup and delegates of the inspector frontend page into implementations of WebInspectorProxy::platformCreateFrontendPage. The Mac implementation will be subsumed by WKInspectorViewController, while the GTK implementation is inherited from the cross-platform version that uses C API. Eventually the GTK version should use GTK API rather than the soon to be deprecated C API. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::createFrontendPage): (WebKit::webProcessDidCrash): Deleted. (WebKit::decidePolicyForNavigationAction): Deleted. (WebKit::getContextMenuFromProposedMenu): Deleted. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::exceededDatabaseQuota): (WebKit::webProcessDidCrash): (WebKit::decidePolicyForNavigationAction): (WebKit::getContextMenuFromProposedMenu): (WebKit::WebInspectorProxy::platformCreateFrontendPage): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::exceededDatabaseQuota): (WebKit::webProcessDidCrash): (WebKit::decidePolicyForNavigationAction): (WebKit::getContextMenuFromProposedMenu): (WebKit::WebInspectorProxy::platformCreateFrontendPage): 2017-10-02 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. Adopt WKInspectorViewController in WebInspectorProxyMac to set up the frontend's web view. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::invalidate): (WebKit::WebInspectorProxy::close): (WebKit::WebInspectorProxy::didClose): (WebKit::WebInspectorProxy::closeFrontendPageAndWindow): Make closeFrontendPageAndWindow into the method that does work. Only use didClose() as the IPC message entry point. * UIProcess/WebInspectorProxy.h: (WebKit::WebInspectorProxy::isUnderTest const): Make public. * UIProcess/mac/WKInspectorViewController.h: * UIProcess/mac/WKInspectorViewController.mm: (+[WKInspectorViewController viewIsInspectorWebView:]): Abstract away the -isInstanceOfClass: check for WKInspectorWKWebView. Clients shouldn't need to know whether we use a subclass or what its name is. * UIProcess/mac/WebInspectorProxyMac.mm: (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]): (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]): Hook up view controller delegates. (WebKit::WebInspectorProxy::platformCreateFrontendPage): (WebKit::WebInspectorProxy::platformCreateFrontendWindow): (WebKit::WebInspectorProxy::closeFrontendPage): New implementation based on the view controller. (WebKit::WebInspectorProxy::platformBringToFront): (WebKit::WebInspectorProxy::platformIsFront): (WebKit::WebInspectorProxy::platformCanAttach): (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): (WebKit::WebInspectorProxy::platformAttach): (WebKit::WebInspectorProxy::platformDetach): (WebKit::WebInspectorProxy::platformStartWindowDrag): Adjust to get the WKWebView out of the view controller for code that needs to do something with the NSView, such as get/set the frame. (WebKit::WebInspectorProxy::createFrontendConfiguration): Deleted. (WebKit::exceededDatabaseQuota): Deleted. (WebKit::webProcessDidCrash): Deleted. (WebKit::decidePolicyForNavigationAction): Deleted. (WebKit::getContextMenuFromProposedMenu): Deleted. 2017-10-02 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. Introduce new platform methods to open and close the frontend page and window. This matches how RemoteWebInspectorProxy divides work up into platform methods. Move existing code from platformDidClose, platformOpen, and other methods into the new platform methods. Move some identical platform code into WebInspectorProxy.cpp. * UIProcess/WebInspectorProxy.h: * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::connect): (WebKit::WebInspectorProxy::showConsole): (WebKit::WebInspectorProxy::showResources): (WebKit::WebInspectorProxy::showTimelines): (WebKit::WebInspectorProxy::showMainResourceForFrame): (WebKit::WebInspectorProxy::createFrontendPage): (WebKit::WebInspectorProxy::createInspectorPage): (WebKit::WebInspectorProxy::open): (WebKit::WebInspectorProxy::didClose): (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Renamed. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::updateInspectorWindowTitle const): (WebKit::WebInspectorProxy::platformCreateFrontendPage): Do everything necessary to set up the frontend page WebView. (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Do everything necessary to set up the detached NSWindow for the frontend. (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow): (WebKit::WebInspectorProxy::platformDetach): (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted. (WebKit::WebInspectorProxy::createInspectorWindow): Deleted. (WebKit::WebInspectorProxy::platformOpen): Deleted. (WebKit::WebInspectorProxy::platformDidClose): Deleted. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::updateInspectorWindowTitle const): (WebKit::WebInspectorProxy::platformCreateFrontendPage): Added. Do everything necessary to set up the frontend page WebView. (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Added. Do everything necessary to set up the detached NSWindow for the frontend. (WebKit::WebInspectorProxy::closeFrontendPage): (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired): (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow): (WebKit::WebInspectorProxy::platformDidCloseForCrash): (WebKit::WebInspectorProxy::platformInvalidate): (WebKit::WebInspectorProxy::platformBringToFront): Carry through renamings. (WebKit::WebInspectorProxy::platformDetach): Defer to the general open() method to create a window if needed and bring it to front. (WebKit::WebInspectorProxy::platformCanAttach): Move this below open/close code. (WebKit::WebInspectorProxy::closeFrontend): Deleted. (WebKit::WebInspectorProxy::createInspectorWindow): Deleted. (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted. (WebKit::WebInspectorProxy::platformOpen): Deleted. (WebKit::WebInspectorProxy::platformDidClose): Deleted. Defer to the general open() method to create a window if needed and bring it to front. * UIProcess/wpe/WebInspectorProxyWPE.cpp: (WebKit::WebInspectorProxy::platformCreateFrontendPage): (WebKit::WebInspectorProxy::platformCreateFrontendWindow): (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow): (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted. (WebKit::WebInspectorProxy::createInspectorWindow): Deleted. (WebKit::WebInspectorProxy::platformOpen): Deleted. (WebKit::WebInspectorProxy::platformDidClose): Deleted. Update stubs. 2017-10-02 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. This patch refactors some Cocoa code pathas. Rename the timer that closes the WebView so it's more obvious what it is for. Extract the common code to close the frontend window so its not implemented by the timer callback. In later patches, this will be extracted further into platform methods to open/close the frontend and window, like how it is for RemoteWebInspectorProxy. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::WebInspectorProxy): * UIProcess/WebInspectorProxy.h: * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired): (WebKit::WebInspectorProxy::closeFrontend): (WebKit::WebInspectorProxy::platformCreateInspectorPage): (WebKit::WebInspectorProxy::platformDidClose): (WebKit::WebInspectorProxy::platformDidCloseForCrash): (WebKit::WebInspectorProxy::platformInvalidate): (WebKit::WebInspectorProxy::closeTimerFired): Deleted. 2017-09-30 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. Modernize the ObjC adapter and related code a bit before it is hooked into WKInspectorViewController. * UIProcess/API/C/mac/WKInspectorPrivateMac.h: No need for the ivar to be declared here, move to @implementation. * UIProcess/WebInspectorProxy.h: Simplify the name to match modern convention. * UIProcess/mac/WebInspectorProxyMac.mm: (-[WKWebInspectorProxyObjCAdapter inspectorRef]): (-[WKWebInspectorProxyObjCAdapter initWithWebInspectorProxy:]): (-[WKWebInspectorProxyObjCAdapter invalidate]): (-[WKWebInspectorProxyObjCAdapter windowDidMove:]): (-[WKWebInspectorProxyObjCAdapter windowDidResize:]): (-[WKWebInspectorProxyObjCAdapter windowWillClose:]): (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]): (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]): (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]): Remove unnecessary casts to and from void*. (WebKit::WebInspectorProxy::attachmentViewDidChange): (WebKit::WebInspectorProxy::setInspectorWindowFrame): (WebKit::WebInspectorProxy::closeTimerFired): (WebKit::WebInspectorProxy::createInspectorWindow): (WebKit::WebInspectorProxy::platformCreateInspectorPage): Fix uses of member variable m_objCAdapter. (-[WKWebInspectorProxyObjCAdapter close]): Deleted. Rename this to invalidate to match modern convention. In this context, 'close' might trick someone into thinking that this closes a window/page. 2017-09-30 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. Move code that sets up and controls the inspector WebView into WKInspectorViewController. This will be shared between RemoteWebInspectorProxy and WebInspectorProxy eventually, but for now just pull out code from RemoteWebInspectorProxy. The next patch will move over WebInspectorProxy. WKInspectorViewController uses the ObjC API for setting up the WKWebView's delegates. Previously, a WKWebView was used but the delegates were set up using the C API. In a few cases it uses delegate methods to ask the owning [Remote]WebInspectorProxy some things. In general, WKInspectorViewController doesn't dig into any internals of WebPageProxy or WebInspectorProxy; that is delegated to the client. * UIProcess/RemoteWebInspectorProxy.h: (WebKit::RemoteWebInspectorProxy::isUnderTest const): Add a method stub for now. We might want to enable tests for a _WKRemoteWebInspectorViewController-based UI in the future, and WebInspectorProxy has the same method. Add this and connect it to the view controller delegate method. (WebKit::RemoteWebInspectorProxy::webView const): This returns a plain WKWebView type now. * UIProcess/mac/RemoteWebInspectorProxyMac.mm: (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]): (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]): (-[WKRemoteWebInspectorProxyObjCAdapter webViewWebContentProcessDidTerminate:]): Deleted. (-[WKRemoteWebInspectorProxyObjCAdapter webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted. Make the ObjCAdapter forward view controller delegate calls to the C++ class. It no longer needs to be the delegate of the WebView, as the view controller handles that. (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): Clean up and move WKWebView setup code into the view controller. (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow): The m_inspectorPage is closed by the caller before calling this method, so we don't need to do it here. (WebKit::RemoteWebInspectorProxy::platformBringToFront): (WebKit::RemoteWebInspectorProxy::platformSave): (WebKit::RemoteWebInspectorProxy::platformAppend): (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Use webView() instead of m_webView. * UIProcess/mac/WKInspectorViewController.h: Added. * UIProcess/mac/WKInspectorViewController.mm: Added. (-[WKInspectorWKWebView tag]): (-[WKInspectorViewController initWithInspectedPage:]): (-[WKInspectorViewController dealloc]): (-[WKInspectorViewController delegate]): (-[WKInspectorViewController webView]): (-[WKInspectorViewController setDelegate:]): (-[WKInspectorViewController configuration]): (-[WKInspectorViewController _webView:getWindowFrameWithCompletionHandler:]): (-[WKInspectorViewController _webView:setWindowFrame:]): (-[WKInspectorViewController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]): (-[WKInspectorViewController _webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:]): (-[WKInspectorViewController webViewWebContentProcessDidTerminate:]): (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]): Move code from RemoteWebInspectorProxyMac into here. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::createFrontendWindow): Remove commented out code left over from the last time that this method got moved around. * WebKit.xcodeproj/project.pbxproj: Add new class. 2017-10-20 Zan Dobersek [WK2] Drop 'CoordinatedGraphics' as a platform prefix from generate-forwarding-headers.pl https://bugs.webkit.org/show_bug.cgi?id=178575 Reviewed by Carlos Garcia Campos. * Scripts/generate-forwarding-headers.pl: Remove CoordinatedGraphics as a supported platform prefix. No one invokes the script with this argument anymore. 2017-10-19 Alex Christensen Introduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSuggestedFilename https://bugs.webkit.org/show_bug.cgi?id=178560 Reviewed by Tim Horton. * UIProcess/API/Cocoa/_WKDownloadDelegate.h: * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::didStart): (WebKit::DownloadClient::didReceiveResponse): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::decideDestinationWithSuggestedFilename): (WebKit::DownloadClient::didFinish): (WebKit::DownloadClient::didFail): (WebKit::DownloadClient::didCancel): (WebKit::DownloadClient::willSendRequest): 2017-10-19 Chris Dumez ServiceWorkerContextManager should be an IPC::MessageReceiver https://bugs.webkit.org/show_bug.cgi?id=178552 Reviewed by Youenn Fablet. ServiceWorkerContextManager should be an IPC::MessageReceiver, to avoid putting too many ServiceWorker related methods on WebProcess class. * DerivedSources.make: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startServiceWorkerContext): (WebKit::WebSWServerConnection::startFetch): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/ServiceWorkerContextManager.cpp: (WebKit::ServiceWorkerContextManager::startFetchInServiceWorker): (WebKit::ServiceWorkerContextManager::startFetch): Deleted. * WebProcess/Storage/ServiceWorkerContextManager.h: * WebProcess/Storage/ServiceWorkerContextManager.messages.in: Added. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didReceiveMessage): (WebKit::WebProcess::getWorkerContextConnection): (WebKit::WebProcess::startServiceWorkerContext): Deleted. (WebKit::WebProcess::startFetchInServiceWorker): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-19 Alex Christensen Modernize authentication challenge handling in WebKit https://bugs.webkit.org/show_bug.cgi?id=178555 Reviewed by Tim Horton. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didReceiveAuthenticationChallengeInFrame): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didReceiveAuthenticationChallenge): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): (WKPageSetPageNavigationClient): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace): (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy): 2017-10-19 Alex Christensen Modernize API::DownloadClient https://bugs.webkit.org/show_bug.cgi?id=178547 Reviewed by Andy Estes. Use more C++ references instead of pointers because they're never null. Remove canAuthenticateAgainstProtectionSpace because there are no implementations except the default implementation which always returns true and we don't intend to add this to the SPI because that's just a legacy call anyways from when NSURLConnection hadn't fully evolved, and we're moving away from NSURLConnection, especially in our API design. Separate the NetworkSession-only and pre-NetworkSession-only callbacks. All the synchronous IPC messages are only used in the pre-NetworkSession code, so once we remove it we can remove them! Make API::DownloadClient calls that NetworkSession uses use a completion handler so we will be able to design an asynchronous API. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): Deleted. * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync): (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace): Deleted. * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/APIDownloadClient.h: (API::DownloadClient::didStart): (API::DownloadClient::didReceiveAuthenticationChallenge): (API::DownloadClient::didReceiveResponse): (API::DownloadClient::didReceiveData): (API::DownloadClient::shouldDecodeSourceDataOfMIMEType): (API::DownloadClient::decideDestinationWithSuggestedFilename): (API::DownloadClient::didCreateDestination): (API::DownloadClient::didFinish): (API::DownloadClient::didFail): (API::DownloadClient::didCancel): (API::DownloadClient::processDidCrash): (API::DownloadClient::willSendRequest): (API::DownloadClient::canAuthenticateAgainstProtectionSpace): Deleted. * UIProcess/API/C/WKContext.cpp: (WKContextSetDownloadClient): * UIProcess/API/glib/WebKitDownloadClient.cpp: * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::didStart): (WebKit::DownloadClient::didReceiveResponse): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::decideDestinationWithSuggestedFilename): (WebKit::DownloadClient::didFinish): (WebKit::DownloadClient::didFail): (WebKit::DownloadClient::didCancel): (WebKit::DownloadClient::willSendRequest): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::processDidClose): (WebKit::DownloadProxy::didStart): (WebKit::DownloadProxy::didReceiveAuthenticationChallenge): (WebKit::DownloadProxy::willSendRequest): (WebKit::DownloadProxy::didReceiveResponse): (WebKit::DownloadProxy::didReceiveData): (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType): (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): (WebKit::DownloadProxy::didCreateDestination): (WebKit::DownloadProxy::didFinish): (WebKit::DownloadProxy::didFail): (WebKit::DownloadProxy::didCancel): (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): Deleted. * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Downloads/DownloadProxy.messages.in: 2017-10-19 Nan Wang AX: Provide a way for Accessibility to cache the selection while retrieving rects for speak selection https://bugs.webkit.org/show_bug.cgi?id=176247 Reviewed by Ryosuke Niwa. When getting the rects for highlighting the spoken text within a selection range on iOS, we can get a list of totally wrong rects if the user changed the selection to some other text. This is because the calculation is based on the current selection range. Therefore, we need to provide a way for accessibility codepath to store the selection during a speaking session. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _accessibilityStoreSelection]): (-[WKWebView _accessibilityClearSelection]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _accessibilityStoreSelection]): (-[WKContentView _accessibilityClearSelection]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::storeSelectionForAccessibility): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getRectsForGranularityWithSelectionOffset): (WebKit::WebPage::storeSelectionForAccessibility): (WebKit::WebPage::getRectsAtSelectionOffsetWithText): 2017-10-19 Sam Weinig [Settings] Move global settings into their own file https://bugs.webkit.org/show_bug.cgi?id=178512 Reviewed by Darin Adler. Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket): * Shared/WebPreferencesDefinitions.h: * Shared/WebPreferencesStore.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): (WebKit::WebPage::updatePreferences): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setResourceLoadStatisticsEnabled): * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::supportsVideoFullscreen const): 2017-10-19 Andy Estes [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices https://bugs.webkit.org/show_bug.cgi?id=178181 Reviewed by Dan Bernstein. * Configurations/BaseTarget.xcconfig: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): * WebKit.xcodeproj/project.pbxproj: 2017-10-19 Youenn Fablet Add preliminary support for ServiceWorker Handle Fetch https://bugs.webkit.org/show_bug.cgi?id=178475 Reviewed by Chris Dumez. Relanding now that underlying issue is fixed in https://bugs.webkit.org/show_bug.cgi?id=178527. Preliminary support of Handle Fetch algorithm and integration with fetch spec. Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker. It is similar to WebResourceLoader that do the load through NetworkProcess. In case ServiceWorkerClientFetch is not able to load through ServiceWorker, it will fallback to WebResourceLoader through a fallback callback. Loading through Service Worker is done currently if: - There is a service worker registered for that origin - Request is a subresource - service workers mode is all There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set. Future work should try to reduce the cases where the IPC dance is done unnecessarily. ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader. In particular, it is calling ResourceLoader error callback if response is of type error. It should call ResourceLoader redirection callback if response is a redirection response. This will be done as a follow-up. Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess. In the future, WebProcess should create a direct IPC communication to the ServiceWorker process. Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager. This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate. * CMakeLists.txt: * DerivedSources.make: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::didReceiveFetchResponse): (WebKit::WebSWServerConnection::didReceiveFetchData): (WebKit::WebSWServerConnection::didFinishFetch): (WebKit::WebSWServerConnection::didFailFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didFailFetch): (WebKit::StorageProcess::didReceiveFetchResponse): (WebKit::StorageProcess::didReceiveFetchData): (WebKit::StorageProcess::didFinishFetch): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::remove): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added. (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch): (WebKit::ServiceWorkerClientFetch::didReceiveResponse): (WebKit::ServiceWorkerClientFetch::didReceiveData): (WebKit::ServiceWorkerClientFetch::didFinish): (WebKit::ServiceWorkerClientFetch::didFail): (WebKit::ServiceWorkerClientFetch::cancel): * WebProcess/Storage/ServiceWorkerClientFetch.h: Copied from Source/WebKit/WebProcess/Storage/WebSWClientConnection.h. * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Copied from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in. * WebProcess/Storage/ServiceWorkerContextManager.cpp: Added. (WebKit::ServiceWorkerContextManager::startServiceWorkerContext): (WebKit::ServiceWorkerContextManager::startFetch): * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h. (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): (WebKit::WebServiceWorkerProvider::handleFetch): (WebKit::WebServiceWorkerProvider::cancelFetch): (WebKit::WebServiceWorkerProvider::fetchFinished): (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): (WebKit::WebProcess::startServiceWorkerContext): (WebKit::WebProcess::startFetchInServiceWorker): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-19 Youenn Fablet Service Worker process should not be selected to open WebView on it https://bugs.webkit.org/show_bug.cgi?id=178527 Reviewed by Chris Dumez. Selection of process to open a page will no longer use an existing web process if it is the service worker process. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): 2017-10-19 Tim Horton Display link bringup can block the main thread for ~150ms during WKWebView init https://bugs.webkit.org/show_bug.cgi?id=178524 Reviewed by Dean Jackson. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::displayLinkHandler): (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): Lazily initialize the display link at first use. 2017-10-19 Tim Horton Expand r209943 to suppress paste during provisional navigation as well https://bugs.webkit.org/show_bug.cgi?id=178429 Reviewed by Dean Jackson. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation): (WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]): (-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Adjust to the changed preference name, except at the SPI level. 2017-10-19 Youenn Fablet Add API to clean CacheStorage data https://bugs.webkit.org/show_bug.cgi?id=178034 Unreviewed. * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Using WK_IOS_TBA instead of WK_MAC_TBA for iOS. 2017-10-19 Chris Dumez Unreviewed build fix after r223692. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: 2017-10-19 Chris Dumez Unreviewed, revert r223650 as it caused crashes on the bots. * CMakeLists.txt: * DerivedSources.make: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::remove): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed. * WebProcess/Storage/ServiceWorkerClientFetch.h: Removed. * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed. * WebProcess/Storage/ServiceWorkerContextManager.cpp: Removed. * WebProcess/Storage/WebSWClientConnection.cpp: * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): (WebKit::WebProcess::startServiceWorkerContext): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-19 Chris Dumez http/tests/workers/service/basic-register.html is a flaky failure. https://bugs.webkit.org/show_bug.cgi?id=178494 Reviewed by Youenn Fablet. In WebSWServerConnection::resolveJobInClient(), when a service worker is registered, we: 1. Add the origin to the WebSWOriginStore 2. Send the IPC to the WebProcess to notify it that the registration succeeded. The assumption was that step 1 would be synchronous and would therefore send the shared memory handle to the WebProcess (if the SharedMemory was invalidated) *before* step 2. The issue is that step 1 was scheduling a zero-timer to schedule the addition. As a result, there was a race and the WebContent process could check the the WebSWOriginTable *after* being notified that a service worker was registered but *before* it received the SharedMemory handle for the WebSWOriginTable. This could lead to false negatives and was causing the layout test to be flaky. To address the issue, step 1 is now synchronous. * Shared/SharedStringHashStore.cpp: (WebKit::SharedStringHashStore::SharedStringHashStore): (WebKit::SharedStringHashStore::scheduleAddition): (WebKit::SharedStringHashStore::scheduleRemoval): (WebKit::SharedStringHashStore::contains): (WebKit::SharedStringHashStore::flushPendingChanges): (WebKit::SharedStringHashStore::processPendingOperations): * Shared/SharedStringHashStore.h: * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: (WebKit::WebSWOriginStore::add): (WebKit::WebSWOriginStore::addAll): (WebKit::WebSWOriginStore::remove): * StorageProcess/ServiceWorker/WebSWOriginStore.h: * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::addVisitedLinkHash): (WebKit::VisitedLinkStore::removeVisitedLinkHash): 2017-10-18 Ryosuke Niwa Don't expose raw HTML in pasteboard to the web content https://bugs.webkit.org/show_bug.cgi?id=178422 Reviewed by Wenson Hsieh. Encode & decode the origin string of the copied content written into the system pasteboard. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-10-18 Chris Dumez Implement ServiceWorkerRegistration.scope / updateViaCache https://bugs.webkit.org/show_bug.cgi?id=178497 Reviewed by Youenn Fablet. * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: 2017-10-18 Youenn Fablet Add preliminary support for ServiceWorker Handle Fetch https://bugs.webkit.org/show_bug.cgi?id=178475 Reviewed by Chris Dumez. Preliminary support of Handle Fetch algorithm and integration with fetch spec. Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker. It is similar to WebResourceLoader that do the load through NetworkProcess. In case ServiceWorkerClientFetch is not able to load through ServiceWorker, it will fallback to WebResourceLoader through a fallback callback. Loading through Service Worker is done currently if: - There is a service worker registered for that origin - Request is a subresource - service workers mode is all There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set. Future work should try to reduce the cases where the IPC dance is done unnecessarily. ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader. In particular, it is calling ResourceLoader error callback if response is of type error. It should call ResourceLoader redirection callback if response is a redirection response. This will be done as a follow-up. Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess. In the future, WebProcess should create a direct IPC communication to the ServiceWorker process. Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager. This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate. * DerivedSources.make: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::didReceiveFetchResponse): (WebKit::WebSWServerConnection::didReceiveFetchData): (WebKit::WebSWServerConnection::didFinishFetch): (WebKit::WebSWServerConnection::failedFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::failedFetch): (WebKit::StorageProcess::didReceiveFetchResponse): (WebKit::StorageProcess::didReceiveFetchData): (WebKit::StorageProcess::didFinishFetch): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added. (WebKit::ServiceWorkerClientFetch::didReceiveResponse): (WebKit::ServiceWorkerClientFetch::didReceiveData): (WebKit::ServiceWorkerClientFetch::didFinishFetch): (WebKit::ServiceWorkerClientFetch::didFail): * WebProcess/Storage/ServiceWorkerClientFetch.h: Added. * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Added. * WebProcess/Storage/ServiceWorkerContextManager.cpp: Renamed from Source/WebCore/workers/service/context/SWContextManager.cpp. (WebKit::ServiceWorkerContextManager::startServiceWorkerContext): (WebKit::ServiceWorkerContextManager::startFetch): * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h. (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): (WebKit::WebServiceWorkerProvider::handleFetch): (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): (WebKit::WebProcess::startServiceWorkerContext): (WebKit::WebProcess::startFetchInServiceWorker): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-18 Chelsea Pugh [iOS] Use new class name from UIKit when checking UITextSuggestion type https://bugs.webkit.org/show_bug.cgi?id=178416 Reviewed by Tim Horton. Here we start using UITextAutofillSuggestion instead of the old name that was being used for AutoFill text suggestions. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertTextSuggestion:]): Use UITextAutofillSuggestion when checking the class and when casting instead of UIKeyboardLoginCredentialsSuggestion. 2017-10-17 Jiewen Tan Replace some stack raw pointers with RefPtrs within WebCore/html https://bugs.webkit.org/show_bug.cgi?id=178201 Reviewed by Ryosuke Niwa. Change the type of node as toNode() is changed to return RefPtr. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp: (WebKit::wrap): * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::WebEditorClient::handleKeyboardEvent): * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: (WebKit::WebEditorClient::handleKeyboardEvent): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::handleEditingKeyboardEvent): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::frameForEvent): 2017-10-18 Chris Dumez [Service Worker] Add stubs for Client / WindowClient / Clients https://bugs.webkit.org/show_bug.cgi?id=178469 Reviewed by Youenn Fablet. Rename PageVisibilityState to VisibilityState. * Shared/API/c/WKSharedAPICast.h: (WebKit::toVisibilityState): * WebProcess/WebPage/WebPage.h: 2017-10-18 John Wilander Check notifyPagesWhenTelemetryWasCaptured before notifying pages if there is no WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=178470 Reviewed by Brian Burg. * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): Add a missing check of notifyPagesWhenTelemetryWasCaptured. The page notification is only for testing purposes. 2017-10-18 Chris Dumez Unreviewed, fix build error after r223608 with some SDKs. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::ensureSWOriginStoreForSession): 2017-10-18 Chris Dumez Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin https://bugs.webkit.org/show_bug.cgi?id=177876 Reviewed by Ryosuke Niwa. Introduce a Service Worker origin store which gets populated / updated on the StorageProcess side and queried on the WebContent process side via the WebSWOriginTable so that the WebProcess can efficiently check if there is a ServiceWorker registered for a given origin without actually doing an IPC to the StorageProcess. For efficiency, the hash table is backed by SharedMemory so we only pass shared memory handles between the StorageProcess and the WebProcesses. We currently add entries to the WebSWOriginStore whenever a service worker registration succeeds on the StorageProcess side. We also clear this store whenever the API to clear service worker registrations is called. Code to query the WebSWOriginTable from the WebContent process side is there but currently only used by Internals for testing. We will later leverage this code when integrating with Fetch API. * CMakeLists.txt: * Shared/SharedStringHashStore.h: (WebKit::SharedStringHashStore::Client::didUpdateSharedStringHashes): * Shared/SharedStringHashTable.cpp: (WebKit::SharedStringHashTable::clear): * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp. (WebKit::WebSWOriginStore::WebSWOriginStore): (WebKit::WebSWOriginStore::add): (WebKit::WebSWOriginStore::remove): (WebKit::WebSWOriginStore::clear): (WebKit::WebSWOriginStore::registerSWServerConnection): (WebKit::WebSWOriginStore::unregisterSWServerConnection): (WebKit::WebSWOriginStore::sendStoreHandle): (WebKit::WebSWOriginStore::didInvalidateSharedMemory): * StorageProcess/ServiceWorker/WebSWOriginStore.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::resolveJobInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: (WebKit::WebSWServerConnection::sessionID const): * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): (WebKit::StorageProcess::ensureSWOriginStoreForSession): (WebKit::StorageProcess::swOriginStoreForSession const): (WebKit::StorageProcess::serviceWorkerContextStarted): (WebKit::StorageProcess::registerSWServerConnection): (WebKit::StorageProcess::unregisterSWServerConnection): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::WebSWClientConnection): (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const): (WebKit::WebSWClientConnection::setSWOriginTableSharedMemory): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWOriginTable.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h. (WebKit::WebSWOriginTable::contains const): (WebKit::WebSWOriginTable::setSharedMemory): * WebProcess/Storage/WebSWOriginTable.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h. * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::startServiceWorkerContext): 2017-10-16 Andy Estes [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError https://bugs.webkit.org/show_bug.cgi?id=178191 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): 2017-10-17 Sam Weinig [Settings] Generate Settings.h/cpp https://bugs.webkit.org/show_bug.cgi?id=178361 Reviewed by Dean Jackson. * PlatformGTK.cmake: * PlatformWPE.cmake: Delete the old Settings.h from the forwarding headers directory to allow the build to work. 2017-10-17 John Wilander Add and remove cookie partition accordingly in intermediary redirect requests https://bugs.webkit.org/show_bug.cgi?id=178369 Reviewed by Brent Fulgham. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::shouldChangePartition): Convenience function. Comment documents the logic. (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): Now adds and removes cookie partition based on the redirect-to URL's domain. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleResourceLoadStatisticsNotifyObserver): Test infrastructure. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: 2017-10-17 Youenn Fablet Cache API implementation should be able to compute storage size for WebKit client applications. https://bugs.webkit.org/show_bug.cgi?id=178350 Reviewed by Chris Dumez. When gathering data from DOM Cache, we compute the size as follows: - If Caches object is not persistent, size is zero - If Caches object is persistent, we use the size computed by NetworkCache::Storage. Covered by updated tests. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::ReadOriginsTaskCounter::create): (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin): (WebKit::CacheStorage::Engine::fetchEntries): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::storageSize const): * NetworkProcess/cache/CacheStorageEngineCaches.h: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreGetFetchCacheSizeForOrigin): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2017-10-17 Keith Miller Change WebCore sources to work with unified source builds https://bugs.webkit.org/show_bug.cgi?id=178229 Rubber stamped by Tim Horton. * Configurations/FeatureDefines.xcconfig: 2017-10-16 Wenson Hsieh Unreviewed, fix the iOS build after r223431 Remove an unused variable captured in a lambda. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): 2017-10-12 Matt Rajca Add API support for quirk that lets an arbitrary click allow auto-play. https://bugs.webkit.org/show_bug.cgi?id=178227 Reviewed by Alex Christensen. Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets an arbitrary click allow auto-play via website policies. * Shared/WebsitePolicies.h: * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): (WKWebsitePoliciesGetAllowedAutoplayQuirks): * UIProcess/API/C/WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): (-[_WKWebsitePolicies allowedAutoplayQuirks]): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::applyToDocumentLoader): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateWebsitePolicies): 2017-10-16 Andy Estes [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError https://bugs.webkit.org/show_bug.cgi?id=178191 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): 2017-10-16 Tim Horton Safari crashes after searching PDF (under [WKPDFView zoom:to:atPoint:kind:]) https://bugs.webkit.org/show_bug.cgi?id=178358 Reviewed by Wenson Hsieh. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _didFindMatch:]): UIPDFSelection can return a null rect as the selection's bounds. We can't zoom to a null rect (and doing so results in CA throwing an exception later). 2017-10-16 Alex Christensen Add a _WKThumbnailView initializer with a WKWebView https://bugs.webkit.org/show_bug.cgi?id=178351 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _page]): (-[WKWebView _setThumbnailView:]): (-[WKWebView _thumbnailView]): (-[WKWebView _setIgnoresAllEvents:]): (-[WKWebView _ignoresAllEvents]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView initWithFrame:fromWKWebView:]): (-[_WKThumbnailView _viewWasUnparented]): (-[_WKThumbnailView _viewWasParented]): 2017-10-16 Alex Christensen Expose more WKView properties as WKWebViewPrivate SPI https://bugs.webkit.org/show_bug.cgi?id=178349 Reviewed by Tim Horton. _backgroundExtendsBeyondPage was already exposed on iOS, but we need it on Mac, too. A few other properties also need exposing. * UIProcess/API/Cocoa/WKWebView.mm: (toAPIScrollbarStyle): (toCoreScrollbarStyle): (-[WKWebView _setBackgroundExtendsBeyondPage:]): (-[WKWebView _backgroundExtendsBeyondPage]): (-[WKWebView _setOverlayScrollbarStyle:]): (-[WKWebView _overlayScrollbarStyle]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-10-16 Chris Dumez Log using differential privacy domains where the WebContent process crashes https://bugs.webkit.org/show_bug.cgi?id=178346 Reviewed by Alex Christensen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::currentURL const): (WebKit::WebPageProxy::processDidTerminate): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didClose): 2017-10-16 Youenn Fablet Activate Cache API by default https://bugs.webkit.org/show_bug.cgi?id=178186 Reviewed by Chris Dumez. * Shared/WebPreferencesDefinitions.h: 2017-10-16 Sam Weinig [Settings] Remove all custom code from Settings.h/cpp https://bugs.webkit.org/show_bug.cgi?id=178330 Reviewed by Simon Fraser. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetFrameFlatteningEnabled): (WKPreferencesGetFrameFlatteningEnabled): * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_get_enable_frame_flattening): (webkit_settings_set_enable_frame_flattening): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setFrameFlatteningEnabled): Update for naming changes of FrameFlattening now that it is an enum class. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentsSizeChanged const): Ge the effectiveFrameFlattening from the FrameView, rather than the Settings. 2017-10-16 Chris Dumez [WK2][NetworkSession] Add support for resuming downloads https://bugs.webkit.org/show_bug.cgi?id=177625 Reviewed by Alex Christensen. Add support for resuming downloads for the WK2 NETWORK_SESSION code path. This was tested manually. I was unable to write an API test because our tests do not run an HTTP server and CFNetwork does not seem to generate resume data when cancelling a download over non-HTTP. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::didReceiveChallenge): (WebKit::Download::continueCanAuthenticateAgainstProtectionSpace): * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): (WebKit::DownloadManager::resumeDownload): * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): This currently includes a workaround for . We update the resume data to include the NSURLSessionResumeInfoLocalPath key with the final destination path so that CFNetwork looks for the temporary data at the right location. * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (WebKit::NetworkSessionCocoa::downloadTaskWithResumeData): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Shared/Authentication/AuthenticationManager.h: 2017-10-16 Adrian Perez de Castro [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM https://bugs.webkit.org/show_bug.cgi?id=178090 Reviewed by Michael Catanzaro. EGLNativeWindowType can be aliased to a different type depending (at least) on the EGL implementation, its build options, and the libepoxy build options. Using "static_cast" works when it is a numeric value and the width of the value needs to be optionally extended to 64 bits (e.g. the EGL type is "int" in a 32-bit CPU) but not for pointers, and using "reinterpret_cast" works when the size of a pointer is 64 bits but not in other cases. Therefore it seems reasonable to use a plain C cast expression to solve this particular situation. * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp: (WebKit::AcceleratedSurfaceWPE::window const): Use a good old plain C cast expression. 2017-10-16 Chris Dumez Clicks on Link with download attribute causes all (other) links to trigger download when clicked https://bugs.webkit.org/show_bug.cgi?id=178267 Reviewed by Darin Adler. When clicking on an anchor with the download attribute, the m_syncNavigationActionHasDownloadAttribute flag on WebPageProxy would get set. This flag would not get reset right away and instead, it would get updated during the next call to WebPageProxy::decidePolicyForNavigationAction(). The issue is that if you later click on a link with target="_blank", WebPageProxy::decidePolicyForNewWindowAction() gets called instead of WebPageProxy::decidePolicyForNavigationAction() and we do not reset the m_syncNavigationActionHasDownloadAttribute flag and we force a download. To address the problem, I got rid of this flag on WebPageProxy and it is error-prone and should really not be at page-level. Instead, I added a shouldForceDownload flag on the navigation object. It makes more sense to associate the flag with the navigation and makes it less error-prone. * UIProcess/API/APINavigation.h: (API::Navigation::setShouldForceDownload): (API::Navigation::shouldForceDownload const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * UIProcess/WebPageProxy.h: 2017-10-16 Ryan Haddad Unreviewed, rolling out r223271. This change introduced LayoutTest failures on WK1. Reverted changeset: "Use asynchronous ResourceHandleClient calls for WebKit1" https://bugs.webkit.org/show_bug.cgi?id=160677 https://trac.webkit.org/changeset/223271 2017-10-13 Youenn Fablet Implement listing origins for which CacheStorage is storing data https://bugs.webkit.org/show_bug.cgi?id=178236 Reviewed by Chris Dumez. Cache storage is split on per-origin folders which name is obfuscated through salting. To retrieve the origin for each folder, an origin file is now stored within each folder. This file contains the actual origin. Adding support to get the list of origin by iterating through each folder and getting the actual origin by reading the content of the 'origin' file. Adding C API for WebKitTestRunner. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::fetchEntries): (WebKit::CacheStorage::ReadOriginsTaskCounter::create): (WebKit::CacheStorage::ReadOriginsTaskCounter::~ReadOriginsTaskCounter): (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin): (WebKit::CacheStorage::ReadOriginsTaskCounter::ReadOriginsTaskCounter): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::cachesOriginFilename): (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory): (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::storeOrigin): (WebKit::CacheStorage::Caches::readOrigin): (WebKit::CacheStorage::Caches::initialize): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::origin const): * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreGetFetchCacheOrigins): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2017-10-13 Alex Christensen Fix API tests after r223269. https://bugs.webkit.org/show_bug.cgi?id=178246 * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::getContentRuleListSource): Version 10 also has the ability to recover content rule list source. 2017-10-11 Gustavo Noronha Silva [GLib] WebKitNavigationAction should tell whether it is a redirect https://bugs.webkit.org/show_bug.cgi?id=178178 There is no good way to know whether a given navigation action has been caused by a redirect through the glib API. This is necessary to implement some app mode heuristics for Epiphany. Reviewed by Carlos Garcia Campos. * UIProcess/API/glib/WebKitNavigationAction.cpp: (webkit_navigation_action_is_redirect): returns whether the navigation action is a redirect. * UIProcess/API/glib/WebKitNavigationActionPrivate.h: add isRedirect to the wrapper object. (_WebKitNavigationAction::_WebKitNavigationAction): * UIProcess/API/gtk/WebKitNavigationAction.h: add the new API. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: ditto. * UIProcess/API/wpe/WebKitNavigationAction.h: ditto. 2017-10-12 Brady Eidson SW "Hello world". https://bugs.webkit.org/show_bug.cgi?id=178187 Reviewed by Andy Estes. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::startServiceWorkerContext): 2017-10-12 Alex Christensen Remove unnecessary includes in WebKit https://bugs.webkit.org/show_bug.cgi?id=178235 Reviewed by Tim Horton. * Platform/IPC/ArgumentCoders.h: * WebProcess/WebProcess.cpp: * WebProcess/WebStorage/StorageAreaImpl.h: 2017-10-12 Alex Christensen Increment ContentRuleListStore::CurrentContentRuleListFileVersion https://bugs.webkit.org/show_bug.cgi?id=178246 Reviewed by Tim Horton. * UIProcess/API/APIContentRuleListStore.h: Things are crashing. Something isn't binary reverse compatible. Probably something related to r222602. This is why we have a version number to update. 2017-10-12 Alex Christensen Expose some of WKView's WebViewImpl accessors through WKWebViewPrivate https://bugs.webkit.org/show_bug.cgi?id=178240 Reviewed by Tim Horton. Also renamed createFullScreenWindow to fullScreenWindow to reflect the fact that it returns an autoreleased NSWindow so we don't make the same naming mistake in the WKWebView SPI. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _dismissContentRelativeChildWindows]): (-[WKWebView _setFrame:andScrollBy:]): (-[WKWebView _setTotalHeightOfBanners:]): (-[WKWebView _totalHeightOfBanners]): (-[WKWebView _beginDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChangesSync]): (-[WKWebView _gestureEventWasNotHandledByWebCore:]): (-[WKWebView _setIgnoresNonWheelEvents:]): (-[WKWebView _ignoresNonWheelEvents]): (-[WKWebView _setCustomSwipeViews:]): (-[WKWebView _setCustomSwipeViewsTopContentInset:]): (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView _fullScreenWindow]): (-[WKWebView _disableFrameSizeUpdates]): (-[WKWebView _enableFrameSizeUpdates]): (-[WKWebView _canChangeFrameLayout:]): (-[WKWebView _underlayColor]): (-[WKWebView _setUnderlayColor:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView createFullScreenWindow]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::fullScreenWindowController): (WebKit::WebViewImpl::fullScreenWindow): (WebKit::WebViewImpl::createFullScreenWindow): Deleted. 2017-10-12 Youenn Fablet Layout Test http/tests/cache-storage/cache-clearing.https.html is failing https://bugs.webkit.org/show_bug.cgi?id=178200 Reviewed by Chris Dumez. Deleting only the per-origin folders inside the CacheStorage engine root folder. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::clearAllCaches): * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreRemoveAllFetchCaches): (WKWebsiteDataStoreRemoveFetchCacheForOrigin): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2017-10-12 Chris Dumez [Mac] Add support for MouseEvent.buttons https://bugs.webkit.org/show_bug.cgi?id=178214 Reviewed by Ryosuke Niwa. * Shared/WebEvent.h: (WebKit::WebMouseEvent::buttons const): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): * Shared/WebMouseEvent.cpp: (WebKit::WebMouseEvent::WebMouseEvent): (WebKit::WebMouseEvent::encode const): (WebKit::WebMouseEvent::decode): * Shared/mac/WebEventFactory.mm: (WebKit::currentlyPressedMouseButtons): (WebKit::WebEventFactory::createWebMouseEvent): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::showContextMenuAtPoint): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createWebEvent const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPage::simulateMouseDown): (WebKit::WebPage::simulateMouseUp): (WebKit::WebPage::simulateMouseMotion): 2017-10-12 Youenn Fablet Add API to clean CacheStorage data https://bugs.webkit.org/show_bug.cgi?id=178034 Unreviewed. * Shared/WebsiteData/WebsiteDataType.h: fixing the DOMCache value. 2017-10-12 Stephan Szabo [WinCairo] add WebProcess files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=178024 Reviewed by Alex Christensen. * PlatformWin.cmake: * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added. (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: Added. (WebKit::InjectedBundle::initialize): (WebKit::InjectedBundle::setBundleParameter): (WebKit::InjectedBundle::setBundleParameters): * WebProcess/Plugins/Netscape/JSNPObject.cpp: * WebProcess/Plugins/Netscape/win/PluginProxyWin.cpp: Added. (WebKit::PluginProxy::needsBackingStore const): * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Added. (WebKit::WebContextMenuClient::lookUpInDictionary): (WebKit::WebContextMenuClient::isSpeaking): (WebKit::WebContextMenuClient::speak): (WebKit::WebContextMenuClient::stopSpeaking): * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added. (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext): (WebKit::WebFrameNetworkingContext::storageSession const): (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const): (WebKit::WebFrameNetworkingContext::blockedError const): * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added. (WebKit::WebFrameNetworkingContext::create): * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Added. (WebKit::WebPopupMenu::setUpPlatformData): * WebProcess/WebPage/win/WebInspectorUIWin.cpp: Added. (WebKit::WebInspectorUI::canSave): (WebKit::WebInspectorUI::localizedStringsURL): (WebKit::RemoteWebInspectorUI::localizedStringsURL): * WebProcess/WebPage/win/WebPageWin.cpp: Added. (WebKit::WebPage::platformInitialize): (WebKit::WebPage::platformDetach): (WebKit::WebPage::platformEditorState const): (WebKit::WebPage::platformPreferencesDidChange): (WebKit::WebPage::performDefaultBehaviorForKeyEvent): (WebKit::WebPage::platformHasLocalDataForURL): (WebKit::WebPage::cachedResponseMIMETypeForURL): (WebKit::WebPage::platformCanHandleRequest): (WebKit::WebPage::cachedSuggestedFilenameForURL): (WebKit::WebPage::cachedResponseDataForURL): (WebKit::WebPage::platformUserAgent const): (WebKit::WebPage::interpretKeyEvent): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureWebToStorageProcessConnection): * WebProcess/win/WebProcessWin.cpp: Added. (loadResourceIntoBuffer): (WebKit::WebProcess::platformInitializeWebProcess): (WebKit::WebProcess::platformTerminate): (WebKit::WebProcess::platformSetCacheModel): 2017-10-12 David Kilzer [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler Reviewed by Chris Fleizach. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]): - Remove unused lambda variable 'touch' which was also passed as an argument. (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]): - Remove unused lambda variable 'gestureState' which was also passed as an argument. (-[WKContentView _simulateLongPressActionAtLocation:]): - Remove unused lambda variable 'location'. 2017-10-12 John Wilander ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url() https://bugs.webkit.org/show_bug.cgi?id=175257 Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]): (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]): Test infrastructure. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder): (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo): Test infrastructure. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-10-12 Andy Estes [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices https://bugs.webkit.org/show_bug.cgi?id=178181 Reviewed by Dan Bernstein. * Configurations/BaseTarget.xcconfig: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): * WebKit.xcodeproj/project.pbxproj: 2017-10-12 Youenn Fablet CacheStorage persistent folder should be in /Library/Cache https://bugs.webkit.org/show_bug.cgi?id=178193 Reviewed by Brady Eidson. * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultCacheStorageDirectory): Making CacheStorage directory a subfolder of Caches folder. (API::WebsiteDataStore::defaultDataStoreConfiguration): * UIProcess/WebProcessPool.cpp: (WebKit::legacyWebsiteDataStoreConfiguration): (WebKit::WebProcessPool::ensureNetworkProcess): Make sure the web site data store has the right cache directory path. Also make sure that the quota is set even if there is no folder specified. Quota may still be useful in case of non persistent sessions. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: (API::WebsiteDataStore::defaultCacheStorageDirectory): 2017-10-11 Sam Weinig Remove out-parameter variants of copyToVector https://bugs.webkit.org/show_bug.cgi?id=178155 Reviewed by Tim Horton. * Shared/API/Cocoa/_WKRemoteObjectInterface.mm: (-[_WKRemoteObjectInterface debugDescription]): * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::dump): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::pendingCookies const): * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]): * WebProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::getHostnamesWithCookies): * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::didChangePosition): (WebKit::WebGeolocationManager::didFailToDeterminePosition): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired): Replace out-parameter based copyToVector, with one that returns a Vector. 2017-10-11 Jaehun Lim Fix debug build Unreviewed. Add ENABLE(SERVICE_WORKER) guard. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): 2017-10-11 Youenn Fablet Add API to clean CacheStorage data https://bugs.webkit.org/show_bug.cgi?id=178034 Unreviewed. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): Fixing lifetime of aggregator. 2017-10-11 Youenn Fablet Add API to clean CacheStorage data https://bugs.webkit.org/show_bug.cgi?id=178034 Reviewed by Chris Dumez. Introducing a new website data type for DOMCache. Adding API to delete DOMCache for a given origin or for all origins. This is added to WKWebsiteDataStore. Cleaning a CacheStorage will remove all data in the Cache object but the object will stay live for the duration of the NetworkProcess. This allows ensuring that once a cache is cleaned, WebProcess will update to this new state. Fetching of WebsiteData for DOMCache is not implemented yet since we do not keep a list of all origins for which we have data. * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDOMCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::cachesRootPath): (WebKit::CacheStorage::Engine::fetchEntries): (WebKit::CacheStorage::ClearTasksHandler::ClearTasksHandler): (WebKit::CacheStorage::ClearTasksHandler::~ClearTasksHandler): (WebKit::CacheStorage::Engine::clearEngines): (WebKit::CacheStorage::Engine::clearCachesForOrigins): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::deleteFolder): (WebKit::CacheStorage::Engine::clearCaches): (WebKit::CacheStorage::Engine::unlock): Removing the assertion as Cache objects are removed when clearing data. * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::clear): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::create): * Shared/WebsiteData/WebsiteDataType.h: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreRemoveAllDOMCaches): (WKWebsiteDataStoreRemoveDOMCacheForOrigin): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore allWebsiteDataTypes]): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): 2017-10-11 Chris Dumez [Geolocation] Expose Coordinates.floorLevel https://bugs.webkit.org/show_bug.cgi?id=178173 Reviewed by Ryosuke Niwa. * UIProcess/API/C/WKGeolocationPosition.cpp: (WKGeolocationPositionCreate): (WKGeolocationPositionCreate_b): (WKGeolocationPositionCreate_c): * UIProcess/API/C/WKGeolocationPosition.h: 2017-10-11 Youenn Fablet Bump default cache storage quota to 20MB https://bugs.webkit.org/show_bug.cgi?id=178132 Reviewed by Alex Christensen. Adding the ability to set the quota per origin through WebsiteDataStore. Moving cache storage directory setting also in WebsiteDataStore. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * 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: * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]): (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]): (-[WKWebsiteDataStore _cacheStorageDirectory]): (-[WKWebsiteDataStore _setCacheStorageDirectory:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: * UIProcess/WebProcessPool.cpp: (WebKit::legacyWebsiteDataStoreConfiguration): (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const): (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota): (WebKit::WebsiteDataStore::cacheStorageDirectory const): (WebKit::WebsiteDataStore::setCacheStorageDirectory): 2017-10-11 Myles C. Maxfield Allow PAL to log messages https://bugs.webkit.org/show_bug.cgi?id=171523 Reviewed by Alex Christensen. * Platform/Logging.h: * Scripts/generate-forwarding-headers.pl: 2017-10-11 Ryosuke Niwa Sanitize URL in pasteboard for other applications and cross origin content https://bugs.webkit.org/show_bug.cgi?id=178060 Reviewed by Wenson Hsieh. Plubmed the origin identifier through IPC from Pasteboard in WebContent process to PlatformPasteboard in UIProcess. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-10-11 Chris Dumez Modernize Geolocation code https://bugs.webkit.org/show_bug.cgi?id=178148 Reviewed by Ryosuke Niwa. * Shared/WebGeolocationPosition.cpp: (WebKit::WebGeolocationPosition::create): (WebKit::WebGeolocationPosition::~WebGeolocationPosition): * Shared/WebGeolocationPosition.h: (WebKit::WebGeolocationPosition::timestamp const): (WebKit::WebGeolocationPosition::latitude const): (WebKit::WebGeolocationPosition::longitude const): (WebKit::WebGeolocationPosition::accuracy const): (WebKit::WebGeolocationPosition::altitude const): (WebKit::WebGeolocationPosition::altitudeAccuracy const): (WebKit::WebGeolocationPosition::heading const): (WebKit::WebGeolocationPosition::speed const): (WebKit::WebGeolocationPosition::corePosition const): (WebKit::WebGeolocationPosition::WebGeolocationPosition): * UIProcess/API/C/WKGeolocationPosition.cpp: (WKGeolocationPositionCreate_b): * UIProcess/API/Cocoa/_WKGeolocationPosition.mm: (WebKit::wrapper): * UIProcess/API/glib/WebKitGeolocationProvider.cpp: (WebKit::WebKitGeolocationProvider::notifyPositionChanged): * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::providerDidChangePosition): * UIProcess/ios/WKGeolocationProviderIOS.mm: (-[WKLegacyCoreLocationProvider positionChanged:]): * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::didChangePosition): * WebProcess/Geolocation/WebGeolocationManager.h: * WebProcess/Geolocation/WebGeolocationManager.messages.in: * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: (WebKit::WebGeolocationClient::lastPosition): * WebProcess/WebCoreSupport/WebGeolocationClient.h: 2017-10-11 Brady Eidson Add a SW context process (where SW scripts will actually execute). https://bugs.webkit.org/show_bug.cgi?id=178156 Reviewed by Andy Estes. This patch adds an auxiliary "ServiceWorker context" WebProcess to a WebProcessPool. This process is where ServiceWorker scripts will execute, separate from the client WebProcess hosting the page(s) they are serving. This patch also adds all of the plumbing to pass along a fetched service worker script to this context WebProcess, as well as message back failure to actually start the script so we can test. Touches lots of code sites but is basically just a lot of plumbing. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::startServiceWorkerContext): (WebKit::WebSWServerConnection::sendToContextProcess): (WebKit::WebSWServerConnection::setContextConnection): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::workerContextProcessConnection): (WebKit::StorageProcess::createWorkerContextProcessConnection): (WebKit::StorageProcess::didGetWorkerContextProcessConnection): (WebKit::StorageProcess::serviceWorkerContextFailedToStart): (WebKit::StorageProcess::registerSWServerConnection): (WebKit::StorageProcess::unregisterSWServerConnection): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::removeSWServerConnection): (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated): * StorageProcess/StorageToWebProcessConnection.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::create): (WebKit::StorageProcessProxy::StorageProcessProxy): (WebKit::StorageProcessProxy::didClose): (WebKit::StorageProcessProxy::getWorkerContextProcessConnection): (WebKit::StorageProcessProxy::didGetWorkerContextProcessConnection): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): (WebKit::WebProcessPool::getWorkerContextProcessConnection): (WebKit::WebProcessPool::didGetWorkerContextProcessConnection): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didGetWorkerContextConnection): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): (WebKit::WebProcess::startServiceWorkerContext): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-11 Don Olmstead Remove ENABLE_NETWORK_CACHE https://bugs.webkit.org/show_bug.cgi?id=177424 Reviewed by Antti Koivisto. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::clearDiskCacheEntries): (WebKit::NetworkProcess::setCacheModel): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::cache): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): (WebKit::NetworkResourceLoader::canUseCachedRedirect const): (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::abort): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: * NetworkProcess/cache/NetworkCacheBlobStorage.h: * NetworkProcess/cache/NetworkCacheCoders.cpp: * NetworkProcess/cache/NetworkCacheCoders.h: * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp: * NetworkProcess/cache/NetworkCacheCodersSoup.cpp: * NetworkProcess/cache/NetworkCacheData.cpp: * NetworkProcess/cache/NetworkCacheData.h: * NetworkProcess/cache/NetworkCacheDataCocoa.mm: * NetworkProcess/cache/NetworkCacheDataSoup.cpp: * NetworkProcess/cache/NetworkCacheEntry.cpp: * NetworkProcess/cache/NetworkCacheEntry.h: * NetworkProcess/cache/NetworkCacheFileSystem.cpp: * NetworkProcess/cache/NetworkCacheFileSystem.h: * NetworkProcess/cache/NetworkCacheIOChannel.h: * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: * NetworkProcess/cache/NetworkCacheKey.cpp: * NetworkProcess/cache/NetworkCacheKey.h: * NetworkProcess/cache/NetworkCacheStatistics.cpp: * NetworkProcess/cache/NetworkCacheStatistics.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: * NetworkProcess/cache/NetworkCacheStorage.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): (WebKit::NetworkProcess::clearDiskCache): * NetworkProcess/ios/NetworkProcessIOS.mm: (WebKit::NetworkProcess::clearCacheForAllOrigins): * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::NetworkProcess::clearDiskCache): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::registerUserDefaultsIfNeeded): (WebKit::WebProcessPool::platformInitializeNetworkProcess): (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): (WebKit::WebProcessPool::isNetworkCacheEnabled): * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::storeDerivedDataToCache): * config.h: 2017-10-11 Michael Catanzaro Unreviewed, rolling out r223146. Better to not expose cairo in the WPE API Reverted changeset: "[WPE] Header cairo.h is used in GLib API headers but cannot be found" https://bugs.webkit.org/show_bug.cgi?id=178100 http://trac.webkit.org/changeset/223146 2017-09-27 Frederic Wang [iOS] Do not flatten frames when async frame scrolling is enabled https://bugs.webkit.org/show_bug.cgi?id=173704 Reviewed by Simon Fraser. This patch disables frame flattening when async frame scrolling is enabled on iOS, as otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264), developers and beta testers will be able to check it by enabling "Async Frame Scrolling" in the "Experimental WebKit Features" menu of Safari iOS. Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentsSizeChanged): Use effectiveFrameFlattening() introduced in Source/WebCore. 2017-10-10 Ryosuke Niwa Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner https://bugs.webkit.org/show_bug.cgi?id=178154 Reviewed by Wenson Hsieh. Plumbed customPasteboardDataEnabled flag to be used in WebKitTestRunner. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetCustomPasteboardDataEnabled): (WKPreferencesGetCustomPasteboardDataEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-10-10 Adrian Perez de Castro [WPE] Remove the possibility of installing the old WebKit2 C API https://bugs.webkit.org/show_bug.cgi?id=178125 Reviewed by Michael Catanzaro. * PlatformWPE.cmake: Remove support for installing the deprecated C API. 2017-10-10 Chris Dumez [WK2] Add API to clear service worker registrations https://bugs.webkit.org/show_bug.cgi?id=178085 Reviewed by Ryosuke Niwa. Add API to clear service worker registrations. Although the request to clear the registration is passed on to the StorageProcess, it is currently a no-op on StorageProcess side until we actually persist service worker registrations on disk. * Shared/WebsiteData/WebsiteDataType.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::fetchWebsiteData): (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore allWebsiteDataTypes]): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::removeData): 2017-10-10 Commit Queue Unreviewed, rolling out r223130. https://bugs.webkit.org/show_bug.cgi?id=178147 Breaks the build when EGLNativeWindowType is a pointer (Requested by aperezdc on #webkit). Reverted changeset: "[WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM" https://bugs.webkit.org/show_bug.cgi?id=178090 http://trac.webkit.org/changeset/223130 2017-10-10 Sam Weinig Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values()) https://bugs.webkit.org/show_bug.cgi?id=178102 Reviewed by Tim Horton. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didClose): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::dumpChangedLayers): * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextInvalidateCustomProtocolRequests): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseContainerForall): * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]): * UIProcess/GenericCallback.h: (WebKit::invalidateCallbackMap): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shutDown): (WebKit::WebProcessProxy::didClose): (WebKit::WebProcessProxy::didBecomeUnresponsive): (WebKit::WebProcessProxy::didBecomeResponsive): (WebKit::WebProcessProxy::willChangeIsResponsive): (WebKit::WebProcessProxy::didChangeIsResponsive): (WebKit::WebProcessProxy::disconnectFramesFromPage): (WebKit::WebProcessProxy::frameCountInPage const): (WebKit::WebProcessProxy::requestTermination): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::invalidate): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::stopAllStreams): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::cancelAllStreams): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::buildTransaction): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didClose): 2017-10-10 Adrian Perez de Castro [WPE] Header cairo.h is used in GLib API headers but cannot be found https://bugs.webkit.org/show_bug.cgi?id=178100 Reviewed by Michael Catanzaro. * wpe/wpe-webkit.pc.in: Add Cairo to the "Requires" field, so its flags get pulled in and the "cairo.h", used in the WPE WebKit GLib API headers, can be found. 2017-10-10 Michael Catanzaro CSS constant properties should not be enabled by default https://bugs.webkit.org/show_bug.cgi?id=177416 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: 2017-10-10 Brady Eidson Random StorageProcess and SWServer cleanup. https://bugs.webkit.org/show_bug.cgi?id=178141 Reviewed by Andy Estes. -StorageProcess should own the set of SWServers -Some renaming and cleanup * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::createStorageToWebProcessConnection): (WebKit::StorageProcess::swServerForSession): * StorageProcess/StorageProcess.h: (WebKit::StorageProcess::queue): * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::establishSWServerConnection): * StorageProcess/StorageToWebProcessConnection.h: 2017-10-10 Michael Catanzaro Unreviewed, rolling out r223136. Forgot to update GTK API header Reverted changeset: "[WPE] Header cairo.h is used in GLib API headers but cannot be found" https://bugs.webkit.org/show_bug.cgi?id=178100 http://trac.webkit.org/changeset/223136 2017-10-10 Adrian Perez de Castro [WPE] Header cairo.h is used in GLib API headers but cannot be found https://bugs.webkit.org/show_bug.cgi?id=178100 Reviewed by Žan Doberšek. Instead of including , it is better to forward-declare cairo_surface_t, which is the one and only Cairo declaration needed by the WPE API header. * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Add inclusion of . * UIProcess/API/glib/WebKitWebView.cpp: Add inclusion of . * UIProcess/API/wpe/WebKitFaviconDatabase.h: Add forward declaration of cairo_surface_t. 2017-10-10 Adrian Perez de Castro [WPE] Cannot link against libWPEWebkit due to wrong contents of wpe-webkit.pc https://bugs.webkit.org/show_bug.cgi?id=178133 Reviewed by Žan Doberšek. * wpe/wpe-webkit.pc.in: Remove "-lWPE" and replace "Requires.private" with a plain "Requires". 2017-10-10 Adrian Perez de Castro [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM https://bugs.webkit.org/show_bug.cgi?id=178090 Reviewed by Žan Doberšek. * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp: (WebKit::AcceleratedSurfaceWPE::window const): Use static_cast instead of reinterpret_cast, this way extending values of EGLNativeWindowType to 64 bits is allowed. 2017-10-10 Adrian Perez de Castro [WPE] GLib API headers WebKitScriptDialog.h and WebKitFileChooserRequest.h are not installed https://bugs.webkit.org/show_bug.cgi?id=178104 Reviewed by Žan Doberšek. * PlatformWPE.cmake: Add missing header paths to the WPE_API_INSTALLED_HEADERS variable. 2017-10-10 Adrian Perez de Castro [WPE][CMake] The “install” target should install all public API headers https://bugs.webkit.org/show_bug.cgi?id=176475 Reviewed by Žan Doberšek. Install the WPE port GLib-based API headers. The deprecated C API is still available, but disabled by default behind the "EXPORT_DEPRECATED_WEBKIT2_C_API" CMake option. * PlatformWPE.cmake: Always install "wpe-webkit.pc" and the GLib C API for WPE. 2017-10-09 Jeremy Jones Fix typo of virtual keyword in PageClientImplIOS.h https://bugs.webkit.org/show_bug.cgi?id=178088 Reviewed by Simon Fraser. This compile error happens when FULLSCREEN_API is enabled for iOS. Remove the redundant virtual keyword since function is marked override. * UIProcess/ios/PageClientImplIOS.h: 2017-10-09 Chris Dumez [iOS][WK2] Tiles outsides the viewport are sometimes missing after relaunching a crashes WebProcess https://bugs.webkit.org/show_bug.cgi?id=178095 Reviewed by Simon Fraser. Make sure we reset WKWebView._hasScheduledVisibleRectUpdate to NO in WKWebView._processDidExit. _scheduleVisibleContentRectUpdateAfterScrollInView would otherwise return early because WKWebView._hasScheduledVisibleRectUpdate is always YES. Normally, _addUpdateVisibleContentRectPreCommitHandler sets a CATransaction commit handler that resets _hasScheduledVisibleRectUpdate to NO, but it does not do so when ![webView _isValid] (which is true when the WebProcess has crashed. Also reset WKWebView._commitDidRestoreScrollPosition to NO in WKWebView._processDidExit even though it does not seem to be the cause of this bug. It seems to make sense to reset this member when the process crashes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processDidExit]): 2017-10-09 Youenn Fablet Add quota to cache API https://bugs.webkit.org/show_bug.cgi?id=177552 Reviewed by Alex Christensen. Adding support for quota checking in CacheStorage::Caches. It is passed to NetworkProcess at creation time. Default quota size is configured to 400Ko by origin per default. This value is suitable for testing. Future patch should raise this default value and allows configuring it. Quota is computed based on the response body size. This size is padded at WebCore for opaque responses. Size is stored persistently as opaque response padded size should remain stable. See https://github.com/whatwg/storage/issues/31 for the rationale about this padding. In case of putting several records at the same time, the size of all records is computed so that all records will be written or rejected together. Sending QuotaExceeded error when quota is exceeded. Future effort should allow asking UIProcess for quota extension. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::cacheStoragePerOriginQuota const): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::readCachesFromDisk): * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::toRecordInformation): (WebKit::CacheStorage::isolatedCopy): (WebKit::CacheStorage::Cache::open): (WebKit::CacheStorage::Cache::storeRecords): (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::writeRecordToDisk): (WebKit::CacheStorage::Cache::updateRecordToDisk): (WebKit::CacheStorage::Cache::removeRecordFromDisk): (WebKit::CacheStorage::Cache::encode): (WebKit::CacheStorage::Cache::decodeRecordHeader): (WebKit::CacheStorage::Cache::decode): * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::initializeSize): (WebKit::CacheStorage::Caches::requestSpace): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::removeCacheEntry): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::create): (WebKit::CacheStorage::Caches::hasEnoughSpace const): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::traverse): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2017-10-09 Sam Weinig Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector https://bugs.webkit.org/show_bug.cgi?id=178072 Reviewed by Darin Adler. * Shared/AsyncRequest.h: (WebKit::AsyncRequestMap::values): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::pages const): Update for type change for HashMap::values(). 2017-10-09 Jeremy Jones Incorrect fullscreen animation when element has a transform. https://bugs.webkit.org/show_bug.cgi?id=177558 rdar://problem/29603741 Reviewed by Jer Noble. Use a bit of code from element fullscreen to do this correctly for video fullscreen. The key is to get the absolute quad from the renderer. This will work for scaling, But since we still take the bounding box, it won't work for rotations. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::inlineVideoFrame): 2017-10-09 Robin Morisset Make the names of the options consistent https://bugs.webkit.org/show_bug.cgi?id=177933 Reviewed by Saam Barati. * NetworkProcess/capture/json.hpp: * Platform/IPC/Connection.cpp: (IPC::Connection::connectionDidClose): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _keyboardWillHide:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runModal): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectWithGesture): 2017-10-09 Adrian Perez de Castro [WPE][GTK] Propagate libepoxy compiler flags obtained from pkg-config https://bugs.webkit.org/show_bug.cgi?id=178081 Reviewed by Carlos Alberto Lopez Perez. * CMakeLists.txt: Use ${LIBEPOXY_DEFINITIONS} for building WebKit. 2017-10-08 Tim Horton mediaPlaybackRequiresUserAction API replacement annotation is wrong https://bugs.webkit.org/show_bug.cgi?id=178063 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebViewConfiguration.h: mediaPlaybackRequiresUserAction suggests that you should use requiresUserActionForMediaPlayback instead, but that is also deprecated. Instead, follow the chain and suggest mediaTypesRequiringUserActionForPlayback. 2017-10-06 Wenson Hsieh [iOS WK2] API tests added in r222991 are failing in iOS 11 test runners https://bugs.webkit.org/show_bug.cgi?id=178037 Reviewed by Tim Horton. This patch carries out some minor cleanup around UIKitSPI.h in WebKit2, so that the internal SDK isn't required to implement -[WKContentView insertTextSuggestion:]. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertTextSuggestion:]): 2017-10-06 Chris Dumez [Beacon][Cocoa] Beacon requests with BufferSource payload should not have a Content-Type HTTP header https://bugs.webkit.org/show_bug.cgi?id=178027 Reviewed by Youenn Fablet. Use new NSURLSessionConfiguration._suppressedAutoAddedHTTPHeaders CFNetwork SPI to make sure that CFNetwork never adds a Content-Type HTTP headers to our requests when we did not add one. This is covered by the following tests on newer OSes: - imported/w3c/web-platform-tests/beacon/headers/header-content-type.html - http/tests/blink/sendbeacon/beacon-same-origin.html * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 2017-10-06 Aishwarya Nirmal [iOS] Respect the "caret-color" CSS property when editing https://bugs.webkit.org/show_bug.cgi?id=177489 Reviewed by Tim Horton. This change adds support for the caret-color property on iOS. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertionPointColor]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState const): 2017-10-06 Brian Burg Web Inspector: clicking in Inspector webview clears the selection in the inspected page https://bugs.webkit.org/show_bug.cgi?id=178014 Reviewed by Timothy Hatcher. If the Inspector is docked to the inspected view, clicking on the Inspector webview will cause selection in the inspected view to be lost. This is because the selection is lost when the web view resigns first responder. Add a check in maintainsInactiveSelection to always retain selection if Web Inspector is open. This approach seems simpler than trying to sync a client's usage of WKPageSetMaintainsInactiveSelection with overrides that need to be applied and unapplied when an inspector web view is shown or hidden. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maintainsInactiveSelection const): (WebKit::WebPageProxy::inspector const): Drive by, use nullptr. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::maintainsInactiveSelection const): Deleted. 2017-10-06 Alex Christensen Add more infrastructure to apply custom headers to same-origin requests https://bugs.webkit.org/show_bug.cgi?id=177629 Reviewed by Ryosuke Niwa. * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesCopyCustomHeaderFields): (WKWebsitePoliciesSetCustomHeaderFields): * UIProcess/API/C/WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies customHeaderFields]): (-[_WKWebsitePolicies setCustomHeaderFields:]): Make the SPI for setting custom header fields take a dictionary instead of an array of Strings with colons. This matches NSURLRequest and other APIs that deal with header fields. 2017-10-06 Wenson Hsieh [iOS] Tweak support for classifying form controls (followup to r222487) https://bugs.webkit.org/show_bug.cgi?id=177917 Reviewed by Dean Jackson. This patch follows up with . It combines the functionality of two SPI hooks implemented on WKContentView into a single method that vends a context dictionary, and additionally addresses an issue with the original implementation, wherein some cached state on WebPageProxy is set upon starting node assistance, but is never unset when stopping node assistance, nor set anywhere else. See per-method comments for more detail. * UIProcess/WebPageProxy.h: Remove members m_acceptsAutofilledLoginCredentials and m_representingPageURL from WebPageProxy. This state is retrieved from the AssistedNodeInformation struct when starting node assistance, but is never reset anywhere else. Instead of introducing new members to remember this state, we can just use the WKContentView's current assisted node information. This also means that programmatically focusing forms (without user gesture) will no longer cause WKContentView to accept autofilled login credentials, since we bail out of node assistance and don't begin an input session. * UIProcess/ios/WKContentView.mm: (-[WKContentView acceptsAutofilledLoginCredentials]): Deleted. (-[WKContentView representingPageURL]): Deleted. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _autofillContext]): Merge functionality of the previous two SPI hooks, such that -_autofillContext will return a non-null dictionary containing the URL of the focused element's document if and only if WKContentView accepts autofilled login credentials, and there exists a representing page URL. When the page stops assisting the focused node, we set the AssistedNodeInformation's element type to None, so we additionally bail and return nil if the element type is None. As an aside, it seems a more reasonable approach to resetting state upon stopping node assistance is to just completely reset _assistedNodeInformation to its initial value, i.e. via _assistedNodeInformation = { }. It's not clear whether there are behaviors relying on the fact that all members but the element type in the content view's assisted node information could be stale, so this seems worthy of some investigation. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAssistingNode): (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Deleted. (WebKit::WebPageProxy::representingPageURL): Deleted. 2017-10-06 Yousuke Kimoto [WinCairo] Add shared curl files https://bugs.webkit.org/show_bug.cgi?id=177999 Reviewed by Alex Christensen. * PlatformWin.cmake: * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Added. (WebKit::AuthenticationManager::receivedCredential): (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential): (WebKit::AuthenticationManager::receivedCancellation): (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling): (WebKit::AuthenticationManager::receivedChallengeRejection): * Shared/curl/WebCoreArgumentCodersCurl.cpp: Added. (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2017-10-06 Brent Fulgham Sandbox rules block PluginProcess using "File Open/Save" dialogs https://bugs.webkit.org/show_bug.cgi?id=177965 Reviewed by Alexey Proskuryakov. Update the PluginProcess sandboxes to allow the same XPC services as the WebContent process. Also allow access to the openAndSavePanelServices. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-10-06 Brady Eidson Add (entirely incorrect) fetching of ServiceWorker scripts. https://bugs.webkit.org/show_bug.cgi?id=176179 Reviewed by Andy Estes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::finishFetchingScriptInServer): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-10-05 Carlos Garcia Campos [GTK][WPE] Add API to configure and enable resource load statistics https://bugs.webkit.org/show_bug.cgi?id=177943 Reviewed by Michael Catanzaro. Add new WebKitWebsiteDataManager construct only property to set the directory where the persistent stats are stored, and methods to enable resource load statistics and query whether it's currently enabled. Also add a new Website data type to be able to remove the persistent stats using WebKitWebsiteDataManager existing API. * UIProcess/API/glib/WebKitWebContext.cpp: (websiteDataStoreConfigurationForWebProcessPoolConfiguration): (webkitWebContextConstructed): * UIProcess/API/glib/WebKitWebsiteData.cpp: (recordContainsSupportedDataTypes): (toWebKitWebsiteDataTypes): * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: (webkitWebsiteDataManagerGetProperty): (webkitWebsiteDataManagerSetProperty): (webkitWebsiteDataManagerConstructed): (webkit_website_data_manager_class_init): (webkitWebsiteDataManagerGetDataStore): (webkit_website_data_manager_get_resource_load_stats_directory): (webkit_website_data_manager_set_resource_load_stats_enabled): (webkit_website_data_manager_get_resource_load_stats_enabled): (toWebsiteDataTypes): * UIProcess/API/gtk/WebKitWebsiteData.h: * UIProcess/API/gtk/WebKitWebsiteDataManager.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitWebsiteData.h: * UIProcess/API/wpe/WebKitWebsiteDataManager.h: 2017-10-05 Carlos Garcia Campos [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049 https://bugs.webkit.org/show_bug.cgi?id=168171 Reviewed by Chris Dumez. Add C API to handle all resource load statistics requests made by the layout tests. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetStatisticsLastSeen): (WKWebsiteDataStoreSetStatisticsPrevalentResource): (WKWebsiteDataStoreIsStatisticsPrevalentResource): (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction): (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction): (WKWebsiteDataStoreSetStatisticsGrandfathered): (WKWebsiteDataStoreIsStatisticsGrandfathered): (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin): (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin): (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo): (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction): (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree): (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords): (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning): (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost): (WKWebsiteDataStoreStatisticsSubmitTelemetry): (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned): (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval): (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured): (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval): (WKWebsiteDataStoreSetStatisticsGrandfatheringTime): (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries): (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo): (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore): (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours): (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval): (WKWebsiteDataStoreStatisticsResetToConsistentState): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2017-10-05 Tim Horton Fix the Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=177985 Unreviewed build fix. * CMakeLists.txt: * PlatformMac.cmake: After r222917, there's one more piece of WebKitSystemInterface left. And some missing bits of PaymentRequest. 2017-10-05 Keith Miller Unreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_WITHOUT_OPTIMIZATIONS. * Configurations/Base.xcconfig: 2017-10-05 Jer Noble [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting https://bugs.webkit.org/show_bug.cgi?id=177261 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2017-10-05 Alex Christensen Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList https://bugs.webkit.org/show_bug.cgi?id=177966 Reviewed by Tim Horton. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didChangeBackForwardList): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn): (WebKit::NavigationState::NavigationClient::didChangeBackForwardList): (WebKit::NavigationState::NavigationClient::willPerformClientRedirect): (WebKit::NavigationState::NavigationClient::didCancelClientRedirect): (WebKit::NavigationState::NavigationClient::renderingProgressDidChange): (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace): (WebKit::NavigationState::NavigationClient::processDidTerminate): (WebKit::NavigationState::NavigationClient::processDidBecomeResponsive): (WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive): (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame): (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData): (WebKit::NavigationState::HistoryClient::didPerformClientRedirect): (WebKit::NavigationState::HistoryClient::didPerformServerRedirect): (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeBackForwardList): 2017-10-05 Alex Christensen Add ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForNavigationAction, didStartProvisionalNavigation, and didFailNavigation https://bugs.webkit.org/show_bug.cgi?id=177974 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation): (WebKit::NavigationState::NavigationClient::didFailNavigationWithError): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu): 2017-10-05 John Wilander Storage Access API: Web process should ask UI process for grant/deny https://bugs.webkit.org/show_bug.cgi?id=176941 Reviewed by Chris Dumez and Sam Weinig. This patch adds infrastructure to let WebCore::Document call WebKit::WebResourceLoadStatisticsStore and ask for storage access on behalf of an iframe. The communication goes through the ChromeClient since we might want to add a native prompt. From the ChromeClient it continues to the WebPage which messages the WebPageProxy. The WebPageProxy calls the WebsiteDataStore which owns the WebResourceLoadStatisticsStore. A uint64_t is used to match the right callback with the boolean result. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestStorageAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::requestStorageAccess): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestStorageAccess): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::nextRequestStorageAccessContextId): (WebKit::WebPage::requestStorageAccess): (WebKit::WebPage::storageAccessResponse): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-10-05 Chris Dumez Drop unused parameters for CookiesStrategy::cookiesEnabled() https://bugs.webkit.org/show_bug.cgi?id=177957 Reviewed by Alex Christensen. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesEnabled): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesEnabled): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-10-05 Tim Horton Make progress toward properly-formed XPC services in the Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=177918 Reviewed by Alex Christensen. * CMakeLists.txt: * PlatformMac.cmake: Turn on the storage process on Mac, and fix its build. Move XPC services to Versions/A/XPCServices and add the toplevel XPCServices as a symlink of that. Run the XPC services' Info.plists through configure_file, and substitute the important variables (most critically the bundle identifier). Factor out the service setup so we don't keep duplicating it as it gets more complicated. 2017-10-05 Andy Estes [Payment Request] Add a payment method that supports Apple Pay https://bugs.webkit.org/show_bug.cgi?id=177850 Reviewed by Youenn Fablet. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (toShippingMethod): Converted the NSDecimalNumber amount to a string rather than an integer. (WebKit::toDecimalNumber): used -decimalNumberWithString:locale: rather than -initWithMantissa:exponent:isNegative: to create an NSDecimalNumber. (WebKit::toPKPaymentSummaryItem): (WebKit::toPKShippingMethod): 2017-10-05 Youenn Fablet Make LibWebRTCProvider port agnostic https://bugs.webkit.org/show_bug.cgi?id=177747 Reviewed by Alex Christensen & Alex Garcia. * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure Mac/iOS provider creates the codec factories. 2017-10-04 Alex Christensen Stop linking with WebKitSystemInterface https://bugs.webkit.org/show_bug.cgi?id=177915 Reviewed by Antti Koivisto. * Configurations/DebugRelease.xcconfig: * WebKit.xcodeproj/project.pbxproj: 2017-10-04 Alex Christensen Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms https://bugs.webkit.org/show_bug.cgi?id=177912 Reviewed by Saam Barati. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: * NetworkProcess/mac/NetworkProcessMac.mm: * NetworkProcess/mac/RemoteNetworkingContext.mm: * Platform/IPC/mac/ConnectionMac.mm: * Platform/mac/LayerHostingContext.mm: * PluginProcess/mac/PluginProcessMac.mm: * PluginProcess/mac/PluginProcessShim.mm: * Shared/ios/ChildProcessIOS.mm: * Shared/mac/ChildProcessMac.mm: * Shared/mac/SandboxExtensionMac.mm: * Shared/mac/WebCoreArgumentCodersMac.mm: * Shared/mac/WebEventFactory.mm: * StorageProcess/ios/StorageProcessIOS.mm: * StorageProcess/mac/StorageProcessMac.mm: * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: * UIProcess/mac/PageClientImplMac.mm: * UIProcess/mac/WKTextInputWindowController.mm: * UIProcess/mac/WebContextMenuProxyMac.mm: * UIProcess/mac/WebPopupMenuProxyMac.mm: * UIProcess/mac/WindowServerConnection.mm: * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: * WebProcess/WebPage/mac/WebPageMac.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-10-04 Youenn Fablet rtc::PacketOptions should have its own IPC encoding/decoding routines https://bugs.webkit.org/show_bug.cgi?id=177812 Reviewed by Alex Christensen. Replacing rtc::PacketOptions IPC encoding/decoding from passing the structure as individual parameters to the structure as a parameter. Introducing WebKit::RTCPacketOptions as a wrapper around it for which encode/decode routines are added. Updating code using rtc::PacketOptions accordingly. * NetworkProcess/webrtc/NetworkRTCSocket.cpp: (WebKit::NetworkRTCSocket::sendTo): * NetworkProcess/webrtc/NetworkRTCSocket.h: * NetworkProcess/webrtc/NetworkRTCSocket.messages.in: * Platform/IPC/Decoder.cpp: (IPC::Decoder::operator>>): (IPC::Decoder::decode): * Platform/IPC/Decoder.h: * Platform/IPC/Encoder.cpp: (IPC::Encoder::encode): * Platform/IPC/Encoder.h: * Shared/RTCPacketOptions.cpp: Added. (WebKit::RTCPacketOptions::encode const): (WebKit::RTCPacketOptions::decode): * Shared/RTCPacketOptions.h: Added. * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::LibWebRTCSocket::SendTo): 2017-10-04 Don Olmstead Include Pasteboard.h for all in WebCoreArgumentCoders https://bugs.webkit.org/show_bug.cgi?id=177902 Reviewed by Alex Christensen. * Shared/WebCoreArgumentCoders.cpp: 2017-10-04 David Kilzer Remove unused variables in lambdas for network process cache Reviewed by Tim Horton. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::putRecords): (WebKit::CacheStorage::Engine::deleteMatchingRecords): * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::reference): - Remove unused |this| from lambda captures. 2017-10-04 Stephan Szabo [WinCairo] add PLATFORM(WIN) configurations to config.h https://bugs.webkit.org/show_bug.cgi?id=177846 Reviewed by Alex Christensen. * config.h: 2017-10-04 Adrian Perez de Castro [GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly https://bugs.webkit.org/show_bug.cgi?id=158531 Reviewed by Carlos Alberto Lopez Perez. Do not bypass WebCore event handling when receiving touch events. Based on a patch by Andre Moreira Magalhaes . Thanks to Carlos Garnacho for helping out reviewing the code. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::doneWithTouchEvent): Make sure touchend reaches gesture controller if touchbegin evet got to it. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseTouchEvent): Do not invoke gesture controller directly by bypassing WebCore event handling. * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::reset): Added. (WebKit::GestureController::handleEvent): Reset gesture controller when touchpadupdate/end is received without touchbegin. (WebKit::GestureController::Gesture::reset): Added. * UIProcess/gtk/GestureController.h: 2017-10-04 Michael Catanzaro Unreviewed WPE build fix after r222837 https://bugs.webkit.org/show_bug.cgi?id=177449 * Shared/wpe/WebEventFactory.cpp: (WebKit::wallTimeForEventTime): 2017-10-04 Ryosuke Niwa Use blob URL when pasting RTFD instead of overriding DocumentLoader https://bugs.webkit.org/show_bug.cgi?id=177801 Reviewed by Wenson Hsieh. Fixed the assertion failure when RTFD content is empty. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardBufferForType): 2017-10-04 Michael Catanzaro REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps https://bugs.webkit.org/show_bug.cgi?id=177449 Reviewed by Chris Dumez. * Shared/wpe/WebEventFactory.cpp: (WebKit::wallTimeForEventTime): 2017-10-03 Brent Fulgham Correct nullptr dereference during shutdown https://bugs.webkit.org/show_bug.cgi?id=177845 Reviewed by Chris Dumez. It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have already been destroyed, they are in an invalid state when accessed. * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be a reference to completely valid object. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call 'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state. 2017-10-03 Alex Christensen Moderize WebKit's back forward list code https://bugs.webkit.org/show_bug.cgi?id=177843 Reviewed by Tim Horton. Use Ref instead of RefPtr when possible. Use references instead of pointers when possible. Remove unnecessary null checks. Reduce unnecessary Vector copying. * Shared/SessionState.h: * Shared/WebBackForwardListItem.h: * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didChangeBackForwardList): (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::pageClosed): (WebKit::WebBackForwardList::addItem): (WebKit::WebBackForwardList::goToItem): (WebKit::WebBackForwardList::currentItem const): (WebKit::WebBackForwardList::backItem const): (WebKit::WebBackForwardList::forwardItem const): (WebKit::WebBackForwardList::itemAtIndex const): (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const): (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const): (WebKit::WebBackForwardList::removeAllItems): (WebKit::WebBackForwardList::clear): (WebKit::WebBackForwardList::backForwardListState const): (WebKit::WebBackForwardList::restoreFromState): * UIProcess/WebBackForwardList.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcessWithItem): (WebKit::WebPageProxy::initializeWebPage): (WebKit::WebPageProxy::didChangeBackForwardList): (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList): (WebKit::WebPageProxy::backForwardGoToItem): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::registerNewWebBackForwardListItem): * UIProcess/WebProcessProxy.h: * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::itemAtIndex): 2017-10-03 Chris Dumez SharedStringHashStore should support removing hashes https://bugs.webkit.org/show_bug.cgi?id=177770 Reviewed by Alex Christensen. SharedStringHashStore should support removing hashes. It currently only supports adding hashes or clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service Worker purposes. * Shared/SharedStringHashStore.cpp: (WebKit::SharedStringHashStore::SharedStringHashStore): (WebKit::SharedStringHashStore::add): (WebKit::SharedStringHashStore::remove): (WebKit::SharedStringHashStore::contains): (WebKit::SharedStringHashStore::clear): (WebKit::SharedStringHashStore::resizeTable): (WebKit::SharedStringHashStore::pendingOperationsTimerFired): * Shared/SharedStringHashStore.h: * Shared/SharedStringHashTable.cpp: (WebKit::SharedStringHashTable::remove): * Shared/SharedStringHashTable.h: * UIProcess/API/Cocoa/_WKVisitedLinkStore.h: * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm: (-[_WKVisitedLinkStore containsVisitedLinkWithURL:]): (-[_WKVisitedLinkStore removeVisitedLinkWithURL:]): * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::containsVisitedLinkHash): (WebKit::VisitedLinkStore::removeVisitedLinkHash): (WebKit::VisitedLinkStore::didUpdateSharedStringHashes): * UIProcess/VisitedLinkStore.h: 2017-10-03 Alex Christensen Fix API tests after r222794. https://bugs.webkit.org/show_bug.cgi?id=177825 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willGoToBackForwardListItem): Sometimes there's no navigation client. 2017-10-03 Alex Christensen Add ObjC equivalent of WKPageLoaderClient.pluginDidFail https://bugs.webkit.org/show_bug.cgi?id=177787 Reviewed by Tim Horton. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didFailToInitializePlugin): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::canHandleDidFailToInitializePlugIn const): (API::NavigationClient::didFailToInitializePlugIn): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const): (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailToInitializePlugin): 2017-10-03 Adrian Perez de Castro [GTK] Prefer -webkit-system-font https://bugs.webkit.org/show_bug.cgi?id=177814 Reviewed by Carlos Garcia Campos. Use "font-family: -webkit-system-font" instead of "font: menu". * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet. 2017-10-03 Alex Christensen Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem https://bugs.webkit.org/show_bug.cgi?id=177825 Reviewed by Tim Horton. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::willGoToBackForwardListItem): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::canHandleWillGoToBackForwardListItem const): (API::NavigationClient::willGoToBackForwardListItem): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const): (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willGoToBackForwardListItem): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const): 2017-10-03 Michael Catanzaro REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps https://bugs.webkit.org/show_bug.cgi?id=177449 Reviewed by Chris Dumez. * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): (WebKit::WebEventFactory::createWebTouchEvent): * Shared/wpe/WebEventFactory.cpp: (WebKit::wallTimeForEventTime): (WebKit::WebEventFactory::createWebKeyboardEvent): (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebTouchEvent): 2017-10-03 Carlos Garcia Campos [GTK][WPE] WebProcess should run cleanup on quit to release resources https://bugs.webkit.org/show_bug.cgi?id=168126 Reviewed by Michael Catanzaro. Do not call exit on sync message send failure for GTK and WPE ports. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): 2017-10-02 Ryosuke Niwa Move more code into PasteboardCustomData https://bugs.webkit.org/show_bug.cgi?id=177795 Reviewed by Wenson Hsieh. Added the support for encoding and decoding the origin string in PasteboardCustomData. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-10-02 Adrian Perez de Castro [GTK] Do not hardcode font family in served remote inspector HTML snippets https://bugs.webkit.org/show_bug.cgi?id=177742 Reviewed by Carlos Garcia Campos. Instead of hardcoding Cantarell as the font used for the HTML snippets served by the remote inspector handler, use "font: menu" to obtain the system UI font, plus a "font-size" rule for adjusting the size. * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::handleRequest): Change the CSS rules in the served snippet. 2017-10-02 Joseph Pecoraro Web Inspector: Include Beacon and Ping requests in Network tab https://bugs.webkit.org/show_bug.cgi?id=177641 Reviewed by Chris Dumez. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::didFinish): (WebKit::PingLoad::didReceiveResponseNetworkSession): * NetworkProcess/PingLoad.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didFinishPingLoad): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::networkProcessCrashed): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::didFinishPingLoad): * WebProcess/Network/WebLoaderStrategy.h: Pass an optional ResourceResponse back to the ping completion handler. 2017-10-02 Alex Christensen REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out https://bugs.webkit.org/show_bug.cgi?id=177764 Reviewed by Chris Dumez. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): I shouldn't have reverted the A API telling the listener to continue if there's no client function. 2017-10-02 Carlos Garcia Campos [WPE][GTK] Crash in webkit_web_resource_get_data_finish() https://bugs.webkit.org/show_bug.cgi?id=177107 Reviewed by Michael Catanzaro. Handle errors in webkit_web_resource_get_data() callback. * UIProcess/API/glib/WebKitWebResource.cpp: (resourceDataCallback): (webkit_web_resource_get_data): 2017-10-02 Olivier Blin [WPE] Fix UIProcess build with GStreamer and without VIDEO https://bugs.webkit.org/show_bug.cgi?id=177753 Reviewed by Michael Catanzaro. GStreamer builds fail when WebAudio is enabled but VIDEO disabled. This is the WPE counterpart of bug 153135. * UIProcess/API/wpe/PageClientImpl.h: 2017-10-02 Alex Christensen Expose more WKPreferences SPI to match C SPI https://bugs.webkit.org/show_bug.cgi?id=177697 * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _javaEnabledForLocalFiles]): (-[WKPreferences _setPlugInsEnabled:]): Deleted. (-[WKPreferences _plugInsEnabled]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: _javaEnabledForLocalFiles should return the correct value. _plugInsEnabled has public API. This SPI is not needed. 2017-10-02 Alex Christensen REGRESSION(r214201): WebProcess hangs during policy decisions https://bugs.webkit.org/show_bug.cgi?id=177590 Reviewed by Andy Estes. This is like r222431 but for trunk instead of a branch. It includes the same regression API test so I don't make the same mistake again. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForResponseSync): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::applyToDocumentLoader): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebDocumentLoader.cpp: (WebKit::WebDocumentLoader::setNavigationID): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::setUpPolicyListener): (WebKit::WebFrame::invalidatePolicyListener): (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-10-02 Alex Christensen Remove unnecessary copy of SessionID in WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=177702 Reviewed by Darin Adler. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sessionID const): (WebKit::WebPageProxy::creationParameters): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::sessionID const): Deleted. 2017-10-02 Alex Christensen Expose more WKPreferences SPI to match C SPI https://bugs.webkit.org/show_bug.cgi?id=177697 Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setJavaEnabledForLocalFiles:]): (-[WKPreferences _javaEnabledForLocalFiles]): (-[WKPreferences _setCanvasUsesAcceleratedDrawing:]): (-[WKPreferences _canvasUsesAcceleratedDrawing]): (-[WKPreferences _setAcceleratedCompositingEnabled:]): (-[WKPreferences _acceleratedCompositingEnabled]): (-[WKPreferences _setDefaultTextEncodingName:]): (-[WKPreferences _defaultTextEncodingName]): (-[WKPreferences _setNeedsSiteSpecificQuirks:]): (-[WKPreferences _needsSiteSpecificQuirks]): (-[WKPreferences _setAuthorAndUserStylesEnabled:]): (-[WKPreferences _authorAndUserStylesEnabled]): (-[WKPreferences _setDOMTimersThrottlingEnabled:]): (-[WKPreferences _domTimersThrottlingEnabled]): (-[WKPreferences _setWebArchiveDebugModeEnabled:]): (-[WKPreferences _webArchiveDebugModeEnabled]): (-[WKPreferences _setLocalFileContentSniffingEnabled:]): (-[WKPreferences _localFileContentSniffingEnabled]): (-[WKPreferences _setUsesPageCache:]): (-[WKPreferences _usesPageCache]): (-[WKPreferences _setPageCacheSupportsPlugins:]): (-[WKPreferences _pageCacheSupportsPlugins]): (-[WKPreferences _setShouldPrintBackgrounds:]): (-[WKPreferences _shouldPrintBackgrounds]): (-[WKPreferences _setWebSecurityEnabled:]): (-[WKPreferences _webSecurityEnabled]): (-[WKPreferences _setUniversalAccessFromFileURLsAllowed:]): (-[WKPreferences _universalAccessFromFileURLsAllowed]): (-[WKPreferences _setAVFoundationEnabled:]): (-[WKPreferences _avFoundationEnabled]): (-[WKPreferences _setSuppressesIncrementalRendering:]): (-[WKPreferences _suppressesIncrementalRendering]): (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]): (-[WKPreferences _asynchronousPluginInitializationEnabled]): (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]): (-[WKPreferences _artificialPluginInitializationDelayEnabled]): (-[WKPreferences _setCookieEnabled:]): (-[WKPreferences _cookieEnabled]): (-[WKPreferences _setPlugInSnapshottingEnabled:]): (-[WKPreferences _plugInSnapshottingEnabled]): (-[WKPreferences _setQTKitEnabled:]): (-[WKPreferences _qtKitEnabled]): (-[WKPreferences _setSubpixelCSSOMElementMetricsEnabled:]): (-[WKPreferences _subpixelCSSOMElementMetricsEnabled]): (-[WKPreferences _setMediaSourceEnabled:]): (-[WKPreferences _mediaSourceEnabled]): (-[WKPreferences _setViewGestureDebuggingEnabled:]): (-[WKPreferences _viewGestureDebuggingEnabled]): (-[WKPreferences _setCSSAnimationTriggersEnabled:]): (-[WKPreferences _cssAnimationTriggersEnabled]): (-[WKPreferences _setStandardFontFamily:]): (-[WKPreferences _standardFontFamily]): (-[WKPreferences _setNotificationsEnabled:]): (-[WKPreferences _notificationsEnabled]): (-[WKPreferences _setBackspaceKeyNavigationEnabled:]): (-[WKPreferences _backspaceKeyNavigationEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-10-02 Carlos Garcia Campos [GTK][WPE] Enable interactive forms validation by default https://bugs.webkit.org/show_bug.cgi?id=177737 Reviewed by Michael Catanzaro. It's currently disabled for no reason. * Shared/WebPreferencesDefinitions.h: 2017-10-02 Michael Catanzaro Remove ENABLE_CSS_REGIONS https://bugs.webkit.org/show_bug.cgi?id=177689 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp: (webkit_dom_element_get_webkit_region_overset): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_get_webkit_region_overset): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h: 2017-09-30 Darin Adler Have IPC::Connection::Client objects consistently invalidate the connection when destroyed https://bugs.webkit.org/show_bug.cgi?id=177708 Reviewed by Anders Carlsson. I ran into an intermittent crash when running regression tests. It looked like a connection client was being called after it was destroyed. I did an audit of the all the connection clients to make sure they all invalidate their connection before they are destroyed. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the connection since this object opened the connection. There is no obvious guarantee that the connection will already be invalid when this is destroyed. * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto. * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto. * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto. * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto. * StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly from IPC::Connection::Client because we can, and this means we don't have to study quite as much code to understand how this is used as a connection client. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto. * WebProcess/Storage/WebToStorageProcessConnection.h: Ditto. * WebProcess/WebPage/WebInspector.h: Ditto. * WebProcess/WebPage/WebInspectorUI.h: Ditto. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a reference cycle cycle leading to a leak that I believe exists here. 2017-09-29 Alex Christensen REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad https://bugs.webkit.org/show_bug.cgi?id=177491 Reviewed by Andy Estes. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::setUpWillSubmitFormListener): (WebKit::WebFrame::continueWillSubmitForm): (WebKit::WebFrame::invalidatePolicyListener): Speculative fix for a flaky assertion. Restore the clearing of the policy listeners we used to have when form submission was treated as a policy. 2017-09-29 Chris Dumez http/tests/preconnect/link-rel-preconnect-https.html is flaky https://bugs.webkit.org/show_bug.cgi?id=177673 Reviewed by Alex Christensen. Update PreconnectTask to query the client when a certificate needs to be validated. This allows WebKitTestRunner to ignore invalid certificates and this causes http/tests/preconnect/link-rel-preconnect-https.html to pass consistently. To avoid duplicating code, PreconnectTask now uses NetworkLoad internally instead of using a NetworkDataTask directly. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::preconnectTo): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::generateCanAuthenticateIdentifier): (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace): (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace): (WebKit::NetworkProcess::preconnectTo): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::PreconnectTask): (WebKit::PreconnectTask::~PreconnectTask): (WebKit::PreconnectTask::willSendRedirectedRequest): (WebKit::PreconnectTask::didReceiveResponse): (WebKit::PreconnectTask::didReceiveBuffer): (WebKit::PreconnectTask::didFinishLoading): (WebKit::PreconnectTask::didFailLoading): (WebKit::PreconnectTask::didSendData): (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync): (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace): (WebKit::PreconnectTask::frameID const): (WebKit::PreconnectTask::pageID const): * NetworkProcess/PreconnectTask.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::preconnectTo): * WebProcess/Network/WebLoaderStrategy.h: 2017-09-29 Alex Christensen Expose WebPreferences::webGLEnabled through WKPreferences https://bugs.webkit.org/show_bug.cgi?id=177692 Reviewed by Andy Estes. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setWebGLEnabled:]): (-[WKPreferences _webGLEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-09-29 Chris Dumez [WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication https://bugs.webkit.org/show_bug.cgi?id=177667 Reviewed by Alex Christensen. Move some authentication-related code to avoid duplication. This is a preparation code supporting Download authentication as Download uses a NSURLSessionDownloadTask and not a NetworkDataTask. * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTask::setSuggestedFilename): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveChallenge): (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost): * NetworkProcess/NetworkSession.h: * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::didReceiveChallenge): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::didReceiveChallenge): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (WebKit::certificatesMatch): (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost): 2017-09-29 Alex Christensen Fix WKWebViewConfigurationPrivate after r222663 https://bugs.webkit.org/show_bug.cgi?id=177644 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2017-09-29 Chris Dumez Split some logic out of VisitedLinkStore and make it reusable https://bugs.webkit.org/show_bug.cgi?id=177575 Reviewed by Alex Christensen. Split some logic out of VisitedLinkStore and make it reusable for other purposes than visited links and from other processes than the UIProcess. The plan is to reuse the new SharedStringHashStore for Service Worker registration on StorageProcess side and querying on WebContent process side. * CMakeLists.txt: * Shared/SharedStringHashStore.cpp: Added. (WebKit::nextPowerOf2): (WebKit::tableSizeForKeyCount): (WebKit::SharedStringHashStore::SharedStringHashStore): (WebKit::SharedStringHashStore::createSharedMemoryHandle): (WebKit::SharedStringHashStore::add): (WebKit::SharedStringHashStore::clear): (WebKit::SharedStringHashStore::resizeTable): (WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired): * Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h. (WebKit::SharedStringHashStore::Client::~Client): (WebKit::SharedStringHashStore::isEmpty const): * Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp. (WebKit::SharedStringHashTable::SharedStringHashTable): (WebKit::SharedStringHashTable::~SharedStringHashTable): (WebKit::SharedStringHashTable::setSharedMemory): (WebKit::SharedStringHashTable::add): (WebKit::SharedStringHashTable::contains const): (WebKit::SharedStringHashTable::clear): * Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h. * UIProcess/API/C/WKContext.cpp: (WKContextAddVisitedLink): * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm: (-[_WKVisitedLinkStore addVisitedLinkWithURL:]): * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::VisitedLinkStore): (WebKit::VisitedLinkStore::addProcess): (WebKit::VisitedLinkStore::addVisitedLinkHash): (WebKit::VisitedLinkStore::removeAll): (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage): (WebKit::VisitedLinkStore::sendStoreHandleToProcess): (WebKit::VisitedLinkStore::didInvalidateSharedMemory): (WebKit::VisitedLinkStore::didAddSharedStringHashes): * UIProcess/VisitedLinkStore.h: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::isLinkVisited): (WebKit::VisitedLinkTableController::addVisitedLink): (WebKit::VisitedLinkTableController::visitedLinkStateChanged): * WebProcess/WebPage/VisitedLinkTableController.h: * WebProcess/WebPage/VisitedLinkTableController.messages.in: 2017-09-28 Alex Christensen Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit https://bugs.webkit.org/show_bug.cgi?id=177644 Reviewed by Geoffrey Garen. WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional with no accessor. It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _setCPULimit:]): (-[WKWebViewConfiguration _cpuLimit]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2017-09-28 Ryosuke Niwa Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items https://bugs.webkit.org/show_bug.cgi?id=170449 Reviewed by Wenson Hsieh. Add sandbox extensions for files in the pasteboard to make copying & pasting image files work. This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files. * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently since WebCore will now create File objects for these pasted files. 2017-09-29 Wenson Hsieh [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol https://bugs.webkit.org/show_bug.cgi?id=177662 Reviewed by Tim Horton. Implements -[WKContentView hasText] by propagating a flag through post-layout editor state. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: Add a new flag to EditorState indicating whether or not the current editable root containing the selection has any plain text. Add IPC support for this new flag. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView hasText]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::computeEditableRootHasContentAndPlainText): Add a new helper to compute whether or not the editable root has any content, and any plain text. This is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important things to note here: - If post layout data already indicates that we have selected some plain text, or that there is a plain text character near the selection, just set the flags to true and bail, since the editable root necessarily has content that is plain text. - If hasContent is false, don't even bother computing hasPlainText, because it must also be false. - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText. These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false if we had a range selection rather than a caret selection even when the editable root has content, because the logic to compute the value of hasContent only existed in the branch where we have a caret selection. (WebKit::WebPage::platformEditorState const): 2017-09-28 Timothy Horton Fix the macOS CMake build * CMakeLists.txt: 2017-09-28 Timothy Horton Revise deployment target macros from r222620 Rubber-stamped by Wenson Hsieh. * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::pdfDocumentDidLoad): 2017-09-28 Aishwarya Nirmal Request for PDF URL targets for specific pages, sections, etc. https://bugs.webkit.org/show_bug.cgi?id=177582 Reviewed by Tim Horton. This change sets the URL fragment for scroll anchoring in PDFs. * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::pdfDocumentDidLoad): 2017-09-28 Ross Kirsling [PAL] Move HysteresisActivity into PAL https://bugs.webkit.org/show_bug.cgi?id=177516 Reviewed by Alex Christensen. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad): * Shared/WebSQLiteDatabaseTracker.cpp: (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker): (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated): * Shared/WebSQLiteDatabaseTracker.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_pageScrolledHysteresis): (WebKit::m_userActivityHysteresis): (WebKit::WebPage::updateUserActivity): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/WebProcess.h: 2017-09-28 Chris Dumez Add support for https://bugs.webkit.org/show_bug.cgi?id=177474 Reviewed by Alex Christensen. Add support for : - https://w3c.github.io/resource-hints/#preconnect Also add corresponding native private API. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::preconnectTo): (WebKit::NetworkConnectionToWebProcess::didFinishPreconnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::preconnectTo): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/PreconnectTask.cpp: Added. (WebKit::PreconnectTask::PreconnectTask): (WebKit::PreconnectTask::~PreconnectTask): (WebKit::PreconnectTask::willPerformHTTPRedirection): (WebKit::PreconnectTask::didReceiveChallenge): (WebKit::PreconnectTask::didReceiveResponseNetworkSession): (WebKit::PreconnectTask::didReceiveData): (WebKit::PreconnectTask::didCompleteWithError): (WebKit::PreconnectTask::didSendData): (WebKit::PreconnectTask::wasBlocked): (WebKit::PreconnectTask::cannotShowURL): (WebKit::PreconnectTask::didFinish): * NetworkProcess/PreconnectTask.h: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * Shared/WebCoreArgumentCoders.h: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKContext.cpp: (WKContextPreconnectToServer): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _preconnectToServer:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::preconnectToServer): * UIProcess/WebProcessPool.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didFinishPreconnection): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::networkProcessCrashed): (WebKit::generateLoadIdentifier): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::preconnectTo): (WebKit::WebLoaderStrategy::didFinishPreconnection): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * config.h: 2017-09-28 Zan Dobersek [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer https://bugs.webkit.org/show_bug.cgi?id=177598 Reviewed by Carlos Garcia Campos. * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the header here now that it's not included in GlyphBuffer.h. * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto. 2017-09-27 Alex Christensen Add WKContentRuleList notify action type https://bugs.webkit.org/show_bug.cgi?id=177013 Reviewed by Darin Adler. * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::processContentExtensionRulesForLoad): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::contentRuleListNotification): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageNavigationClient.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::contentRuleListNotification): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contentRuleListNotification): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentRuleListNotification): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-09-27 Wenson Hsieh Drag event DataTransfer has unexpected types "dyn.ah62d4..." https://bugs.webkit.org/show_bug.cgi?id=172526 Reviewed by Ryosuke Niwa. Add boilerplate plumbing and encoder/decoder support for new pasteboard codepaths. See WebCore ChangeLog for more details. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Add encoder/decoder support for PasteboardCustomData. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Encode and decode dataInHTMLFormat. * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): (WebKit::WebPasteboardProxy::writeCustomData): * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): (WebKit::WebPasteboardProxy::writeCustomData): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite): (WebKit::WebPlatformStrategies::writeCustomData): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-09-27 Alex Christensen Allow modern decoding of std::optional https://bugs.webkit.org/show_bug.cgi?id=177519 Reviewed by Tim Horton. * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder>::decode): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::decode): 2017-09-27 Commit Queue Unreviewed, rolling out r222541. https://bugs.webkit.org/show_bug.cgi?id=177580 WebCore isn't ready for the asynchronousness this was going to enable (Requested by alexchristensen on #webkit). Reverted changeset: "Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions" https://bugs.webkit.org/show_bug.cgi?id=177509 http://trac.webkit.org/changeset/222541 2017-09-27 Tina Liu Expose setShouldSuppressFirstResponderChanges() as WKView SPI https://bugs.webkit.org/show_bug.cgi?id=177513 Reviewed by Wenson Hsieh. We already have setShouldSuppressFirstResponderChanges() SPI on WKWebView; Expose it on WKView as well for clients using legacy WebKit. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _setShouldSuppressFirstResponderChanges:]): 2017-09-27 Chris Dumez Have PingLoad take a CompletionHandler https://bugs.webkit.org/show_bug.cgi?id=177549 Reviewed by Youenn Fablet. Have PingLoad take a CompletionHandler instead of relying on it calling on method on the NetworkConnectionToWebProcess when it is done. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::didFinish): * NetworkProcess/PingLoad.h: 2017-09-26 Alex Christensen Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions https://bugs.webkit.org/show_bug.cgi?id=177509 Reviewed by Tim Horton. This makes WebFramePolicyListenerProxy just a wrapper around a WTF::Function which is only needed for the C and glib APIs. This is a step towards making WebPageProxy::DecidePolicyForResponseSync and WebPageProxy::DecidePolicyForNavigationAction asynchronous. This patch has no change in behavior. * CMakeLists.txt: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::decidePolicyForNavigationAction): (API::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/API/APIPolicyClient.h: (API::PolicyClient::decidePolicyForNavigationAction): (API::PolicyClient::decidePolicyForNewWindowAction): (API::PolicyClient::decidePolicyForResponse): * UIProcess/API/C/WKFramePolicyListener.cpp: (WKFramePolicyListenerUseWithPolicies): * UIProcess/API/C/WKPage.cpp: (WKPageSetPagePolicyClient): (WKPageSetPageNavigationClient): * UIProcess/API/Cocoa/WKBrowsingContextController.mm: * UIProcess/API/glib/WebKitPolicyClient.cpp: * UIProcess/Automation/WebAutomationSession.cpp: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/RemoteWebInspectorProxy.cpp: * UIProcess/WebFormSubmissionListenerProxy.h: * UIProcess/WebFrameListenerProxy.cpp: Removed. * UIProcess/WebFrameListenerProxy.h: Removed. * UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy): (WebKit::WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy): (WebKit::WebFramePolicyListenerProxy::create): (WebKit::WebFramePolicyListenerProxy::use): (WebKit::WebFramePolicyListenerProxy::download): (WebKit::WebFramePolicyListenerProxy::ignore): * UIProcess/WebFramePolicyListenerProxy.h: (WebKit::WebFramePolicyListenerProxy::create): Deleted. (): Deleted. (WebKit::WebFramePolicyListenerProxy::operator new): Deleted. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::webProcessWillShutDown): (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted. (WebKit::WebFrameProxy::setUpPolicyListenerProxy): Deleted. * UIProcess/WebFrameProxy.h: * UIProcess/WebInspectorProxy.cpp: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponseSync): (WebKit::WebPageProxy::receivedPolicyDecision): Deleted. (WebKit::WebPageProxy::decidePolicyForResponse): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/mac/ViewGestureControllerMac.mm: * WebKit.xcodeproj/project.pbxproj: 2017-09-26 Brian Burg Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible https://bugs.webkit.org/show_bug.cgi?id=177514 Reviewed by Joseph Pecoraro. * UIProcess/Automation/atoms/ElementDisplayed.js: (isShown.isElementSubtreeHiddenByOverflow): Array.prototype.every returns true when passed an empty list, so we need to check for the case where the element has no children and return 'false'. 2017-09-26 Youenn Fablet [Cocoa] Add a modern WKPreferences switch to disable WebRTC https://bugs.webkit.org/show_bug.cgi?id=176638 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _peerConnectionEnabled]): (-[WKPreferences _setPeerConnectionEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-09-26 Brent Fulgham Harden our access to the vector of URL schemes. https://bugs.webkit.org/show_bug.cgi?id=177470 Reviewed by Chris Dumez. Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startURLSchemeTask): (WebKit::WebPageProxy::stopURLSchemeTask): 2017-09-26 Jer Noble Thrown ObjC exception when right clicking on containing mp4 link https://bugs.webkit.org/show_bug.cgi?id=177370 Reviewed by Darin Adler. Creating a NSImage from mp4 data will fail and return nil; do a nil-check before attempting to put the results into a NSMutableArray. * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::createShareMenuItem): 2017-09-26 Brian Burg Web Automation: add commands to get and set user permissions for pages in an automation session https://bugs.webkit.org/show_bug.cgi?id=177405 Reviewed by Joseph Pecoraro. To test some Web APIs via WebDriver, it needs to be possible to simulate a user accepting or denying requests for elevated permissions, such as getUserMedia() or geolocation. This patch adds a generic way for a test to configure the automation session's simulated user action that will happen every time a specific permission is requested. A test can set a "session permission", trigger the permission request via Web API, and then verify that the page behaves correctly when the user accepted or denied the request. A proposal will follow shortly to expose this functionality via a new REST API endpoint. * UIProcess/Automation/Automation.json: Add get/set commands. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::getSessionPermissions): (WebKit::WebAutomationSession::setSessionPermissions): For now, store the permission value in a member of the session. The getUserMedia permission only needs a bool, but there is no reason we couldn't use more complicated values for permissions (i.e., strings, numbers, arrays, objects) someday. (WebKit::WebAutomationSession::shouldAllowGetUserMediaForPage const): Expose the specific decision to be taken based on whether the request is allowed or denied. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): If the page is under automation, then simulate the user action according to the current values of permissions set for the session. 2017-09-25 Alex Christensen Make PolicyAction an encodable enum class https://bugs.webkit.org/show_bug.cgi?id=177480 Reviewed by Antti Koivisto. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueDecidePendingDownloadDestination): (WebKit::DownloadManager::cancelDownload): * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession): * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::~NetworkLoad): (WebKit::NetworkLoad::continueDidReceiveResponse): (WebKit::NetworkLoad::notifyDidReceiveResponse): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveResponseNetworkSession): * NetworkProcess/capture/NetworkDataTaskReplay.cpp: (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): * Scripts/webkit/messages.py: (headers_for_type): * UIProcess/WebFormSubmissionListenerProxy.h: * UIProcess/WebFrameListenerProxy.h: (WebKit::WebFrameListenerProxy::navigation): Deleted. * UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::use): (WebKit::WebFramePolicyListenerProxy::download): (WebKit::WebFramePolicyListenerProxy::ignore): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::invalidatePolicyListener): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-09-25 Yoshiaki Jitsukawa [WinCairo] Share default value of font family preferences among non-cocoa builds https://bugs.webkit.org/show_bug.cgi?id=177479 Reviewed by Yusuke Suzuki. * Shared/WebPreferencesDefinitions.h: 2017-09-25 Frederik Riedel Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI https://bugs.webkit.org/show_bug.cgi?id=174394 Reviewed by Ryosuke Niwa. * Platform/spi/ios/UIKitSPI.h: * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode const): Encodes additional node information, including if the node is part of a login screen. (WebKit::AssistedNodeInformation::decode): Decodes the additional assisted node information. * Shared/AssistedNodeInformation.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView acceptsAutofilledLoginCredentials]): Determines if the WKContentView shows a login screen. (-[WKContentView representingPageUrl]): Returns the URL of the currently displayed web page. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertTextSuggestion:]): Inserts the login credentials into the Web View. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAssistingNode): Transfer the additional assistednode information (acceptsAutofilledLoginCredentials and representingPageUrl). (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Returns if the Web View shows a login screen. (WebKit::WebPageProxy::representingPageUrl): Returns the Web View's URL. (WebKit::WebPageProxy::autofillLoginCredentials): Insert the credentials into the Web View. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): Transports the information if the currently highlighted node accepts autofilled login credentials. (WebKit::WebPage::autofillLoginCredentials): Fills the login credentials into the WebPage. 2017-09-25 Youenn Fablet WebRTC video does not resume receiving when switching back to Safari 11 on iOS https://bugs.webkit.org/show_bug.cgi?id=175472 Reviewed by Darin Adler. Notifying LibWebRTC of backgrounding/foregrouding. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applicationDidEnterBackground): (WebKit::WebPage::applicationWillEnterForeground): 2017-09-25 Sam Weinig Remove unused EditorClient functions https://bugs.webkit.org/show_bug.cgi?id=177463 Reviewed by Alex Christensen. Remove unused EditorClient functions. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::canonicalizeURL): Deleted. (WebKit::WebEditorClient::canonicalizeURLString): Deleted. (WebKit::WebEditorClient::writeDataToPasteboard): Deleted. (WebKit::WebEditorClient::supportedPasteboardTypesForCurrentSelection): Deleted. (WebKit::WebEditorClient::readDataFromPasteboard): Deleted. (WebKit::WebEditorClient::pasteboardChangeCount): Deleted. * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: (WebKit::WebEditorClient::canonicalizeURL): Deleted. (WebKit::WebEditorClient::canonicalizeURLString): Deleted. 2017-09-25 Alex Christensen Make Attribute an enum class https://bugs.webkit.org/show_bug.cgi?id=177414 Reviewed by Yusuke Suzuki. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::getOwnPropertySlot): 2017-09-25 Alex Christensen Stop using PolicyCallback https://bugs.webkit.org/show_bug.cgi?id=176088 Reviewed by Andy Estes. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::invalidatePolicyListener): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebInspector.cpp: 2017-09-25 Chris Dumez [WK2] Add API to query if a download was user-initiated https://bugs.webkit.org/show_bug.cgi?id=177435 Reviewed by Alex Christensen. Add C and Cocoa private API to query if a download was user-initiated. For clarity, we now construct navigation object for subframe loads as well (we used to do so only for main frame loads). This allows us to store the user-intiated flag and the redirect chain on the navigation object instead of the WebFrameProxy. * UIProcess/API/APINavigation.cpp: (API::Navigation::Navigation): (API::Navigation::appendRedirectionURL): * UIProcess/API/APINavigation.h: (API::Navigation::takeRedirectChain): (API::Navigation::setWasUserInitiated): (API::Navigation::wasUserInitiated const): * UIProcess/API/C/WKDownload.cpp: (WKDownloadGetWasUserInitiated): * UIProcess/API/C/WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.mm: (-[_WKDownload wasUserInitiated]): * UIProcess/Downloads/DownloadProxy.h: (WebKit::DownloadProxy::setWasUserInitiated): (WebKit::DownloadProxy::wasUserInitiated const): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameProxy::didFailProvisionalLoad): (WebKit::WebFrameProxy::didFinishLoad): (WebKit::WebFrameProxy::didFailLoad): * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::title const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForResponse): (WebKit::WebPageProxy::decidePolicyForResponseSync): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): 2017-09-25 Chris Dumez Make StoredCredentials an enum class and rename its header https://bugs.webkit.org/show_bug.cgi?id=177455 Reviewed by Youenn Fablet. Make StoredCredentials an enum class and rename its header for clarity. This was error-prone because 0 meant "allow" and and 1 meant "do not allow". It was trivial to convert it to a boolean by mistake and get the opposite behavior. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didCompleteWithError): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): (WebKit::NetworkDataTask::NetworkDataTask): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::shouldUseCredentialStorage): * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::makeCrossOriginAccessRequest): (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest): (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight): (WebKit::PingLoad::preflightSuccess): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): * NetworkProcess/capture/NetworkDataTaskReplay.cpp: (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate existingTask:]): (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::createRequest): (WebKit::NetworkDataTaskSoup::authenticate): (WebKit::NetworkDataTaskSoup::continueAuthenticate): (WebKit::NetworkDataTaskSoup::continueHTTPRedirection): * NetworkProcess/soup/NetworkDataTaskSoup.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::startPingLoad): * WebProcess/Network/WebLoaderStrategy.h: 2017-09-25 Sam Weinig Remove unnecessary userVisibleString EditorClient function https://bugs.webkit.org/show_bug.cgi?id=177456 Reviewed by Dan Bernstein. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::userVisibleString): Deleted. * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: (WebKit::WebEditorClient::userVisibleString): Deleted. Remove userVisibleString client function. 2017-09-25 Commit Queue Unreviewed, rolling out r222455. https://bugs.webkit.org/show_bug.cgi?id=177460 broke iOS build (Requested by alexchristensen on #webkit). Reverted changeset: "Add WKContentRuleList notify action type" https://bugs.webkit.org/show_bug.cgi?id=177013 http://trac.webkit.org/changeset/222455 2017-09-25 Alex Christensen Separate form submission from PolicyChecker infrastructure https://bugs.webkit.org/show_bug.cgi?id=177396 Reviewed by Geoffrey Garen. * UIProcess/API/APIFormClient.h: (API::FormClient::willSubmitForm): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): * UIProcess/WebFormClient.cpp: (WebKit::WebFormClient::willSubmitForm): * UIProcess/WebFormClient.h: * UIProcess/WebFormSubmissionListenerProxy.cpp: (WebKit::WebFormSubmissionListenerProxy::continueSubmission): (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy): Deleted. * UIProcess/WebFormSubmissionListenerProxy.h: (WebKit::WebFormSubmissionListenerProxy::create): (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy): (): Deleted. (WebKit::WebFormSubmissionListenerProxy::operator new): Deleted. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy): Deleted. * UIProcess/WebFrameProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willSubmitForm): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::setUpWillSubmitFormListener): (WebKit::WebFrame::continueWillSubmitForm): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::continueWillSubmitForm): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-09-25 Alex Christensen Add WKContentRuleList notify action type https://bugs.webkit.org/show_bug.cgi?id=177013 Reviewed by Darin Adler. * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::processContentExtensionRulesForLoad): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::contentRuleListNotification): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageNavigationClient.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::contentRuleListNotification): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contentRuleListNotification): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentRuleListNotification): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-09-25 Timothy Horton Make progress on getting Mac CMake building again https://bugs.webkit.org/show_bug.cgi?id=177443 Unreviewed, just "fixing" the build. * PlatformMac.cmake: Add some missing files and include paths. 2017-09-24 Michael Catanzaro Viewport fit is no longer experimental https://bugs.webkit.org/show_bug.cgi?id=177417 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: 2017-09-24 Michael Catanzaro [GTK] Unreviewed, move webkit_hit_test_result_context_is_scrollbar in documentation * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: 2017-09-24 Michael Catanzaro Alphabetize experimental features list https://bugs.webkit.org/show_bug.cgi?id=177374 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: 2017-09-24 Zan Dobersek [WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore https://bugs.webkit.org/show_bug.cgi?id=177312 Reviewed by Carlos Garcia Campos. When enabling EME through the InjectedBundle for testing purposes, it's only enabled in RuntimeEnabledFeatures, but not in WebPreferencesStore. This causes failures on imported W3C tests that cover EME persistent state licenses and perform parts of that test in a new window, where the original RuntimeEnabledFeatures state doesn't have any effect. To avoid those failures, when enabling EME feature for testing purposes through InjectedBundle, the feature should also be enabled in the WebPreferencesStore. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-09-22 Zalan Bujtas WeakPtrFactory should populate m_ref lazily. https://bugs.webkit.org/show_bug.cgi?id=177375 Reviewed by Geoffrey Garen. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/ApplicationStateTracker.mm: (WebKit::ApplicationStateTracker::ApplicationStateTracker): * UIProcess/Cocoa/WebViewImpl.h: (WebKit::WebViewImpl::createWeakPtr): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::ProcessLauncher): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::createWeakPtr): * UIProcess/WebPageProxy.cpp: (WebKit::m_configurationPreferenceValues): (WebKit::m_weakPtrFactory): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::createWeakPtr const): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): 2017-09-22 John Wilander Re-enable configuration.HTTPCookieStorage on session without credentials https://bugs.webkit.org/show_bug.cgi?id=177393 This patch rolls back the crucial change to the network session without credentials that landed in r221632: Reviewed by Brent Fulgham. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Commented out the disabled cookie jar and added a FIXME referring to https://bugs.webkit.org/show_bug.cgi?id=177394. 2017-09-22 Chris Dumez Enable File and Directory Entries API at runtime https://bugs.webkit.org/show_bug.cgi?id=176616 Reviewed by Geoffrey Garen. Enable File and Directory Entries API at runtime on Mac/WebKit2, now that DataTransfer.items is enabled there. * Shared/WebPreferencesDefinitions.h: 2017-09-22 Matt Lewis Unreviewed, rolling out r222394. This broke the Windows Debug Build. Reverted changeset: "Remove build-webkit's notion of feature flags having a default value" https://bugs.webkit.org/show_bug.cgi?id=177338 http://trac.webkit.org/changeset/222394 2017-09-22 John Wilander Non-prevalent resources should be allowed access to existing cookies in a third-party context https://bugs.webkit.org/show_bug.cgi?id=177336 Reviewed by Brent Fulgham. This patch restructures what is communicated to the network process, from two vectors - with user interaction and without user interaction - to three vectors - to partition, to block, to neither partition nor block. The previous two vectors did not allow proper categorization into which domains should be partitioned, blocked, or left alone. That was the cause of the regression where non-prevalent third-party domains erroneously had their cookies blocked when they should fall back to the old behavior of access but no new cookies allowed to be set. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies): (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains): (WebKit::WebResourceLoadStatisticsStore::clearInMemory): (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const): (WebKit::WebResourceLoadStatisticsStore::shouldBlockCookies const): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains): (WebKit::WebResourceLoadStatisticsStore::resetCookiePartitioningState): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies): (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-09-22 Tim Horton and Michael Catanzaro Remove build-webkit's notion of feature flags having a default value https://bugs.webkit.org/show_bug.cgi?id=177338 Reviewed by Alex Christensen. Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime experimental features. * Shared/WebPreferencesDefinitions.h: 2017-09-22 Chris Dumez Use high resolution timestamp for event time https://bugs.webkit.org/show_bug.cgi?id=154246 Reviewed by Ryosuke Niwa. Use WallTime / MonotonicTime instead of double type for clarity. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * Shared/WebEvent.cpp: (WebKit::WebEvent::WebEvent): * Shared/WebEvent.h: (WebKit::WebEvent::timestamp const): (WebKit::WebTouchEvent::WebTouchEvent): * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): * Shared/WebMouseEvent.cpp: (WebKit::WebMouseEvent::WebMouseEvent): * Shared/WebTouchEvent.cpp: (WebKit::WebTouchEvent::WebTouchEvent): * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::WebWheelEvent): * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): (WebKit::WebEventFactory::createWebTouchEvent): * Shared/ios/NativeWebTouchEventIOS.mm: (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): * Shared/ios/WebIOSEventFactory.mm: (WebIOSEventFactory::createWebKeyboardEvent): * Shared/mac/NativeWebGestureEventMac.mm: (WebKit::NativeWebGestureEvent::NativeWebGestureEvent): * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): * Shared/mac/WebGestureEvent.h: (WebKit::WebGestureEvent::WebGestureEvent): * Shared/wpe/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebKeyboardEvent): (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebTouchEvent): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSimulateMouseDown): (WKBundlePageSimulateMouseUp): (WKBundlePageSimulateMouseMotion): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::showContextMenuAtPoint): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createWebEvent const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPage::contextMenuAtPointInWindow): (WebKit::WebPage::dragEnded): (WebKit::WebPage::simulateMouseDown): (WebKit::WebPage::simulateMouseUp): (WebKit::WebPage::simulateMouseMotion): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): (WebKit::WebPage::completeSyntheticClick): (WebKit::WebPage::requestAdditionalItemsForDragSession): (WebKit::WebPage::inspectorNodeSearchMovedToPosition): 2017-09-22 Fujii Hironori [GTK] Web Inspector: Can't load three.js https://bugs.webkit.org/show_bug.cgi?id=177340 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: Add JS files of three.js to InspectorFiles variable. * PlatformWPE.cmake: Ditto. 2017-09-21 Ryosuke Niwa Enable dataTransfer.items on macOS and iOS https://bugs.webkit.org/show_bug.cgi?id=177335 Reviewed by Sam Weinig. * Shared/WebPreferencesDefinitions.h: 2017-09-21 Dan Bernstein Try to fix Apple internal builds with the iOS 11.0 SDK. * Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 11.0. 2017-09-21 Chris Dumez Regression(r222308): new API tests are failing for !NETWORK_SESSION https://bugs.webkit.org/show_bug.cgi?id=177321 Reviewed by Alex Christensen. When a load is redirected and then converted into a download, CFNetwork seems to call [NSURLDownloadDelegate willSendRequest:] on the download with a non-nil redirectResponse, which was unexpected. To address the issue, we now ignore the willSendRequest call if the new request's URL is the same as the redirectResponse one. * NetworkProcess/Downloads/mac/DownloadMac.mm: (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]): 2017-09-21 Chris Dumez Unreviewed, drop assertion added in r222308. The assertion is hit by a couple of tests still but there is no bad effect to the vector not being empty at this point since we clear it right after. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): 2017-09-21 Chris Dumez [WK2] Add API to get the redirect chain of a WKDownload https://bugs.webkit.org/show_bug.cgi?id=176628 Reviewed by Alex Christensen. Re-enable assertion initially added in r222308 and later disabled in r222320. The assertion was hit because we failed to clear the redirect chain in WebFrameProxy::didFailProvisionalLoad(). * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): (WebKit::WebFrameProxy::didFailProvisionalLoad): 2017-09-21 Alex Christensen REGRESSION(r221465) WKWebViews without WebGL delegate callbacks crash when WebGL contexts are created https://bugs.webkit.org/show_bug.cgi?id=177306 Reviewed by Chris Dumez. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const): (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const): I forgot to early return after calling the default completion handler if there's no delegate selector. 2017-09-21 Chris Dumez Unreviewed, temporarily disable assertion added in r222308 while I investigate. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): 2017-09-20 Stephan Szabo [Win] WTF: Add alias for process id to use in place of direct uses of pid_t https://bugs.webkit.org/show_bug.cgi?id=177017 Reviewed by Alex Christensen. * NetworkProcess/NetworkProcessCreationParameters.h: * Shared/WebProcessCreationParameters.h: * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContext.cpp: (WKContextGetNetworkProcessIdentifier): (WKContextGetDatabaseProcessIdentifier): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/C/WKPage.cpp: (WKPageGetProcessIdentifier): * UIProcess/API/C/WKPagePrivate.h: * UIProcess/ChildProcessProxy.h: (WebKit::ChildProcessProxy::processIdentifier const): * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::didFinishLaunchingProcess): * UIProcess/Launcher/ProcessLauncher.h: (WebKit::ProcessLauncher::processIdentifier const): * UIProcess/ProcessAssertion.cpp: (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion): * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::ProcessAssertion): * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::didConnectToProcess): * UIProcess/ProcessThrottler.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processIdentifier const): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::networkProcessIdentifier): (WebKit::WebProcessPool::storageProcessIdentifier): * UIProcess/WebProcessPool.h: 2017-09-20 Chris Dumez [WK2] Add API to get the redirect chain of a WKDownload https://bugs.webkit.org/show_bug.cgi?id=176628 Reviewed by Alex Christensen. Add API to get the redirect chain of a WKDwnload. The redirect chain includes redirects that happened during initial load, before the load was converted into a download. * UIProcess/API/C/WKDownload.cpp: (WKDownloadCopyRedirectChain): * UIProcess/API/C/WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.mm: (-[_WKDownload originatingWebView]): (-[_WKDownload redirectChain]): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::willSendRequest): * UIProcess/Downloads/DownloadProxy.h: (WebKit::DownloadProxy::setRedirectChain): (WebKit::DownloadProxy::redirectChain const): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::redirectChain const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): 2017-09-20 Alex Christensen Add infrastructure for adding custom headers to requests per website https://bugs.webkit.org/show_bug.cgi?id=177255 Reviewed by Geoffrey Garen. * Shared/WebsitePolicies.cpp: Added. * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::encode const): (WebKit::WebsitePolicies::decode): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesCopyCustomHeaderFields): (WKWebsitePoliciesSetCustomHeaderFields): * UIProcess/API/C/WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies customHeaderFields]): (-[_WKWebsitePolicies setCustomHeaderFields:]): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2017-09-20 Michael Catanzaro REGRESSION(r222194) [WPE] Library and executable output names broken https://bugs.webkit.org/show_bug.cgi?id=177273 Reviewed by Carlos Alberto Lopez Perez. Move the WebKit2 output name variables to here from Source/cmake, since this is a better place and where they are set on all other ports. Update them for the changes in r222194. * PlatformWPE.cmake: 2017-09-20 Jonathan Bedard Removed nullable from UIDragItem property https://bugs.webkit.org/show_bug.cgi?id=176264 Unreviewed build fix When a nullable annotation is used in a header file, the Objective-C compiler forces annotations on the entire file. Remove an unneeded annotation in UIKitSPI.h so that we can build in iOS 11. * Platform/spi/ios/UIKitSPI.h: 2017-09-20 Antti Koivisto Remove DOM and styling support for CSS Regions https://bugs.webkit.org/show_bug.cgi?id=177221 Reviewed by Andreas Kling. * Configurations/FeatureDefines.xcconfig: 2017-09-19 Simon Fraser Do more math in terms of FloatSizes and FloatPoints https://bugs.webkit.org/show_bug.cgi?id=177217 Reviewed by Zalan Bujtas. Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&), FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&) and use them in lots of places to do math in terms of points and sizes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): * UIProcess/ios/DragDropInteractionState.mm: (WebKit::createTargetedDragPreview): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/WebPage.cpp: (WebKit::paintSnapshotAtSize): (WebKit::WebPage::snapshotNode): 2017-09-19 Simon Fraser tiled-drawing/tiled-backing-in-window.html fails on Retina displays https://bugs.webkit.org/show_bug.cgi?id=177113 Reviewed by Tim Horton. Make m_customDeviceScaleFactor a std::optional<> instead of having the weird "0 is unset" behavior. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::deviceScaleFactor const): (WebKit::WebPageProxy::setCustomDeviceScaleFactor): * UIProcess/WebPageProxy.h: 2017-09-19 Alex Christensen Allow modern decoding of Vectors https://bugs.webkit.org/show_bug.cgi?id=177102 Reviewed by Andy Estes. Rather than allow modern decoding of Vectors of types that only allow legacy decoding, I just made modern decoders for all types that we need to decode in Vectors. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::decode): * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder::decode): * Platform/IPC/ArgumentCoders.h: * Shared/AssistedNodeInformation.cpp: (WebKit::OptionItem::decode): * Shared/AssistedNodeInformation.h: * Shared/CallbackID.h: (WebKit::CallbackID::decode): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): * Shared/Databases/IndexedDB/WebIDBResult.cpp: (WebKit::WebIDBResult::decode): * Shared/FrameInfoData.cpp: (WebKit::FrameInfoData::decode): * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::decode): * Shared/Gamepad/GamepadData.h: * Shared/PlatformPopupMenuData.cpp: (WebKit::PlatformPopupMenuData::decode): * Shared/PlatformPopupMenuData.h: * Shared/Plugins/NPIdentifierData.cpp: (WebKit::NPIdentifierData::decode): * Shared/Plugins/NPIdentifierData.h: * Shared/Plugins/NPVariantData.cpp: (WebKit::NPVariantData::decode): * Shared/Plugins/NPVariantData.h: * Shared/RTCNetwork.cpp: (WebKit::RTCNetwork::IPAddress::decode): (WebKit::RTCNetwork::SocketAddress::decode): (WebKit::RTCNetwork::decode): * Shared/RTCNetwork.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode): (WebKit::RemoteLayerTreeTransaction::decode): * Shared/SessionState.cpp: (WebKit::HTTPBody::Element::decode): (WebKit::FrameState::decode): (WebKit::PageState::decode): (WebKit::BackForwardListItemState::decode): (WebKit::BackForwardListState::decode): * Shared/SessionState.h: * Shared/WebCompiledContentRuleListData.cpp: (WebKit::WebCompiledContentRuleListData::decode): * Shared/WebCompiledContentRuleListData.h: * Shared/WebContextMenuItemData.cpp: (WebKit::WebContextMenuItemData::decode): * Shared/WebContextMenuItemData.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder>::decode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * Shared/WebEvent.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::decode): * Shared/WebPlatformTouchPoint.cpp: (WebKit::WebPlatformTouchPoint::decode): * Shared/WebPopupItem.cpp: (WebKit::WebPopupItem::decode): * Shared/WebPopupItem.h: * Shared/WebUserContentControllerDataTypes.cpp: (WebKit::WebUserScriptData::decode): (WebKit::WebUserStyleSheetData::decode): (WebKit::WebScriptMessageHandlerData::decode): * Shared/WebUserContentControllerDataTypes.h: * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::Entry::decode): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::decode): * Shared/ios/WebPlatformTouchPointIOS.cpp: (WebKit::WebPlatformTouchPoint::decode): * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::decode): * UIProcess/LegacySessionStateCodingNone.cpp: (WebKit::decodeLegacySessionState): * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h: * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode): (WebKit::PlatformCAAnimationRemote::Properties::decode): 2017-09-19 Ryosuke Niwa On iOS, getData can't get text set by setData during copy event https://bugs.webkit.org/show_bug.cgi?id=176980 Reviewed by Darin Adler. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::copy): Deleted. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-09-19 Alex Christensen Expose WKPageRef as a private property on WKWebView on Mac https://bugs.webkit.org/show_bug.cgi?id=177022 Reviewed by Andy Estes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pageRefForTransitionToWKWebView]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-09-19 Alex Christensen Make _WKProcessPoolConfiguration.allowsCellularAccess actually work on iOS https://bugs.webkit.org/show_bug.cgi?id=177124 Reviewed by Andy Estes. The boolean added in r213747 was getting lost in two places: 1. The API::ProcessPoolConfiguration gets copied before it's used, so we need to set the bool on the copy. 2. The bool was not getting copied from that ProcessPoolConfiguration to the NetworkProcessCreationParameters to be sent to the NetworkProcess to be given to the NSURLSessionConfiguration in NetworkSessionCocoa.mm. These two problems were fixed and verified manually with a customized iOS app on my phone. Unfortunately, this cannot be tested well with our current test infrastructure. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2017-09-18 Michael Catanzaro [CMake] Rename WebKit target to WebKitLegacy and rename WebKit2 target to WebKit https://bugs.webkit.org/show_bug.cgi?id=174558 Reviewed by Alex Christensen. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * PlatformWin.cmake: * Shared/gtk/WebKitWaylandProtocol.xml: Renamed from Source/WebKit/Shared/gtk/WebKit2WaylandProtocol.xml. * UIProcess/gtk/WaylandCompositor.cpp: * WebProcess/gtk/WaylandCompositorDisplay.cpp: 2017-09-18 Andy Estes [Cocoa] Upstream sandbox-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=177047 Reviewed by Daniel Bates. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): * Platform/spi/mac/QuarantineSPI.h: Added. * Shared/SandboxExtension.h: (): Deleted. * Shared/mac/ChildProcessMac.mm: (WebKit::enableSandboxStyleFileQuarantine): (WebKit::ChildProcess::initializeSandbox): * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtensionImpl::create): (WebKit::SandboxExtensionImpl::SandboxExtensionImpl): (WebKit::SandboxExtensionImpl::~SandboxExtensionImpl): (WebKit::SandboxExtensionImpl::consume): (WebKit::SandboxExtensionImpl::invalidate): (WebKit::SandboxExtensionImpl::getSerializedFormat): (WebKit::SandboxExtension::Handle::Handle): (WebKit::SandboxExtension::Handle::~Handle): (WebKit::SandboxExtension::Handle::encode const): (WebKit::SandboxExtension::Handle::decode): (WebKit::SandboxExtension::createHandleWithoutResolvingPath): (WebKit::SandboxExtension::createHandleForReadWriteDirectory): (WebKit::SandboxExtension::createHandleForTemporaryFile): (WebKit::SandboxExtension::createHandleForGenericExtension): (WebKit::SandboxExtension::SandboxExtension): (WebKit::SandboxExtension::~SandboxExtension): (WebKit::SandboxExtension::revoke): (WebKit::SandboxExtension::consume): (WebKit::SandboxExtension::consumePermanently): (WebKit::wkSandboxExtensionType): Deleted. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::didChooseFilesForOpenPanel): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::processDidFinishLaunching): (WebKit::WebProcessPool::resumeDownload): (WebKit::WebProcessPool::startMemorySampler): * WebKit.xcodeproj/project.pbxproj: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL): 2017-09-18 Andy Estes [Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface https://bugs.webkit.org/show_bug.cgi?id=177048 Reviewed by Alex Christensen. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::sendMessage): (IPC::readFromMachPort): * Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm. * Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm. (WebKit::setCrashReportApplicationSpecificInformation): * Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm. * Shared/Cocoa/ChildProcessCocoa.mm: (WebKit::ChildProcess::didReceiveInvalidMessage): * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::_WKSetCrashReportApplicationSpecificInformation): 2017-09-18 Andy Estes [Mac] Upstream miscellaneous WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=177029 Reviewed by Alex Christensen. * NetworkProcess/mac/NetworkProcessMac.mm: (WebKit::NetworkProcess::initializeProcessName): * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeProcessName): * StorageProcess/mac/StorageProcessMac.mm: (WebKit::StorageProcess::initializeProcessName): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::trackingAreaOptions): (WebKit::WebViewImpl::mightBeginScrollWhileInactive): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: (WebKit::NetscapePlugin::popUpContextMenu): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::handleContextMenuEvent): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeProcessName): (WebKit::WebProcess::updateActivePages): 2017-09-17 Michael Catanzaro [WPE][GTK] Merge ProcessLauncher[WPE,GTK] https://bugs.webkit.org/show_bug.cgi?id=177041 Unreviewed fixup, I broke the size of the argv buffer when experimenting with how to respond to review comments. Not sure why this didn't blow up everything during testing. * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::ProcessLauncher::launchProcess): 2017-09-17 Michael Catanzaro [WPE][GTK] Merge ProcessLauncher[WPE,GTK] https://bugs.webkit.org/show_bug.cgi?id=177041 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: * PlatformWPE.cmake: * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Renamed from Source/WebKit/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp. (WebKit::childSetupFunction): (WebKit::ProcessLauncher::launchProcess): (WebKit::ProcessLauncher::terminateProcess): (WebKit::ProcessLauncher::platformInvalidate): * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Removed. 2017-09-16 Tim Horton Fix the Tools build with CMake on macOS https://bugs.webkit.org/show_bug.cgi?id=177030 Reviewed by Geoffrey Garen. * PlatformMac.cmake: Add some WebKitLegacy headers to forward (for use by the tools). 2017-09-15 JF Bastien WTF: use Forward.h when appropriate instead of Vector.h https://bugs.webkit.org/show_bug.cgi?id=176984 Reviewed by Saam Barati. There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice. * Scripts/webkit/LegacyMessages-expected.h: * Scripts/webkit/Messages-expected.h: * Shared/API/APIData.h: * UIProcess/API/APIContextMenuClient.h: * UIProcess/API/APIFormClient.h: * UIProcess/API/APIHTTPCookieStore.h: * UIProcess/API/APINotificationProvider.h: * UIProcess/API/glib/WebKitNotificationProvider.h: * UIProcess/Notifications/WebNotificationProvider.h: * UIProcess/TextCheckerCompletion.h: * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebOpenPanelResultListenerProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPopupMenuProxy.h: * UIProcess/WebTextCheckerClient.h: * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Gamepad/WebGamepadProvider.h: * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h: * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h: * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/Network/webrtc/WebRTCMonitor.h: * WebProcess/Network/webrtc/WebRTCResolver.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/WebOpenPanelResultListener.h: 2017-09-15 Tim Horton Fix the macOS CMake build https://bugs.webkit.org/show_bug.cgi?id=177015 Reviewed by Andy Estes. * CMakeLists.txt: Add the new RemoteLayerTree directories to the header search path. Add CookieStorageUtilsCF.mm to Sources. * PlatformMac.cmake: Add a few more files, and fix the generated forwarding headers include path to name "WebKit" instead of "WebKit2". 2017-09-15 Youenn Fablet Add an URL method to remove both query string and fragment identifier https://bugs.webkit.org/show_bug.cgi?id=176911 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::computeKeyURL): 2017-09-15 Andy Estes [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176953 Reviewed by Eric Carlson. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-15 Ryosuke Niwa iOS: WebKitTestRunner hits an assertion in editing/pasteboard/datatransfer-items-copy-plaintext.html https://bugs.webkit.org/show_bug.cgi?id=176968 Reviewed by Wenson Hsieh. Don't allocate a SharedMemory of size zero (content was empty) as this would result in a crash inside a WebContent process in release builds and an assertion failure in debug builds. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::readBufferFromPasteboard): 2017-09-14 Youenn Fablet Add Cache API support of records persistency https://bugs.webkit.org/show_bug.cgi?id=176845 Reviewed by Alex Christensen. Introducing asynchronous opening of Cache objects. When opening, Cache objects will read the list of records from the disk. They keep in memory the necessary information to make any match or remove request without reading further information from the disk. Cache objects thus keep during the opening time a list of callbacks to call when being opened. Persistent storage is implemented through NetworkCache::Storage. A Cache object is added a unique name so that records from a Cache cannot be mixed with records from another Cache. This unique name is stored persistenly in addition to the Cache name. This unique name is used as the key type given to the storage. Request, response and responsebody data are no longer kept by the Cache object. For regular sessions, this information is kept on the disk through NetworkCache::Storage. Insertion time is also stored persistently so as to keep the ordering of the records consistent. For private browsing sessions, this information is kept in a map owned by the Caches object. RecordData is renamed to RecordInformation as it now only contains the information used to handle the different Cache actions. For every record retrieval action, a ReadRecordTaskCounter is used. Its purpose is to allow retrieving the record data on the disk in parallel, and then send back the information when everything is read. In case some records cannot be correctly read, they are removed automatically at that point. The current implementation loads all information in memory including response bodies. Further improvements might consider streaming the response bodies progressively. For every stored record, an AsynchronousPutTaskCounter is used. Its purpose is also to wait for all put actions to be completed before executing the completion callback. In some cases, a record needs to be overriden. In that case, as per the specification, only the data related to the response is to be modified. This requires reading the record request data on disk before actually writing the whole record again. This is implemented in updateRecordToDisk. The Cache object is delegating all record writing/reading tasks to its Caches object. The Caches object is responsible to handle persistent/private sessions. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::retrieveRecords): Making sure Cache object is opened. (WebKit::CacheStorage::Engine::readCache): Ditto. (WebKit::CacheStorage::Engine::unlock): Disposing the cache without going through initializing it. * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::computeKeyURL): (WebKit::CacheStorage::queryCache): (WebKit::CacheStorage::updateVaryInformation): (WebKit::CacheStorage::Cache::toRecordInformation): (WebKit::CacheStorage::Cache::Cache): (WebKit::CacheStorage::Cache::open): (WebKit::CacheStorage::Cache::finishOpening): (WebKit::CacheStorage::ReadRecordTaskCounter::create): (WebKit::CacheStorage::ReadRecordTaskCounter::~ReadRecordTaskCounter): (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord): (WebKit::CacheStorage::ReadRecordTaskCounter::ReadRecordTaskCounter): (WebKit::CacheStorage::Cache::retrieveRecord): (WebKit::CacheStorage::Cache::retrieveRecords): (WebKit::CacheStorage::Cache::addRecord): (WebKit::CacheStorage::Cache::recordsFromURL): (WebKit::CacheStorage::Cache::recordsFromURL const): (WebKit::CacheStorage::AsynchronousPutTaskCounter::create): (WebKit::CacheStorage::AsynchronousPutTaskCounter::~AsynchronousPutTaskCounter): (WebKit::CacheStorage::AsynchronousPutTaskCounter::onCompletion): (WebKit::CacheStorage::AsynchronousPutTaskCounter::setError): (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::remove): (WebKit::CacheStorage::Cache::removeFromRecordList): (WebKit::CacheStorage::Cache::writeRecordToDisk): (WebKit::CacheStorage::Cache::updateRecordToDisk): (WebKit::CacheStorage::Cache::readRecordFromDisk): (WebKit::CacheStorage::Cache::removeRecordFromDisk): (WebKit::CacheStorage::Cache::encode): (WebKit::CacheStorage::decodeRecordHeader): (WebKit::CacheStorage::Cache::decode): (WebKit::CacheStorage::Cache::keys const): * NetworkProcess/cache/CacheStorageEngineCache.h: (WebKit::CacheStorage::Cache::isOpened const): (WebKit::CacheStorage::Cache::uniqueName const): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::Caches::dispose): (WebKit::CacheStorage::encodeCacheNames): (WebKit::CacheStorage::decodeCachesNames): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::readRecordsList): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::readRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::clearMemoryRepresentation): (WebKit::CacheStorage::Caches::salt const): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::shouldPersist const): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::store): * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::writeWithoutWaiting): 2017-09-14 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight https://bugs.webkit.org/show_bug.cgi?id=176889 Reviewed by Andy Estes. * UIProcess/API/C/WKPage.cpp: (WKPageLoadAlternateHTMLString): (WKPageLoadAlternateHTMLStringWithUserData): * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::headerHeight): (WebKit::UIDelegate::UIClient::footerHeight): (WebKit::UIDelegate::UIClient::drawHeader): (WebKit::UIDelegate::UIClient::drawFooter): * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::printOperationWithPrintInfo): * UIProcess/FrameLoadState.cpp: (WebKit::FrameLoadState::didStartProvisionalLoad): (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad): (WebKit::FrameLoadState::didFailProvisionalLoad): (WebKit::FrameLoadState::didCommitLoad): (WebKit::FrameLoadState::didSameDocumentNotification): (WebKit::FrameLoadState::setUnreachableURL): (WebKit::FrameLoadState::FrameLoadState): Deleted. * UIProcess/FrameLoadState.h: (WebKit::FrameLoadState::url const): (WebKit::FrameLoadState::provisionalURL const): (WebKit::FrameLoadState::unreachableURL const): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::loadURL): (WebKit::WebFrameProxy::didStartProvisionalLoad): (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameProxy::didSameDocumentNavigation): (WebKit::WebFrameProxy::setUnreachableURL): * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::url const): (WebKit::WebFrameProxy::provisionalURL const): (WebKit::WebFrameProxy::unreachableURL const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadAlternateHTMLString): (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL): (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadURLInFrame): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-09-14 Andy Estes [Mac] Upstream SpeechSynthesis-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176931 Reviewed by Joseph Pecoraro. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-14 Ryan Haddad Unreviewed, rolling out r222033. This change caused API test WebKit.PrintFrame to time out. Reverted changeset: "Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight" https://bugs.webkit.org/show_bug.cgi?id=176889 http://trac.webkit.org/changeset/222033 2017-09-14 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight https://bugs.webkit.org/show_bug.cgi?id=176889 Reviewed by Andy Estes. * UIProcess/API/C/WKPage.cpp: (WKPageLoadAlternateHTMLString): (WKPageLoadAlternateHTMLStringWithUserData): * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::headerHeight): (WebKit::UIDelegate::UIClient::footerHeight): (WebKit::UIDelegate::UIClient::drawHeader): (WebKit::UIDelegate::UIClient::drawFooter): * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::printOperationWithPrintInfo): * UIProcess/FrameLoadState.cpp: (WebKit::FrameLoadState::didStartProvisionalLoad): (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad): (WebKit::FrameLoadState::didFailProvisionalLoad): (WebKit::FrameLoadState::didCommitLoad): (WebKit::FrameLoadState::didSameDocumentNotification): (WebKit::FrameLoadState::setUnreachableURL): (WebKit::FrameLoadState::FrameLoadState): Deleted. * UIProcess/FrameLoadState.h: (WebKit::FrameLoadState::url const): (WebKit::FrameLoadState::provisionalURL const): (WebKit::FrameLoadState::unreachableURL const): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::loadURL): (WebKit::WebFrameProxy::didStartProvisionalLoad): (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameProxy::didSameDocumentNavigation): (WebKit::WebFrameProxy::setUnreachableURL): * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::url const): (WebKit::WebFrameProxy::provisionalURL const): (WebKit::WebFrameProxy::unreachableURL const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadAlternateHTMLString): (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL): (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadURLInFrame): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-09-14 Carlos Garcia Campos [GTK][Wayland] Flickering when resizing the window https://bugs.webkit.org/show_bug.cgi?id=176774 Reviewed by Michael Catanzaro. This regressed when we switched to always start the wayland compositor. In AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState() we check if the nested compositor is running, which is always true now (if EGL and the required extensions are available). We should check if we are in AC mode instead. * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): 2017-09-14 Yusuke Suzuki [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray https://bugs.webkit.org/show_bug.cgi?id=176867 Reviewed by Sam Weinig. * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::enumerate): 2017-09-14 Maureen Daum Introduce the option to mark an HTML element as having AutoFill available. https://bugs.webkit.org/show_bug.cgi?id=176710 Reviewed by Alex Christensen. Introduce the option to mark an HTML element as having AutoFill available. Accessibility can use this property when deciding whether to announce that the focused field offers AutoFill. * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: (WKBundleNodeHandleGetHTMLInputElementAutoFillAvailable): (WKBundleNodeHandleSetHTMLInputElementAutoFillAvailable): * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::isAutoFillAvailable const): (WebKit::InjectedBundleNodeHandle::setAutoFillAvailable): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: 2017-09-13 John Wilander Introduce Storage Access API (document parts) as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=175759 Reviewed by Alex Christensen. Storage Access API is an experimental feature which allows cross-origin, sandboxed iframes to request access to their first-party storage (as opposed to partitioned storage). This might be restricted to cookies or might cover all stateful mechanisms. It introduces the following three developer-facing things: - A new readonly attribute, document.hasStorageAccess. - A new function, document.requestStorageAccess(). - A new iframe sandbox token, allow-storage-access-by-user-activation. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Storage handling of the new type of data. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetStorageAccessAPIEnabled): (WKPreferencesGetStorageAccessAPIEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: Bumped the model version from 9 to 10. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-09-13 Andy Estes [Apple Pay] Consider phoneticName when encoding ContactFields https://bugs.webkit.org/show_bug.cgi?id=176885 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-09-13 Matt Lewis Unreviewed, rolling out r221976. The test introduced was flaky from point of addition. Reverted changeset: "Introduce Storage Access API (document parts) as an experimental feature" https://bugs.webkit.org/show_bug.cgi?id=175759 http://trac.webkit.org/changeset/221976 2017-09-13 Youenn Fablet Internals clearCacheStorageMemoryRepresentation should return a Promise https://bugs.webkit.org/show_bug.cgi?id=176818 Reviewed by Alex Christensen. Adding a completion handler to clearMemoryRepresentation. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::clearMemoryRepresentation): (WebKit::WebCacheStorageConnection::clearMemoryRepresentationCompleted): * WebProcess/Cache/WebCacheStorageConnection.h: * WebProcess/Cache/WebCacheStorageConnection.messages.in: 2017-09-13 Andy Estes [CF] Upstream CFNetwork-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176729 Reviewed by Alex Christensen. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::createSerializableRepresentation): (IPC::dictionaryValueOfType): (IPC::createArchiveList): (IPC::createCFURLRequestFromSerializableRepresentation): (IPC::createNSURLRequestFromSerializableRepresentation): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-13 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's setIsResizable, getWindowFrame, and setWindowFrame https://bugs.webkit.org/show_bug.cgi?id=176857 Reviewed by Tim Horton. isResizable is unreachable code because nothing sends Messages::WebPageProxy::GetIsResizable, so I removed it. * UIProcess/API/APIUIClient.h: (API::UIClient::setStatusBarIsVisible): (API::UIClient::isResizable): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::setIsResizable): (WebKit::UIDelegate::UIClient::setWindowFrame): (WebKit::UIDelegate::UIClient::windowFrame): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::getIsResizable): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: 2017-09-13 Youenn Fablet Add a lambda-based map for Vectors https://bugs.webkit.org/show_bug.cgi?id=176487 Reviewed by Darin Adler. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::readCachesFromDisk): 2017-09-13 John Wilander Introduce Storage Access API (document parts) as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=175759 Reviewed by Alex Christensen. Storage Access API is an experimental feature which allows cross-origin, sandboxed iframes to request access to their first-party storage (as opposed to partitioned storage). This might be restricted to cookies or might cover all stateful mechanisms. It introduces the following three developer-facing things: - A new readonly attribute, document.hasStorageAccess. - A new function, document.requestStorageAccess(). - A new iframe sandbox token, allow-storage-access-by-user-activation. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Storage handling of the new type of data. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetStorageAccessAPIEnabled): (WKPreferencesGetStorageAccessAPIEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: Bumped the model version from 9 to 10. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-09-13 Sergio Villar Senin [WebVR] Add IDLs and stubs https://bugs.webkit.org/show_bug.cgi?id=174202 Reviewed by Dean Jackson. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-09-12 Ryosuke Niwa Dragging & dropping a file creates an attachment element even when it's disabled https://bugs.webkit.org/show_bug.cgi?id=176769 Reviewed by Tim Horton. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAttachmentElementEnabled): (WKPreferencesGetAttachmentElementEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-09-12 Youenn Fablet Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not https://bugs.webkit.org/show_bug.cgi?id=176579 Reviewed by Alex Christensen. Introducing RecordData that splits its stored data in mandatory data, used to check a record with a request and optional data that is necessary to build a CacheStorageEngine::Record used by WebProcess. The mandatory data contains the URL, Vary header information and identifiers. Adding routines to go from a Record to RecordData and vice versa. Storing in CacheStorage::Cache RecordData instead of Record. * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::queryCache): (WebKit::CacheStorage::updateVaryInformation): (WebKit::CacheStorage::toRecord): (WebKit::CacheStorage::toRecordData): (WebKit::CacheStorage::Cache::retrieveRecords const): (WebKit::CacheStorage::Cache::addRecord): (WebKit::CacheStorage::Cache::recordsFromURL): (WebKit::CacheStorage::Cache::recordsFromURL const): (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::writeRecordToDisk): (WebKit::CacheStorage::Cache::removeRecordFromDisk): * NetworkProcess/cache/CacheStorageEngineCache.h: 2017-09-12 Dan Bernstein Tried to fix the iOS 10 build after r221930. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setDragInteractionPolicy:]): 2017-09-12 Dan Bernstein Update availability annotations to match the macOS 10.13 and iOS 11.0 GM seed SDKs https://bugs.webkit.org/show_bug.cgi?id=176793 Reviewed by Tim Horton. Changed WK_MAC_TBA and WK_IOS_TBA to 10.13 and 11.0, respectively, in all declarations that appear in the GM seed SDKs. Additional changes and exceptions are noted below. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added missing availability annotation to -_webView:dataOwnerForDropSession: and -_webView:dataOwnerForDragSession:. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed rednundant __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 guards. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Added missing availability annotation to -_setResourceLoadStatisticsTestingCallback:. * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added missing availability annotation. * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Added availability annotation that had been missing since macOS 10.12.3 and iOS 10.3. Corrected annotation for _WKLinkIconParameters. * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Added missing TBA annotation to _resourceLoadStatisticsDirectory. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Removed iOS availability from macOS-only declaration and vice versa. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Removed an availability annotation from this method implementation. * Shared/API/Cocoa/WKDragDestinationAction.h: * UIProcess/API/Cocoa/WKContentRuleList.h: * UIProcess/API/Cocoa/WKContentRuleListStore.h: * UIProcess/API/Cocoa/WKError.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKHTTPCookieStore.h: * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKSnapshotConfiguration.h: * UIProcess/API/Cocoa/WKURLSchemeHandler.h: * UIProcess/API/Cocoa/WKURLSchemeTask.h: * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h: * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: * UIProcess/API/Cocoa/_WKGeolocationPosition.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/_WKWebViewPrintFormatter.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h: 2017-09-12 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's runModal https://bugs.webkit.org/show_bug.cgi?id=176728 Covered by a new API test. Reviewed by Tim Horton. * UIProcess/API/APIUIClient.h: (API::UIClient::runModal): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::canRunModal const): (WebKit::UIDelegate::UIClient::runModal): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runModal): 2017-09-12 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForNotificationPermissionRequest https://bugs.webkit.org/show_bug.cgi?id=176768 Reviewed by Tim Horton. Covered by a new API test. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel): (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest): (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): 2017-09-11 Wenson Hsieh [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS https://bugs.webkit.org/show_bug.cgi?id=176721 Reviewed by Tim Horton. Rename elementBounds => dragPreviewFrameInRootViewCoordinates. * UIProcess/ios/DragDropInteractionState.h: * UIProcess/ios/DragDropInteractionState.mm: (WebKit::DragDropInteractionState::previewForDragItem const): (WebKit::DragDropInteractionState::stageDragItem): 2017-09-11 Tim Horton REGRESSION (r221272): WKWebView gets stuck zoomed in if the web process crashes https://bugs.webkit.org/show_bug.cgi?id=176767 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processDidExit]): Reset the "last sent" layout parameters when the Web Content process exits. They're no longer "last sent", and if we short-circuit from sending them again (from under _didRelaunchProcess), we will never send the correct layout width (until it changes). 2017-09-11 Wenson Hsieh [iOS WK2] Support tapping to add items to the current drag session in web content https://bugs.webkit.org/show_bug.cgi?id=176421 Reviewed by Tim Horton. To request additional drag items, end the current drag in the web page and try to begin a drag at the new location. This process is transparent to the UI process, which still maintains the same UIDragSession with the old drag source. As opposed to firing a new event (for instance: `adddragitem`), this approach is taken to ensure that if the page wants to preventDefault() on `dragstart`, it would also prevent the user from adding it as an additional drag item. Using the new event approach, dealing with this case would either require the page to listen for a new event and call preventDefault(), which would break compatibility with pages that only preventDefault() on `dragstart`, or it would require the default behavior of this new event to be _not_ adding a drag item, in which case this approach would require pages to adopt the new event in some form. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestAdditionalItemsForDragSession): 2017-09-11 Alex Christensen Clean up API::UIClient https://bugs.webkit.org/show_bug.cgi?id=176568 Reviewed by Brady Eidson. We don't need createNewPage and createNewPageAsync. An async version can support synchronous delegate calls by just calling the completion handler synchronously. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): (API::UIClient::createNewPageAsync): Deleted. (API::UIClient::canCreateNewPageAsync): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/API/glib/WebKitUIClient.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted. (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted. (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createNewPage): * UIProcess/WebPageProxy.h: 2017-09-11 Alex Christensen Fix memory leak introduced in r221894. https://bugs.webkit.org/show_bug.cgi?id=176753 * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::createRequest): The NotificationPermissionRequestManagerProxy keeps track of pending requests so they can be denied when invalidating the page. We add them to a HashMap and in r221894 I removed the code that removes them from that map once the request is complete. This code adds the completed task removal back. The NotificationPermissionRequestManagerProxy and WebPageProxy have the same lifetime, so protecting the WebPageProxy (m_page) makes sure there is no use-after-free when the completion handler is called. 2017-09-11 Alex Christensen Make NotificationPermissionRequest work with completion handlers https://bugs.webkit.org/show_bug.cgi?id=176753 Reviewed by Andy Estes. API::UIClient::decidePolicyForNotificationPermissionRequest should take a completion handler which it will eventually call with a bool representing whether notifications are allowed. To do this, I make NotificationPermissionRequest just a wrapper for a lambda. One subtle change in behavior is when invalidating all outstanding requests, we deny them instead of just dropping them. This results in a deny message sent where there wasn't one before, resulting in better cleanup in NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision. * UIProcess/API/APIUIClient.h: (API::UIClient::decidePolicyForNotificationPermissionRequest): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/Notifications/NotificationPermissionRequest.cpp: Removed. * UIProcess/Notifications/NotificationPermissionRequest.h: (WebKit::NotificationPermissionRequest::create): (WebKit::NotificationPermissionRequest::allow): (WebKit::NotificationPermissionRequest::deny): (WebKit::NotificationPermissionRequest::NotificationPermissionRequest): * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests): (WebKit::NotificationPermissionRequestManagerProxy::createRequest): (WebKit::NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision): Deleted. * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestNotificationPermission): * WebKit.xcodeproj/project.pbxproj: 2017-09-11 Alex Christensen Modernize and make API::UIClient more asynchronous https://bugs.webkit.org/show_bug.cgi?id=176583 Reviewed by Brian Burg. API::UIClient calls that return values synchronously require synchronous APIs unnecessarily. Having them call completion handlers with the results instead allows us to make asynchronous APIs, and existing synchronous APIs can just call the completion handlers immediately. Unfortunately an assumption that API::UIClient::windowFrame returns synchronously had worked its way into the WebAutomationSession, which calls WebPageProxy::getWindowFrame. Making it asynchronous required making some automation protocols asynchronous so they can send their result once they have the resulting frames from the UIClient. No change in behaviour. * UIProcess/API/APIUIClient.h: (API::UIClient::setToolbarsAreVisible): (API::UIClient::menuBarIsVisible): (API::UIClient::setMenuBarIsVisible): (API::UIClient::statusBarIsVisible): (API::UIClient::setStatusBarIsVisible): (API::UIClient::isResizable): (API::UIClient::setIsResizable): (API::UIClient::setWindowFrame): (API::UIClient::windowFrame): (API::UIClient::headerHeight): (API::UIClient::footerHeight): (API::UIClient::drawHeader): (API::UIClient::drawFooter): (API::UIClient::printFrame): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::buildBrowsingContextForPage): (WebKit::WebAutomationSession::getNextContext): (WebKit::WebAutomationSession::getBrowsingContexts): (WebKit::WebAutomationSession::getBrowsingContext): (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): (WebKit::WebAutomationSession::performMouseInteraction): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::printFrame): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::printOperationWithPrintInfo): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::setToolbarsAreVisible): (WebKit::WebPageProxy::setMenuBarIsVisible): (WebKit::WebPageProxy::getMenuBarIsVisible): (WebKit::WebPageProxy::setStatusBarIsVisible): (WebKit::WebPageProxy::getStatusBarIsVisible): (WebKit::WebPageProxy::setIsResizable): (WebKit::WebPageProxy::getIsResizable): (WebKit::WebPageProxy::setWindowFrame): (WebKit::WebPageProxy::getWindowFrame): (WebKit::WebPageProxy::getWindowFrameWithCompletionHandler): (WebKit::WebPageProxy::screenToRootView): (WebKit::WebPageProxy::rootViewToScreen): (WebKit::WebPageProxy::printFrame): (WebKit::WebPageProxy::headerHeight): (WebKit::WebPageProxy::footerHeight): (WebKit::WebPageProxy::drawHeader): (WebKit::WebPageProxy::drawFooter): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WKPrintingView.h: * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView initWithFrameProxy:view:]): (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]): (-[WKPrintingView drawPageBorderWithSize:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::windowAndViewFramesChanged): 2017-09-11 Stephan Szabo [WinCairo] Add entry Web Process files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=176570 Reviewed by Alex Christensen. * PlatformWin.cmake: * WebProcess/EntryPoint/win/WebProcessMain.cpp: Added. * WebProcess/win/WebProcessMainWin.cpp: Added. * WebProcess/win/WebProcessMainWin.h: Added. 2017-09-11 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForGeolocationPermissionRequest https://bugs.webkit.org/show_bug.cgi?id=176642 Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): (WebKit::Function [iOS DnD] Elements in the DOM with the `draggable` attribute should be draggable https://bugs.webkit.org/show_bug.cgi?id=176664 Reviewed by Tim Horton. Makes a simple adjustment in DragDropInteractionState::previewForDragItem to respect the drag image supplied to the UI process during a "DHTML"-defined drag (i.e. DragSourceActionDHTML). Test: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateDataInteractionEntered:]): Deleted. (-[WKWebView _simulateDataInteractionUpdated:]): Deleted. (-[WKWebView _simulateDataInteractionPerformOperation:]): Deleted. (-[WKWebView _simulateDataInteractionEnded:]): Deleted. (-[WKWebView _simulateDataInteractionSessionDidEnd:]): Deleted. (-[WKWebView _simulateWillBeginDataInteractionWithSession:]): Deleted. (-[WKWebView _simulatedItemsForSession:]): Deleted. (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted. (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]): Deleted. Remove all -_simulate*: testing helpers on WKWebView. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/DragDropInteractionState.mm: (WebKit::shouldUseDragImageToCreatePreviewForDragSource): (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource): Add shouldUseDragImageToCreatePreviewForDragSource, which returns YES when dragging an image or DHTML-defined draggable element and the drag image exists. This is called from previewForDragItem when constructing the drag preview for a given UIDragItem. (WebKit::DragDropInteractionState::previewForDragItem const): (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _simulateDataInteractionEntered:]): Deleted. (-[WKContentView _simulateDataInteractionUpdated:]): Deleted. (-[WKContentView _simulateDataInteractionEnded:]): Deleted. (-[WKContentView _simulateDataInteractionPerformOperation:]): Deleted. (-[WKContentView _simulateDataInteractionSessionDidEnd:]): Deleted. (-[WKContentView _simulateWillBeginDataInteractionWithSession:]): Deleted. (-[WKContentView _simulatedItemsForSession:]): Deleted. (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]): Deleted. (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted. Remove all -_simulate*: testing helpers on WKContentView. 2017-09-11 Alex Christensen Modernize BoxExtent into RectEdges https://bugs.webkit.org/show_bug.cgi?id=176437 Reviewed by Simon Fraser. * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebCoreArgumentCoders.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.messages.in: 2017-09-11 Andy Estes [Mac] Upstream QTKit-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176472 Reviewed by Eric Carlson. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-11 JF Bastien cmake build fix Unreviewed * PlatformMac.cmake: one file was deleted, another renamed. 2017-09-10 Carlos Garcia Campos REGRESSION: [GTK] Generated HTML API documentation is missing descriptions https://bugs.webkit.org/show_bug.cgi?id=176667 Reviewed by Michael Catanzaro. Fix several typos in API documentation. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_class_init): * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: 2017-09-10 Brady Eidson Try to avoid creating the default WKWebsiteDataStore until its actually needed. and https://bugs.webkit.org/show_bug.cgi?id=176551 Reviewed by Tim Horton. * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::cookies): (API::HTTPCookieStore::setCookie): (API::HTTPCookieStore::deleteCookie): * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::defaultDataStore): (API::WebsiteDataStore::defaultDataStoreExists): * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/C/WKContext.cpp: (WKContextGetWebsiteDataStore): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore _defaultDataStoreExists]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::m_hiddenPageThrottlingTimer): (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): (WebKit::WebProcessPool::warmInitialProcess): (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::pageAddedToProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::isAssociatedProcessPool const): 2017-09-09 Mark Lam Avoid duplicate computations of ExecState::vm(). https://bugs.webkit.org/show_bug.cgi?id=176647 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.h: (WebKit::JSNPMethod::create): * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::setProperty): (WebKit::NPJSObject::removeProperty): (WebKit::NPJSObject::enumerate): 2017-09-08 Joseph Pecoraro Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses https://bugs.webkit.org/show_bug.cgi?id=176479 Reviewed by Alex Christensen. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): Initialize AtomicString statics like emptyAtom(). 2017-09-08 Commit Queue Unreviewed, rolling out r221773. https://bugs.webkit.org/show_bug.cgi?id=176614 This caused build failures. (Requested by mlewis13 on #webkit). Reverted changeset: "[Mac] Upstream QTKit-related WebKitSystemInterface functions" https://bugs.webkit.org/show_bug.cgi?id=176472 http://trac.webkit.org/changeset/221773 2017-09-08 Stephan Szabo [WinCairo] Add Storage Process files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=176567 Reviewed by Alex Christensen. * PlatformWin.cmake: * StorageProcess/EntryPoint/win/StorageProcessMain.cpp: Added. (main): * StorageProcess/win/StorageProcessMainWin.cpp: Added. (WebKit::StorageProcessMainWin): * StorageProcess/win/StorageProcessMainWin.h: Added. 2017-09-08 Ryan Haddad Unreviewed, rolling out r221771. This change caused two API tests to crash. Reverted changeset: "Clean up API::UIClient" https://bugs.webkit.org/show_bug.cgi?id=176568 http://trac.webkit.org/changeset/221771 2017-09-07 Carlos Garcia Campos [GTK][WPE] UI process crash in WebBackForwardList::restoreFromState https://bugs.webkit.org/show_bug.cgi?id=176303 Reviewed by Michael Catanzaro. Ensure the current index provided by the session state is not out of actual item list bounds. This is a bug in the session state decoder, but WebBackForwardList::backForwardListState() is already doing the check and using the last item index instead, so it's not easy to know where the actual problem is. In any case we should still protect the decoder. * UIProcess/API/glib/WebKitWebViewSessionState.cpp: (decodeSessionState): 2017-09-07 Andy Estes [Mac] Upstream QTKit-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176472 Reviewed by Eric Carlson. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-07 Alex Christensen Clean up API::UIClient https://bugs.webkit.org/show_bug.cgi?id=176568 Reviewed by Brady Eidson. We don't need createNewPage and createNewPageAsync. An async version can support synchronous delegate calls by just calling the completion handler synchronously. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): (API::UIClient::createNewPageAsync): Deleted. (API::UIClient::canCreateNewPageAsync): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/API/glib/WebKitUIClient.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted. (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted. (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createNewPage): * UIProcess/WebPageProxy.h: 2017-09-07 Alex Christensen Make DragControllerAction an enum class https://bugs.webkit.org/show_bug.cgi?id=176565 Reviewed by Andy Estes. * Shared/DragControllerAction.h: (): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dragEntered): (WebKit::WebPageProxy::dragUpdated): (WebKit::WebPageProxy::dragExited): (WebKit::WebPageProxy::performDragOperation): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-09-07 Myles C. Maxfield [PAL] Unify PlatformUserPreferredLanguages.h with Language.h https://bugs.webkit.org/show_bug.cgi?id=176561 Reviewed by Brent Fulgham. * UIProcess/WebProcessPool.cpp: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::userPreferredLanguagesChanged const): 2017-09-07 Youenn Fablet Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache https://bugs.webkit.org/show_bug.cgi?id=176548 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::dereference): 2017-09-07 Chris Dumez [WK2] Add C API to retrieve the originating page of a WKDownload https://bugs.webkit.org/show_bug.cgi?id=176557 Reviewed by Alex Christensen. Add C API to retrieve the original page of a WKDownload. This is the C API equivalent to _WKDownload.originatingWebView which already exists in ObjC. The pointer is weak so as to not keep alive the page for the duration of the download. * UIProcess/API/C/WKDownload.cpp: (WKDownloadGetOriginatingPage): * UIProcess/API/C/WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.mm: (-[_WKDownload originatingWebView]): * UIProcess/API/Cocoa/_WKDownloadInternal.h: * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::originatingPage const): (WebKit::DownloadProxy::setOriginatingPage): * UIProcess/Downloads/DownloadProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::download): (WebKit::WebProcessPool::resumeDownload): (WebKit::WebProcessPool::createDownloadProxy): * UIProcess/WebProcessPool.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::handleDownloadRequest): * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::handleDownloadRequest): 2017-09-07 Alex Christensen Clean up Geolocation request handling https://bugs.webkit.org/show_bug.cgi?id=176562 Reviewed by Tim Horton. Instead of passing a GeolocationPermissionRequestProxy& to each client and returning a bool if the request will be handled, pass a Function&& completionHandler and return the function if it won't be handled. This allows to temporarily support our UIClient/PageClient hybrid design while moving towards a sane design. * UIProcess/API/APIUIClient.h: (API::UIClient::Function Allow modern decoding of enums and OptionSets https://bugs.webkit.org/show_bug.cgi?id=176480 Reviewed by Andy Estes. * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder>::decode): * Platform/IPC/Decoder.h: (IPC::Decoder::operator>>): * Platform/IPC/Encoder.h: * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::encode const): (WebKit::WebsitePolicies::decode): 2017-09-07 Frederic Wang Move more code from ScrollingTreeScrollingNodeDelegateIOS to ScrollingTreeScrollingNodeDelegate https://bugs.webkit.org/show_bug.cgi?id=174130 Reviewed by Simon Fraser. * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Remove some members, headers and pre-declaration that are moved into the delegate. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer): Deleted. * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Remove some headers and WKOverflowScrollViewDelegate since they are moved into the delegate file. Also fix the comment to closing the WebKit namespace. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS): Remove some code moved into the delegate and call the corresponding helper function to preserve the current behavior. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto. Note that it is only necessary to cast the parameter to a ScrollingStateTreeNode. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Ditto. (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Deleted. (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Deleted. (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Deleted. (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted. (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Deleted. (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Deleted. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Import headers and members from ScrollingTreeOverflowScrollingNodeIOS. Define new helper functions for the code imported from ScrollingTreeOverflowScrollingNodeIOS. Remove the friendship with ScrollingTreeOverflowScrollingNodeIOS and only makes public the function used by that class. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollLayer): This function is moved from ScrollingTreeOverflowScrollingNodeIOS. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Add headers, WKOverflowScrollViewDelegate (renamed WKScrollingNodeScrollViewDelegate) and some helper code imported from ScrollingTreeOverflowScrollingNodeIOS. (-[WKScrollingNodeScrollViewDelegate scrollViewDidScroll:]): Moved from ScrollingTreeOverflowScrollingNodeIOS. (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginDragging:]): Ditto. (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Ditto. (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Ditto. (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS): Import code from ScrollingTreeOverflowScrollingNodeIOS. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::resetScrollViewDelegate): New helper function importing code from ScrollingTreeOverflowScrollingNodeIOS. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Ditto. 2017-09-07 Chris Dumez [WK2] Notify client when downloads are redirected https://bugs.webkit.org/show_bug.cgi?id=176481 Reviewed by Geoffrey Garen. Notify client when downloads are redirected via both ObjC and C API. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::willSendRedirectedRequest): * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/mac/DownloadMac.mm: (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]): * UIProcess/API/APIDownloadClient.h: (API::DownloadClient::willSendRequest): * UIProcess/API/C/WKContext.cpp: (WKContextSetDownloadClient): * UIProcess/API/C/WKContextDownloadClient.h: * UIProcess/API/Cocoa/_WKDownloadDelegate.h: * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::willSendRequest): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::willSendRequest): * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Downloads/DownloadProxy.messages.in: * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): Set menu proxy before calling menuFromProposedMenu() client delegate. This allows me to perform one of the menu item's action from the menuFromProposedMenu() client delegate in my API test. 2017-09-07 Alex Christensen Modernize Geolocation code https://bugs.webkit.org/show_bug.cgi?id=176496 Reviewed by Andy Estes. Making the GeolocationPermissionRequestManager take a reference instead of a pointer spilled into making the other supplement constructors do the same. * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp: (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager): (WebKit::LegacyCustomProtocolManager::startLoading): (WebKit::LegacyCustomProtocolManager::stopLoading): * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::addSupplement): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::AuthenticationManager): (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Shared/Authentication/AuthenticationManager.h: * UIProcess/API/APIUIClient.h: (API::UIClient::decidePolicyForGeolocationPermissionRequest): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestGeolocationPermissionForFrame): * WebProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::WebCookieManager): (WebKit::WebCookieManager::getHostnamesWithCookies): (WebKit::WebCookieManager::deleteCookie): (WebKit::WebCookieManager::deleteAllCookiesModifiedSince): (WebKit::WebCookieManager::getAllCookies): (WebKit::WebCookieManager::getCookies): (WebKit::WebCookieManager::setCookie): (WebKit::WebCookieManager::setCookies): (WebKit::WebCookieManager::notifyCookiesDidChange): (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy): * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::GeolocationPermissionRequestManager): (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation): (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation): * WebProcess/Geolocation/GeolocationPermissionRequestManager.h: * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::WebGeolocationManager): (WebKit::WebGeolocationManager::registerWebPage): (WebKit::WebGeolocationManager::unregisterWebPage): (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage): (WebKit::WebGeolocationManager::didChangePosition): (WebKit::WebGeolocationManager::didFailToDeterminePosition): (WebKit::WebGeolocationManager::resetPermissions): * WebProcess/Geolocation/WebGeolocationManager.h: * WebProcess/MediaCache/WebMediaKeyStorageManager.h: (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager): * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::WebNotificationManager): (WebKit::WebNotificationManager::show): (WebKit::WebNotificationManager::cancel): (WebKit::WebNotificationManager::clearNotifications): (WebKit::WebNotificationManager::didDestroyNotification): * WebProcess/Notifications/WebNotificationManager.h: * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: (WebKit::WebGeolocationClient::requestPermission): (WebKit::WebGeolocationClient::cancelPermissionRequest): * WebProcess/WebCoreSupport/WebGeolocationClient.h: (WebKit::WebGeolocationClient::WebGeolocationClient): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): * WebProcess/WebProcess.h: (WebKit::WebProcess::addSupplement): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::UserMediaCaptureManager): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-09-06 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's pageDidScroll https://bugs.webkit.org/show_bug.cgi?id=176482 Reviewed by Tim Horton. Covered by a new API test! * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::pageDidScroll): 2017-09-06 Youenn Fablet NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed https://bugs.webkit.org/show_bug.cgi?id=176249 Reviewed by Alex Christensen. CacheStorageEngineConnection will store the number of Caches references for its related WebProcess. For a new reference, CacheStorageEngineConnection will notify its engine to lock the related Cache. When the last reference is gone, CacheStorageEngineConnection will ask the engine to release the lock. CacheStorageEngine will keep locks as a counter for each Cache object. When the counter goes to zero, the engine asks the Cache to dispose itself. Disposal is done by its parent Caches as only Caches knows whether the Cache is persistent or has been removed. The Caches will remove the Cache from memory. For removed caches, all information will be lost. For caches that are not removed, they will keep their identifiers but all in-memory record information will be discarded. If there is a need to reopen the Cache, it will need to read its information from the filesystem. If the Caches has no longer any active Cache object, it will ask the engine to release itself. WebProcess crashing is handled correctly as the CacheStorageEngineConnection will release its locks at destruction time of the connection to the web process. Adding the possiblity to grab an engine representation for test purposes. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::removeCaches): (WebKit::CacheStorage::Engine::lock): (WebKit::CacheStorage::Engine::unlock): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::Cache): (WebKit::CacheStorage::Cache::dispose): (WebKit::CacheStorage::Cache::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineCache.h: (WebKit::CacheStorage::Cache::isActive const): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::dispose): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::create): * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection): (WebKit::CacheStorageEngineConnection::reference): (WebKit::CacheStorageEngineConnection::dereference): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::reference): (WebKit::WebCacheStorageConnection::dereference): * WebProcess/Cache/WebCacheStorageConnection.h: 2017-09-06 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange https://bugs.webkit.org/show_bug.cgi?id=176474 Reviewed by Tim Horton. Rather than telling the UIClient that the pinned state changed and having the application check 4 bools like we do with WKPage, I made a KVO property on the WKWebView. I introduce _WKRectEdge for this purpose, which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags. This same structure is used for rubber band state. Covered by a new API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pinnedState]): (-[WKWebView _rubberBandState]): (-[WKWebView _setRubberBandState:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::pinnedState): (WebKit::WebViewImpl::rubberBandState): (WebKit::WebViewImpl::setRubberBandState): * UIProcess/PageClient.h: (WebKit::PageClient::pinnedStateWillChange): (WebKit::PageClient::pinnedStateDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::pinnedStateWillChange): (WebKit::PageClientImpl::pinnedStateDidChange): 2017-09-06 Youenn Fablet Introduce asynchronous opening of CacheStorageEngine cache https://bugs.webkit.org/show_bug.cgi?id=176425 Reviewed by Alex Christensen. Introducing Cache::open to allow reading from the filesystem to fill the Cache. This is called by Caches when engine requests to open an existing Cache. * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::Cache): (WebKit::CacheStorage::Cache::open): (WebKit::CacheStorage::Cache::finishOpening): (WebKit::CacheStorage::Cache::readRecordsList): * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::find): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::find const): Deleted. * NetworkProcess/cache/CacheStorageEngineCaches.h: 2017-09-06 Alex Christensen Unreviewed, rolling out r221694. broke build Reverted changeset: "Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange" https://bugs.webkit.org/show_bug.cgi?id=176474 http://trac.webkit.org/changeset/221694 2017-09-06 Ryan Haddad Unreviewed, rolling out r221461. The LayoutTest added with this change crashes under GuardMalloc. Reverted changeset: "Add (entirely incorrect) fetching of ServiceWorker scripts." https://bugs.webkit.org/show_bug.cgi?id=176179 http://trac.webkit.org/changeset/221461 2017-09-06 Alex Christensen Add modern decoders for POD types https://bugs.webkit.org/show_bug.cgi?id=176456 Reviewed by Geoffrey Garen. * Platform/IPC/Decoder.cpp: (IPC::Decoder::getOptional): (IPC::Decoder::operator>>): * Platform/IPC/Decoder.h: * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: 2017-09-06 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange https://bugs.webkit.org/show_bug.cgi?id=176474 Reviewed by Tim Horton. Rather than telling the UIClient that the pinned state changed and having the application check 4 bools like we do with WKPage, I made a KVO property on the WKWebView. I introduce _WKRectEdge for this purpose, which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags. This same structure is used for rubber band state. Covered by a new API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pinnedState]): (-[WKWebView _rubberBandState]): (-[WKWebView _setRubberBandState:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::pinnedState): (WebKit::WebViewImpl::rubberBandState): (WebKit::WebViewImpl::setRubberBandState): * UIProcess/PageClient.h: (WebKit::PageClient::pinnedStateWillChange): (WebKit::PageClient::pinnedStateDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::pinnedStateWillChange): (WebKit::PageClientImpl::pinnedStateDidChange): 2017-09-06 Brent Fulgham Deny third-party cookie creation for prevalent resources without interaction https://bugs.webkit.org/show_bug.cgi?id=175232 Reviewed by Alex Christensen. Prior to Intelligent Tracking Prevention, WebKit would deny the ability to create a third party cookie if the user's settings prohibited it. Due to the internal mechanics of cookie partitioning, we now accept the third party cookie, but destroy it at some arbitrary moment which is difficult for websites to work with. This patch revises WebKit so that attempts to set third party cookies without user interaction fails immediately, which is what sites are expecting from Safari. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction): (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: Renamed the UpdateCookiePartitioningForTopPrivatelyOwnedDomains message to UpdatePrevalentDomainsWithAndWithoutInteraction. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Recognize cases where a network session should block cookies, and use the stateless session so we fail immediately when attempting an invalid cookie set operation. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsSetShouldPartitionCookies): Use new helper function to clear partitioning state. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Update for revised naming. (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): Track domains with and without interaction so that we can recognize domains that should be immediately blocked from setting cookies. (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Update for revised naming. (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains): Added helper function for testing. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Update for revised naming. (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Ditto. (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-09-06 Adrian Perez de Castro [WPE][CMake] Fix path to the WebKitApplicationInfo.h header. Unreviewed build fix. This doesn't really make a difference for the build bots, but it makes it possible to craft working release tarballs of WPE. * PlatformWPE.cmake: Use the WPE version of WebKitApplicationInfo.h 2017-09-06 Frédéric Wang Introduce ScrollingTreeScrollingNodeDelegateIOS to share code between overflow and frame scrolling https://bugs.webkit.org/show_bug.cgi?id=174097 Reviewed by Darin Adler. This patch introduces a new ScrollingTreeScrollingNodeDelegateIOS that can be used by WKOverflowScrollViewDelegate to communicate to the scrolling tree and nodes. It can also be used as a helper class by ScrollingTreeOverflowScrollingNodeIOS. For now, only the non- overriden member functions of ScrollingTreeOverflowScrollingNodeIOS are moved to that new class. In follow-up commits, WKOverflowScrollViewDelegate can become a generic ScrollViewDelegate and more code can be moved into the ScrollingTreeScrollingNodeDelegateIOS file. Frame scrolling nodes will then be able to share the same UI code as overflow:auto when iOS frame scrolling is implemented (bug 149264). * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Move non-overriden member functions and m_updatingFromStateNode into the delegate class. Also define a member to store that delegate. * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Use the node delegate to communicate to the scrolling tree and node. (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Init with a delegate. (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Call the delegate function. (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Ditto. (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Use the delegate functions or pass by ScrollingTreeScrollingNodeDelegateIOS::scrollingNode(). (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Use the delegate functions. (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS): Init the delegate for this class. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Use the delegate. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Use the delegate function. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Ditto. (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:]): Deleted. This is renamed initWithScrollingTreeNodeDelegate and accepts a delegate. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): Deleted. Moved to ScrollingTreeScrollingNodeDelegateIOS. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollWillStart): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollDidEnd): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::currentSnapPointIndicesDidChange): Ditto. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Added. New delegate class for ScrollingTreeOverflowScrollingNodeIOS. The members used by WKOverflowScrollViewDelegate are public and the others are private. ScrollingTreeOverflowScrollingNodeIOS is a friend of ScrollingTreeScrollingNodeDelegateIOS so that it can access private members e.g. updateChildNodesAfterScroll() or m_updatingFromStateNode. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Added. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS): (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS): (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Code extracted from ScrollingTreeOverflowScrollingNodeIOS. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollDidEnd): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewWillStartPanGesture): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::currentSnapPointIndicesDidChange): Ditto. * WebKit.xcodeproj/project.pbxproj: Add ScrollingTreeScrollingNodeDelegateIOS files to the build system. 2017-09-05 Wenson Hsieh [iOS WK2] Add plumbing for WKContentView to ask the web process for additional drag items https://bugs.webkit.org/show_bug.cgi?id=176348 Work towards Reviewed by Tim Horton. Adds boilerplate plumbing to request additional items to an existing session. This implements some UI-side logic in WKContentView to send an additional drag items request and handle a response from the web process. To start, WebPageProxy::requestAdditionalItemsForDragSession is invoked by -_dragInteraction: itemsForAddingToSession:withTouchAtPoint:completion: in WKContentView, and the response from the web process is handled in -[WKContentView _didHandleAdditionalDragItemsRequest:]. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add SPI to simulate a request for additional drag items. See Tools/ChangeLog for more detail. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add an IPC message handler for the additional drag items response from the web process. * UIProcess/ios/DragDropInteractionState.h: (WebKit::DragDropInteractionState::BlockPtr for more information. (-[WKContentView dragInteraction:itemsForBeginningSession:]): Refactored to use -_itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:. (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest): (WebKit::WebPageProxy::requestAdditionalItemsForDragSession): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add an IPC message handler for the additional drag items request from the UI process. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestAdditionalItemsForDragSession): 2017-09-05 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's mouseDidMoveOverElement https://bugs.webkit.org/show_bug.cgi?id=176428 Reviewed by Tim Horton. Covered by a new API test. * UIProcess/API/APIUIClient.h: (API::UIClient::mouseDidMoveOverElement): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu): (WebKit::UIDelegate::UIClient::createNewPageCommon): (WebKit::UIDelegate::UIClient::runJavaScriptAlert): (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel): (WebKit::UIDelegate::UIClient::takeFocus): (WebKit::UIDelegate::UIClient::focus): (WebKit::UIDelegate::UIClient::unfocus): (WebKit::UIDelegate::UIClient::didExceedBackgroundResourceLimitWhileInForeground): (WebKit::UIDelegate::UIClient::didNotHandleWheelEvent): (WebKit::toNSEventModifierFlags): (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement): (WebKit::UIDelegate::UIClient::toolbarsAreVisible): (WebKit::UIDelegate::UIClient::didClickAutoFillButton): (WebKit::UIDelegate::UIClient::handleAutoplayEvent): (WebKit::requestUserMediaAuthorizationForDevices): (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): (WebKit::UIDelegate::UIClient::printFrame): (WebKit::UIDelegate::UIClient::close): (WebKit::UIDelegate::UIClient::fullscreenMayReturnToInline): (WebKit::UIDelegate::UIClient::didEnterFullscreen): (WebKit::UIDelegate::UIClient::didExitFullscreen): (WebKit::UIDelegate::UIClient::requestPointerLock): (WebKit::UIDelegate::UIClient::didLosePointerLock): (WebKit::UIDelegate::UIClient::hasVideoInPictureInPictureDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::mouseDidMoveOverElement): * UIProcess/WebPageProxy.h: 2017-09-05 Brent Fulgham Relax keychain access to permit users to permanently allow client certificates https://bugs.webkit.org/show_bug.cgi?id=175857 Reviewed by Alex Christensen. Further relax the write permissions on the user's Keychain directory to support local certificates. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2017-09-05 Youenn Fablet Cache Storage Engine should not mix different origin caches https://bugs.webkit.org/show_bug.cgi?id=176394 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::readCachesFromDisk): Initializing the salt before creating the Caches object so that its persistency path is correctly computed. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::cachesRootPath): Setting origin as partition string. 2017-09-05 Brent Fulgham Use a single network storage session for stateless connections https://bugs.webkit.org/show_bug.cgi?id=176386 Reviewed by Alex Christensen. Change the name of 'm_dataTaskMapWithoutCredentials' to 'm_dataTaskMapWithoutState' to reflect that the data tasks do not involve credential or cookie storage. Ditto for the change from 'm_sessionWIthoutCredentialStorage' to 'm_statelessSession'. This update should not change behavior, unless some stateless sessions were depending on cookies to be persistent (which would be a bug!) * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Update for new variable names. (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): Ditto. * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Update the configuration to block cookies as well. (WebKit::NetworkSessionCocoa::invalidateAndCancel): Update for new names. (WebKit::NetworkSessionCocoa::clearCredentials): Ditto. (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): Ditto. 2017-09-05 Yousuke Kimoto [WinCairo] Add Network Process files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=176069 Reviewed by Alex Christensen. * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Added. (WebKit::Download::resume): (WebKit::Download::platformDidFinish): (WebKit::Download::startNetworkLoadWithHandle): (WebKit::Download::startNetworkLoad): (WebKit::Download::platformInvalidate): * NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp: Added. (main): * NetworkProcess/curl/NetworkProcessCurl.cpp: Added. (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::NetworkProcess::platformSetURLCacheSize): (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): (WebKit::NetworkProcess::clearCacheForAllOrigins): (WebKit::NetworkProcess::clearDiskCache): (WebKit::NetworkProcess::platformTerminate): * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp: Added. (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): (WebKit::RemoteNetworkingContext::isValid const): (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::RemoteNetworkingContext::storageSession const): (WebKit::RemoteNetworkingContext::blockedError const): * NetworkProcess/win/NetworkProcessMainWin.cpp: Added. (WebKit::NetworkProcessMainWin): * NetworkProcess/win/NetworkProcessMainWin.h: Added. * NetworkProcess/win/SystemProxyWin.cpp: Added. (WindowsSystemProxy::getSystemHttpProxy): (WindowsSystemProxy::setCurlHttpProxy): (WindowsSystemProxy::parseProxyString): * NetworkProcess/win/SystemProxyWin.h: Added. * PlatformWin.cmake: 2017-09-05 Youenn Fablet Allow retrieving Cache Storage records for a given URL only https://bugs.webkit.org/show_bug.cgi?id=176202 Reviewed by Alex Christensen. Update CacheStorageEngineCache to store records as a map URL -> Vector of Records. This allows regular record retrieval to be faster. Retrieval of all records is less efficient but this should happen less often. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::retrieveRecords): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::queryCache): (WebKit::CacheStorage::Cache::retrieveRecords const): (WebKit::CacheStorage::computeKeyURL): (WebKit::CacheStorage::Cache::addNewURLRecord): (WebKit::CacheStorage::Cache::recordsFromURL): (WebKit::CacheStorage::Cache::recordsFromURL const): (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::remove): * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::retrieveRecords): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::doRetrieveRecords): * WebProcess/Cache/WebCacheStorageConnection.h: 2017-09-05 Youenn Fablet WebKitTestRunner should set the cache storage directory path https://bugs.webkit.org/show_bug.cgi?id=176373 Reviewed by Chris Dumez. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyCacheStorageDirectory): (WKContextConfigurationSetCacheStorageDirectory): * UIProcess/API/C/WKContextConfigurationRef.h: 2017-09-05 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's unavailablePluginButtonClicked https://bugs.webkit.org/show_bug.cgi?id=176274 Reviewed by Darin Adler. * UIProcess/API/APIUIClient.h: (API::UIClient::unavailablePluginButtonClicked): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setPluginsEnabled:]): (-[WKPreferences _pluginsEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::toWKPluginUnavailabilityReason): (WebKit::UIDelegate::UIClient::unavailablePluginButtonClicked): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::unavailablePluginButtonClicked): 2017-09-04 Alex Christensen Allow classes to have modern and legacy decoders to aid transition https://bugs.webkit.org/show_bug.cgi?id=176186 Reviewed by Zan Dobersek. To illustrate this, I made legacy and modern decoders to WTF::String and transitioned one String decoder. * Platform/IPC/ArgumentCoder.h: * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder::decode): * Platform/IPC/ArgumentCoders.h: * Platform/IPC/Decoder.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::decode): 2017-09-05 Frederic Wang Use TilesBacking for iframes when async frame scrolling is enabled https://bugs.webkit.org/show_bug.cgi?id=173644 Reviewed by Simon Fraser. This patch adds creation of TilesBacking for non-main frames when async frame scrolling is enabled. RenderLayerBacking::m_isMainFrameLayerWithTiledBacking is also renamed to reflect that tiled backing is not exclusive to the main frame. More adjustments might be needed for non-main frames and will be handled in follow-up commits. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Also use tiled backing when asyncFrameScrollingEnabled is true. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Ditto. 2017-09-05 Carlos Garcia Campos [GTK] Rename PLUGIN_ARCHITECTURE(X11) as PLUGIN_ARCHITECTURE(UNIX) https://bugs.webkit.org/show_bug.cgi?id=176330 Reviewed by Michael Catanzaro. It's no longer X11 specific since it's also used in Wayland when the X11 target is enabled. It should be renamed as UNIX and make it available when building the wayland target even if the X11 on is disabled. * PlatformGTK.cmake: * PlatformWPE.cmake: * PluginProcess/unix/PluginProcessMainUnix.cpp: * Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::tryLoad): * Shared/Plugins/Netscape/NetscapePluginModule.h: * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: Renamed from Source/WebKit/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp. * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::getPluginInfo): (WebKit::PluginInfoCache::updatePluginInfo): * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: (WebKit::PluginProcessProxy::scanPlugin): * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_InvalidateRect): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::initialize): (WebKit::NetscapePlugin::destroy): (WebKit::NetscapePlugin::geometryDidChange): * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp: * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.h: * config.h: 2017-09-05 Carlos Garcia Campos [GTK] Wrong use of PLUGIN_ARCHITECTURE(X11) in several places https://bugs.webkit.org/show_bug.cgi?id=176329 Reviewed by Michael Catanzaro. We are using PLUGIN_ARCHITECTURE(X11) in several places where we should actually be using PLATFORM(X11). This is confusing because PLUGIN_ARCHITECTURE(X11) is no longer specific to X11, it will be renamed as UNIX in a follow up patch. Because of this we only support plugins in Wayland when building with both X11 and Wayland targets enabled. * PluginProcess/PluginControllerProxy.cpp: * PluginProcess/PluginControllerProxy.h: * PluginProcess/unix/PluginProcessMainUnix.cpp: * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: (WebKit::NetscapePluginModule::determineQuirks): * Shared/Plugins/PluginQuirks.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/gtk/WebPageProxyGtk.cpp: * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_GetValue): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::shouldLoadSrcURL): (WebKit::NetscapePlugin::initialize): * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp: (WebKit::NetscapePlugin::platformHandleMouseEvent): * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h: * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginProxy.cpp: * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginProxy.messages.in: * WebProcess/Plugins/PluginView.cpp: * WebProcess/Plugins/PluginView.h: 2017-09-04 Wenson Hsieh [iOS DnD] Refactor drag and drop logic in WKContentView in preparation for supporting multiple drag items in a drag session https://bugs.webkit.org/show_bug.cgi?id=176264 Reviewed by Darin Adler. Move DataInteractionState from WKContentViewInteraction.h to DragDropInteractionState.h, and also rename it to DragDropInteractionState. Additionally, refactor drag and drop state in the UI process to capture metadata about the dragged element in a separate DragSourceState struct. This patch also moves drag and drop state transition logic that doesn't involve WKContentView internals out of WKContentView, and into the implementation of DragDropInteractionState. To support multiple drag items per session, we also introduce a simple mechanism to trace a UIDragItem back to the DragSourceState used to generate it. When generating a DragSourceState, we assign it a unique identifier, which we also set as the privateLocalContext of all UIDragItems generated when beginning the drag (this includes drag items returned by an internal client that uses one of the SPI hooks to augment drag items when starting a drag). This is subsequently used in the implementation of lift and cancellation preview delegate methods to supply the appropriate drag preview for each UIDragItem. Lastly, fix a bug wherein the pageX and pageY of mouse drag events are inconsistent with other synthetic mouse events, such as synthetic clicks. For synthetic clicks, the PlatformMouseEvent is initialized with the same position and globalPosition. Whether this is really intended is unclear (see http://webkit.org/b/173855), but it's a trivial change for now to keep mouse events on iOS consistent by tweaking the behavior during drag and drop. See Tools/ChangeLog for some more information. * Platform/spi/ios/UIKitSPI.h: Add -[UIDragItem privateLocalContext]. * UIProcess/ios/DragDropInteractionState.h: Added. (WebKit::DragDropInteractionState::stagedDragSource const): (WebKit::DragDropInteractionState::dropSessionDidExit): (WebKit::DragDropInteractionState::dropSessionWillPerformDrop): (WebKit::DragDropInteractionState::adjustedPositionForDragEnd const): (WebKit::DragDropInteractionState::didBeginDragging const): (WebKit::DragDropInteractionState::isPerformingDrop const): (WebKit::DragDropInteractionState::dragSession const): (WebKit::DragDropInteractionState::dropSession const): Wrap private drag/drop state member variables behind const getters, and move drag and drop logic that involves only the DragDropInteractionState into helper methods on DragDropInteractionState. (WebKit::DragDropInteractionState::BlockPtr _dragInteraction and _dataOperation => _dropInteraction. (uiImageForImage): Deleted. (shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted. (-[WKContentView dragPreviewForImage:frameInRootViewCoordinates:clippingRectsInFrameCoordinates:backgroundColor:]): Deleted. (-[WKContentView dragPreviewForCurrentDataInteractionState]): Deleted. (-[WKContentView _transitionDragPreviewToImageIfNecessary:]): Deleted. * WebKit.xcodeproj/project.pbxproj: 2017-09-03 Carlos Garcia Campos [Threaded Compositor] Deadlock in ThreadedDisplayRefreshMonitor https://bugs.webkit.org/show_bug.cgi?id=176296 Reviewed by Žan Doberšek. The main thread tries to schedule a display refresh monitor from RAF, requestDisplayRefreshMonitorUpdate() tries to take the attributes lock to update coordinateUpdateCompletionWithClient. The compositing thread has finished a frame and sceneUpdateFinished() takes the attributes lock to update clientRendersNextFrame and then asks the display refresh monitor if it requires a new callback. ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback() takes its lock to check the state, and requestDisplayRefreshMonitorUpdate() was called by ThreadedDisplayRefreshMonitor::requestRefreshCallback() with the display refresh monitor lock taken. So, the compositing thread has the attributes lock and wants the display refresh monitor one, and main thread has the display refresh monitor lock and wants the attributes one. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): Release the mutex before calling ThreadedCompositor::requestDisplayRefreshMonitorUpdate(). 2017-09-03 Zan Dobersek [GTK] Libgcrypt warning: missing initialization - please fix the application https://bugs.webkit.org/show_bug.cgi?id=171230 Reviewed by Michael Catanzaro. Replicate the libgcrypt initialization in the NetworkProcess entrypoint. This is required due to libgcrypt being used through digest operations originating from the certificate hash computation in SoupNetworkSession. The initialization is moved to the PAL library, and the initialize() function is now leveraged in both NetworkProcess and WebProcess entrypoints. * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: (main): * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): 2017-09-03 Zan Dobersek [WPE] Use the device scale factor value in WebPageCreationParameters https://bugs.webkit.org/show_bug.cgi?id=175377 Reviewed by Michael Catanzaro. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea): WebPageCreationParameters::deviceScaleFactor value should be used to set the device scale factor on the given WebPage object. This enables correctly leveraging the scale factor for the WPE port which enters accelerated mode unconditionally and as such doesn't wait for the backing store update that would provide that value otherwise. 2017-09-03 Brent Fulgham [WK2][iOS] Remove unnecessary IOHIDEventServiceFastPathUserClient access https://bugs.webkit.org/show_bug.cgi?id=175947 Reviewed by Darin Adler. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-09-03 Dan Bernstein WKContentViewInteraction.mm includes redundant declaration of UIPreviewItemController's presentationSecondaryGestureRecognizer https://bugs.webkit.org/show_bug.cgi?id=176322 Reviewed by Darin Adler. * UIProcess/ios/WKContentViewInteraction.mm: Removed the declaration, which is already made in the SDK or in UIKitSPI.h. 2017-09-03 Timothy Horton Try to fix the iOS build * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (-[WKRemoteView initWithFrame:contextID:]): 2017-09-03 Tim Horton Fix some style issues in the Remote Layer Tree code https://bugs.webkit.org/show_bug.cgi?id=176298 Reviewed by Dan Bernstein. In bugs 176273 and 176297, the style bot noticed some existing style issues in the UI-side compositing code. Fix them, because there aren't many and they're straightforward. * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h: * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: 2017-09-03 Yusuke Suzuki String#utf8() allocates new CString https://bugs.webkit.org/show_bug.cgi?id=176302 Reviewed by Sam Weinig. * NetworkProcess/webrtc/NetworkRTCSocket.cpp: (WebKit::NetworkRTCSocket::sendTo): 2017-09-03 Tim Horton Move shared part of the Remote Layer Tree code out of a Mac-specific directory https://bugs.webkit.org/show_bug.cgi?id=176297 Reviewed by Dan Bernstein. UI-side compositing works on all Cocoa platforms, so the code should not live inside Mac/. Also merge the Scrolling directory in here, since those files are very related. * PlatformMac.cmake: * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: Renamed from Shared/mac/RemoteLayerBackingStore.h. * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: Renamed from Shared/mac/RemoteLayerBackingStore.mm. * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h: Renamed from Shared/mac/RemoteLayerBackingStoreCollection.h. * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm: Renamed from Shared/mac/RemoteLayerBackingStoreCollection.mm. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: Renamed from Shared/mac/RemoteLayerTreePropertyApplier.h. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: Renamed from Shared/mac/RemoteLayerTreePropertyApplier.mm. * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: Renamed from Shared/mac/RemoteLayerTreeTransaction.h. * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: Renamed from Shared/mac/RemoteLayerTreeTransaction.mm. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Renamed from Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h: Renamed from Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h. * WebKit.xcodeproj/project.pbxproj: 2017-09-03 Sam Weinig Remove CanvasProxy https://bugs.webkit.org/show_bug.cgi?id=176288 Reviewed by Yusuke Suzuki. CanvasProxy does not appear to be in any current HTML spec and was disabled and unimplemented in our tree. Time to get rid of it. * Configurations/FeatureDefines.xcconfig: 2017-09-02 Andy Estes [CA] Upstream QuartzCore-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176270 Reviewed by Tim Horton. * Platform/mac/LayerHostingContext.mm: (WebKit::LayerHostingContext::createForPort): (WebKit::LayerHostingContext::createForExternalHostingProcess): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::enterAcceleratedCompositingMode): (WebKit::PageClientImpl::updateAcceleratedCompositingMode): * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::createLayer): * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm: (WebKit::makeRenderLayer): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-02 Tim Horton Move UI Process part of the Remote Layer Tree code out of a Mac-specific directory https://bugs.webkit.org/show_bug.cgi?id=176273 Reviewed by Dan Bernstein. UI-side compositing works on all Cocoa platforms, so the code should not live inside Mac/. Also merge the Scrolling directory in here, since those files are very related. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: Renamed from SourceebKit/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: Renamed from UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.messages.in. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: Renamed from UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm. * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: Renamed from UIProcess/mac/RemoteLayerTreeHost.h. * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: Renamed from UIProcess/mac/RemoteLayerTreeHost.mm. * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h: Renamed from UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.h. * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm: Renamed from UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm. * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Renamed from UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp. * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Renamed from UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h. * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Renamed from UIProcess/Scrolling/RemoteScrollingTree.cpp. * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: Renamed from UIProcess/Scrolling/RemoteScrollingTree.h. * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: Renamed from UIProcess/ios/RemoteLayerTreeHostIOS.mm. * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Renamed from UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm. * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Renamed from UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h. * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Renamed from UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm. * WebKit.xcodeproj/project.pbxproj: 2017-09-02 Joseph Pecoraro Web Automation: -[_WKAutomationSession init] leaks https://bugs.webkit.org/show_bug.cgi?id=176268 Reviewed by Darin Adler. * UIProcess/API/Cocoa/_WKAutomationSession.mm: (-[_WKAutomationSession init]): 2017-09-02 Tim Horton Fix some style issues in the Web Process part of the Remote Layer Tree code https://bugs.webkit.org/show_bug.cgi?id=176272 Reviewed by Dan Bernstein. In bug 176271, the style bot noticed some existing style issues in the UI-side compositing code. Fix them, because there aren't many and they're straightforward. * WebProcess/WebPage/Cocoa/RemoteLayerTree/GraphicsLayerCARemote.cpp: * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCAAnimationRemote.h: * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::setValues): * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::appendSublayer): (WebKit::PlatformCALayerRemote::insertSublayer): (WebKit::PlatformCALayerRemote::replaceSublayer): * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemote.h: * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::clone const): * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.h: * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteLayerTreeContext.h: * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteScrollingCoordinator.h: * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteScrollingCoordinator.mm: 2017-09-02 Tim Horton Move Web Process part of the Remote Layer Tree code out of a Mac-specific directory https://bugs.webkit.org/show_bug.cgi?id=176271 Rubber-stamped by Dan Bernstein. UI-side compositing works on all Cocoa platforms, so the code should not live inside Mac/. Also merge the Scrolling directory in here, since those files are very related. * WebKit.xcodeproj/project.pbxproj: * DerivedSources.make: * PlatformMac.cmake: * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp: Renamed from WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp. * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h: Renamed from WebProcess/WebPage/mac/GraphicsLayerCARemote.h. * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h: Renamed from WebProcess/WebPage/mac/PlatformCAAnimationRemote.h. * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: Renamed from WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemote.cpp. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemote.h. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeContext.h. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeContext.mm. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: Renamed from WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: Renamed from WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm. * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.h. * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.messages.in: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in. * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.mm. 2017-09-02 Carlos Garcia Campos [GTK][Wayland] Use fast malloc to allocate backing store cairo surfaces data https://bugs.webkit.org/show_bug.cgi?id=176226 Reviewed by Michael Catanzaro. Do not create the cairo surface for BackingStoreBackendCairoImpl. When not using X11 we are going to use an image surface anyway, so we don't really need to use the create similar. This way we only need to pass the size and device scale factor to BackingStoreBackendCairoImpl that will create the image surface using fast malloc to allocate the data. * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::BackingStore::createBackend): 2017-09-02 Carlos Garcia Campos [GTK][Wayland] Opening FedoraProject's pastebin chews CPU https://bugs.webkit.org/show_bug.cgi?id=175942 Reviewed by Žan Doberšek. This regressed when we introduced the display refresh monitor. The monitor schedules updates immediately, because we removed the option to not do frame sync in X11 to let swapBuffers do the throttling, but that's not happening in Wayland because the nested compositor is dispatching frame callbacks on surface commit. We need to ensure that frame callbacks are dispatched on every monitor refresh, because swapBuffers waits for frame callbacks to be queued on display. * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::Surface::~Surface): Destroy pending frame callbacks too. (WebKit::WaylandCompositor::Surface::setWebPage): Add a tick callback to the web view widget to flush all committed frame callbacks on every frame update. (WebKit::WaylandCompositor::Surface::requestFrame): Add the callbacks to m_pendingFrameCallbackList. (WebKit::WaylandCompositor::Surface::flushFrameCallbacks): Dispatch all committed frame callabcks. (WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks): Dispatch all pending frame callbacks. (WebKit::WaylandCompositor::Surface::commit): Do not dispatch frame callbacks here, move them to the list of committed frame callbacks that will be dispatched on the next frame clock update. * UIProcess/gtk/WaylandCompositor.h: (WebKit::WaylandCompositor::Surface::setWebPage): Moved to the cpp. * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp: (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): Move surface initialization and destruction to the compositing thread. (WebKit::AcceleratedSurfaceWayland::initialize): (WebKit::AcceleratedSurfaceWayland::finalize): (WebKit::AcceleratedSurfaceWayland::~AcceleratedSurfaceWayland): Deleted. * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h: 2017-09-01 Youenn Fablet Do not Reject CacheStorage promises when updating the persistent filesystem data fails https://bugs.webkit.org/show_bug.cgi?id=176241 Reviewed by Alex Christensen. Open/Remove caches may succeed in the memory representation but the write-to-disk operation may fail. In that case, the callback does not return an error but a value containing the cache identifier. The value will also contain a boolean flag set to true to notify the client that persistent storage failed this time. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): * NetworkProcess/cache/CacheStorageEngineCaches.h: 2017-09-01 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's toolbarsAreVisible https://bugs.webkit.org/show_bug.cgi?id=176246 Reviewed by Tim Horton. * UIProcess/API/APIUIClient.h: (API::UIClient::toolbarsAreVisible): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::toolbarsAreVisible): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::getToolbarsAreVisible): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: 2017-09-01 Alex Christensen Make PageClientImplCocoa a proper superclass of PageClientImpls for Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=176239 Reviewed by Tim Horton. * UIProcess/Cocoa/PageClientImplCocoa.h: Added. (WebKit::PageClientImplCocoa::PageClientImplCocoa): * UIProcess/Cocoa/PageClientImplCocoa.mm: (WebKit::PageClientImplCocoa::isPlayingAudioWillChange): (WebKit::PageClientImplCocoa::isPlayingAudioDidChange): (WebKit::PageClientImpl::isPlayingAudioWillChange): Deleted. (WebKit::PageClientImpl::isPlayingAudioDidChange): Deleted. * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::PageClientImpl): * UIProcess/mac/PageClientImpl.h: Removed. * UIProcess/mac/PageClientImpl.mm: Removed. * UIProcess/mac/PageClientImplMac.h: Copied from Source/WebKit/UIProcess/mac/PageClientImpl.h. * UIProcess/mac/PageClientImplMac.mm: Copied from Source/WebKit/UIProcess/mac/PageClientImpl.mm. (WebKit::PageClientImpl::PageClientImpl): * UIProcess/mac/WebContextMenuProxyMac.mm: * UIProcess/mac/WebPageProxyMac.mm: * UIProcess/mac/WebPopupMenuProxyMac.mm: * WebKit.xcodeproj/project.pbxproj: 2017-09-01 Alex Christensen Replace WKUIDelegatePrivate's isPlayingMediaDidChange with KVO _isPlayingAudio on WKWebView https://bugs.webkit.org/show_bug.cgi?id=176212 Reviewed by Tim Horton. Dan suggested this in bug 176203, I think it's a good idea, and I'll need to add more KVO properties soon anyways so I'd better learn how. Determining if audio playing changed is important for Safari, so WKPageUIClient's isPlayingAudioDidChange was correctly named but incorrectly fired if either audio or video playing changed and had you check if audio was playing, possibly too often. * UIProcess/API/APIUIClient.h: (API::UIClient::isPlayingMediaDidChange): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isPlayingAudio]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::isPlayingMediaDidChange): Deleted. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::isPlayingAudioWillChange): (WebKit::WebViewImpl::isPlayingAudioDidChange): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::isPlayingAudioDidChange): (WebKit::PageClientImpl::isPlayingAudioWillChange): 2017-09-01 Alex Christensen Disable ObjC WebGL policy SPI on iOS https://bugs.webkit.org/show_bug.cgi?id=176233 Reviewed by Tim Horton. In r221465 I uploaded new SPI that is only needed on Mac with a beautiful test that only works on Mac. Since it fails on iOS and is not needed on iOS, let's just disable it on iOS. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): 2017-09-01 Andy Estes [CG] Upstream CoreGraphics-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176200 Reviewed by Tim Horton. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializeProcess): * UIProcess/mac/WindowServerConnection.h: * UIProcess/mac/WindowServerConnection.mm: (WebKit::registerOcclusionNotificationHandler): (WebKit::WindowServerConnection::WindowServerConnection): (WebKit::WindowServerConnection::applicationWindowModificationsStarted): Deleted. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-01 Per Arne Vollan [Win] Compile error, 'Cache' is not declared. https://bugs.webkit.org/show_bug.cgi?id=176062 Reviewed by Youenn Fablet. Rename DOMCache to DOMCacheEngine. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::queryCache): (WebKit::CacheStorage::Engine::writeFile): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): * NetworkProcess/cache/CacheStorageEngineCaches.h: * NetworkProcess/cache/CacheStorageEngineConnection.cpp: * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * WebProcess/Cache/WebCacheStorageConnection.cpp: * WebProcess/Cache/WebCacheStorageConnection.h: * WebProcess/Cache/WebCacheStorageConnection.messages.in: 2017-08-31 Andy Estes [Mac] Upstream AppKit-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176175 Reviewed by Brady Eidson. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::initializeCocoaOverrides): * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): * UIProcess/mac/WKTextInputWindowController.mm: (-[WKTextInputPanel init]): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-08-31 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's isPlayingAudioDidChange https://bugs.webkit.org/show_bug.cgi?id=176203 Reviewed by Tim Horton. * UIProcess/API/APIUIClient.h: (API::UIClient::isPlayingMediaDidChange): (API::UIClient::isPlayingAudioDidChange): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::isPlayingMediaDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): 2017-08-31 Alex Christensen Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy https://bugs.webkit.org/show_bug.cgi?id=175779 Reviewed by Tim Horton. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::webGLLoadPolicy const): (API::NavigationClient::resolveWebGLLoadPolicy const): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::toWebCoreWebGLLoadPolicy): (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const): (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::webGLPolicyForURL): (WebKit::WebPageProxy::resolveWebGLPolicyForURL): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::webGLPolicyForURL const): (WebKit::WebFrameLoaderClient::resolveWebGLPolicyForURL const): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::webGLPolicyForURL): (WebKit::WebPage::resolveWebGLPolicyForURL): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::webGLPolicyForURL): (WebKit::WebPage::resolveWebGLPolicyForURL): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::webGLPolicyForURL): (WebKit::WebPage::resolveWebGLPolicyForURL): 2017-08-31 Brady Eidson Add (entirely incorrect) fetching of ServiceWorker scripts. https://bugs.webkit.org/show_bug.cgi?id=176179 Reviewed by Andy Estes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::finishFetchingScriptInServer): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-08-31 Megan Gardner Fix error in protocol revving https://bugs.webkit.org/show_bug.cgi?id=176191 Protocol definition was mastered out of later iOS submissions, causing them to not build. Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]): 2017-08-31 Youenn Fablet Update CacheStorage caches only if it is updated https://bugs.webkit.org/show_bug.cgi?id=176135 Reviewed by Alex Christensen. For each change to CacheStorageEngineCaches list of cache, CacheStorageEngineCaches increments a counter. When sending the list of caches, CacheStorageEngineCaches will compare its counter with the one provided. If they sare the same, CacheStorageEngineCaches will return nothing. Otherwise it returns the whole list of caches. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::retrieveCaches): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::Caches::clearMemoryRepresentation): (WebKit::CacheStorage::Caches::cacheInfos const): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::updateCounter const): * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::caches): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::doRetrieveCaches): * WebProcess/Cache/WebCacheStorageConnection.h: 2017-08-31 Youenn Fablet Introduce CacheStorageEngineCache to handle cache records https://bugs.webkit.org/show_bug.cgi?id=176137 Reviewed by Alex Christensen. CacheStorageEngineCache is the equivalent of WebCore Cache. It contains a list of records that it needs to manage (add, update, remove). Moving the logic of this management from CacheStorageEngine to this new class so as to ease future development. * CMakeLists.txt: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::retrieveRecords): (WebKit::CacheStorage::Engine::putRecords): (WebKit::CacheStorage::Engine::deleteMatchingRecords): (WebKit::CacheStorage::Engine::cache): (WebKit::CacheStorage::Engine::writeCacheRecords): Deleted. (WebKit::CacheStorage::Engine::removeCacheRecords): Deleted. (WebKit::CacheStorage::Engine::queryCache): Deleted. * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: Added. * NetworkProcess/cache/CacheStorageEngineCache.h: (WebKit::CacheStorage::Cache::identifier const): (WebKit::CacheStorage::Cache::name const): (WebKit::CacheStorage::Cache::info const): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::find): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::encodeCacheNames): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::cacheInfos const): * WebKit.xcodeproj/project.pbxproj: 2017-08-31 David Quesada WKNavigationDelegatePrivate client redirect SPI needs to be able to detect redirects scheduled before the document finishes loading https://bugs.webkit.org/show_bug.cgi?id=176128 rdar://problem/34068476 Reviewed by Brady Eidson. _webView:didPerformClientRedirect: isn't useful for delegates that want to know about client redirects started before the document is finished loading. This is because the method would be called after the navigation scheduler's timer fires and the navigation for the redirect has begun. Since this happens in a later iteration of the run loop, the document has already finished loading. Address this by replacing the method with two that give the navigation delegate more information about when client redirects are scheduled and canceled. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::willPerformClientRedirect): (API::NavigationClient::didCancelClientRedirect): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::willPerformClientRedirect): (WebKit::NavigationState::NavigationClient::didCancelClientRedirect): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willPerformClientRedirectForFrame): (WebKit::WebPageProxy::didCancelClientRedirectForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-08-30 Megan Gardner Remove IsBlockSelection flag https://bugs.webkit.org/show_bug.cgi?id=176141 Reviewed by Dean Jackson. Block selection is disabled. Removed code associated with this flag to allow removal of the flag in UIKit. No tests for a removed feature. * Platform/spi/ios/UIKitSPI.h: * Shared/ios/GestureTypes.h: * UIProcess/ios/WKContentViewInteraction.mm: (toUIWKSelectionFlags): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::selectWithGesture): (WebKit::WebPage::contractedRangeFromHandle): (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): (WebKit::WebPage::updateBlockSelectionWithTouch): (WebKit::WebPage::updateSelectionWithTouches): 2017-08-30 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's didClickAutoFillButton https://bugs.webkit.org/show_bug.cgi?id=176139 Reviewed by Tim Horton. Covered by a cool new API test! * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didClickAutoFillButton): 2017-08-31 Chris Dumez Use WTF::crossThreadCopy() in more places https://bugs.webkit.org/show_bug.cgi?id=176169 Reviewed by Andreas Kling. Use WTF::crossThreadCopy() in more places to make code more concise. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): 2017-08-31 Youenn Fablet Take into account removed caches in Caches::remove assertion https://bugs.webkit.org/show_bug.cgi?id=176164 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::remove): 2017-08-31 Youenn Fablet Do not create a salt if the CacheStorage engine should not persist https://bugs.webkit.org/show_bug.cgi?id=176138 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::~Engine): Ensuring that Caches will not try using the engine if it goes away. (WebKit::CacheStorage::Engine::initialize): Removing making a salt if engine data is not persistent. * NetworkProcess/cache/CacheStorageEngine.h: Check persistency according the root path. If it is null, caches should not try to do persistency. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::cachesRootPath): (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::detach): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::writeCachesToDisk): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::shouldPersist const): * NetworkProcess/cache/NetworkCacheData.cpp: Making makeSalt private again. (WebKit::NetworkCache::makeSalt): * NetworkProcess/cache/NetworkCacheData.h: 2017-08-31 Carlos Garcia Campos [GTK] Several InputMethodFilter tests are failing and crashing https://bugs.webkit.org/show_bug.cgi?id=176158 Reviewed by Carlos Alberto Lopez Perez. * UIProcess/gtk/InputMethodFilter.cpp: (WebKit::InputMethodFilter::confirmCurrentComposition): Return early in testing mode because the page is not available. (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting): Use hexadecimal numbers for logging key codes. 2017-08-31 Carlos Garcia Campos [GTK][Wayland] Crash when gdk_keymap_get_entries_for_keyval returns TRUE but n_keys=0 https://bugs.webkit.org/show_bug.cgi?id=176154 Reviewed by Carlos Alberto Lopez Perez. In Wayland gdk_keymap_get_entries_for_keyval() can return TRUE with n_keys=0. We have several places in WebKit where we just check the return value of gdk_keymap_get_entries_for_keyval() and then use the returned array to get the first position assuming it has at least one item. This has always worked in X11 because the GDK X11 backend does the right thing, but it's crashing in Wayland now. It should be fixed in GTK+ but in the meantime it's easy to workaround by also checking n_keys > 0. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: (WebKit::doKeyStrokeEvent): 2017-08-30 Dan Bernstein [iOS] REGRESSION (r218144) -[WKContentView targetForAction:withSender:] returns the content view for actions implemented only by the WKWebView, causing a crash https://bugs.webkit.org/show_bug.cgi?id=176077 Reviewed by Sam Weinig. Test: TestWebKitAPI/Tests/WebKitCocoa/WKContentViewTargetForAction.mm * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView targetForAction:withSender:]): Override and forward WKContentView actions to -[WKContentView targetForActionForWebView:withSender:]. * UIProcess/ios/WKContentViewInteraction.h: Declare -targetForActionForWebView:withSender:. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView targetForAction:withSender:]): Forward to the WKWebView. (-[WKContentView targetForActionForWebView:withSender:]): Call super’s -targetForAction:withSender:. 2017-08-30 Brent Fulgham Fix whitespace and formatting https://bugs.webkit.org/show_bug.cgi?id=176134 Reviewed by Sam Weinig. Bring the file formatting into compliance with WebKit Coding Style. * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]): (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]): (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]): (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]): (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]): (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]): (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]): (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]): (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]): (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]): 2017-08-30 Youenn Fablet Remove the list of removed caches from CacheStorageEngine https://bugs.webkit.org/show_bug.cgi?id=176136 Reviewed by Alex Christensen. This list is no longer useful as CacheStorageEngineCaches handles its own removed caches. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::cache): * NetworkProcess/cache/CacheStorageEngine.h: 2017-08-30 Tim Horton REGRESSION (r221068): Graphics corruption when dragging images on iOS https://bugs.webkit.org/show_bug.cgi?id=176132 Reviewed by Dean Jackson. * Shared/mac/ColorSpaceData.mm: (WebKit::ColorSpaceData::encode): Color space encoding was entirely disabled on iOS, so after r221068, ShareableBitmap would make different decisions about image format on both sides of the wire. Enable color space encoding on iOS (decoding is already implemented) by moving some ifdefs around. 2017-08-30 Youenn Fablet [Cache API] Support cache names persistency https://bugs.webkit.org/show_bug.cgi?id=175995 Reviewed by Alex Christensen. Adding disk read/write capacities to CacheStorage engine. This is used to store per-origin cache names in a file. Making Engine a thread safe refcounted object so that it does read/write in a background thread. Introducing CacheStorage::Caches as the object managing the list of Cache objects for a given origin. Caches will be responsible to do all the read/write operations for all of its caches. It will be responsible for quota limitation as well. Moving part of the logic from CacheStorage::Engine into CacheStorage::Caches. CacheStorage::Engine is initialized asynchronously as it first creates a salt which is used to obfuscate the names of the various files stored on disk. In the same spirit, CacheStorage::Caches is initialized asynchronously as it needs to read from the disk the list of cache names. Once read, the names will be stored in memory. Added the possibility to clear this in-memory representation. This will be useful for testing. This might also be useful to save memory when there is no more use of CacheStorage by web pages. Introducing a new cacheStorageSubdirectoryName parameter for WebsiteDataStore so as to segment the different per session CacheStorageEngine in direct sub folders of the main cacheStorageDirectory folder. * CMakeLists.txt: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::retrieveCaches): (WebKit::CacheStorage::Engine::retrieveRecords): (WebKit::CacheStorage::Engine::initialize): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::cache): (WebKit::CacheStorage::Engine::writeFile): Making use of default parameter to directly return to the main loop. (WebKit::CacheStorage::Engine::readFile): Ditto. (WebKit::CacheStorage::Engine::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngine.h: (WebKit::CacheStorage::Engine::rootPath const): (WebKit::CacheStorage::Engine::salt const): (WebKit::CacheStorage::Engine::nextCacheIdentifier): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: Added. (WebKit::CacheStorage::cachesRootPath): (WebKit::CacheStorage::cachesListFilename): (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::find): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::encodeCacheNames): (WebKit::CacheStorage::decodeCachesNames): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::writeCachesToDisk): (WebKit::CacheStorage::Caches::clearMemoryRepresentation): (WebKit::CacheStorage::Caches::cacheInfos const): * NetworkProcess/cache/CacheStorageEngineCaches.h: Added. (WebKit::CacheStorage::Caches::create): (WebKit::CacheStorage::Caches::isInitialized const): (WebKit::CacheStorage::Caches::detach): * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::makeSalt): * NetworkProcess/cache/NetworkCacheData.h: * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::clearMemoryRepresentation): * WebProcess/Cache/WebCacheStorageConnection.h: 2017-08-30 Brady Eidson Add "Identified" base class to replace a whole bunch of custom identifier generators. https://bugs.webkit.org/show_bug.cgi?id=176120 Reviewed by Alex Christensen. * UIProcess/API/APIUserScript.cpp: (API::UserScript::UserScript): (API::generateIdentifier): Deleted. * UIProcess/API/APIUserScript.h: * UIProcess/API/APIUserStyleSheet.cpp: (API::UserStyleSheet::UserStyleSheet): (API::generateIdentifier): Deleted. * UIProcess/API/APIUserStyleSheet.h: * UIProcess/UserContent/WebScriptMessageHandler.cpp: (WebKit::WebScriptMessageHandler::WebScriptMessageHandler): (WebKit::generateIdentifier): Deleted. * UIProcess/UserContent/WebScriptMessageHandler.h: (WebKit::WebScriptMessageHandler::identifier const): Deleted. * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy): (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy): (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::removeProcess): (WebKit::WebUserContentControllerProxy::addUserContentWorldUse): (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses): (WebKit::WebUserContentControllerProxy::addUserScript): (WebKit::WebUserContentControllerProxy::removeUserScript): (WebKit::WebUserContentControllerProxy::removeAllUserScripts): (WebKit::WebUserContentControllerProxy::addUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets): (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler): (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName): (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers): (WebKit::WebUserContentControllerProxy::addContentRuleList): (WebKit::WebUserContentControllerProxy::removeContentRuleList): (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists): (WebKit::generateIdentifier): Deleted. * UIProcess/UserContent/WebUserContentControllerProxy.h: (WebKit::WebUserContentControllerProxy::identifier const): Deleted. * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::~VisitedLinkStore): (WebKit::VisitedLinkStore::VisitedLinkStore): (WebKit::VisitedLinkStore::addProcess): (WebKit::VisitedLinkStore::removeProcess): (WebKit::VisitedLinkStore::removeAll): (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired): (WebKit::VisitedLinkStore::sendTable): (WebKit::generateIdentifier): Deleted. * UIProcess/VisitedLinkStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::generateIdentifier): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::identifier const): Deleted. * WebProcess/Network/WebSocketStream.cpp: (WebKit::WebSocketStream::WebSocketStream): (WebKit::WebSocketStream::~WebSocketStream): (WebKit::WebSocketStream::messageSenderDestinationID): * WebProcess/Network/WebSocketStream.h: 2017-08-30 Brady Eidson Implement all of "Register" right up until where the script is fetched. https://bugs.webkit.org/show_bug.cgi?id=176082 Reviewed by Andy Estes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::resolveJobInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-08-30 Andy Estes [Mac] Upstream Accessibility-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176093 Reviewed by Eric Carlson. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setAccessibilityWebProcessToken): (WebKit::WebViewImpl::updateRemoteAccessibilityRegistration): (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformInitialize): (WebKit::WebPage::registerUIProcessAccessibilityTokens): 2017-08-30 Carlos Alberto Lopez Perez [WPE] Enable MEMORY_SAMPLER https://bugs.webkit.org/show_bug.cgi?id=176099 Reviewed by Michael Catanzaro. Enable it at runtime if the environment variable WEBKIT_SAMPLE_MEMORY is set. * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_compositingManagerProxy): 2017-08-30 Andy Estes [Mac] Upstream Carbon-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176087 Reviewed by Alex Christensen. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::cgWindowID): * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: (WebKit::scriptCodeFromCurrentKeyboardInputSource): (WebKit::NetscapePlugin::sendComplexTextInput): 2017-08-30 Carlos Garcia Campos Unreviewed. Try to fix layout test timing out after r221344. There seems to be an infinite loop in the web process when WebPage::platformEditorState is called with non content editable result. * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformEditorState const): 2017-08-29 Carlos Garcia Campos REGRESSION(r221064): [GTK] Editor not correctly working after r221064 https://bugs.webkit.org/show_bug.cgi?id=176052 Reviewed by Michael Catanzaro. Since r221064 we are not always notified about typing attributes when editor state changes. didChangeSelection no longer includes the typing attributes in EditorStateChange message, it's scheduled to be sent after the compositing layer have been flushed, but that part is not implemented for GTK+ port. Fixes test /webkit2/WebKitWebView/editor-state/typing-attributes. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::updateBackingStoreState): Call WebPage::flushPendingEditorStateUpdate() after the layout. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): Call WebPage::flushPendingEditorStateUpdate() after the display sync. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::display): Call WebPage::flushPendingEditorStateUpdate() after the layout. * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformEditorState const): Also return early, setting isMissingPostLayoutData to true, when there's no frame view, the view needs a layout or the result is not for editable content. 2017-08-29 Brent Fulgham ResourceLoadStatistics logic does not understand custom WebsiteData stores https://bugs.webkit.org/show_bug.cgi?id=176037 Reviewed by Alex Christensen. The NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains always notifies the default website data store about observations it has made. This should be revised so that WebKit clients that register custom data stores through the WKWebsiteDataStores API can be assured that observations made in one session do not manipulate data from another session. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Use the passed sessionID to locate the correct NetworkStorageSession to notify about the new partitioning data. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: Accept new argument. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Include the WebsiteDataStore's session ID in the message to update cookie partition data. 2017-08-29 Alex Christensen Automatically determine if a class has a modern decoder https://bugs.webkit.org/show_bug.cgi?id=176084 Reviewed by Sam Weinig. Instead of determining if ModernDecoder is defined in the class, just check the signature of the decode member function. * Platform/IPC/ArgumentCoder.h: (): Deleted. * Shared/WebPageCreationParameters.h: * Shared/WebPageGroupData.h: * Shared/WebsitePolicies.h: 2017-08-29 Alex Christensen Begin transition to modern IPC decoding https://bugs.webkit.org/show_bug.cgi?id=176043 Reviewed by JF Bastien. Right now, if a class is decoded from IPC we must have a default constructor. This prevents us from having Ref or C++ references in such types, which is cluttering up our code. This is because IPC::decode makes a default-constructed object, fills it, and returns a bool indicating success. Making IPC::decode instead return a std::optional makes it so we do not need to call an empty constructor. This could also enable us to add IPC::Decoder::operator>> and other fun things! I also modernized two arbitrary classes, WebsitePolicies and WebPageGroupData with more to come. There's no good way to update the actual generated IPC code until each class has been transitioned. * Platform/IPC/ArgumentCoder.h: (IPC::ArgumentCoder::decode): * Platform/IPC/Decoder.h: (IPC::Decoder::decode): * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * Shared/WebPageGroupData.cpp: (WebKit::WebPageGroupData::decode): * Shared/WebPageGroupData.h: * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::decode): 2017-08-29 Youenn Fablet Setting the cache storage engine root path according the session WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=176055 Reviewed by Alex Christensen. Adding disk read/write capacities to CacheStorage engine. This is used to store per-origin cache names in a file. Making Engine a thread safe refcounted object so that it does read/write in a background thread. Setting the root path of the engine to the directory set for the session in use according the WebsiteDataStore. For each WebsiteDataStore, a path and a sandbox extension is passed to the network process if persistency of the cache storage is wanted. Ephemeral sessions will set the path of the engine to null so that no read/write access is performed. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::cacheStorageDirectory const): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::from): (WebKit::CacheStorage::Engine::defaultEngine): (WebKit::CacheStorage::Engine::Engine): (WebKit::CacheStorage::Engine::writeFile): * NetworkProcess/cache/CacheStorageEngine.h: (WebKit::CacheStorage::Engine::create): (WebKit::CacheStorage::Engine::shouldPersist const): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2017-08-29 Chris Dumez Add initial support for dataTransferItem.webkitGetAsEntry() https://bugs.webkit.org/show_bug.cgi?id=176038 Reviewed by Wenson Hsieh. Make dataTransfer.items an experimental feature so that it can be easily turned on from the Develop menu, for testing convenience. * Shared/WebPreferencesDefinitions.h: 2017-08-29 Andy Estes [Mac] Upstream WKSetMetadataURL() from WebKitSystemInterface https://bugs.webkit.org/show_bug.cgi?id=176046 Reviewed by Alex Christensen. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-08-28 Andy Estes [Cocoa] Upstream WKGetWebDefaultCFStringEncoding() https://bugs.webkit.org/show_bug.cgi?id=176039 Reviewed by Alex Christensen. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-08-28 Megan Gardner Fix incorrect enum in atBoundaryOfGranularity call https://bugs.webkit.org/show_bug.cgi?id=176004 Reviewed by Wenson Hsieh and Enrica Casucci Enum that was being used was incorrect, as that case in not covered in called function. Resulted in a no-op. Should now have correct behavior around line boundaries. Not possible to add tests for selections with velocity. Will attempt to add this behavior later. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::rangeAtWordBoundaryForPosition): 2017-08-28 Stephan Szabo [WinCairo] Add PlatformWin cmake for Webkit https://bugs.webkit.org/show_bug.cgi?id=176027 Reviewed by Brent Fulgham. * PlatformWin.cmake: Added. 2017-08-28 Andy Estes [Cocoa] Upstream CFNetwork-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176032 Reviewed by Alex Christensen. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::privateBrowsingSession): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformHasLocalDataForURL): (WebKit::cachedResponseForURL): 2017-08-28 Brent Fulgham Disable access to secure cookies if an HTTPS site loads mixed content (Part 2: Header Requests) https://bugs.webkit.org/show_bug.cgi?id=175992 Reviewed by Daniel Bates. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Use a better label than 'result'. (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): Modify to accept a flag indicating if secure cookies should be included, and return a pair containing the resulting cookie string and a boolean indicating if secure cookies were accessed. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Ditto. * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): Ditto. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Ditto. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-08-28 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's didExceedBackgroundResourceLimitWhileInForeground https://bugs.webkit.org/show_bug.cgi?id=176028 Reviewed by Andy Estes. An API test for this did not succeed with either the memory or CPU limit calls, possibly because the app must be in the foreground for this call to be made. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::toWKResourceLimit): (WebKit::UIDelegate::UIClient::didExceedBackgroundResourceLimitWhileInForeground): 2017-08-28 Carlos Garcia Campos WebDriver: implement screen capture commands https://bugs.webkit.org/show_bug.cgi?id=174615 Reviewed by Brian Burg. Extend takeScreenshot command to optionally take a screenshot of an element. When no element is provided, the screenshot is taken from the page visible area. * PlatformGTK.cmake: Add WebAutomationSessionCairo.cpp to compilation. * PlatformWPE.cmake: Ditto. * UIProcess/Automation/Automation.json: Add ScreenshotError and several optional parameters to takeScreenshot. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::takeScreenshot): Receive optional frame, node and scrollIntoView that are checked and passed to the web process. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp: Added. (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): Cairo implementation. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::snapshotRectForScreenshot): Helper to get the rectangle to be used for a screenshot. (WebKit::WebAutomationSessionProxy::takeScreenshot): If a node handle is provided take the snapshot using the element rectangle, otherwise use the page visible content rectangle. * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Update TakeSnapshot message. 2017-08-28 Carlos Garcia Campos Automation: takeScreenshot should use the visible content rect not the document rect https://bugs.webkit.org/show_bug.cgi?id=175665 Reviewed by Brian Burg. According to the spec, we should get the toplevel browsing context document rectangle and take a screenshot of it using the current viewport width and height. We are currently using the document size. 19. Screen Capture. https://w3c.github.io/webdriver/webdriver-spec.html#dfn-draw-a-bounding-box-from-the-framebuffer * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::takeScreenshot): Use FrameView::visibleContentRect(). 2017-08-28 Carlos Garcia Campos [GTK][WPE] ASSERTION FAILED: !isOpen() in WebKit::IconDatabase::~IconDatabase() https://bugs.webkit.org/show_bug.cgi?id=175719 Reviewed by Michael Catanzaro. This is happening always when running /webkit2/WebKitFaviconDatabase/favicon-database-test in debug builds. The last step we do is removing all icons, then the test finishes, which destroys the WebKitFaviconDatabase object that closes the icon database on dispose. The problem is that removing all icons schedules a main thread notification and IconDatabase is not considered closed until all main thread callbacks have been dispatched. This is never going to happen in the test, because the main loop is no longer running at that point. I don't think it's worth it to consider the database open while main thread callbacks are pending, they are just notifications and the client is no longer insterested on them afer closing the database. I think it's bettter and simpler to simply cancel the pending callbacks on database close. That ensures that isOpen() after close() is always false. This patch adds a helper private class to schedule notifications to the main thread that can be cancelled on database close. It also removes the didClose() notification because it was unused and because it's pointless now that we know the database is closed after close(). * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::open): Mark the main thread notifier as active. (WebKit::IconDatabase::close): Mark the main thread notifier as not active. (WebKit::IconDatabase::IconDatabase): Remove m_mainThreadCallbackCount initialization. (WebKit::IconDatabase::isOpen const): Do what isOpenBesidesMainThreadCallbacks() used to do. (WebKit::IconDatabase::removeAllIconsOnThread): Remove the notification because it's currently unused. (WebKit::IconDatabase::dispatchDidImportIconURLForPageURLOnMainThread): Use MainThreadNotifier. (WebKit::IconDatabase::dispatchDidImportIconDataForPageURLOnMainThread): Ditto. (WebKit::IconDatabase::dispatchDidFinishURLImportOnMainThread): Ditto. (WebKit::IconDatabase::isOpenBesidesMainThreadCallbacks const): Deleted. (WebKit::IconDatabase::checkClosedAfterMainThreadCallback): Deleted. (WebKit::IconDatabase::dispatchDidRemoveAllIconsOnMainThread): Deleted. * UIProcess/API/glib/IconDatabase.h: (WebKit::IconDatabaseClient::didChangeIconForPageURL): (WebKit::IconDatabaseClient::didFinishURLImport): (WebKit::IconDatabase::MainThreadNotifier::MainThreadNotifier): (WebKit::IconDatabase::MainThreadNotifier::setActive): (WebKit::IconDatabase::MainThreadNotifier::notify): (WebKit::IconDatabase::MainThreadNotifier::stop): (WebKit::IconDatabase::MainThreadNotifier::timerFired): (WebKit::IconDatabaseClient::didRemoveAllIcons): Deleted. (WebKit::IconDatabaseClient::didClose): Deleted. 2017-08-27 Wenson Hsieh Picking an emoji via the emoji dialog (Ctrl+Cmd+Space) fires inconsistent beforeinput events. https://bugs.webkit.org/show_bug.cgi?id=170955 Reviewed by Ryosuke Niwa. Currently, we insert text with TextEventInputAutocompletion as the text event input type if any text range to replace was specified by the platform. Instead, limit this only to when the text replacement range is not empty. This more closely matches the intention of the spec, which states that the "insertReplacementText" inputType should be used when "[replacing] existing text by means of a spell checker, auto-correct or similar". * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertTextAsync): 2017-08-27 Wenson Hsieh [iOS WK2] Web process crashes after changing selection to the end of the document when speaking a selection https://bugs.webkit.org/show_bug.cgi?id=176011 Reviewed by Ryosuke Niwa. Adds an SPI hook to test accessibility codepaths when speaking selected content. This patch does some minor refactoring by introducing _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:, which takes and invokes a completion handler block. The existing _accessibilityRetrieveRectsAtSelectionOffset:withText: method simply turns around and calls the former variant with `nil` as a completion handler. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:]): (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::visiblePositionForPositionWithOffset): Deleted. 2017-08-25 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's saveDataToFileInDownloadsFolder https://bugs.webkit.org/show_bug.cgi?id=176000 Reviewed by Andy Estes. Covered by a new API test. * Shared/Cocoa/WKNSData.h: (wrapper): Deleted. * UIProcess/API/APIUIClient.h: (API::UIClient::saveDataToFileInDownloadsFolder): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder): (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::url const): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::savePDFToFileInDownloadsFolder): * WebProcess/WebPage/WebPage.h: 2017-08-25 David Kilzer Fix -Wunused-lambda-capture warnings in WebKit with new clang compiler Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::retrieveCaches): Remove unused lambda capture for 'this'. (WebKit::CacheStorage::Engine::putRecords): Remove unused lambda capture for 'cacheIdentifier'. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::records): Ditto. 2017-08-25 Brian Burg Web Automation: add capabilities to control ICE candidate filtering and insecure media capture https://bugs.webkit.org/show_bug.cgi?id=175563 Reviewed by Joseph Pecoraro. * UIProcess/Cocoa/AutomationClient.mm: (WebKit::AutomationClient::requestAutomationSessionWithCapabilities): Translate new capabilities to _WKAutomationSessionConfiguration properties. 2017-08-24 Brian Burg Web Automation: use automation session configurations to propagate per-session settings https://bugs.webkit.org/show_bug.cgi?id=175562 Reviewed by Joseph Pecoraro. Some WebDriver capabilities need WebKit support in order to be implemented correctly. There is currently no easy way to forward WebDriver capability keys and values to WebKit at session creation time. This is unfortunate, as it would be best to implement many of them via existing mechanisms (i.e., WKPreferences properties) that need to be set up before any windows are opened in the session. This patch adds WebKit-side plumbing to forward named capabilities from a remote WebDriver client to the _WKAutomationSession and its delegate in WebKit2 UIProcess. These capabilities are exposed via API in ways that abstract away details of how the capabilities are represented in RWI wire protocol messages. In the Cocoa API, these capabilities are exposed via a session configuration object that's similar to WKWebView's WKWebViewConfiguration. A session's configuration is copied and used at initialization and cannot be modified after the session is created. Code in the Cocoa subclass of API::AutomationClient translates between RWI protocol capability names and property values on the _WKAutomationSessionConfiguration it uses to request a new session. Later patches will hook up the two properties present in the configuration in this patch. Most of this patch is just generic plumbing without doing any capability-specific work. * UIProcess/API/Cocoa/_WKAutomationDelegate.h: * UIProcess/API/Cocoa/_WKAutomationSession.h: * UIProcess/API/Cocoa/_WKAutomationSession.mm: (-[_WKAutomationSession init]): (-[_WKAutomationSession initWithConfiguration:]): (-[_WKAutomationSession configuration]): * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKAutomationDelegate.h. * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.h. (-[_WKAutomationSessionConfiguration init]): (-[_WKAutomationSessionConfiguration description]): * UIProcess/Cocoa/AutomationClient.h: * UIProcess/Cocoa/AutomationClient.mm: (WebKit::AutomationClient::AutomationClient): (WebKit::AutomationClient::requestAutomationSession): (WebKit::AutomationClient::requestAutomationSessionWithCapabilities): * WebKit.xcodeproj/project.pbxproj: 2017-08-25 Brady Eidson Introduce ServerWorkerRegistration task queues. https://bugs.webkit.org/show_bug.cgi?id=175851 Reviewed by Andy Estes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): * StorageProcess/ServiceWorker/WebSWServerConnection.h: (WebKit::WebSWServerConnection::identifier const): Deleted. * WebProcess/Storage/WebSWClientConnection.h: (WebKit::WebSWClientConnection::identifier const): Deleted. 2017-08-25 Youenn Fablet [Cache API] UIProcess should provide the directory path where to store Cache Storage data https://bugs.webkit.org/show_bug.cgi?id=175884 Unreviewed. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Fixing typo. 2017-08-25 Jonathan Bedard Fix build breakage with Public iOS 11 SDK https://bugs.webkit.org/show_bug.cgi?id=175960 Reviewed by Wenson Hsieh. * Platform/spi/ios/UIKitSPI.h: Add UIURLDragPreviewView declaration. 2017-08-24 Chris Dumez [Directory Upload] Add basic support for input.webkitdirectory https://bugs.webkit.org/show_bug.cgi?id=175950 Reviewed by Geoffrey Garen. Add private API to toggle Directory Upload support. Add new member to WKOpenPanelParameters to communicate to the client that the file picker should allow selecting directories. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebPreferencesDefinitions.h: * UIProcess/API/APIOpenPanelParameters.h: (API::OpenPanelParameters::allowDirectories const): * UIProcess/API/C/WKOpenPanelParametersRef.cpp: (WKOpenPanelParametersGetAllowsDirectories): * UIProcess/API/C/WKOpenPanelParametersRef.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDirectoryUploadEnabled): (WKPreferencesGetDirectoryUploadEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKOpenPanelParameters.h: * UIProcess/API/Cocoa/WKOpenPanelParameters.mm: (-[WKOpenPanelParameters allowsDirectories]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-24 Youenn Fablet [Cache API] UIProcess should provide the directory path where to store Cache Storage data https://bugs.webkit.org/show_bug.cgi?id=175884 Reviewed by Brady Eidson. Adding API to set the cache storage directory path. Updating IPC to pass this parameter with its sandbox extension to NetworkProcess at creation time. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::cacheStorageDirectory const): * 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::createWithLegacyOptions): (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): (API::ProcessPoolConfiguration::ProcessPoolConfiguration): (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultCacheStorageDirectory): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory): * UIProcess/WebProcessPool.cpp: (WebKit::legacyWebsiteDataStoreConfiguration): (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-08-24 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's handleAutoplayEvent https://bugs.webkit.org/show_bug.cgi?id=175965 Reviewed by Tim Horton. Covered by updating API tests to use UIDelegate instead of _pageForTesting and WKPageUIClient. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::toWKFocusDirection): (WebKit::toWKAutoplayEventFlags): (WebKit::toWKAutoplayEvent): (WebKit::UIDelegate::UIClient::handleAutoplayEvent): 2017-08-24 Brady Eidson Remove duplicate WebCore::URL encoder/decoder https://bugs.webkit.org/show_bug.cgi?id=175952 Reviewed by Chris Dumez. Don't need the WebCoreArgumentCoder in WebKit since the URL class defines its own coders. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: 2017-08-24 Alex Christensen Add WKUIDelegatePrivate callback corresponding to PageUIClient's didNotHandleWheelEvent https://bugs.webkit.org/show_bug.cgi?id=175957 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didNotHandleWheelEvent): 2017-08-24 Tim Horton Overflow scroll views are inset to avoid safe areas even if the parent view is not https://bugs.webkit.org/show_bug.cgi?id=175949 Reviewed by Beth Dakin. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::createLayer): Disable automatic content inset adjustment to avoid safe areas on all of WKWebView's child UIScrollViews. 2017-08-24 Tim Horton Layout size override changes during in-flight animated resize are dropped on the floor forever https://bugs.webkit.org/show_bug.cgi?id=175916 Reviewed by Beth Dakin. Layout size override changes that come in during an animated resize are currently stored, but not sent in a separate message, because they're sent as part of the resize. However, if a layout size override change happens after the animated resize message was already sent, but before the animated resize is ended, that change will be stored, but not sent in the animated resize message (because it's too late), and then subsequent calls with the same size will early-return, because we're testing against the stored size, not the size we last actually sent to the Web Content process. Instead, store the last-sent size, so that subsequent layout size override changes with the same size won't bail, and if it differs from the active state after the animated resize completes, send an out-of-band update. All of the above also applies to device orientation, which follows exactly the same pattern. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _dispatchSetMinimumLayoutSize:]): (-[WKWebView _dispatchSetMaximumUnobscuredSize:]): (-[WKWebView _dispatchSetDeviceOrientation:]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _windowDidRotate:]): (-[WKWebView _didRelaunchProcess]): (-[WKWebView _setMinimumLayoutSizeOverride:]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): 2017-08-24 Tim Horton _WKThumbnailView snapshots have to be copied by CA on first commit due to bad row alignment https://bugs.webkit.org/show_bug.cgi?id=175898 Reviewed by Sam Weinig. In order to avoid copying, CGImages used as layer contents need to have certain alignment requirements fulfilled. Align the row stride to the desired value. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::createShareable): (WebKit::ShareableBitmap::numBytesForSize): (WebKit::ShareableBitmap::calculateBytesPerPixel): Deleted. * Shared/ShareableBitmap.h: (WebKit::ShareableBitmap::sizeInBytes const): (WebKit::ShareableBitmap::numBytesForSize): Deleted. Merge the interfaces of numBytesPerSize and sizeInBytes between the platforms. numBytesForSize now makes use of the new calculateBytesPerRow, which is implemented by each platform ShareableBitmap implementation to do the requisite alignment for that platform. * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::calculateBytesPerRow): (WebKit::ShareableBitmap::calculateBytesPerPixel): (WebKit::createSurfaceFromData): (WebKit::ShareableBitmap::numBytesForSize): Deleted. Implement calculateBytesPerRow (which used to be hidden inside of numBytesForSize) and get rid of the now-duplicative numBytesForSize. * Shared/cg/ShareableBitmapCG.cpp: (WebKit::ShareableBitmap::calculateBytesPerRow): (WebKit::ShareableBitmap::createGraphicsContext): (WebKit::ShareableBitmap::createCGImage const): Implement calculateBytesPerRow and make use of it when providing a row stride to CoreGraphics. 2017-08-24 Chris Dumez [iOS] ViewServices started by StoreKitUIService may get suspended unexpectedly https://bugs.webkit.org/show_bug.cgi?id=175922 Reviewed by Tim Horton. ViewServices started by StoreKitUIService may get suspended unexpectedly. This is because StoreKitUIService is itself a ViewService and is therefore in the background. To address the issue, treat StoreKitUIService as initially foreground in ApplicationStateTracker so that its ViewServices do not get suspended. We don't have good way to deal with ViewServices started by other ViewServices unfortunately. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ApplicationStateTracker.mm: (WebKit::ApplicationStateTracker::ApplicationStateTracker): 2017-08-23 Youenn Fablet [Cache API] Unify WebCore and WebKit error handling https://bugs.webkit.org/show_bug.cgi?id=175902 Reviewed by Alex Christensen. Removing all callbacks and error definitions from WebKit and reusing DOMCache ones instead. * NetworkProcess/cache/CacheStorage.h: Removed. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::caches const): (WebKit::CacheStorage::Engine::queryCache): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::putRecords): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::doBatchPutOperation): (WebKit::WebCacheStorageConnection::openCompleted): (WebKit::WebCacheStorageConnection::removeCompleted): (WebKit::WebCacheStorageConnection::updateCaches): (WebKit::WebCacheStorageConnection::updateRecords): (WebKit::WebCacheStorageConnection::deleteRecordsCompleted): (WebKit::WebCacheStorageConnection::putRecordsCompleted): * WebProcess/Cache/WebCacheStorageConnection.h: * WebProcess/Cache/WebCacheStorageConnection.messages.in: 2017-08-23 Alex Christensen Clean up UIClients https://bugs.webkit.org/show_bug.cgi?id=175906 Reviewed by Tim Horton. There were some unnecessary checks to see if the client implements something, when the default behavior is to do nothing if the client doesn't implement the callback. Also, make some overrides finals and fix some spacing. * UIProcess/API/APIUIClient.h: (API::UIClient::didNotHandleKeyEvent): (API::UIClient::implementsDidNotHandleKeyEvent const): Deleted. (API::UIClient::implementsDidNotHandleWheelEvent const): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): 2017-08-23 Alex Christensen Add WKUIDelegatePrivate callbacks corresponding to WKPageUIClient's takeFocus, focus, and unfocus https://bugs.webkit.org/show_bug.cgi?id=175896 Reviewed by Tim Horton. I also renamed _webViewShow to _showWebView based on feedback from https://bugs.webkit.org/show_bug.cgi?id=175797 Added an API test. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::toWKFocusDirection): (WebKit::UIDelegate::UIClient::takeFocus): (WebKit::UIDelegate::UIClient::focus): (WebKit::UIDelegate::UIClient::unfocus): (WebKit::UIDelegate::UIClient::showPage): 2017-08-23 Youenn Fablet [CacheAPI] Introduce a WebKit::CacheStorage namespace https://bugs.webkit.org/show_bug.cgi?id=175885 Reviewed by Alex Christensen. Introducing WebKit::CacheStorage namespace. Splitting CacheStorageEngine.h in three files. Updating client code accordingly. * NetworkProcess/cache/CacheStorage.h: Added. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::globalEngineMap): (WebKit::CacheStorage::Engine::from): (WebKit::CacheStorage::Engine::destroyEngine): (WebKit::CacheStorage::Engine::defaultEngine): (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::retrieveCaches): (WebKit::CacheStorage::Engine::retrieveRecords): (WebKit::CacheStorage::Engine::putRecords): (WebKit::CacheStorage::Engine::deleteMatchingRecords): (WebKit::CacheStorage::Engine::writeCachesToDisk): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::readCache): (WebKit::CacheStorage::Engine::writeCacheRecords): (WebKit::CacheStorage::Engine::removeCacheRecords): (WebKit::CacheStorage::Engine::cache): (WebKit::CacheStorage::Engine::caches const): (WebKit::CacheStorage::Engine::queryCache): * NetworkProcess/cache/CacheStorageEngineCache.h: Added. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::records): (WebKit::CacheStorageEngineConnection::deleteMatchingRecords): (WebKit::CacheStorageEngineConnection::putRecords): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::openCompleted): (WebKit::WebCacheStorageConnection::removeCompleted): (WebKit::WebCacheStorageConnection::updateCaches): (WebKit::WebCacheStorageConnection::updateRecords): (WebKit::WebCacheStorageConnection::deleteRecordsCompleted): (WebKit::WebCacheStorageConnection::putRecordsCompleted): * WebProcess/Cache/WebCacheStorageConnection.h: 2017-08-23 Youenn Fablet [Cache API] Enable persistent coder to encode FetchOptions https://bugs.webkit.org/show_bug.cgi?id=175883 Reviewed by Alex Christensen. Removing FetchOptions related ArgumentCoders specific code. * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: 2017-08-23 Youenn Fablet CacheStorageEngine readCachesFromDisk callback should return the read Caches https://bugs.webkit.org/show_bug.cgi?id=175882 Reviewed by Alex Christensen. Callback of readCachesFromDisk takes now a Caches or error parameter. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorageEngine::open): (WebKit::CacheStorageEngine::retrieveCaches): (WebKit::CacheStorageEngine::readCachesFromDisk): * NetworkProcess/cache/CacheStorageEngine.h: 2017-08-23 Chris Dumez Regression(r221059): NetworkDataTask::didReceiveResponse() should not use PolicyUse for HTTP/0.9 https://bugs.webkit.org/show_bug.cgi?id=175872 Reviewed by Daniel Bates. r221059 was calling the ResponseCompletionHandler with {} which ended up being PolicyUse. Since this is an error case and do not want to receive the data, it makes more sense to use PolicyIgnore instead. There should not be a behavior change on WebKit side though since we are cancelling the load right after calling the completion handler anyway. Tests under http/tests/security/http-0.9/ are still passing. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): 2017-08-22 Tim Horton _WKThumbnailView should use the screen color space instead of sRGB https://bugs.webkit.org/show_bug.cgi?id=175858 Reviewed by Dean Jackson. Currently, _WKThumbnailView uses software snapshotting via WebPage's takeSnapshot and friends, which always use sRGB. However, it is immediately presented in display space, which causes an expensive color conversion, which could have been avoided if the snapshot was instead originally taken in display space. To solve this, add: - a mechanism allowing ShareableBitmap to be constructed with a configuration, which can include a color space as well as the existing flags (flipping SupportsAlpha to be IsOpaque instead because most callers want alpha) - a WebImage constructor allowing callers to pass a ShareableBitmap configuration through - a bit in SnapshotOptions for callers to indicate that they want to snapshot in the display's color space (repurposed from the ExtendedColor bit) And then make use of that bit in _WKThumbnailView. * Shared/API/c/WKSharedAPICast.h: (WebKit::snapshotOptionsFromImageOptions): Remove this incorrect conversion (WKImageOptions doesn't include kWKSnapshotOptionsExtendedColor). (WebKit::toSnapshotOptions): Plumb kWKSnapshotOptionsExtendedColor to WebKit::SnapshotOptions as the "UseScreenColorSpace". Leave the SPI name intact because it has clients, but the difference isn't so huge that it will be a problem. * Shared/ImageOptions.h: (WebKit::snapshotOptionsToImageOptions): Remove ImageOptionsExtendedColor, and rename SnapshotOptionsExtendedColor to SnapshotOptionsUseScreenColorSpace. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::Handle::Handle): (WebKit::ShareableBitmap::Handle::encode const): (WebKit::ShareableBitmap::Handle::decode): (WebKit::ShareableBitmap::Handle::clear): (WebKit::ShareableBitmap::Configuration::encode const): (WebKit::ShareableBitmap::Configuration::decode): (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::createShareable): (WebKit::ShareableBitmap::createHandle const): (WebKit::ShareableBitmap::ShareableBitmap): (WebKit::ShareableBitmap::calculateBytesPerPixel): (WebKit::calculateBytesPerPixel): Deleted. * Shared/ShareableBitmap.h: (WebKit::ShareableBitmap::numBytesForSize): (WebKit::ShareableBitmap::sizeInBytes const): * Shared/cg/ShareableBitmapCG.cpp: (WebKit::colorSpace): (WebKit::bitmapInfo): (WebKit::ShareableBitmap::calculateBytesPerPixel): (WebKit::ShareableBitmap::createGraphicsContext): (WebKit::ShareableBitmap::createCGImage const): Remove ShareableBitmap's flags parameter, and replace it with a configuration parameter. Configuration is a struct that currently encompasses the newly-flipped IsOpaque bit and (on Cocoa platforms) a platform colorspace object. Compute bytesPerPixel dynamically based on the colorspace and whether it uses extended colors or not. * Shared/WebImage.cpp: (WebKit::WebImage::create): * Shared/WebImage.h: Pass ShareableBitmap::Configuration through to the ShareableBitmap constructor, if provided. * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView requestSnapshot]): Make use of the new bit, and use the screen's color space. * WebProcess/WebPage/WebPage.cpp: (WebKit::snapshotOptionsToBitmapConfiguration): (WebKit::WebPage::snapshotAtSize): (WebKit::WebPage::snapshotNode): If the snapshot option to use the display color space is set, fill in the colorSpace field in the ShareableBitmap::Configuration with the screen's color space. (WebKit::WebPage::drawRectToImage): * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeImage): * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::snapshot): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::snapshot): * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::geometryDidChange): (WebKit::PluginProxy::updateBackingStore): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): (WebKit::convertCGImageToBitmap): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createSelectionSnapshot const): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): Adopt ShareableBitmap::Configuration. Since IsOpaque defaults to false, all callers who previously constructed ShareableBitmap with SupportsAlpha now don't have to do anything. 2017-08-20 Wenson Hsieh [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div https://bugs.webkit.org/show_bug.cgi?id=175116 Reviewed by Darin Adler and Ryosuke Niwa. Refactors WebPage::editorState to only use the StyleProperties derived from EditingStyle, instead of inserting and removing a temporary node to figure out the style. Also adds hooks to notify the UI delegate of EditorState changes. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (nsTextAlignment): (dictionaryRepresentationForEditorState): (-[WKWebView _didChangeEditorState]): Alerts the private UI delegate of UI-side EditorState updates. (-[WKWebView _web_editorStateDidChange]): (-[WKWebView _executeEditCommand:argument:completion:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _web_editorStateDidChange]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::selectionDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::executeEditCommand): Change executeEditCommand(name, callback) to executeEditCommand(name, argument, callback) and lift out of iOS platform code and into WebPage.cpp. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView executeEditCommandWithCallback:]): (-[WKContentView _selectionChanged]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::executeEditCommand): Deleted. Move the iOS-specific implementation of executeEditCommand that invokes a callback when the web process responds out of WebPageProxyIOS, and into cross-platform WebPageProxy code. Additionally, add a parameter for the edit command's argument. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): Use EditingStyle::styleAtSelectionStart instead of Editor::styleForSelectionStart when computing an EditorState. Tweak bold, italic and underline to use EditingStyle TriStates. (WebKit::WebPage::executeEditCommandWithCallback): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::executeEditCommandWithCallback): Deleted. 2017-08-22 Wenson Hsieh [WK2] EditorState updates should be rolled into the layer update lifecycle when possible https://bugs.webkit.org/show_bug.cgi?id=175370 Reviewed by Ryosuke Niwa. See per-method comments for more detail. WebPage::didChangeSelection now schedules EditorState updates to be sent during the next layer tree transaction rather than sending them synchronously. To ensure that iOS and Mac continue to behave correctly w.r.t. EditorState updates, we immediately dispatch EditorStates in the following cases: - After the composition changes, is confirmed, or is canceled. - After an edit command is executed. - After ending user-triggered selection changes. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::hasEditorState const): (WebKit::RemoteLayerTreeTransaction::editorState const): (WebKit::RemoteLayerTreeTransaction::setEditorState): Attaches an optional EditorState to the RemoteLayerTreeTransaction. This EditorState is computed and sent over when setting up the transaction in WebPage, if something previously scheduled an EditorState update. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode const): (WebKit::RemoteLayerTreeTransaction::decode): Add coder support for sending over a layer tree transaction's EditorState. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _doAfterNextPresentationUpdate:]): Add _doAfterNextPresentationUpdate to WKView (used in TestWebKitAPI -- refer to WebKitAgnosticTest::waitForNextPresentationUpdate). * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::dispatchPresentationCallbacksAfterFlushingLayers): * UIProcess/DrawingAreaProxy.messages.in: Add a new IPC messages, DispatchPresentationCallbacksAfterFlushingLayers, to invoke in-flight presentation callbacks in the UI process following a layer flush in the web process. * UIProcess/WebPageProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::~TiledCoreAnimationDrawingAreaProxy): (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing): (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchPresentationCallbacksAfterFlushingLayers): Run all pending _doAfterNextPresentationUpdate callbacks. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::didApplyStyle): (WebKit::WebEditorClient::respondToChangedContents): (WebKit::WebEditorClient::didEndUserTriggeredSelectionChanges): (WebKit::WebEditorClient::didUpdateComposition): Forward editor client calls to the WebPage. (WebKit::WebEditorClient::didChangeSelectionAndUpdateLayout): Deleted. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): (WebKit::WebPage::updateEditorStateAfterLayoutIfEditabilityChanged): (WebKit::WebPage::willCommitLayerTree): (WebKit::WebPage::didApplyStyle): Allow style application to immediately trigger EditorState updates, if we're not currently ignoring selection changes in the Editor. (WebKit::WebPage::didChangeContents): Allow applying top-level edit commands to immediately trigger EditorState updates, if we're not currently ignoring selection changes in the Editor. (WebKit::WebPage::didChangeSelection): (WebKit::WebPage::didUpdateComposition): (WebKit::WebPage::didEndUserTriggeredSelectionChanges): (WebKit::WebPage::discardedComposition): (WebKit::WebPage::canceledComposition): When handling composition updates, always send an EditorState to the UI process. Unlike other cases, IME requires immediate EditorState data, so we need to be explicit here in sending updates right away. (WebKit::WebPage::sendEditorStateUpdate): (WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate): (WebKit::WebPage::flushPendingEditorStateUpdate): Helper methods to schedule an EditorState update to be sent upon the next layer tree update, or flush any pending EditorState update that has been scheduled. The private, more aggressive variant of this is sendEditorStateUpdate, which ignores whether or not there was already an EditorState update scheduled, and sends one anyways (this still fulfills any EditorState update that was previously scheduled). These helper methods are treated as no-ops when invoked while ignoring selection changes. This is to prevent temporary selection state and editor commands during operations such as text indicator snapshotting from pushing bogus information about transient editor states to the UI process. (WebKit::WebPage::sendPostLayoutEditorStateIfNeeded): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState const): (WebKit::WebPage::executeEditCommandWithCallback): (WebKit::selectionIsInsideFixedPositionContainer): (WebKit::WebPage::updateVisibleContentRects): Fix a hack that was computing an EditorState to figure out whether the current selection starts or ends in a fixed position container. Factors out relevant logic into a separate helper, and also schedules an EditorState update instead of immediately computing it. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::addTransactionCallbackID): Add support for registering and dispatching presentation callbacks that hook into the layer flush lifecycle, using the tiled CA drawing area. These are used by Mac LayoutTests and API tests that need to wait until the next flush before checking for state that depends on EditorState updates in the UI process. (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Tell the WebPage to flush any pending EditorState updates. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformEditorState const): 2017-08-22 Brent Fulgham Relax keychain access to permit users to permanently allow client certificates https://bugs.webkit.org/show_bug.cgi?id=175857 Reviewed by Alex Christensen. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2017-08-22 Chris Dumez Introduce a new CompletionHandler type and use it for NetworkDataTaskClient's completion handlers to help catch bugs https://bugs.webkit.org/show_bug.cgi?id=175832 Reviewed by Alex Christensen. Use new CompletionHandler type for NetworkDataTaskClient's completion handlers to help catch bugs. It actually already found a bug in our HTTP 0.9 error handling which is fixed in this patch as well. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): * Shared/Authentication/AuthenticationManager.h: * Shared/Authentication/mac/AuthenticationManager.mac.mm: (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): 2017-08-22 Alex Christensen Add UIDelegatePrivate SPI corresponding to WKPageUIClient.showPage https://bugs.webkit.org/show_bug.cgi?id=175797 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::showPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::registerURLSchemeHandler): window.open, createWebViewWithConfiguration, and WKURLSchemeHandlers all used together make it so that URLSchemeHandlers are added to WebPages that already have them. The assertions are no longer valid. 2017-08-22 Matt Lewis Unreviewed, rolling out r221026. This caused a consistent API failure on iOS Simulator. Reverted changeset: "Add UIDelegatePrivate SPI corresponding to WKPageUIClient.showPage" https://bugs.webkit.org/show_bug.cgi?id=175797 http://trac.webkit.org/changeset/221026 2017-08-22 Ryan Haddad Unreviewed, rolling out r221027. This change caused LayoutTests to exit early with assertion failures. Reverted changeset: "Add sanity check for source origin in WebLoaderStrategy::startPingLoad()" https://bugs.webkit.org/show_bug.cgi?id=175827 http://trac.webkit.org/changeset/221027 2017-08-22 Chris Dumez [WK2] Enable Beacon API by default https://bugs.webkit.org/show_bug.cgi?id=175839 Reviewed by Youenn Fablet. * Shared/WebPreferencesDefinitions.h: 2017-08-22 Tim Horton REGRESSION (High Sierra): PDFPlugin won't render PostScript Files https://bugs.webkit.org/show_bug.cgi?id=175840 Reviewed by Brent Fulgham. * WebProcess/com.apple.WebProcess.sb.in: Add a sandbox exception for the PostScript conversion process. 2017-08-22 Chris Dumez Clean up PingLoad::processContentExtensionRulesForLoad() https://bugs.webkit.org/show_bug.cgi?id=175834 Reviewed by Alex Christensen. * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::processContentExtensionRulesForLoad): * NetworkProcess/PingLoad.h: 2017-08-22 Alex Christensen Remove ChromeClient::scrollbarsModeDidChange https://bugs.webkit.org/show_bug.cgi?id=175805 Reviewed by Daniel Bates. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::scrollbarsModeDidChange const): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-08-22 Chris Dumez Add sanity check for source origin in WebLoaderStrategy::startPingLoad() https://bugs.webkit.org/show_bug.cgi?id=175827 Reviewed by Geoffrey Garen. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::startPingLoad): 2017-08-22 Alex Christensen Add UIDelegatePrivate SPI corresponding to WKPageUIClient.showPage https://bugs.webkit.org/show_bug.cgi?id=175797 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::showPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::registerURLSchemeHandler): window.open, createWebViewWithConfiguration, and WKURLSchemeHandlers all used together make it so that URLSchemeHandlers are added to WebPages that already have them. The assertions are no longer valid. 2017-08-22 Youenn Fablet [Cache API] Add support for overwriting responses with put on an existing record https://bugs.webkit.org/show_bug.cgi?id=175825 Reviewed by Geoffrey Garen. Add support for encoding/decoding the update counter. Incrementing it when overwriting an existing response. Storing the new body in addition to the new response. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorageEngine::putRecords): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-08-22 Alex Christensen Remove ChromeClient::hasOpenedPopup https://bugs.webkit.org/show_bug.cgi?id=175804 Reviewed by Sam Weinig. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::hasOpenedPopup const): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-08-22 Brent Fulgham and Pranjal Jumde Disable access to secure cookies if an HTTPS site loads mixed content https://bugs.webkit.org/show_bug.cgi?id=157053 Reviewed by Dan Bates. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Pass new arguments needed by WebCore. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Updated the CookiesForDOM message with the new foundMixedContent argument and the new didAccessSecureCookies reply. * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): Drive-by fix to use the right message. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesForDOM): Check and return whether secure cookies were accessed. Accept a new argument indicating whether secure cookies should be included in the response. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-08-22 Zan Dobersek [GTK][WPE] Rename StorageProcessMainGtk.cpp to StorageProcessMainGLib.cpp https://bugs.webkit.org/show_bug.cgi?id=175814 Reviewed by Gyuyoung Kim. Both GTK+ and WPE ports already compile the StorageProcessMainGtk.cpp file, but it should be renamed to StorageProcessMainGLib and moved into the StorageProcess/glib/ directory. * PlatformGTK.cmake: * PlatformWPE.cmake: * StorageProcess/glib/StorageProcessMainGLib.cpp: Renamed from Source/WebKit/StorageProcess/gtk/StorageProcessMainGtk.cpp. 2017-08-21 Zan Dobersek [WK] Add missing ENABLE(NETWORK_CACHE) build guards https://bugs.webkit.org/show_bug.cgi?id=175769 Reviewed by Carlos Alberto Lopez Perez. Given that the build guard exists, it should be possible to compile the WebKit layer with the feature disabled. Missing guards are added in order to achieve that. * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::NetworkProcess::clearDiskCache): * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::storeDerivedDataToCache): 2017-08-21 Chris Dumez [Beacon] Content extensions should be able to intercept Beacon / Ping redirects https://bugs.webkit.org/show_bug.cgi?id=175746 Reviewed by Alex Christensen. Update PingLoad to process content extension rules upon redirect. This allows content extensions to block and upgrade to HTTPS beacon / ping loads. Because ping loads can outlive the WebProcess, the content extensions rules are passed to the NetworkProcess when starting the Ping load. The PingLoad can then consult those rules upon redirect, on the NetworkProcess side. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::contentExtensionsBackend): (WebKit::PingLoad::processContentExtensionRulesForLoad): * NetworkProcess/PingLoad.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::startPingLoad): 2017-08-21 Adrian Perez de Castro [WPE][GTK] Unused variables in UserMediaProcessManager.cpp https://bugs.webkit.org/show_bug.cgi?id=175799 Reviewed by Alex Christensen. The code which uses the "audioExtensionPath" and "videoExtensionPath" variables is guarded with "#if ENABLE(SANDBOX_EXTENSIONS)”, so do the same for the variables themselves. * UIProcess/UserMediaProcessManager.cpp: Add missing guards. 2017-08-21 Yoshiaki Jitsukawa [PAL] Move spi/mac directory into PAL https://bugs.webkit.org/show_bug.cgi?id=175649 Reviewed by Myles C. Maxfield. * Platform/mac/MenuUtilities.mm: * Shared/mac/WebCoreArgumentCodersMac.mm: * Shared/mac/WebEventFactory.mm: * Shared/mac/WebHitTestResultData.mm: * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/mac/ServicesController.mm: * UIProcess/mac/TextCheckerMac.mm: * UIProcess/mac/ViewGestureControllerMac.mm: * UIProcess/mac/WKImmediateActionController.h: * UIProcess/mac/WKImmediateActionController.mm: * UIProcess/mac/WKSharingServicePickerDelegate.mm: * UIProcess/mac/WKTextFinderClient.mm: * UIProcess/mac/WebContextMenuProxyMac.mm: * UIProcess/mac/WebPageProxyMac.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-08-21 Brady Eidson Split the one SWServer::Connection into SWClientConnection and SWServer::Connection. https://bugs.webkit.org/show_bug.cgi?id=175745 Reviewed by Andy Estes. * CMakeLists.txt: * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.cpp. (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::~WebSWServerConnection): (WebKit::WebSWServerConnection::disconnectedFromWebProcess): (WebKit::WebSWServerConnection::rejectJobInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: Copied from Source/WebKit/WebProcess/Storage/WebSWServerConnection.h. (WebKit::WebSWServerConnection::identifier const): * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWServerConnection.messages.in. * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): (WebKit::StorageToWebProcessConnection::didClose): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::removeSWServerConnection): * StorageProcess/StorageToWebProcessConnection.h: * WebProcess/Storage/WebSWClientConnection.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp. (WebKit::WebSWClientConnection::WebSWClientConnection): (WebKit::WebSWClientConnection::~WebSWClientConnection): (WebKit::WebSWClientConnection::scheduleJobInServer): * WebProcess/Storage/WebSWClientConnection.h: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.h. (WebKit::WebSWClientConnection::identifier const): * WebProcess/Storage/WebSWClientConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.messages.in. * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: 2017-08-21 Charlie Turner MemoryCache::setCapacities assertion failure maxDeadBytes <= totalBytes https://bugs.webkit.org/show_bug.cgi?id=175571 Reviewed by Antti Koivisto. * Shared/CacheModel.cpp: (WebKit::calculateMemoryCacheSizes): Ensure cacheTotalCapacity is set to a reasonable value even in low-memory environments. 2017-08-20 Chris Dumez Simplify calls to LoaderStrategy::startPingLoad() https://bugs.webkit.org/show_bug.cgi?id=175756 Reviewed by Sam Weinig. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::startPingLoad): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-18 Chris Dumez [Beacon] Improve error reporting https://bugs.webkit.org/show_bug.cgi?id=175723 Reviewed by Darin Adler. Have Ping loads such as beacons report errors via their completion handler. The Beacon API is using this error to log a console message when beacon loads fail, provided that the page is still alive. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::~PingLoad): (WebKit::PingLoad::didFinish): (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::didReceiveChallenge): (WebKit::PingLoad::didReceiveResponseNetworkSession): (WebKit::PingLoad::didCompleteWithError): (WebKit::PingLoad::wasBlocked): (WebKit::PingLoad::cannotShowURL): (WebKit::PingLoad::timeoutTimerFired): (WebKit::PingLoad::currentRequest const): (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight): * NetworkProcess/PingLoad.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didFinishPingLoad): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::networkProcessCrashed): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::didFinishPingLoad): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-18 Chris Dumez REGRESSION (r220601): Crash when closing google doc after switching the order of tabs in safari https://bugs.webkit.org/show_bug.cgi?id=175721 Reviewed by Geoffrey Garen. Make sure WebProcess::markAllLayersVolatile() does not call WTFMove() multiple times on the same completion handler. Use a RefCounter to hold on to the completion handler and make sure the handler gets called when the RefCounter's value becomes 0. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::cancelPrepareToSuspend): (WebKit::WebProcess::markAllLayersVolatile): (WebKit::WebProcess::cancelMarkAllLayersVolatile): * WebProcess/WebProcess.h: 2017-08-18 Youenn Fablet [Cache API] Add response body storage https://bugs.webkit.org/show_bug.cgi?id=175658 Reviewed by Alex Christensen. Added IPC serialization of Record response body. Updated CacheStorageEngine implementation as Record has no longer a copy constructor. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorageEngine::retrieveRecords): (WebKit::CacheStorageEngine::deleteMatchingRecords): * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeSharedBuffer): (IPC::decodeSharedBuffer): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-08-18 Brady Eidson Bounce ServiceWorker jobs to the Storage Process. https://bugs.webkit.org/show_bug.cgi?id=175650 Reviewed by Andy Estes. * CMakeLists.txt: * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: * Platform/Logging.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): (WebKit::StorageToWebProcessConnection::didClose): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::removeSWServerConnection): (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): * StorageProcess/StorageToWebProcessConnection.h: * StorageProcess/StorageToWebProcessConnection.messages.in: * WebProcess/Storage/WebSWServerConnection.cpp: Added. (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::~WebSWServerConnection): (WebKit::WebSWServerConnection::disconnectedFromWebProcess): (WebKit::WebSWServerConnection::scheduleJob): (WebKit::WebSWServerConnection::scheduleStorageJob): * WebProcess/Storage/WebSWServerConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerJob.h. (WebKit::WebSWServerConnection::create): (WebKit::WebSWServerConnection::identifier const): * WebProcess/Storage/WebSWServerConnection.messages.in: Copied from Source/WebKit/StorageProcess/StorageToWebProcessConnection.messages.in. * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): (WebKit::WebServiceWorkerProvider::scheduleJob): Deleted. * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: 2017-08-18 Chris Dumez [Beacon] Add support for quota limitation https://bugs.webkit.org/show_bug.cgi?id=175443 Reviewed by Youenn Fablet. WebLoaderStrategy now generates an identifier for ping loads and keep the completion handler in a local HashMap. Once the ping load is done, the network process sends an IPC message back to the WebContent process so that WebLoaderStrategy can look up the completion handler for the ping load and call it. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::~PingLoad): * NetworkProcess/PingLoad.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didFinishPingLoad): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::generatePingLoadIdentifier): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::didFinishPingLoad): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-18 Youenn Fablet [Cache API] Add a WK2 implementation of CacheStorageConnection https://bugs.webkit.org/show_bug.cgi?id=175640 Reviewed by Alex Christensen & Chris Dumez. Adding WebCacheStorageConnection as an implementation of CacheStorageConnection. Making WebCacheStorageProvider instantiates such class. One WebCacheStorageConnection is created for each session of a given WebProcess. WebCacheStorageConnection is sending IPC calls to the network process. Main implementation of the cache API is done in the network process by CacheStorageEngineConnection and CacheStorageEngine. There is one WebCacheStorageConnection per session. WebCacheStorageConnection is passing the session ID for each call to the network process to ensure the right cache storage engine is used. CacheStorageEngineConnection mirrors WebCacheStorageConnection on the network process. There is one CacheStorageEngine per session and CacheStorageEngineConnection will select the right CacheStorageEngine using the given session ID. CacheStorageEngine is responsible of storing and matching cache API records. Current implementation only keeps in memory the cached objects. CacheStorageEngine is keeping (for each different origin) caches and records as a Vector as the order of insertion is important as per spec. It also keeps a list of removed caches. These caches should remain functional until the last web page having access to these is gone. The mechanism to fully remove these caches is not implemented yet. Adding IPC encodings for WTF::Expected, CacheQueryOptions, FetchOptions, CacheStorageConnection Record and CacheInfo. * CMakeLists.txt: * DerivedSources.make: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::generateCacheStorageConnectionIdentifier): (WebKit::NetworkConnectionToWebProcess::createCacheStorageConnection): (WebKit::NetworkConnectionToWebProcess::closeCacheStorageConnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/cache/CacheStorageEngine.cpp: Added. (WebKit::defaultCacheStorageEngine): (WebKit::globalEngineMap): (WebKit::CacheStorageEngine::from): (WebKit::CacheStorageEngine::destroyEngine): (WebKit::CacheStorageEngine::defaultEngine): (WebKit::CacheStorageEngine::open): (WebKit::CacheStorageEngine::remove): (WebKit::CacheStorageEngine::retrieveCaches): (WebKit::CacheStorageEngine::retrieveRecords): (WebKit::CacheStorageEngine::putRecords): (WebKit::CacheStorageEngine::deleteMatchingRecords): (WebKit::CacheStorageEngine::writeCachesToDisk): (WebKit::CacheStorageEngine::readCachesFromDisk): (WebKit::CacheStorageEngine::readCache): (WebKit::CacheStorageEngine::writeCacheRecords): (WebKit::CacheStorageEngine::removeCacheRecords): (WebKit::CacheStorageEngine::cache): (WebKit::CacheStorageEngine::caches const): (WebKit::CacheStorageEngine::records): (WebKit::CacheStorageEngine::queryCache): * NetworkProcess/cache/CacheStorageEngine.h: Added. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: Added. (WebKit::CacheStorageEngineConnection::CacheStorageEngineConnection): (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::records): (WebKit::CacheStorageEngineConnection::deleteMatchingRecords): (WebKit::CacheStorageEngineConnection::putRecords): * NetworkProcess/cache/CacheStorageEngineConnection.h: Added. (WebKit::CacheStorageEngineConnection::create): * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: Added. * Platform/IPC/ArgumentCoders.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Cache/WebCacheStorageConnection.cpp: Added. (WebKit::WebCacheStorageConnection::WebCacheStorageConnection): (WebKit::WebCacheStorageConnection::~WebCacheStorageConnection): (WebKit::WebCacheStorageConnection::messageSenderConnection): (WebKit::WebCacheStorageConnection::doOpen): (WebKit::WebCacheStorageConnection::doRemove): (WebKit::WebCacheStorageConnection::doRetrieveCaches): (WebKit::WebCacheStorageConnection::doRetrieveRecords): (WebKit::WebCacheStorageConnection::doBatchDeleteOperation): (WebKit::WebCacheStorageConnection::doBatchPutOperation): (WebKit::WebCacheStorageConnection::openCompleted): (WebKit::WebCacheStorageConnection::removeCompleted): (WebKit::WebCacheStorageConnection::updateCaches): (WebKit::WebCacheStorageConnection::updateRecords): (WebKit::WebCacheStorageConnection::deleteRecordsCompleted): (WebKit::WebCacheStorageConnection::putRecordsCompleted): * WebProcess/Cache/WebCacheStorageConnection.h: Added. * WebProcess/Cache/WebCacheStorageConnection.messages.in: Added. * WebProcess/Cache/WebCacheStorageProvider.cpp: Copied from Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.h. (WebKit::WebCacheStorageProvider::createCacheStorageConnection): * WebProcess/Cache/WebCacheStorageProvider.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): 2017-08-18 Commit Queue Unreviewed, rolling out r220854. https://bugs.webkit.org/show_bug.cgi?id=175716 I'm not sure we really need this (Requested by KaL on #webkit). Reverted changeset: "[GTK][WPE] Add NTLM authentication enabled API" https://bugs.webkit.org/show_bug.cgi?id=122952 http://trac.webkit.org/changeset/220854 2017-08-15 Megan Gardner Update to changeSelectionWithTouchAt:baseIsStart:withFlags: https://bugs.webkit.org/show_bug.cgi?id=175615 Update calls to use the flag versions, as they are used for passing state. Leave old calls, but set them up to be removed next cycle. Reviewed by Tim Horton. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (selectionChangedWithTouch): (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]): (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]): (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]): 2017-08-17 Chris Dumez Regression(r220817): We should only copy the original request headers for Ping loads https://bugs.webkit.org/show_bug.cgi?id=175679 Reviewed by Youenn Fablet. For performance reason, we should only copy the original request headers for Ping loads (Beacon at the moment), not for all CachedResourceRequests. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::makeCrossOriginAccessRequest): (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest): (WebKit::PingLoad::originalRequestHeaders const): Deleted. * NetworkProcess/PingLoad.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-17 Don Olmstead [PAL] Relocate SessionID to root https://bugs.webkit.org/show_bug.cgi?id=175684 Reviewed by Alex Christensen. * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkLoad.cpp: * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSocketStream.h: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: * Scripts/webkit/messages.py: (forward_declarations_and_headers.templates): Deleted. (class_template_headers.template): Deleted. * Shared/ChildProcess.cpp: * Shared/SessionTracker.h: * Shared/Storage/StorageProcessCreationParameters.h: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebPageCreationParameters.h: * Shared/WebProcessCreationParameters.h: * Shared/WebsiteDataStoreParameters.h: * Shared/mac/CookieStorageShim.mm: * StorageProcess/IndexedDB/WebIDBConnectionToClient.h: * StorageProcess/StorageProcess.cpp: * StorageProcess/StorageProcess.h: * StorageProcess/StorageToWebProcessConnection.h: * UIProcess/API/APIPageConfiguration.h: * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/glib/WebKitCookieManager.cpp: * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebDatabaseProvider.cpp: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/Network/NetworkProcessConnection.cpp: * WebProcess/Network/WebLoaderStrategy.cpp: * WebProcess/Network/WebSocketStream.cpp: * WebProcess/Network/WebSocketStream.h: * WebProcess/Storage/WebToStorageProcessConnection.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebCoreSupport/WebPlugInClient.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebProcess.h: 2017-08-17 Chris Dumez REGRESSION (r220601): Crash under ProcessAssertion::markAsInvalidated() https://bugs.webkit.org/show_bug.cgi?id=175685 Reviewed by Sam Weinig. After r220601, it is no longer safe to call a default-initialized WTF::Function. * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAssertion::markAsInvalidated): 2017-08-17 Andreas Kling Disable CSS regions at compile time https://bugs.webkit.org/show_bug.cgi?id=175630 Reviewed by Antti Koivisto. * Configurations/FeatureDefines.xcconfig: 2017-08-17 Wenson Hsieh [iOS] Respect type fidelities when copying image elements to the pasteboard https://bugs.webkit.org/show_bug.cgi?id=175638 Reviewed by Ryosuke Niwa. Currently, we treat the case when copying an image enclosed by a link by only writing a URL to the pasteboard. This patch tweaks logic in WebPage::performActionOnElement to write both an image and a link to the pasteboard if the hit-tested image element is enclosed by an anchor. * Platform/spi/ios/UIKitSPI.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::containingLinkElement): Tweak this helper to be more restrictive when finding an enclosing 'link' -- only return an element if isLink() is true, and it is an HTMLAnchorElement. Currently, the isLink() also matches HTMLLinkElements, but this isn't the intention here. (WebKit::WebPage::performActionOnElement): 2017-08-17 Jacobo Aragunde Pérez [WPE][GTK] Ensure proper casting of data in gvariants https://bugs.webkit.org/show_bug.cgi?id=175667 Reviewed by Michael Catanzaro. g_variant_builder_add requires data to have the correct width for their types, using casting if necessary. Corrected a call where a single precision float was being put into a double precision parameter without a cast. * UIProcess/API/glib/WebKitWebViewSessionState.cpp: (encodeFrameState): 2017-08-17 Don Olmstead [PAL] Move SessionID into PAL https://bugs.webkit.org/show_bug.cgi?id=174192 Reviewed by Antti Koivisto. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::Download): * NetworkProcess/Downloads/Download.h: (WebKit::Download::Download): * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): (WebKit::DownloadManager::resumeDownload): * NetworkProcess/Downloads/DownloadManager.h: (WebKit::DownloadManager::startDownload): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::createSocketStream): (WebKit::storageSession): (WebKit::NetworkConnectionToWebProcess::startDownload): (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): (WebKit::NetworkConnectionToWebProcess::cookiesEnabled): (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): (WebKit::NetworkConnectionToWebProcess::getRawCookies): (WebKit::NetworkConnectionToWebProcess::deleteCookie): (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::startDownload): * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkLoad.cpp: * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::destroySession): (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::downloadRequest): (WebKit::NetworkProcess::resumeDownload): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::create): (WebKit::NetworkSession::defaultSession): (WebKit::NetworkSession::NetworkSession): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::sessionID const): * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::create): (WebKit::NetworkSocketStream::NetworkSocketStream): * NetworkProcess/NetworkSocketStream.h: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::configurationForSessionID): (WebKit::NetworkSessionCocoa::create): (WebKit::NetworkSessionCocoa::defaultSession): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * NetworkProcess/soup/NetworkSessionSoup.cpp: (WebKit::NetworkSessionSoup::NetworkSessionSoup): * NetworkProcess/soup/NetworkSessionSoup.h: * Scripts/webkit/messages.py: (forward_declarations_and_headers.templates): Deleted. (class_template_headers.template): Deleted. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::initialize): * Shared/SessionTracker.cpp: (WebKit::staticSessionMap): (WebKit::SessionTracker::networkSession): (WebKit::SessionTracker::setSession): (WebKit::SessionTracker::destroySession): * Shared/SessionTracker.h: * Shared/Storage/StorageProcessCreationParameters.h: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * Shared/WebPageCreationParameters.h: * Shared/WebProcessCreationParameters.h: * Shared/WebsiteDataStoreParameters.h: * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::create): (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient): * StorageProcess/IndexedDB/WebIDBConnectionToClient.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::idbServer): (WebKit::StorageProcess::fetchWebsiteData): (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): * StorageProcess/StorageToWebProcessConnection.h: * StorageProcess/StorageToWebProcessConnection.messages.in: * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::setWebsiteDataStore): (API::PageConfiguration::sessionID): (API::PageConfiguration::setSessionID): * UIProcess/API/APIPageConfiguration.h: * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::defaultDataStore): (API::WebsiteDataStore::createLegacy): (API::WebsiteDataStore::WebsiteDataStore): * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/C/WKCookieManager.cpp: (WKCookieManagerGetHostnamesWithCookies): (WKCookieManagerDeleteCookiesForHostname): (WKCookieManagerDeleteAllCookies): (WKCookieManagerDeleteAllCookiesModifiedAfterDate): (WKCookieManagerSetHTTPCookieAcceptPolicy): (WKCookieManagerGetHTTPCookieAcceptPolicy): (WKCookieManagerStartObservingCookieChanges): (WKCookieManagerStopObservingCookieChanges): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setCookieAcceptPolicy:]): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/glib/WebKitCookieManager.cpp: (webkit_cookie_manager_set_accept_policy): (webkit_cookie_manager_get_accept_policy): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Plugins/PlugInAutoStartProvider.cpp: (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider): (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash): (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy const): (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest): (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction): * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::fetchWebsiteData): (WebKit::StorageProcessProxy::deleteWebsiteData): (WebKit::StorageProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): (WebKit::WebCookieManagerProxy::deleteCookiesForHostname): (WebKit::WebCookieManagerProxy::deleteAllCookies): (WebKit::WebCookieManagerProxy::deleteCookie): (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince): (WebKit::WebCookieManagerProxy::setCookie): (WebKit::WebCookieManagerProxy::setCookies): (WebKit::WebCookieManagerProxy::getAllCookies): (WebKit::WebCookieManagerProxy::getCookies): (WebKit::WebCookieManagerProxy::startObservingCookieChanges): (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): (WebKit::WebCookieManagerProxy::setCookieObserverCallback): (WebKit::WebCookieManagerProxy::registerObserver): (WebKit::WebCookieManagerProxy::unregisterObserver): (WebKit::WebCookieManagerProxy::cookiesDidChange): (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebCookieManagerProxy.messages.in: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::sessionID const): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::pageAddedToProcess): (WebKit::WebProcessPool::pageRemovedFromProcess): (WebKit::WebProcessPool::download): (WebKit::WebProcessPool::resumeDownload): (WebKit::WebProcessPool::addPlugInAutoStartOriginHash): (WebKit::WebProcessPool::plugInDidReceiveUserInteraction): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessPool.messages.in: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::createNonPersistent): (WebKit::WebsiteDataStore::create): (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::sessionID const): * WebProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::getHostnamesWithCookies): (WebKit::WebCookieManager::deleteCookiesForHostname): (WebKit::WebCookieManager::deleteAllCookies): (WebKit::WebCookieManager::deleteCookie): (WebKit::WebCookieManager::deleteAllCookiesModifiedSince): (WebKit::WebCookieManager::getAllCookies): (WebKit::WebCookieManager::getCookies): (WebKit::WebCookieManager::setCookie): (WebKit::WebCookieManager::setCookies): (WebKit::WebCookieManager::notifyCookiesDidChange): (WebKit::WebCookieManager::startObservingCookieChanges): (WebKit::WebCookieManager::stopObservingCookieChanges): * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Cookies/WebCookieManager.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::create): (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebDatabaseProvider.cpp: (WebKit::WebDatabaseProvider::idbConnectionToServerForSession): * WebProcess/Databases/WebDatabaseProvider.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPrivateBrowsingEnabled): * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didCacheResource): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebSocketProvider.cpp: (WebKit::WebSocketProvider::createSocketStreamHandle): * WebProcess/Network/WebSocketProvider.h: * WebProcess/Network/WebSocketStream.cpp: (WebKit::WebSocketStream::create): (WebKit::WebSocketStream::WebSocketStream): * WebProcess/Network/WebSocketStream.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::convertMainResourceLoadToDownload): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/WebPlugInClient.cpp: (WebKit::WebPlugInClient::didStartFromOrigin): * WebProcess/WebCoreSupport/WebPlugInClient.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::startDownload): (WebKit::WebFrame::convertMainResourceLoadToDownload): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setSessionID): (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::sessionID const): * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::WebProcess::ensurePrivateBrowsingSession): (WebKit::WebProcess::destroySession): (WebKit::WebProcess::isPlugInAutoStartOriginHash): (WebKit::WebProcess::plugInDidStartFromOrigin): (WebKit::WebProcess::didAddPlugInAutoStartOriginHash): (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes): (WebKit::WebProcess::resetPlugInAutoStartOriginHashes): (WebKit::WebProcess::plugInDidReceiveUserInteraction): (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-08-17 Joseph Pecoraro Fix typo: setUpInectedBundleClient https://bugs.webkit.org/show_bug.cgi?id=175655 Reviewed by Andreas Kling. * UIProcess/API/Cocoa/WKProcessGroup.mm: (setUpInjectedBundleClient): (-[WKProcessGroup initWithInjectedBundleURL:]): 2017-08-17 Carlos Garcia Campos [GTK][WPE] Add NTLM authentication enabled API https://bugs.webkit.org/show_bug.cgi?id=122952 Reviewed by Michael Catanzaro. Add API to WebKitWebContext to enable/disable NTLM authentication. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::NetworkProcess::setNTLMAuthenticationEnabled): * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_get_ntlm_authentication_enabled): (webkit_web_context_set_ntlm_authentication_enabled): * UIProcess/API/gtk/WebKitWebContext.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitWebContext.h: * UIProcess/WebProcessPool.h: * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::setNTLMAuthenticationEnabled): 2017-08-16 Andy Estes [Apple Pay] Rename PaymentRequest to ApplePaySessionPaymentRequest https://bugs.webkit.org/show_bug.cgi?id=175648 Reviewed by Tim Horton. * Scripts/webkit/messages.py: (headers_for_type): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (toShippingMethod): (WebKit::toPKContactFields): (WebKit::toPKAddressField): (WebKit::toPKPaymentSummaryItemType): (WebKit::toPKPaymentSummaryItem): (WebKit::toPKPaymentSummaryItems): (WebKit::toPKMerchantCapabilities): (WebKit::toPKShippingType): (WebKit::toPKShippingMethod): (WebKit::toPKPaymentRequest): * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::showPaymentUI): (WebKit::WebPaymentCoordinator::didSelectShippingMethod): * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: 2017-08-16 Chris Dumez Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight https://bugs.webkit.org/show_bug.cgi?id=175628 Reviewed by Geoffrey Garen. Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight. To achieve this, the following changes were made: 1. Revert r220779 which caused us to use a non CORS-safelisted Content-Type header for such payload 2. Teach PingLoad how to deal with "simple" cross origin requests (i.e. Don't assume we need a CORS preflight merely because the fetch mode is set to "cors"). * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::startPreflight): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::loadRequest): (WebKit::PingLoad::originalRequestHeaders const): (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::isAllowedRedirect const): (WebKit::PingLoad::makeCrossOriginAccessRequest): (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest): (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight): (WebKit::PingLoad::preflightSuccess): * NetworkProcess/PingLoad.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-16 Yoshiaki Jitsukawa [PAL] Move spi/ios and spi/win directories into PAL https://bugs.webkit.org/show_bug.cgi?id=175171 Reviewed by Antti Koivisto. * UIProcess/Cocoa/NavigationState.mm: * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-08-16 Miguel Gomez [GTK] Crash of WebProcess with on-demand AC https://bugs.webkit.org/show_bug.cgi?id=171161 Reviewed by Carlos Garcia Campos. Set the viewOverlayRootLayer to the previous layerTreeHost if it exists. This avoids a crash when reusing the previous layerTreeHost, because it would keep a reference to an already destroyed viewOverlayRootLayer. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer): 2017-08-16 Zan Dobersek [CoordGraphics] Simplify CoordinatedGraphicsScene state updates https://bugs.webkit.org/show_bug.cgi?id=175528 Reviewed by Carlos Garcia Campos. Hold the information about state updates in ThreadedCompositor, in the m_attributes struct. This way we don't need to store the updates in functors and accumulate them in the CoordinatedGraphicsScene class, but instead just apply any pending state update or atlas removal before the scene is rendered. This removes the need to update the CoordinatedGraphicsScene object from the main thread with data that ultimately has to be handled on the composition thread. Similarly, when updating CoordinatedGraphicsScene, we only need to synchronize on the m_attributes lock object once in order to retrieve the scene update information, instead of having each functor do that repeatedly. Outside of CoordinatedGraphicsScene and ThreadedCompositor classes, the CompositingCoordinator class now passes the atlases-to-remove Vector by a const lvalue reference down to ThreadedCompositor, and then manually clears the Vector. Before the Vector was passed as an rvalue reference, depending on the ThreadedCompositor code to clear out the original Vector object by moving its resources into the functor object. This doesn't occur anymore because the Vector object is now appended to another Vector. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::applyStateChanges): (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): (WebKit::CoordinatedGraphicsScene::detach): (WebKit::CoordinatedGraphicsScene::setActive): (WebKit::CoordinatedGraphicsScene::syncRemoteContent): Deleted. (WebKit::CoordinatedGraphicsScene::appendUpdate): Deleted. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::releaseUpdateAtlases): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::flushPendingLayerChanges): (WebKit::CompositingCoordinator::releaseAtlases): (WebKit::CompositingCoordinator::clearUpdateAtlases): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: 2017-08-16 Andy Estes [Payment Request] Add an ENABLE flag and an experimental feature preference https://bugs.webkit.org/show_bug.cgi?id=175622 Reviewed by Tim Horton. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPaymentRequestEnabled): (WKPreferencesGetPaymentRequestEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-15 Carlos Garcia Campos [GTK][WPE] WebKitAutomationSession should set session client to nullptr on dispose https://bugs.webkit.org/show_bug.cgi?id=175564 Reviewed by Carlos Alberto Lopez Perez. WebAutomationSession expects its client to be nullptr in the destructor. * UIProcess/API/glib/WebKitAutomationSession.cpp: (webkitAutomationSessionDispose): 2017-08-15 Tim Horton WKSnapshotConfiguration is missing from the WebKit umbrella header https://bugs.webkit.org/show_bug.cgi?id=175614 Reviewed by Dan Bernstein. * Shared/API/Cocoa/WebKit.h: Add WKSnapshotConfiguration, which is a public header. 2017-08-15 Simon Fraser Allow WebCore logging channels to be set from the UI process https://bugs.webkit.org/show_bug.cgi?id=175608 Reviewed by Tim Horton. The UI process can now read the "WebCoreLogging" default, and pass it to the web process via WebProcessCreationParameters, where WebProcess::platformInitializeWebProcess() uses it to set up WebCore logging channels. Note that these will override channels read from the web process user defaults domain (but those are hard to set anyway). * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2017-08-15 Don Olmstead [PAL] Move Sleep classes into PAL https://bugs.webkit.org/show_bug.cgi?id=175456 Reviewed by Ryosuke Niwa. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: 2017-08-15 Youenn Fablet [Cache API] Adding generic support for CacheStorage and Cache methods https://bugs.webkit.org/show_bug.cgi?id=175455 Reviewed by Chris Dumez. * WebKit.xcodeproj/project.pbxproj: * WebProcess/Cache/WebCacheStorageProvider.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::cacheStorageProvider): 2017-08-15 Michael Catanzaro Unreviewed, rolling out r220700. Broke debug bot Reverted changeset: "[CoordGraphics] Simplify CoordinatedGraphicsScene state updates" https://bugs.webkit.org/show_bug.cgi?id=175528 http://trac.webkit.org/changeset/220700 2017-08-15 Carlos Garcia Campos WebDriver: timeout when JavaScript alert is shown in onload handler https://bugs.webkit.org/show_bug.cgi?id=175315 Reviewed by Brian Burg. When a JavaScript alert is shown in an onload handler, the alert prevents the load from finishing in case of normal page load strategy, so navigation commands or any other command for which we wait for navigation to complete end up timing out. There are two selenium tests covering this that are currently timing out: testShouldHandleAlertOnPageLoad and testShouldHandleAlertOnPageLoadUsingGet. The spec says that in case of page load timeout we should only fail with timeout error when there isn't an active alert dialog. If the next command expects an alert it will just work, otherwise it will fail with UnexpectedAlertOpen error when trying to handle user prompts. 9 Navigation. https://w3c.github.io/webdriver/webdriver-spec.html#dfn-wait-for-navigation-to-complete * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::waitForNavigationToComplete): Do not wait for the timeout when the page is loading and there's an active alert in case of normal page load strategy. (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout): Respond with timeout unless the page is showing a JavaScript dialog. (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout): Ditto. (WebKit::WebAutomationSession::loadTimerFired): Use respondToPendingPageNavigationCallbacksWithTimeout() and respondToPendingFrameNavigationCallbacksWithTimeout(). (WebKit::WebAutomationSession::willShowJavaScriptDialog): The page is about to show a JavaScript dialog, so we wait until the next run loop iteration to give time for the client to show the dialog, then check if page is loading and the dialog is still present. If that's the case we finish all normal strategy pending navigations. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptAlert): If controlled by automation, notify the session. (WebKit::WebPageProxy::runJavaScriptConfirm): Ditto. (WebKit::WebPageProxy::runJavaScriptPrompt): Ditto. (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Ditto. 2017-08-14 Carlos Garcia Campos WebDriver: handle click events on option elements https://bugs.webkit.org/show_bug.cgi?id=174710 Reviewed by Brian Burg. Add selectOptionElement method to automation to select an option element according to the WebDriver specification. 14.1 Element Click. https://w3c.github.io/webdriver/webdriver-spec.html#element-click * UIProcess/Automation/Automation.json: Add selectOptionElement method and ElementNotSelectable error. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::selectOptionElement):Send SelectOptionElement message to the web process. (WebKit::WebAutomationSession::didSelectOptionElement): Notify the driver. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.messages.in: Add DidSelectOptionElement message. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::elementContainer): Helper to get the container of an element according to the spec. (WebKit::WebAutomationSessionProxy::computeElementLayout): Use the container element to scroll the view and compute the in-view center point. (WebKit::WebAutomationSessionProxy::selectOptionElement): Use HTMLSelectElement::optionSelectedByUser(). * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SelectOptionElement message. 2017-08-14 Simon Fraser Remove Proximity Events and related code https://bugs.webkit.org/show_bug.cgi?id=175545 Reviewed by Daniel Bates. No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS) and other related code. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * WebProcess/WebCoreSupport/WebDeviceProximityClient.cpp: Removed. * WebProcess/WebCoreSupport/WebDeviceProximityClient.h: Removed. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): 2017-08-14 Simon Fraser Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere https://bugs.webkit.org/show_bug.cgi?id=175504 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::didRequestAutocomplete): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-08-14 Simon Fraser Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code https://bugs.webkit.org/show_bug.cgi?id=175557 Reviewed by Jon Lee. No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it. * Configurations/FeatureDefines.xcconfig: 2017-08-14 Andy Estes [Apple Pay] Add support for phonetic contact names https://bugs.webkit.org/show_bug.cgi?id=175537 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Soft-linked PKContactFieldPhoneticName. (WebKit::toPKContactFields): Added code to append PKContactFieldPhoneticName to result if contactFields.phoneticName is true. (WebKit::toNSError): Specified PKContactFieldPhoneticName as the contact field for PaymentError::ContactField::PhoneticName. 2017-08-14 Tim Horton Only create directory and sandbox extension handle for storage directories if they are set https://bugs.webkit.org/show_bug.cgi?id=175522 Reviewed by Brady Eidson. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): If using a non-persistent WebsiteDataStore, all the storage directories are unset, but we still try to create them and make sandbox extensions for them. This has no effect except a ton of noisy logging, but that is reason enough to stop. This is similar to r216053, but for more directories. 2017-08-14 Zan Dobersek [CoordGraphics] Simplify CoordinatedGraphicsScene state updates https://bugs.webkit.org/show_bug.cgi?id=175528 Reviewed by Carlos Garcia Campos. Hold the information about state updates in ThreadedCompositor, in the m_attributes struct. This way we don't need to store the updates in functors and accumulate them in the CoordinatedGraphicsScene class, but instead just apply any pending state update or atlas removal before the scene is rendered. This removes the need to update the CoordinatedGraphicsScene object from the main thread with data that ultimately has to be handled on the composition thread. Similarly, when updating CoordinatedGraphicsScene, we only need to synchronize on the m_attributes lock object once in order to retrieve the scene update information, instead of having each functor do that repeatedly. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::applyStateChanges): (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): (WebKit::CoordinatedGraphicsScene::detach): (WebKit::CoordinatedGraphicsScene::setActive): (WebKit::CoordinatedGraphicsScene::syncRemoteContent): Deleted. (WebKit::CoordinatedGraphicsScene::appendUpdate): Deleted. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::releaseUpdateAtlases): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 2017-08-14 Carlos Garcia Campos [GTK][WPE] Avoid emitting WebKitFaviconDatabase::favicon-changed multiple times while setting an icon https://bugs.webkit.org/show_bug.cgi?id=175531 Reviewed by Michael Catanzaro. When webkitFaviconDatabaseSetIconForPageURL() is called, both setIconURLForPageURL() and setIconDataForIconURL() might notify the client, which ends up emitting the WebKitFaviconDatabase::favicon-changed signal and calling webkitFaviconDatabaseSetIconURLForPageURL(). Both things are already done by webkitFaviconDatabaseSetIconForPageURL() itself, so we can just ignore the client notification while setting a new icon. * UIProcess/API/glib/WebKitFaviconDatabase.cpp: (webkitFaviconDatabaseSetIconURLForPageURL): Return early if isSettingIcon is true. (webkitFaviconDatabaseSetIconForPageURL): Set isSettingIcon to true for the scope. 2017-08-14 Carlos Garcia Campos [GTK][WPE] Crash in IconDatabase::IconRecord::setImageData() https://bugs.webkit.org/show_bug.cgi?id=175527 Reviewed by Žan Doberšek. The problem is that when setImageData() is called from IconDatabase::readFromDatabase() the shared buffer might be nullptr, because getImageDataForIconURLFromSQLDatabase() returns nullptr if the icon data is not in the database. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::IconRecord::setImageData): Return early if passed in buffer is nullptr. 2017-08-14 Zan Dobersek [ThreadedCompositor] Improve composition and update state handling https://bugs.webkit.org/show_bug.cgi?id=172448 Reviewed by Carlos Garcia Campos. In the ThreadedCompositor and related classes, we now track composition and scene update states separately. This enables properly piping in the DisplayRefreshMonitor object, leveraging it for both display refresh notifications and signalling to the client that the scene update is completed. In CompositingRunLoop, two separate states are now used, one for compositing and the other for scene update. Access to both should be done while the related Lock object is held. The pending update state is also tracked in order to schedule any required updates as soon as the current state update is completed. In ThreadedCompositor, the information about client notification and update completion coordination is now also kept under a Lock object, moving away from atomics. DisplayRefreshMonitor can now utilize just two methods in order to either schedule an update or report that update as finished. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): (WebKit::CompositingRunLoop::scheduleUpdate): (WebKit::CompositingRunLoop::stopUpdates): (WebKit::CompositingRunLoop::compositionCompleted): (WebKit::CompositingRunLoop::updateCompleted): (WebKit::CompositingRunLoop::updateTimerFired): (WebKit::CompositingRunLoop::isActive): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: (WebKit::CompositingRunLoop::stateLock): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::sceneUpdateFinished): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::requestDisplayRefreshMonitorUpdate): (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate): (WebKit::ThreadedCompositor::renderNextFrameIfNeeded): Deleted. (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded): Deleted. (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback): 2017-08-13 Manuel Rego Casasnovas Composition underline color is always black https://bugs.webkit.org/show_bug.cgi?id=174675 Reviewed by Ryosuke Niwa. This patch uses the current color of the text instead of black for the composition underline marker. This makes it visible in the case we have a black/dark background. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::extractUnderlines): If NSUnderlineColorAttributeName is not present use text color for composition underline. (WebKit::WebViewImpl::setMarkedText): Use text color for composition underline in the plain text case. * UIProcess/gtk/InputMethodFilter.cpp: (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults): Use text color for composition underline. (WebKit::InputMethodFilter::updatePreedit): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setCompositionForTesting): Ditto. 2017-08-13 Adrian Perez de Castro [WPE] Implement WebCore::standardUserAgent() https://bugs.webkit.org/show_bug.cgi?id=175507 Reviewed by Carlos Alberto Lopez Perez. Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port. * UIProcess/API/glib/WebKitSettings.cpp: Remove preprocessor conditionals for the WPE port. (webkit_settings_set_user_agent): (webkit_settings_set_user_agent_with_application_details): * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::standardUserAgent): Remove hardcoded value and make use of WebCore::standardUserAgent(). 2017-08-11 Ryosuke Niwa Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation https://bugs.webkit.org/show_bug.cgi?id=175474 Reviewed by Wenson Hsieh. Replaced the build flag by a runtime flag and disabled the feature by default. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDataTransferItemsEnabled): Added to be used by WebKitTestRunner. (WKPreferencesGetDataTransferItemsEnabled): Ditto. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-10 Sam Weinig WTF::Function does not allow for reference / non-default constructible return types https://bugs.webkit.org/show_bug.cgi?id=175244 Reviewed by Chris Dumez. * UIProcess/WebResourceLoadStatisticsStore.h: Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows us to remove support for calling null WTF::Function. No change in behavior. 2017-08-11 Adrian Perez de Castro [WPE] Build failure with Clang 4.0.1: no matching conversion for functional-style cast from 'pointer' (aka 'unsigned short *') to 'WTF::String' https://bugs.webkit.org/show_bug.cgi?id=175477 Reviewed by Žan Doberšek. * Shared/wpe/WebEventFactory.cpp: (WebKit::singleCharacterStringForKeyEvent): Cast to UChar* to make compiler choose the correct WTF::String constructor. 2017-08-11 Carlos Garcia Campos [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication https://bugs.webkit.org/show_bug.cgi?id=175378 Reviewed by Sergio Villar Senin. In case of HTTPS resource with a proxy, libsoup uses a tunnel internally, that uses its own SoupMessage during the proxy authentication. We were ignoring authentication requests for other messages. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::authenticateCallback): Only return early if the message does't match and it's not HTTPS resource over a proxy. (WebKit::NetworkDataTaskSoup::authenticate): Use the soup message from the authentication challenge. (WebKit::NetworkDataTaskSoup::continueAuthenticate): Ditto. 2017-08-10 Carlos Garcia Campos [Soup] Do not spawn the network process to setup cookie persistent storage https://bugs.webkit.org/show_bug.cgi?id=175424 Reviewed by Sergio Villar Senin. The persistent storage configuration is saved and passed to network process as creation parameters, so we don't need to spawn the network process to configure it, when it's created eventually it will use the configuration. * UIProcess/soup/WebCookieManagerProxySoup.cpp: (WebKit::WebCookieManagerProxy::setCookiePersistentStorage): Use sendToNetworkingProcess() instead of endToNetworkingProcessRelaunchingIfNecessary(). 2017-08-10 Carlos Garcia Campos [GTK][WPE] Assertion failure in TimerBase inside WebCore::IconRecord::setImageData https://bugs.webkit.org/show_bug.cgi?id=173866 Reviewed by Michael Catanzaro. IconDatabase creates and destroys IconRecord objects in both database and main thread. If the IconRecord has a valid icon, its Image could be created in one thread and destroyed in another, something that is not expected to happen, because Image has a Timer member. Since we have all the data and we are decoding it right after creating the Image, we don't really need to keep the Image object around, we could simply take a reference of the encoded data and the decoded native image to be returned by synchronousIconForPageURL(). * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::IconRecord::image): Return NativeImagePtr now. (WebKit::IconDatabase::IconRecord::setImageData): Create a BitmapImage to decode it and keep a reference to the encoded data and decoded native image. (WebKit::IconDatabase::IconRecord::snapshot const): Use m_imageData to get the encoded data. (WebKit::IconDatabase::synchronousIconForPageURL): Return the native image and whether the icon is known or not. (WebKit::IconDatabase::IconRecord::loadImageFromResource): Deleted. * UIProcess/API/glib/IconDatabase.h: * UIProcess/API/glib/WebKitFaviconDatabase.cpp: (getIconSurfaceSynchronously): Use new API. 2017-08-10 Dan Bernstein Restored svn:ignore values that went missing when the project got renamed. * WebKit.xcodeproj: Added property svn:ignore. 2017-08-10 Brady Eidson Rename the source files for the WTF persistent coders. https://bugs.webkit.org/show_bug.cgi?id=175441 Reviewed by Tim Horton. * NetworkProcess/cache/NetworkCacheCoders.h: * NetworkProcess/cache/NetworkCacheKey.cpp: * NetworkProcess/cache/NetworkCacheKey.h: * UIProcess/API/APIContentRuleListStore.cpp: 2017-08-10 John Wilander Resource Load Statistics: Increase grandfathering time to 7 days https://bugs.webkit.org/show_bug.cgi?id=175414 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-08-10 John Wilander Resource Load Statistics: Add significant figures to telemetry calls https://bugs.webkit.org/show_bug.cgi?id=175442 Reviewed by Brent Fulgham. With this change, logged values are allowed to have 3 significant figures as opposed to today's 0 which is wrong. * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::submitTopList): (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): 2017-08-10 Mark Lam Apply the UNLIKELY macro to some unlikely things. https://bugs.webkit.org/show_bug.cgi?id=175440 Reviewed by Yusuke Suzuki. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::getBytecodeProfile): 2017-08-10 Chris Dumez Turn on support for Beacon API by default in STP https://bugs.webkit.org/show_bug.cgi?id=175445 Reviewed by Youenn Fablet. * Shared/WebPreferencesDefinitions.h: 2017-08-10 Ross Kirsling Fix iOS simulator build after change "[WTF] Move TextStream into WTF" https://bugs.webkit.org/show_bug.cgi?id=175211 Reviewed by Myles C. Maxfield. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _scrollByContentOffset:]): (-[WKWebView _navigationGestureDidBegin]): 2017-08-10 Chris Dumez [Beacon] Do connect-src CSP check on redirects as well https://bugs.webkit.org/show_bug.cgi?id=175410 Reviewed by Youenn Fablet. Pass CSP Response headers to the NetworkProcess via NetworkResourceLoadParameters when doing a PingLoad. This allows PingLoad to do CSP checks (in particular connect-src ones) in case the ping load gets redirected. Those checks need to be done on the NetworkProcess side at this point because there is no guarantee the WebContent process is still around. To do the CSP checks, PingLoad lazily reconstructs a ContentSecurityPolicy object from the CSP response headers. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::contentSecurityPolicy): * NetworkProcess/PingLoad.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-10 Brian Burg WKPreferences should conform to NSCopying https://bugs.webkit.org/show_bug.cgi?id=175303 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Add conformance in the private header, as there is not consensus that this needs to be API. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences copyWithZone:]): Copy the wrapped WebPreferences instance and return its wrapper. 2017-08-10 Michael Catanzaro REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie https://bugs.webkit.org/show_bug.cgi?id=175426 Reviewed by Carlos Alberto Lopez Perez. * PlatformGTK.cmake: 2017-08-10 Brady Eidson Add ServiceWorkerJob. https://bugs.webkit.org/show_bug.cgi?id=175241 Reviewed by Tim Horton. * CMakeLists.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebServiceWorkerProvider.cpp: Added. (WebKit::WebServiceWorkerProvider::singleton): (WebKit::WebServiceWorkerProvider::WebServiceWorkerProvider): (WebKit::WebServiceWorkerProvider::scheduleJob): * WebProcess/Storage/WebServiceWorkerProvider.h: Added. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-08-10 Tim Horton Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture https://bugs.webkit.org/show_bug.cgi?id=175436 Reviewed by Simon Fraser. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): 2017-08-10 Michael Catanzaro Remove ENABLE_GAMEPAD_DEPRECATED https://bugs.webkit.org/show_bug.cgi?id=175361 Reviewed by Carlos Garcia Campos. * Configurations/FeatureDefines.xcconfig: 2017-08-10 Zan Dobersek [GTK] Don't use --whole-archive linking flags for the WebKit2 target libraries https://bugs.webkit.org/show_bug.cgi?id=175416 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: Drop the ADD_WHOLE_ARCHIVE_TO_LIBRARIES instruction for the WebKit2 target. This unnecessarily bundles complete archive files both into the main .so library as well as single executables that are linked against the WebKit2 target. 2017-08-09 Chris Dumez Disable Beacon API on WK1 DRT and WK2 when not using NETWORK_SESSION https://bugs.webkit.org/show_bug.cgi?id=175401 Reviewed by Brady Eidson. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetBeaconAPIEnabled): (WKPreferencesGetBeaconAPIEnabled): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * config.h: 2017-08-09 Yoshiaki Jitsukawa [PAL] Move spi/cocoa and spi/cg directories into PAL https://bugs.webkit.org/show_bug.cgi?id=175175 Reviewed by Myles C. Maxfield. * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: * NetworkProcess/Downloads/mac/DownloadMac.mm: * Platform/cocoa/SharedMemoryCocoa.cpp: * Platform/mac/LayerHostingContext.mm: * Shared/Cocoa/DataDetectionResult.mm: * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: * Shared/cf/CookieStorageUtilsCF.mm: * Shared/ios/InteractionInformationAtPosition.mm: * Shared/mac/HangDetectionDisablerMac.mm: * Shared/mac/RemoteLayerBackingStore.mm: * Shared/mac/RemoteLayerTreePropertyApplier.mm: * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/mac/WKView.mm: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: * UIProcess/ios/ViewGestureControllerIOS.mm: * UIProcess/ios/WKContentView.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/WKPDFPageNumberIndicator.mm: * UIProcess/ios/WKScrollView.mm: * UIProcess/mac/RemoteLayerTreeHost.mm: * UIProcess/mac/ServicesController.mm: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: * UIProcess/mac/ViewGestureControllerMac.mm: * UIProcess/mac/ViewSnapshotStore.mm: * UIProcess/mac/WKViewLayoutStrategy.mm: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-08-09 John Wilander Resource Load Statistics: Increase grandfathering time to 3 days https://bugs.webkit.org/show_bug.cgi?id=175414 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-08-09 Jeremy Jones Invalidate PlaybackSessionManager in same fashion as VideoFullscreenManager. https://bugs.webkit.org/show_bug.cgi?id=175399 rdar://problem/33663344 Reviewed by Eric Carlson. Invalidate PlaybackSessionManager when WebPage is destructed. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::~WebPage): * WebProcess/cocoa/PlaybackSessionManager.h: * WebProcess/cocoa/PlaybackSessionManager.mm: (WebKit::PlaybackSessionManager::~PlaybackSessionManager): (WebKit::PlaybackSessionManager::invalidate): 2017-08-09 Don Olmstead [WTF] Move TextStream into WTF https://bugs.webkit.org/show_bug.cgi?id=175211 Reviewed by Myles C. Maxfield. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: * Shared/VisibleContentRectUpdateInfo.cpp: * Shared/VisibleContentRectUpdateInfo.h: * Shared/mac/RemoteLayerTreeTransaction.mm: * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/ios/WKContentView.mm: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (WebKit::operator<<): * UIProcess/ios/WebPageProxyIOS.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: 2017-08-09 Andy Estes Part 3 of: Rename DatabaseProcess to StorageProcess https://bugs.webkit.org/show_bug.cgi?id=175034 Reviewed by Brady Eidson. We tried renaming com.apple.WebKit.Databases to com.apple.WebKit.Storage in r219986, but this prevented trunk WebKit from running on iOS 11 devices. This is because launchd keeps a codesigned cache of XPC services, and refuses to launch services that aren't in the cache. It's not possibe for us to rebuild the cache with the new service name (only Apple's production build system can do this), and disabling the cache or opting WebKit's XPC services out of the cache might have a negative impact on our performance testing. For now we'll retain the name "com.apple.WebKit.Databases" on iOS 11 devices to work around this issue. If we find a way to allow the new service to run without impacting performance, we can revert this change. We will rename the service to "com.apple.WebKit.Storage" on macOS and iOS Simulator, and in a follow-up patch we'll use the new service name on post-iOS 11 device builds. * Configurations/BaseTarget.xcconfig: Defined WK_STORAGE_SERVICE_PRODUCT_NAME to be com.apple.WebKit.Databases by default, and overrode it to com.apple.WebKit.Storage on macOS and iOS Simulator. * Configurations/StorageService.xcconfig: Changed PRODUCT_NAME to $(WK_STORAGE_SERVICE_PRODUCT_NAME). * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): Changed to return "com.apple.WebKit.Storage" on macOS and iOS Simulator platforms. * WebKit.xcodeproj/project.pbxproj: Updated the "Copy XPC services for engineering builds" build phase to use WK_STORAGE_SERVICE_PRODUCT_NAME. 2017-08-09 Commit Queue Unreviewed, rolling out r220466, r220477, and r220487. https://bugs.webkit.org/show_bug.cgi?id=175411 This change broke existing API tests and follow up fixes did not resolve all the issues. (Requested by ryanhaddad on #webkit). Reverted changesets: https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220466 "WTF::Function does not allow for reference / non-default constructible return types" https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220477 https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220487 2017-08-09 Chris Dumez [Beacon][NetworkSession] Support CORS-preflighting on redirects https://bugs.webkit.org/show_bug.cgi?id=175386 Reviewed by Youenn Fablet. Add support to Beacon for doing CORS-preflighting upon redirect to a different domain. * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::~PingLoad): (WebKit::PingLoad::loadRequest): (WebKit::PingLoad::securityOrigin const): (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::didReceiveResponseNetworkSession): (WebKit::PingLoad::needsCORSPreflight const): (WebKit::PingLoad::doCORSPreflight): * NetworkProcess/PingLoad.h: 2017-08-09 Jeremy Jones Use MPAVRoutingController instead of deprecated versions. https://bugs.webkit.org/show_bug.cgi?id=175063 rdar://problem/33301230 Reviewed by Tim Horton. Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController. * UIProcess/ios/forms/WKAirPlayRoutePicker.h: * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: (-[WKAirPlayRoutePicker dealloc]): (-[WKAirPlayRoutePicker show:fromRect:]): (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted. (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted. (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted. (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted. (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted. (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted. (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted. 2017-08-09 Sam Weinig WTF::Function does not allow for reference / non-default constructible return types https://bugs.webkit.org/show_bug.cgi?id=175244 Reviewed by Chris Dumez. * UIProcess/WebResourceLoadStatisticsStore.h: Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows us to remove support for calling null WTF::Function. No change in behavior. 2017-08-09 Wenson Hsieh [iOS DnD] ENABLE_DRAG_SUPPORT should be turned off for iOS 10 and enabled by default https://bugs.webkit.org/show_bug.cgi?id=175392 Reviewed by Tim Horton and Megan Gardner. Tweak FeatureDefines to enable drag and drop by default, and disable only on unsupported platforms (i.e. iOS 10). * Configurations/FeatureDefines.xcconfig: 2017-08-09 Brady Eidson ServiceWorker experimental feature should not be on by default (definitely not ready). https://bugs.webkit.org/show_bug.cgi?id=175389 Rubberstamped by Andy Estes. * Shared/WebPreferencesDefinitions.h: false, not DEFAULT_EXPERIMENTAL_FEATURES_ENABLED 2017-08-09 Ryan Haddad Unreviewed, rolling out r220457. This change introduced API test failures. Reverted changeset: "WTF::Function does not allow for reference / non-default constructible return types" https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220457 2017-08-09 Daniel Bates REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication https://bugs.webkit.org/show_bug.cgi?id=175247 Reviewed by Brady Eidson. Add SPI WKNavigationAction._isRedirect to query whether the navigation was in response to receiving a redirect response. The majority of the WebKit change is plumbing this knowledge through to connect it with the SPI. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode const): (WebKit::NavigationActionData::decode): Encode and decode the boolean NavigationActionData::isRedirect. * Shared/NavigationActionData.h: * UIProcess/API/APINavigationAction.h: * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction _isRedirect]): Added. * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Set NavigationActionData::isRedirect depending on whether the navigation is in response to receiving a redirect response. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-08-09 Sam Weinig WTF::Function does not allow for reference / non-default constructible return types https://bugs.webkit.org/show_bug.cgi?id=175244 Reviewed by Chris Dumez. * UIProcess/WebResourceLoadStatisticsStore.h: Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows us to remove support for calling null WTF::Function. No change in behavior. 2017-08-08 Wenson Hsieh Unreviewed, rolling out r220393. This patch regresses the performance of WebPage::editorState. Reverted changeset: "[iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div" https://bugs.webkit.org/show_bug.cgi?id=175116 http://trac.webkit.org/changeset/220393 2017-08-08 Chris Dumez [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION https://bugs.webkit.org/show_bug.cgi?id=175264 Reviewed by Youenn Fablet. Implement CORS-preflighting for beacons with a payload that has a non safelisted MIME type, as per: - https://w3c.github.io/beacon/#privacy - https://www.w3.org/TR/beacon/#sec-processing-model CORS-preflighting is completely handled on Network Process side because a beacon request can outlive its page and therefore its WebContent process. This requires us to pass a little more information to the Network process, in particular the source origin and the corsMode. The current implementation does not currently deal with CORS preflights needed upon a redirect. This will be added in a follow-up. * CMakeLists.txt: * NetworkProcess/NetworkCORSPreflightChecker.cpp: Added. (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker): (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker): (WebKit::NetworkCORSPreflightChecker::startPreflight): (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection): (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge): (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession): (WebKit::NetworkCORSPreflightChecker::didReceiveData): (WebKit::NetworkCORSPreflightChecker::didCompleteWithError): (WebKit::NetworkCORSPreflightChecker::didSendData): (WebKit::NetworkCORSPreflightChecker::wasBlocked): (WebKit::NetworkCORSPreflightChecker::cannotShowURL): * NetworkProcess/NetworkCORSPreflightChecker.h: Added. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: Added. (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::~PingLoad): (WebKit::PingLoad::startNetworkLoad): (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::didReceiveChallenge): (WebKit::PingLoad::didReceiveResponseNetworkSession): (WebKit::PingLoad::didReceiveData): (WebKit::PingLoad::didCompleteWithError): (WebKit::PingLoad::didSendData): (WebKit::PingLoad::wasBlocked): (WebKit::PingLoad::cannotShowURL): (WebKit::PingLoad::timeoutTimerFired): (WebKit::PingLoad::needsCORSPreflight const): (WebKit::PingLoad::doCORSPreflight): * NetworkProcess/PingLoad.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-08 Megan Gardner Remove old and unused pointIsInAssistedNode definition https://bugs.webkit.org/show_bug.cgi?id=175335 Stage removal here to allow removal from UIKit. Replaced by textInteractionGesture:shouldBeginAtPoint: Reviewed by Tim Horton. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView pointIsInAssistedNode:]): Deleted. 2017-08-08 Michael Catanzaro Unreviewed, fix Ubuntu LTS build https://bugs.webkit.org/show_bug.cgi?id=174490 * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::RemoteInspectorClient): 2017-08-08 Wenson Hsieh Unreviewed, fix the Mac debug build after r220418. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::prepareForMoveToWindow): 2017-08-08 Wenson Hsieh [Mac WK2] WebViewImpl should hold a weak pointer to its WKWebView or WKView https://bugs.webkit.org/show_bug.cgi?id=175302 Reviewed by Tim Horton. Refactor WebViewImpl's m_view from a raw pointer to a WeakObjCPtr to ensure that it is automatically cleared out when the WKWebView or WKView are destroyed, and also changes several places where we implicitly block capture the WebViewImpl to only capture a WeakPtr to the WebViewImpl. Most of the changes here are boilerplate adjustments for how m_view is now a weak pointer. Test: WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView. * Shared/mac/WeakObjCPtr.h: (WebKit::WeakObjCPtr::operator ValueType * const): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateTouchBar): (WebKit::WebViewImpl::updateMediaTouchBar): (WebKit::WebViewImpl::WebViewImpl): (WebKit::WebViewImpl::~WebViewImpl): (WebKit::WebViewImpl::window): (WebKit::WebViewImpl::resignFirstResponder): (WebKit::WebViewImpl::isFocused const): (WebKit::WebViewImpl::renewGState): (WebKit::WebViewImpl::setFrameAndScrollBy): (WebKit::WebViewImpl::updateWindowAndViewFrames): (WebKit::WebViewImpl::updateLayer): (WebKit::WebViewImpl::printOperationWithPrintInfo): (WebKit::WebViewImpl::updateContentInsetsIfAutomatic): (WebKit::WebViewImpl::setLayoutMode): (WebKit::WebViewImpl::intrinsicDeviceScaleFactor const): (WebKit::WebViewImpl::windowDidBecomeKey): (WebKit::WebViewImpl::windowDidResignKey): (WebKit::WebViewImpl::windowDidChangeScreen): (WebKit::WebViewImpl::mightBeginDragWhileInactive): (WebKit::WebViewImpl::acceptsFirstMouse): (WebKit::WebViewImpl::shouldDelayWindowOrderingForEvent): (WebKit::WebViewImpl::windowResizeMouseLocationIsInVisibleScrollerThumb): (WebKit::WebViewImpl::viewWillMoveToWindow): (WebKit::WebViewImpl::viewDidMoveToWindow): (WebKit::WebViewImpl::viewDidChangeBackingProperties): (WebKit::WebViewImpl::hitTest): (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent): (WebKit::WebViewImpl::colorSpace): (WebKit::WebViewImpl::prepareForMoveToWindow): (WebKit::WebViewImpl::notifyInputContextAboutDiscardedComposition): (WebKit::WebViewImpl::pressureChangeWithEvent): (WebKit::WebViewImpl::fullScreenWindowController): (WebKit::WebViewImpl::executeSavedCommandBySelector): (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes): (WebKit::WebViewImpl::handleRequestedCandidates): (WebKit::WebViewImpl::preferencesDidChange): (WebKit::WebViewImpl::setTextIndicator): (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly): (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens): (WebKit::WebViewImpl::sendToolTipMouseExited): (WebKit::WebViewImpl::sendToolTipMouseEntered): (WebKit::WebViewImpl::toolTipChanged): (WebKit::WebViewImpl::setAcceleratedCompositingRootLayer): (WebKit::WebViewImpl::updateThumbnailViewLayer): (WebKit::WebViewImpl::setInspectorAttachmentView): (WebKit::WebViewImpl::inspectorAttachmentView): (WebKit::WebViewImpl::draggedImage): (WebKit::WebViewImpl::draggingEntered): (WebKit::WebViewImpl::draggingUpdated): (WebKit::WebViewImpl::draggingExited): (WebKit::WebViewImpl::performDragOperation): (WebKit::WebViewImpl::hitTestForDragTypes): (WebKit::WebViewImpl::startWindowDrag): (WebKit::WebViewImpl::dragImageForView): (WebKit::WebViewImpl::setPromisedDataForImage): (WebKit::WebViewImpl::setPromisedDataForAttachment): (WebKit::WebViewImpl::takeViewSnapshot): (WebKit::WebViewImpl::scrollWheel): (WebKit::WebViewImpl::magnifyWithEvent): (WebKit::WebViewImpl::rotateWithEvent): (WebKit::WebViewImpl::doneWithKeyEvent): (WebKit::WebViewImpl::interpretKeyEvent): (WebKit::WebViewImpl::firstRectForCharacterRange): (WebKit::WebViewImpl::characterIndexForPoint): (WebKit::WebViewImpl::performKeyEquivalent): (WebKit::WebViewImpl::keyUp): (WebKit::WebViewImpl::keyDown): (WebKit::WebViewImpl::mouseMoved): (WebKit::WebViewImpl::windowIsFrontWindowUnderMouse): (WebKit::WebViewImpl::userInterfaceLayoutDirection): 2017-08-08 Filip Pizlo Baseline JIT should do caging https://bugs.webkit.org/show_bug.cgi?id=175037 Reviewed by Mark Lam. Use a better API to disable disabling the primitive gigacage. * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::primitiveGigacageDisabled): Deleted. 2017-08-08 John Wilander Resource Load Statistics: Clear web processes' state on history removal https://bugs.webkit.org/show_bug.cgi?id=175271 Reviewed by Chris Dumez. https://bugs.webkit.org/show_bug.cgi?id=175090 introduced state in the web process and that state needs to be cleared when the UI process' statistics are cleared as part of history removal. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::clearResourceLoadStatistics): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::clearResourceLoadStatistics): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-08-08 Adrian Perez de Castro [WPE] Implement WebsiteDataStore::defaultApplicationCacheDirectory() and friends https://bugs.webkit.org/show_bug.cgi?id=175322 Reviewed by Carlos Garcia Campos. This makes WPE use the same implementation as the GTK+ port, with a preprocessor switch to choose the name of the base directory inside the user XDG cache directory. * PlatformGTK.cmake: Add APIWebsiteDataStoreGLib.cpp to the build sources and remove APIWebsiteDataStoreGtk.cpp. * PlatformWPE.cmake: Add APIWebsiteDataStoreGLib.cpp to the built sources. * UIProcess/API/APIWebsiteDataStore.cpp: Remove now dead code. * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp. (API::WebsiteDataStore::defaultApplicationCacheDirectory): (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): (API::WebsiteDataStore::defaultLocalStorageDirectory): (API::WebsiteDataStore::defaultMediaKeysStorageDirectory): (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): 2017-08-08 Ryan Haddad Unreviewed, rolling out r220368. This change caused WK1 tests to exit early with crashes. Reverted changeset: "Baseline JIT should do caging" https://bugs.webkit.org/show_bug.cgi?id=175037 http://trac.webkit.org/changeset/220368 2017-08-08 Michael Catanzaro [CMake] Properly test if compiler supports compiler flags https://bugs.webkit.org/show_bug.cgi?id=174490 Reviewed by Konstantin Tokarev. * CMakeLists.txt: * PlatformGTK.cmake: 2017-08-07 Carlos Garcia Campos Web Automation: setUserInputForCurrentJavaScriptPrompt should fail if current dialog is not a prompt https://bugs.webkit.org/show_bug.cgi?id=175261 Reviewed by Brian Burg. According to the spec, send alert text command should fail if the current dialog is not a prompt. This patch adds JavaScriptDialogType enum to API::AutomationSessionClient and a new virtual method to ask the client about the type of the current dialog. WebAutomationSession::setUserInputForCurrentJavaScriptPrompt() uses the new client method to check the type of the current dialog and fail in case it's not a prompt. Cocoa needs an implementation, for now it always returns Prompt as the type to keep compatibility. 18.4 Send Alert Text. https://w3c.github.io/webdriver/webdriver-spec.html#send-alert-text This fixes selenium test testSettingTheValueOfAnAlertThrows. * UIProcess/API/APIAutomationSessionClient.h: (API::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage): * UIProcess/API/glib/WebKitAutomationSession.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewGetCurrentScriptDialogType): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt): * UIProcess/Cocoa/AutomationSessionClient.h: * UIProcess/Cocoa/AutomationSessionClient.mm: (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage): 2017-08-08 Wenson Hsieh [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div https://bugs.webkit.org/show_bug.cgi?id=175116 Reviewed by Darin Adler and Ryosuke Niwa. Refactors WebPage::editorState to only use the StyleProperties derived from EditingStyle, instead of inserting and removing a temporary node to figure out the style. Also adds hooks to notify the UI delegate of EditorState changes. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (nsTextAlignment): (dictionaryRepresentationForEditorState): (-[WKWebView _didChangeEditorState]): Alerts the private UI delegate of UI-side EditorState updates. (-[WKWebView _web_editorStateDidChange]): (-[WKWebView _executeEditCommand:argument:completion:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _web_editorStateDidChange]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::selectionDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::executeEditCommand): Change executeEditCommand(name, callback) to executeEditCommand(name, argument, callback) and lift out of iOS platform code and into WebPage.cpp. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView executeEditCommandWithCallback:]): (-[WKContentView _selectionChanged]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::executeEditCommand): Deleted. Move the iOS-specific implementation of executeEditCommand that invokes a callback when the web process responds out of WebPageProxyIOS, and into cross-platform WebPageProxy code. Additionally, add a parameter for the edit command's argument. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): Use EditingStyle::styleAtSelectionStart instead of Editor::styleForSelectionStart when computing an EditorState. Tweak bold, italic and underline to use EditingStyle TriStates. (WebKit::shouldEnsureEditorStateUpdateAfterExecutingCommand): (WebKit::WebPage::executeEditCommandWithCallback): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::executeEditCommandWithCallback): Deleted. 2017-08-08 Zan Dobersek [TexMap] Don't expose GraphicsContext3D object https://bugs.webkit.org/show_bug.cgi?id=175310 Reviewed by Carlos Garcia Campos. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Stop using GraphicsContext3D directly and instead use the TextureMapper::clearColor() method to achieve the same result. 2017-08-07 Carlos Garcia Campos [GTK] Implement JavaScript dialog methods of API::AutomationSessionClient https://bugs.webkit.org/show_bug.cgi?id=175259 Reviewed by Michael Catanzaro. Move the default implementation of WebKitScriptDialog from WebKitWebView platform specific files to their own files. Implement all JavaScript dialog methods of API::AutomationSessionClient in WebKitAutomationSession. For now it only works when the user doesn't override WebKitWebView::script-dialog signal and default implementation is used. * PlatformGTK.cmake: Add new files to compilation. * PlatformWPE.cmake: Ditto. * UIProcess/API/glib/WebKitAutomationSession.cpp: (webkitAutomationSessionCreate): Pass the WebKitWebContext to the constructor and keep a pointer to it in session. * UIProcess/API/glib/WebKitAutomationSessionPrivate.h: * UIProcess/API/glib/WebKitScriptDialogPrivate.h: * UIProcess/API/glib/WebKitWebContext.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunJavaScriptAlert): Set the currently script dialog for the scope of the function. (webkitWebViewRunJavaScriptConfirm): Ditto. (webkitWebViewRunJavaScriptPrompt): Ditto. (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto. (webkitWebViewIsShowingScriptDialog): Ask current dialog if there's one. (webkitWebViewGetCurrentScriptDialogMessage): Ditto. (webkitWebViewSetCurrentScriptDialogUserInput): Ditto. (webkitWebViewAcceptCurrentScriptDialog): Ditto. (webkitWebViewDismissCurrentScriptDialog): Ditto. * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp: Added. (webkitWebViewCreateJavaScriptDialog): Moved from WebKitWebViewGtk.cpp. (webkitScriptDialogRun): Run the dialog, this code is moved from WebKitWebViewGtk.cpp. (webkitScriptDialogIsRunning): Return true if the script dialog has a native dialog running. (webkitScriptDialogAccept): Send Ok or Close response to the native dialog depending on the dialog type. (webkitScriptDialogDismiss): Send Close response to the native dialog. (webkitScriptDialogSetUserInput): Set the given text on the prompt dialog entry. * UIProcess/API/gtk/WebKitWebViewGtk.cpp: (webkitWebViewScriptDialog): Simply call webkitScriptDialogRun() now. * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp: Copied from Source/WebKit/UIProcess/API/glib/WebKitAutomationSessionPrivate.h. (webkitScriptDialogRun): (webkitScriptDialogIsRunning): (webkitScriptDialogAccept): (webkitScriptDialogDismiss): (webkitScriptDialogSetUserInput): 2017-08-07 Devin Rousso Web Inspector: Preview Canvas path when viewing a recording https://bugs.webkit.org/show_bug.cgi?id=174967 Reviewed by Brian Burg. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetInspectorAdditionsEnabled): (WKPreferencesGetInspectorAdditionsEnabled): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Add plumbing for new InspectorAdditions runtime flag. * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::WebInspectorUI): Enable InspectorAdditions by default in the WebInspector page. 2017-08-07 Filip Pizlo Baseline JIT should do caging https://bugs.webkit.org/show_bug.cgi?id=175037 Reviewed by Mark Lam. Use a better