2016-11-09 Matthew Hanson Merge r208437. rdar://problem/29032334 2016-11-09 Chris Dumez [WK2] Network cache speculative revalidation can cause loads to hang https://bugs.webkit.org/show_bug.cgi?id=164532 Reviewed by Alex Christensen. Network cache speculative revalidation could cause loads to hang when HTTP authentication was involved because NetworkCacheSpeculativeLoad failed to call NetworkLoad::continueCanAuthenticateAgainstProtectionSpace() in its canAuthenticateAgainstProtectionSpaceAsync() callback. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: 2016-11-03 Matthew Hanson Merge r208328. rdar://problem/29084886 2016-11-03 Dan Bernstein REGRESSION (r206247): Painting milestones can be delayed until the next layer flush https://bugs.webkit.org/show_bug.cgi?id=164340 Reviewed by Tim Horton. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper function that sends the message to the UI process and resets m_pendingNewlyReachedLayoutMilestones. (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the pending milestones and send them to the UI process. This way we don’t miss milestones that fire during the commit. 2016-11-03 Matthew Hanson Merge r208340. rdar://problem/29092397 2016-11-03 Dan Bernstein WKWebView’s _observedRenderingProgressEvents not restored after web process crash https://bugs.webkit.org/show_bug.cgi?id=164368 Reviewed by Anders Carlsson. Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member. (WebKit::WebPageCreationParameters::decode): Decode it. * Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Removed initializer for m_wantsSessionRestorationRenderTreeSizeThresholdEvent. (WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent. (WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the creation parameters. * UIProcess/WebPageProxy.h: Declared new member variable, deleted m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didCommitLayerTree): Rather than using m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters. 2016-11-03 Matthew Hanson Merge r208307. rdar://problem/29078457 2016-11-02 David Kilzer Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes Reviewed by Alex Christensen. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash): Add private method to log diagnostic message. (WebKit::WebProcess::networkProcessConnectionClosed): Call logDiagnosticMessageForNetworkProcessCrash(). * WebProcess/WebProcess.h: (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash): Declare new method. 2016-11-03 Matthew Hanson Merge r208286. rdar://problem/28634857 2016-11-02 David Kilzer Add logging for "WebKit encountered an internal error" messages Reviewed by Alex Christensen. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResourceSynchronously): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResource): - Add logging for various internalError() events. 2016-11-01 Matthew Hanson Rollout r208255. rdar://problem/28962886 2016-11-01 Matthew Hanson Rollout r208173. rdar://problem/28962886 2016-10-31 Matthew Hanson Merge r208168. rdar://problem/28962886 2016-10-28 Brent Fulgham Do a better job of protecting Frame objects in the context of JavaScript calls https://bugs.webkit.org/show_bug.cgi?id=164163 Reviewed by Darin Adler. * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertTextAsync): Ditto. (WebKit::WebPage::setComposition): Ditto. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::insertDictatedTextAsync): Ditto. 2016-10-31 Matthew Hanson Merge r206802. rdar://problem/28409525 2016-10-28 Said Abou-Hallawa The dragged image should be the current frame only of the animated image https://bugs.webkit.org/show_bug.cgi?id=162109 * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name. 2016-10-27 Matthew Hanson Merge r206684. rdar://problem/28545011 2016-09-30 Brady Eidson REGRESSION (Safari 10 combined with WK changes): Unable to store WebCrypto keys in IndexedDB database. and https://bugs.webkit.org/show_bug.cgi?id=162554 Reviewed by Alexey Proskuryakov. Safari 10 has a WKPageNavigation client but does not implement the "copyWebCryptoMasterKey" callback. WebKit just fails in this case, instead of falling back to "getDefaultWebCryptoMasterKey". It should fall back. Additionally there's a WKContextClient callback to get the crypto key, also, but it is completely unused. So it should be pulled. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::webCryptoMasterKey): Deleted. * UIProcess/API/C/WKContext.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): (WKPageSetPageNavigationClient): If the client doesn't implement this method, fallback to getDefaultWebCryptoMasterKey. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): If the client doesn't implement this method, fallback to getDefaultWebCryptoMasterKey. * UIProcess/WebContextClient.cpp: (WebKit::WebContextClient::copyWebCryptoMasterKey): Deleted. * UIProcess/WebContextClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::wrapCryptoKey): Only ask the NavigationClient before falling back. Don't ask the loader client. (WebKit::WebPageProxy::unwrapCryptoKey): Ditto. 2016-10-26 David Kilzer Merge r207708. rdar://problem/28962914 2016-10-21 David Kilzer Bug 163762: IntSize::area() should used checked arithmetic Reviewed by Darin Adler. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): Add overflow check and return nullptr on overflow. (WebKit::ShareableBitmap::createShareable): Ditto. (WebKit::ShareableBitmap::create): Change debug assert for adequate buffer size check into release check. * Shared/ShareableBitmap.h: (WebKit::ShareableBitmap::numBytesForSize): Change to return a Checked value. (WebKit::ShareableBitmap::sizeInBytes): * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::numBytesForSize): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot]): Call unsafeGet(). 2016-10-26 Babak Shafiei Merge r207171. rdar://problem/28857503 2016-10-11 Daniel Bates Attempt to fix the Apple Internal Mac build following r207159 (https://bugs.webkit.org/show_bug.cgi?id=163244) * UIProcess/API/Cocoa/WKWebView.mm: (shouldRequireUserGestureToLoadVideo): 2016-10-24 Matthew Hanson Merge r206762. rdar://problem/28544885 2016-10-03 Keith Rollin More logging to diagnose "WebKit encountered an internal error" messages https://bugs.webkit.org/show_bug.cgi?id=162754 Reviewed by Antti Koivisto. Add more logging around calls to internalError, as well as some low-level logging around SharedMemory, and mach_vm_map in particular. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * Platform/Logging.h: * Platform/mac/SharedMemoryMac.cpp: (WebKit::SharedMemory::allocate): (WebKit::makeMemoryEntry): (WebKit::SharedMemory::map): (WebKit::SharedMemory::~SharedMemory): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::networkProcessCrashed): (WebKit::WebLoaderStrategy::loadResourceSynchronously): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResource): 2016-10-24 Matthew Hanson Merge r204472. rdar://problem/28544885 2016-08-15 Keith Rollin Rename LOG_ALWAYS https://bugs.webkit.org/show_bug.cgi?id=160768 Rename LOG_ALWAYS and friends, given that the first parameter to it is a boolean expression that determines whether or not logging should be performed. Reviewed by Chris Dumez. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::didReceiveResponse): (WebKit::Download::didReceiveData): (WebKit::Download::didFinish): (WebKit::Download::didFail): (WebKit::Download::didCancel): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::cancelPrepareToSuspend): (WebKit::NetworkProcess::processDidResume): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::continueWillSendRequest): * Platform/IPC/Connection.cpp: (IPC::Connection::waitForSyncReply): * Shared/ChildProcess.cpp: (WebKit::didCloseOnConnectionWorkQueue): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::didChangeIsLoading): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles): * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::updateAssertionNow): (WebKit::ProcessThrottler::updateAssertion): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityToken): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): (WebKit::WebProcessProxy::didSetAssertionState): (WebKit::WebProcessProxy::setIsHoldingLockedFiles): * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]): (WebKit::ProcessAssertion::ProcessAssertion): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): (WebKit::WebResourceLoader::didReceiveResponse): (WebKit::WebResourceLoader::didReceiveData): (WebKit::WebResourceLoader::didFinishResourceLoad): (WebKit::WebResourceLoader::didFailResourceLoad): (WebKit::WebResourceLoader::didReceiveResource): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::layerVolatilityTimerFired): (WebKit::WebPage::markLayersVolatile): (WebKit::WebPage::cancelMarkLayersVolatile): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::actualPrepareToSuspend): (WebKit::WebProcess::processWillSuspendImminently): (WebKit::WebProcess::prepareToSuspend): (WebKit::WebProcess::cancelPrepareToSuspend): (WebKit::WebProcess::markAllLayersVolatile): (WebKit::WebProcess::processDidResume): 2016-10-20 Matthew Hanson Merge r206771. rdar://problem/28811939 2016-10-04 Wenson Hsieh Media controls are displayed in the incorrect state momentarily after switching between tabs playing media https://bugs.webkit.org/show_bug.cgi?id=162766 Reviewed by Jer Noble. Plumbs some more Now Playing information from the web process to the UI process for testing purposes. See WebCore ChangeLog for more details. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]): (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::requestActiveNowPlayingSessionInfo): 2016-10-20 Matthew Hanson Merge r206123. rdar://problem/28544885 2016-09-19 Keith Rollin Reduce logging from WebResourceLoader::didReceiveData https://bugs.webkit.org/show_bug.cgi?id=162233 Reviewed by Antti Koivisto. Only log once even if called multiple times for a single resource. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveData): * WebProcess/Network/WebResourceLoader.h: 2016-10-20 Matthew Hanson Merge r207159. rdar://problem/28857481 2016-10-11 Daniel Bates [iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps https://bugs.webkit.org/show_bug.cgi?id=163244 Reviewed by Jer Noble. Enable or disable the Setting::requiresUserGestureToLoadVideo() in WebKit depending on the version of iOS SDK that the app was linked against. We require a user gesture to begin loading a video as of iOS 10. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebView.mm: (shouldRequireUserGestureToLoadVideo): Added. (-[WKWebView _initializeWithConfiguration:]): Set the requiresUserGestureToLoadVideo preference. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Modified to pass the WebKit requiresUserGestureToLoadVideo preference to WebCore. 2016-10-20 Matthew Hanson Merge r203809. rdar://problem/28433607 2016-07-27 Andy Estes [iOS] Add WKUIDelegate SPI for specifying that an attachment list is from a managed source https://bugs.webkit.org/show_bug.cgi?id=160280 Reviewed by Dan Bernstein. * Platform/spi/ios/UIKitSPI.h: Declared UIPreviewItemTypeAttachment, UIPreviewDataAttachmentList, and UIPreviewDataAttachmentIndex. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Declared -_attachmentListForWebView:sourceIsManaged:. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dataForPreviewItemController:atPosition:type:]): Used UIPreviewItemTypeAttachment, UIPreviewDataAttachmentList, and UIPreviewDataAttachmentIndex. If uiDelegate responds to -_attachmentListForWebView:sourceIsManaged:, called it instead of -_attachmentListForWebView:. Set sourceIsManaged as the value for the UIPreviewDataAttachmentListSourceIsManaged key in dataForPreview. 2016-10-20 Matthew Hanson Merge r206449. rdar://problem/28635085 2016-09-27 Dan Bernstein [iOS] REGRESSION (r182126): Selection highlight and handles aren’t visible with WKSelectionGranularityCharacter https://bugs.webkit.org/show_bug.cgi?id=162577 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _uiTextSelectionRectViews]): Added this method in the WKTesting category, which uses UIKit internals to get the views used for the selection highlight. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _selectionClipRect]): When selection is not confined to a form control or content-editable element, return the null rect to indicate no clipping, rather than clipping to the empty rect at the origin. 2016-10-20 Daniel Bates Merge r206809. rdar://problem/28718761 2016-10-05 Daniel Bates Do not follow redirects when sending violation report https://bugs.webkit.org/show_bug.cgi?id=162520 Reviewed by Alex Christensen. Update the non-Network Session WebKit2 implementation to follow redirect responses for a ping request, if applicable. I did not update the Network Session implementation at this time. I will fix it in . * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): Tell PingHandle whether to follow redirects. * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode): Encode NetworkResourceLoadParameters::shouldFollowRedirects. (WebKit::NetworkResourceLoadParameters::decode): Decode NetworkResourceLoadParameters::shouldFollowRedirects. * NetworkProcess/PingLoad.h: Added FIXME comment to implement support for following redirects, if applicable (for hyperlink auditing). See for more details. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::createPingHandle): Modified to take a boolean whether to follow redirects responses and set NetworkResourceLoadParameters::shouldFollowRedirects as appropriate. * WebProcess/Network/WebLoaderStrategy.h: 2016-10-20 Matthew Hanson Merge r206413. rdar://problem/28744171 2016-09-26 Tim Horton Delete some unused code from r202695 https://bugs.webkit.org/show_bug.cgi?id=162595 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]): Deleted. (-[WKWebView _didFirstVisuallyNonEmptyLayoutForMainFrame]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame): We didn't end up needing this mechanism. 2016-10-20 Matthew Hanson Merge r204637. rdar://problem/28216256 2016-08-16 Simon Fraser Rename didLayout(LayoutMilestones) to didReachLayoutMilestone(), and related WK2 functions https://bugs.webkit.org/show_bug.cgi?id=160923 Reviewed by Tim Horton. didLayout(LayoutMilestones) -> didReachLayoutMilestone(LayoutMilestones) dispatchDidLayout(LayoutMilestones) -> dispatchDidReachLayoutMilestone(LayoutMilestones) Avoided changing functions that are exposed as API/SPI. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didReachLayoutMilestone): (API::LoaderClient::didLayout): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didLayoutForCustomContentProvider): (WebKit::WebPageProxy::didReachLayoutMilestone): (WebKit::WebPageProxy::didLayout): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didCommitLayerTree): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (didReachLayoutMilestone): (setUpPageLoaderClient): (didLayout): Deleted. * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone): (WebKit::InjectedBundlePageLoaderClient::didLayout): Deleted. * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone): (WebKit::WebFrameLoaderClient::dispatchDidLayout): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::dispatchDidReachLayoutMilestone): (WebKit::DrawingArea::dispatchDidLayout): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::dispatchDidReachLayoutMilestone): (WebKit::WebPage::dispatchDidLayout): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone): (WebKit::RemoteLayerTreeDrawingArea::dispatchDidLayout): Deleted. 2016-10-20 Matthew Hanson Merge r206834. rdar://problem/28634858 2016-10-05 Tim Horton Fix the build. * UIProcess/Cocoa/WebViewImpl.mm: 2016-10-20 Matthew Hanson Merge r206833. rdar://problem/28634858 2016-10-05 Tim Horton Avoid automatically re-taking snapshots for back-forward items that were never loaded into the view https://bugs.webkit.org/show_bug.cgi?id=162955 Reviewed by Simon Fraser. Make it possible for clients to control the snapshot for back-forward items that are restored from session state without navigating to them, by ensuring that we won't stomp on the snapshot that they explicitly take, until a load occurs. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::addItem): (WebKit::WebBackForwardList::goToItem): * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::trackSwipeGesture): Disambiguate explicit API-driven snapshot recording from automatic, navigation-driven snapshot recording. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::saveBackForwardSnapshotForCurrentItem): Get rid of the version of recordNavigationSnapshot() that doesn't take a back-forward list item, and grab the current item at the one remaining caller. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::recordAutomaticNavigationSnapshot): (WebKit::WebPageProxy::recordNavigationSnapshot): (WebKit::WebPageProxy::restoreFromSessionState): (WebKit::WebPageProxy::didCommitLoadForFrame): * UIProcess/WebPageProxy.h: Rename m_suppressNavigationSnapshotting to m_suppressAutomaticNavigationSnapshotting, and make it be only about automatic (navigation-driven) snapshots; it won't have any impact on explicit snapshots forced by clients. Set m_suppressAutomaticNavigationSnapshotting unconditionally when restoring from session state, so that we won't start automatically snapshotting until something has loaded in the view. 2016-10-20 Matthew Hanson Merge r206829. rdar://problem/28634858 2016-10-05 Tim Horton Make it possible to test ViewSnapshotStore behaviors https://bugs.webkit.org/show_bug.cgi?id=162983 Reviewed by Simon Fraser. Add two pieces of SPI to make it easier to test ViewSnapshotStore: - [WKWebView _disableBackForwardSnapshotVolatilityForTesting] This makes it so that we don't make snapshots volatile after we take them, so that they won't get purged while the test is running and cause the test to be flaky. - [WKBackForwardListItem _copySnapshotForTesting] This returns a CGImage with the content of the given back-forward item's current snapshot, if there is one. * UIProcess/API/Cocoa/WKBackForwardListItem.mm: (-[WKBackForwardListItem _copySnapshotForTesting]): * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h: * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Added. Add WKBackForwardListItem SPI to retrieve the snapshot for a given back-forward list item. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): Add WKWebView SPI to disable volatility of snapshots, for testing purposes. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::takeViewSnapshot): Adopt ViewSnapshot::setVolatile instead of reaching into the surface. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::removeSwipeSnapshot): Adopt ViewSnapshot::setVolatile instead of reaching into the surface. * UIProcess/mac/ViewSnapshotStore.h: (WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting): (WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting): * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::ViewSnapshotStore): (WebKit::ViewSnapshot::setVolatile): (WebKit::ViewSnapshot::asLayerContents): Move all touching of snapshot volatility into the new setVolatile, and short-circuit if the testing-only m_disableSnapshotVolatility bit is set (WebKit::ViewSnapshot::asImageForTesting): Make a CGImageRef for the aforementioned WKBackForwardListItem SPI. This is currently not implemented for the iOS Simulator, because we don't have access to the bits of the image in that case. 2016-10-20 Matthew Hanson Merge r206247. rdar://problem/28216256 2016-09-21 Dan Bernstein [macOS] Upon layout, _webView:renderingProgressDidChange: fires before the intrinsic content size is updated https://bugs.webkit.org/show_bug.cgi?id=162359 Reviewed by Tim Horton. Test: added to TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Fixed a bug where m_pendingNewlyReachedLayoutMilestones was never initialized. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Added m_pendingNewlyReachedLayoutMilestones member variable to this derived class as well. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): If we have pending milestones, notify the WebPageProxy now, after any content size changes have been sent. (WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone): New override that accumulates the milestones into m_pendingNewlyReachedLayoutMilestones and returns true, so that the caller won’t notify the WebPageProxy immediately. 2016-10-20 Matthew Hanson Merge r206132. rdar://problem/28634856 2016-09-19 Anders Carlsson Suppress JavaScript prompts early on in certain cases https://bugs.webkit.org/show_bug.cgi?id=162243 rdar://problem/27661602 Reviewed by Geoffrey Garen. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::shouldSuppressJavaScriptDialogs): Add helper function. (WebKit::WebChromeClient::runJavaScriptAlert): (WebKit::WebChromeClient::runJavaScriptConfirm): (WebKit::WebChromeClient::runJavaScriptPrompt): Call helper function and return early if we should supress dialogs. 2016-09-28 Babak Shafiei Merge r206527. rdar://problem/28499358 2016-09-27 Wenson Hsieh Adopt MediaRemote SPI to achieve desired Now Playing behavior https://bugs.webkit.org/show_bug.cgi?id=162658 Reviewed by Jer Noble. Plumbs Now Playing session information (for now, this is just a flag indicating whether or not there is an active session) across from the web process to the UI process for testing in the form of asynchronous request/ handle-response messages on the WebPage and its proxy in the UI process. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestActiveNowPlayingSessionInfo]): (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo): (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::requestActiveNowPlayingSessionInfo): 2016-09-28 Babak Shafiei Merge r206135. rdar://problem/28499358 2016-09-19 Wenson Hsieh Add a unit test covering https://bugs.webkit.org/show_bug.cgi?id=162112 Reviewed by Beth Dakin. Adds some a test support method as SPI on WKWebView to determine whether to request candidates. See Tools/ChangeLog for more details. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _shouldRequestCandidates]): (-[WKWebView _forceRequestCandidates]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2016-09-26 Babak Shafiei Merge r206238. rdar://problem/28450514 2016-09-21 Anders Carlsson support openPaymentSetup API on ApplePaySession object https://bugs.webkit.org/show_bug.cgi?id=162357 rdar://problem/26776939 Reviewed by Tim Horton. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): Call through to platformOpenPaymentSetup, and in the completion handler, send back a OpenPaymentSetupReply message. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Add new members. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: Add OpenPaymentSetup message. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup): Allocate a PKPassLibrary and call openPaymentSetupForMerchantIdentifier:domain:completion: on it. * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::generateOpenPaymentSetupReplyID): New helper function to generate a reply ID. (WebKit::WebPaymentCoordinator::openPaymentSetup): Add the completion handler to m_pendingOpenPaymentSetupCallbacks and send a OpenPaymentSetup message to the UI process. (WebKit::WebPaymentCoordinator::openPaymentSetupReply): Grab the callback given its ID and invoke it. * WebProcess/ApplePay/WebPaymentCoordinator.h: Add new members. * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: Add OpenPaymentSetupReply message. 2016-09-26 Babak Shafiei Merge r206350. rdar://problem/28115680 2016-09-23 Wenson Hsieh Media controls playhead does not animate smoothly while playing https://bugs.webkit.org/show_bug.cgi?id=162399 Reviewed by Beth Dakin. See WebCore ChangeLog for more details. In the UI process, we update the WebPlaybackSessionManager's timing value when the rate or current time changes. Each AVValueTiming is generated from the current time, system anchor time, and playback rate. The behavior of the first two properties is unaffected. However, the rate used to update the timing value is the effective playback rate, which is equal to the playback rate unless we are (1) not playing, (2) interacting with the media controls in such a way that the media is essentially not playing, or (3) the current time precedes the playback start time, accounting for playback direction. In these cases, our effective playback rate is 0, which means that we do not animate the playhead. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::beginScrubbing): (WebKit::WebPlaybackSessionModelContext::endScrubbing): (WebKit::WebPlaybackSessionModelContext::setPlaybackStartedTime): (WebKit::WebPlaybackSessionModelContext::setCurrentTime): (WebKit::WebPlaybackSessionManagerProxy::setPlaybackStartedTime): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::playbackStartedTimeChanged): (WebKit::WebPlaybackSessionManager::playbackStartedTimeChanged): 2016-09-22 Babak Shafiei Merge r206033. rdar://problem/28086237 2016-09-16 Wenson Hsieh Inserting a space after inserting an accepted candidate scrolls the document and causes a flicker https://bugs.webkit.org/show_bug.cgi?id=162009 Reviewed by Tim Horton. After inserting a text candidate, if the candidate ended with a soft space, the next space we insert should just replace the soft space. This currently works because we leave the text insertion out of the list of KeypressCommands sent to the web process and instead replace the soft space via WebPage::InsertTextAsync. However, this means when the web process handles this keydown event, the current editor will not handle it, since the list of key commands is empty despite the text and unmodified text being non-empty. To fix this, when sending keydown or keyup events where we replace a soft space, we set the key event's text to an empty string instead of a space. This allows us to return early in EventHandler::keyEvent and avoid the codepath that tries to insert text into the current editor and (in the case of inserting a ' ') scrolls the document if necessary. Since we've already handled text insertion via WebPage::InsertTextAsync, there is no need to also dispatch the keypress to the editor. Additionally, this patch addresses flickering in the candidates UI due to the fact that we're asynchronously replacing the last soft space. During this operation, we select the range of the soft space and then insert the new text. This causes a momentary range selection which the web process notifies the UI process about, prompting us to hide the candidates list. To address this, we suppress the EditorStateChanged message fired from the web process to the UI process while we're selecting the original range to replace. This patch adds 3 new WebKit API tests. * Shared/NativeWebKeyboardEvent.h: * Shared/mac/NativeWebKeyboardEventMac.mm: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): * Shared/mac/WebEventFactory.h: * Shared/mac/WebEventFactory.mm: (WebKit::textFromEvent): (WebKit::unmodifiedTextFromEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _handleAcceptedCandidate:]): (-[WKWebView _didHandleAcceptedCandidate]): (-[WKWebView _didUpdateCandidateListVisibility:]): (-[WKWebView _forceRequestCandidates]): (-[WKWebView _handleControlledElementIDResponse:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _didHandleAcceptedCandidate]): (-[WKView _didUpdateCandidateListVisibility:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::forceRequestCandidatesForTesting): (WebKit::WebViewImpl::becomeFirstResponder): (WebKit::WebViewImpl::didHandleAcceptedCandidate): (WebKit::WebViewImpl::insertText): (WebKit::WebViewImpl::performKeyEquivalent): (WebKit::WebViewImpl::keyUp): (WebKit::WebViewImpl::keyDown): (WebKit::WebViewImpl::flagsChanged): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::insertTextAsync): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertTextAsync): (WebKit::WebPage::didChangeSelection): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-09-16 Babak Shafiei Merge r206006. rdar://problem/27991573 2016-09-15 Brady Eidson WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage (even if it has http resources). and https://bugs.webkit.org/show_bug.cgi?id=162043 Reviewed by Brent Fulgham. * Scripts/webkit/messages.py: (headers_for_type): Add a custom header, and alphabetize existing ones. * Shared/WebCoreArgumentCoders.h: Add EnumTraits for HasInsecureContent. * UIProcess/PageLoadState.h: (WebKit::PageLoadState::committedHasInsecureContent): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::hasInsecureContent): (WebKit::WebPageProxy::didCommitLoadForFrame): If the WebProcess included an existing "HasInsecureContent" value, use it. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame): Save the "HasInsecureContent" value to the CachedFrame in case we restore it in the future. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2016-09-16 Babak Shafiei Merge r206003. rdar://problem/27991573 2016-09-15 Anders Carlsson Actually assign the decoded enum value to the output value https://bugs.webkit.org/show_bug.cgi?id=162042 Reviewed by Brady Eidson. * Platform/IPC/Decoder.h: 2016-09-16 Babak Shafiei Merge r206000. rdar://problem/27991573 2016-09-15 Anders Carlsson Add support for enum class parameters in the message generator https://bugs.webkit.org/show_bug.cgi?id=162036 Reviewed by Brady Eidson. Also, convert the WebPage::SetLayerHostingMode to take an actual enum class. * Scripts/webkit/messages.py: (function_parameter_type): Change this to take the parameter kind as well, and use the raw type for enums. (arguments_type): (message_to_struct_declaration): Pass the kind to function_parameter_type. (forward_declaration): (forward_declarations_for_namespace): Forward declare enums with "enum class". (headers_for_type): Add WebKit::LayerHostingMode as a special case. (generate_message_handler): Pass the kind to function_parameter_type. * Scripts/webkit/parser.py: (parse_parameters_string): Parse 'enum' as well. * Shared/LayerTreeContext.h: Add enum traits. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::viewDidEnterWindow): (WebKit::WebPageProxy::layerHostingModeDidChange): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::setLayerHostingMode): * WebProcess/WebPage/WebPage.h: Change unsigned to LayerHostingMode. * WebProcess/WebPage/WebPage.messages.in: Change unsigned to LayerHostingMode. 2016-09-16 Babak Shafiei Merge r204916. rdar://problem/27991573 2016-08-23 Anders Carlsson Add enum traits and use them in the IPC::Decoder https://bugs.webkit.org/show_bug.cgi?id=161103 Reviewed by Sam Weinig. * Platform/IPC/Decoder.h: * Platform/IPC/Encoder.h: Add new encode/decode functions. * Shared/mac/ArgumentCodersMac.mm: Change NSType to be a strongly typed enum. Use encode/decode instead of encodeEnum/decodeEnum since the latter don't have the enum check. 2016-09-16 Babak Shafiei Merge r205983. rdar://problem/28312297 2016-09-14 Beth Dakin dictionaryPopupInfoForRange() can change selection temporarily; updates should not be sent to the UIProcess. https://bugs.webkit.org/show_bug.cgi?id=162008 -and corresponding- rdar://problem/28312297 Reviewed by Tim Horton. This patch prevents the selection changes that occur while gathering dictionaryPopupInfo from being propagated to the UIProcess. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didChangeSelection): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::dictionaryPopupInfoForRange): 2016-09-14 Babak Shafiei Merge r205938. rdar://problem/28227805 2016-09-14 Wenson Hsieh Media controls behave strangely when changing media sources https://bugs.webkit.org/show_bug.cgi?id=161914 Reviewed by Tim Horton. Allows a web page to have an active video for a media control manager even if no audio or video is currently being produced. This is because the media element may be in a state where it is changing its source and does not currently have a video or audio track. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::hasActiveVideoForControlsManager): 2016-09-14 Babak Shafiei Merge r205878. rdar://problem/28229827 2016-09-13 Tim Horton Provide a mechanism to specify the maximum size of WKThumbnailView snapshots https://bugs.webkit.org/show_bug.cgi?id=161896 Reviewed by Simon Fraser. Some clients know that their thumbnail views will only be displayed up to a specific size that is significantly smaller than the WKView size. Allow them to avoid wasting lots of memory on unnecessarily large snapshots. * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView requestSnapshot]): (-[_WKThumbnailView _requestSnapshotIfNeeded]): (-[_WKThumbnailView setMaximumSnapshotSize:]): Add a maximumSnapshotSize property which can be changed dynamically. 2016-09-14 Babak Shafiei Merge r205935. rdar://problem/26013388 2016-09-14 Beth Dakin Add needsPlainTextQuirk and send it to the UIProcess https://bugs.webkit.org/show_bug.cgi?id=161996 -and corresponding- rdar://problem/26013388 Rubber-stamped by Simon Fraser. Quick clean-up. * WebProcess/WebPage/WebPage.cpp: (WebKit::needsPlainTextQuirk): 2016-09-14 Babak Shafiei Merge r205934. rdar://problem/26013388 2016-09-14 Beth Dakin Add needsPlainTextQuirk and send it to the UIProcess https://bugs.webkit.org/show_bug.cgi?id=161996 -and corresponding- rdar://problem/26013388 Reviewed by Anders Carlsson. WebPageProxy should keep track of m_needsPlainTextQuirk. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setNeedsPlainTextQuirk): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::needsPlainTextQuirk): (WebKit::WebPageProxy::needsHiddenContentEditableQuirk): Deleted. * UIProcess/WebPageProxy.messages.in: If m_needsPlainTextQuirk is true, set it back to false on page transition. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didStartPageTransition): The sites that need this quirk. (WebKit::needsPlainTextQuirk): (WebKit::WebPage::didChangeSelection): * WebProcess/WebPage/WebPage.h: 2016-09-14 Babak Shafiei Merge r205928. rdar://problem/26013388 2016-09-14 Beth Dakin Add needsHiddenContentEditableQuirk and send it to the UIProcess https://bugs.webkit.org/show_bug.cgi?id=161984 -and corresponding- rdar://problem/26013388 Reviewed by Anders Carlsson. Keep track of m_needsHiddenContentEditableQuirk in WebPageProxy. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setNeedsHiddenContentEditableQuirk): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::needsHiddenContentEditableQuirk): (WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction): Deleted. * UIProcess/WebPageProxy.messages.in: If m_needsHiddenContentEditableQuirk is true, set it back to false on page transition. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didStartPageTransition): Google Docs and iCloud Pages are the sites that need this quirk. (WebKit::needsHiddenContentEditableQuirk): (WebKit::WebPage::didChangeSelection): * WebProcess/WebPage/WebPage.h: 2016-09-13 Babak Shafiei Merge r205873. rdar://problem/28208208 2016-09-13 Anders Carlsson REGRESSION (r196321): Amazon Videos are all black in Fullscreen https://bugs.webkit.org/show_bug.cgi?id=161924 rdar://problem/28208208 Reviewed by Dan Bernstein. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (main): Set AppleMagnifiedMode to true. 2016-09-12 Babak Shafiei Merge r205783. rdar://problem/28229756 2016-09-09 Tim Horton WKThumbnailView should expose a mode where it can be reparented without resnapshotting https://bugs.webkit.org/show_bug.cgi?id=161828 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView initWithFrame:fromWKView:]): (-[_WKThumbnailView _viewWasUnparented]): Add such a mode. Bail from snapshot teardown when unparented if it is on. 2016-09-12 Babak Shafiei Merge r205765. rdar://problem/28033492 2016-09-09 Tim Horton Text replacement candidates don't always overwrite the entire original string https://bugs.webkit.org/show_bug.cgi?id=161779 Reviewed by Simon Fraser. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformEditorState): Make use of the shared implementation of contextRangeForCandidateRequest. 2016-09-09 Babak Shafiei Merge r204456. rdar://problem/27860536 2016-08-14 Daniel Bates Fix compiler errors when building iOS WebKit using the iOS 10 beta SDK https://bugs.webkit.org/show_bug.cgi?id=160725 Reviewed by Sam Weinig. * Platform/spi/ios/UIKitSPI.h: Add SPI for UITextInputSuggestionDelegate. * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Remove unnecessary include of PKPaymentMerchantSession.h. 2016-09-09 Babak Shafiei Merge r203381. rdar://problem/27860536 2016-07-18 Anders Carlsson WebKit nightly fails to build on macOS Sierra https://bugs.webkit.org/show_bug.cgi?id=159902 rdar://problem/27365672 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Use new PassKitSPI header. 2016-09-09 Babak Shafiei Merge r205381. rdar://problem/27806012 2016-09-02 Beth Dakin Need to updateEditorState if an element change edit-ability without changing selection https://bugs.webkit.org/show_bug.cgi?id=161546 -and corresponding- rdar://problem/27806012 Reviewed by Ryosuke Niwa. Every time WebPage::editorState() is called, we now save whether the last state was contentEditable. That way in updateEditorStateAfterLayoutIfNeeded() we can assess whether or not edit-ability has changed. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient:: updateEditorStateAfterLayoutIfEditabilityChanged): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState): (WebKit::WebPage:: updateEditorStateAfterLayoutIfEditabilityChanged): (WebKit::WebPage::didStartPageTransition): * WebProcess/WebPage/WebPage.h: 2016-09-09 Babak Shafiei Merge r205371. rdar://problem/28020157 2016-09-02 Jer Noble Unreviewed build fix; partial roll out of r205365 to remove unintentional change in WKWebView.mm. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): 2016-09-09 Babak Shafiei Merge r205365. rdar://problem/28020157 2016-07-08 Jer Noble Refactor WebPlaybackSessionModelMediaElement to be client based. https://bugs.webkit.org/show_bug.cgi?id=159580 Reviewed by Eric Carlson. Adopt the changes made in the WebPlaybackSessionModel,Interface and WebVideoFullscreenModel,Interface in the WebPlaybackSessionManager,Proxy classes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): Deleted. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::addClient): (WebKit::WebPlaybackSessionModelContext::removeClient): (WebKit::WebPlaybackSessionModelContext::setDuration): (WebKit::WebPlaybackSessionModelContext::setCurrentTime): (WebKit::WebPlaybackSessionModelContext::setBufferedTime): (WebKit::WebPlaybackSessionModelContext::setRate): (WebKit::WebPlaybackSessionModelContext::setSeekableRanges): (WebKit::WebPlaybackSessionModelContext::setCanPlayFastReverse): (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions): (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions): (WebKit::WebPlaybackSessionModelContext::setExternalPlayback): (WebKit::WebPlaybackSessionModelContext::setWirelessVideoPlaybackDisabled): (WebKit::WebPlaybackSessionManagerProxy::createModelAndInterface): (WebKit::WebPlaybackSessionManagerProxy::removeClientForContext): (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime): (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime): (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector): (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse): (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions): (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions): (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties): (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled): (WebKit::WebPlaybackSessionManagerProxy::setDuration): (WebKit::WebPlaybackSessionManagerProxy::setRate): * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in: * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenModelContext::addClient): (WebKit::WebVideoFullscreenModelContext::removeClient): (WebKit::WebVideoFullscreenManagerProxy::setHasVideo): (WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::durationChanged): (WebKit::WebPlaybackSessionInterfaceContext::currentTimeChanged): (WebKit::WebPlaybackSessionInterfaceContext::bufferedTimeChanged): (WebKit::WebPlaybackSessionInterfaceContext::rateChanged): (WebKit::WebPlaybackSessionInterfaceContext::seekableRangesChanged): (WebKit::WebPlaybackSessionInterfaceContext::canPlayFastReverseChanged): (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionInterfaceContext::externalPlaybackChanged): (WebKit::WebPlaybackSessionInterfaceContext::wirelessVideoPlaybackDisabledChanged): (WebKit::WebPlaybackSessionManager::~WebPlaybackSessionManager): (WebKit::WebPlaybackSessionManager::createModelAndInterface): (WebKit::WebPlaybackSessionManager::removeContext): (WebKit::WebPlaybackSessionManager::durationChanged): (WebKit::WebPlaybackSessionManager::currentTimeChanged): (WebKit::WebPlaybackSessionManager::bufferedTimeChanged): (WebKit::WebPlaybackSessionManager::rateChanged): (WebKit::WebPlaybackSessionManager::seekableRangesChanged): (WebKit::WebPlaybackSessionManager::canPlayFastReverseChanged): (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::externalPlaybackChanged): (WebKit::WebPlaybackSessionManager::wirelessVideoPlaybackDisabledChanged): (WebKit::WebPlaybackSessionInterfaceContext::setDuration): Deleted. (WebKit::WebPlaybackSessionInterfaceContext::setCurrentTime): Deleted. (WebKit::WebPlaybackSessionInterfaceContext::setBufferedTime): Deleted. (WebKit::WebPlaybackSessionInterfaceContext::setRate): Deleted. (WebKit::WebPlaybackSessionInterfaceContext::setSeekableRanges): Deleted. (WebKit::WebPlaybackSessionInterfaceContext::setCanPlayFastReverse): Deleted. (WebKit::WebPlaybackSessionInterfaceContext::setAudioMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionInterfaceContext::setLegibleMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionInterfaceContext::setExternalPlayback): Deleted. (WebKit::WebPlaybackSessionInterfaceContext::setWirelessVideoPlaybackDisabled): Deleted. (WebKit::WebPlaybackSessionManager::setDuration): Deleted. (WebKit::WebPlaybackSessionManager::setCurrentTime): Deleted. (WebKit::WebPlaybackSessionManager::setBufferedTime): Deleted. (WebKit::WebPlaybackSessionManager::setRate): Deleted. (WebKit::WebPlaybackSessionManager::setSeekableRanges): Deleted. (WebKit::WebPlaybackSessionManager::setCanPlayFastReverse): Deleted. (WebKit::WebPlaybackSessionManager::setAudioMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionManager::setLegibleMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionManager::setExternalPlayback): Deleted. (WebKit::WebPlaybackSessionManager::setWirelessVideoPlaybackDisabled): Deleted. * WebProcess/cocoa/WebVideoFullscreenManager.h: (WebKit::WebVideoFullscreenInterfaceContext::create): * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext): (WebKit::WebVideoFullscreenInterfaceContext::hasVideoChanged): (WebKit::WebVideoFullscreenInterfaceContext::videoDimensionsChanged): (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): (WebKit::WebVideoFullscreenManager::createModelAndInterface): (WebKit::WebVideoFullscreenManager::removeContext): (WebKit::WebVideoFullscreenManager::hasVideoChanged): (WebKit::WebVideoFullscreenManager::videoDimensionsChanged): (WebKit::WebVideoFullscreenInterfaceContext::resetMediaState): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setDuration): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setRate): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback): Deleted. (WebKit::WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled): Deleted. (WebKit::WebVideoFullscreenManager::setVideoDimensions): Deleted. 2016-09-09 Babak Shafiei Merge r205412. rdar://problem/28014919 2016-09-03 Wenson Hsieh Refactor the heuristic for showing media controls to take all media sessions into account https://bugs.webkit.org/show_bug.cgi?id=161503 Reviewed by Darin Adler. Adds an SPI testing hook for sending the element ID of the currently controlled video element from the web process to the UI process. See VideoControlsManager.mm in Tools/TestWebKitAPI/ for usage. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestControlledElementID]): (-[WKWebView _handleControlledElementIDResponse:]): (-[WKWebView _hasActiveVideoForControlsManager]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionManagerProxy::handleControlledElementIDResponse): (WebKit::WebPlaybackSessionManagerProxy::requestControlledElementID): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestControlledElementID): (WebKit::WebPageProxy::handleControlledElementIDResponse): * UIProcess/WebPageProxy.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::handleControlledElementIDResponse): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionManager::handleControlledElementIDRequest): 2016-09-09 Babak Shafiei Merge r204911. rdar://problem/28175524 2016-08-24 Anders Carlsson In some cases, an IPC::Connection won't know when the other end has gone away https://bugs.webkit.org/show_bug.cgi?id=161153 rdar://problem/27896368 Reviewed by Dan Bernstein. When being asked to invalidate a connection that isn't yet connected, make sure to release our send and receive rights so that the other end will get a failure when trying to connect. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::platformInvalidate): 2016-08-17 Babak Shafiei Merge r204587. rdar://problem/27807479 2016-08-17 Anders Carlsson Add support for additional networks https://bugs.webkit.org/show_bug.cgi?id=160951 rdar://problem/27807479 Reviewed by Sam Weinig. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toAdditionalSupportedNetwork): (WebKit::toSupportedNetwork): (WebKit::toSupportedNetworks): * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::supportsVersion): 2016-08-12 Babak Shafiei Merge r204414. rdar://problem/27624095 2016-08-12 Anders Carlsson message loading never finishes in Mail https://bugs.webkit.org/show_bug.cgi?id=160806 rdar://problem/27624095 Reviewed by Dan Bernstein. Add more checks for when a process goes away before we've established a proper connection to it. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::receiveSourceEventHandler): Handle the MACH_NOTIFY_NO_SENDERS and MACH_NOTIFY_SEND_ONCE messages here. Also, once we receive a send right from the other side, stop listening for the MACH_NOTIFY_NO_SENDERS notification. * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::didFinishLaunching): Null check the connection identifier. * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::ProcessLauncher): (WebKit::processLauncherWorkQueue): Deleted. Get rid of the process launcher queue - we're not doing any blocking work here. * UIProcess/Launcher/ProcessLauncher.h: Add a weak factory. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::systemDirectoryPath): Move this before launchProcess(). (WebKit::ProcessLauncher::launchProcess): Merge createService and connectToService into launchProcess. Also make the following changes: - Use mach_port_request_notification to get a notification for when our receive right loses all its senders. This lets us listen for the other process going away before we have a send right for it. - Use xpc_connection_set_event_handler to listen for errors, so we can detect the process going away before we've sent a message to it. (WebKit::connectToService): Deleted. (WebKit::createService): Deleted. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didFinishLaunching): If we failed to launch, call networkProcessCrashedOrFailedToLaunch so we'll unblock any waiting web processes. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): Null check the connection and XPC connection before trying to get its pid. 2016-08-04 Babak Shafiei Merge r204135. rdar://problem/19814215 2016-08-04 Chris Dumez Crash under NavigationState::NavigationClient::processDidCrash() https://bugs.webkit.org/show_bug.cgi?id=160563 Reviewed by Sam Weinig. When WebPageProxy::close() gets called, make sure we destroy the page's navigationClient. If we don't then the navigationClient can outlive the navigationState, causing crashes when navigationClient tries to use its stale navigationState member reference later on. This happens when the WebPageProxy outlives its WKWebView because: 1. WebPageProxy owns the navigationClient 2. WKWebView owns the navigationState 3. navigationClient has a reference to the navigationState as member. WebPageProxy can outlive the WKWebView because it is refCounted. It can happen for example when the client application uses the RelatedPage API as this extend the lifetime of the related WebPage's proxy but the application may not keep the related WKWebView alive. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): Note that it is safe to null out m_navigationClient here instead of creating a fresh one because there is a null check before every use of m_navigationClient in WebPageProxy. 2016-08-02 Babak Shafiei Merge r204057. rdar://problem/27534205 2016-08-02 Tim Horton REGRESSION (r203385): Frequent RELEASE_ASSERT in WebKit::RemoteLayerTreeDrawingArea::flushLayers() https://bugs.webkit.org/show_bug.cgi?id=160481 Reviewed by Simon Fraser. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): If the UI process sends a didUpdate message while the Web process is in the middle of flushing on a background thread, the drawing area will allow another commit to start on the main thread, which then (rightfully) causes the RELEASE_ASSERT. This is normally not a problem, because didRefreshDisplay (which sends the didUpdate) bails if m_didUpdateMessageState is anything other than NotSent, and m_didUpdateMessageState is only NotSent if the Web process has sent a commit (and thus will not commit again until it gets a didUpdate). This is the fundamental mechanism that avoids multiple commits being in flight at once. In r203385, I added a path where didRefreshDisplay could be called before the first commit arrived (by way of _applicationWillEnterForeground -> viewStateDidChange -> waitForDidUpdateViewState). This caused trouble because m_didUpdateMessageState is initialized to NotSent, which means that we could end up sending a didUpdate immediately, before the first commit arrives - even worse, while the first commit is being flushed on a background thread, leading the aforementioned RELEASE_ASSERT to fire. Instead, initialize it to Sent (which I've renamed to DoesNotNeedDidUpdate), so that we won't send a didUpdate until after the first commit arrives (at which point the two processes are in agreement about the order of things). It's not currently possible to API test this for multiple reasons, though it is fairly easy to write a test app that reproduces reliably (by simulating suspend/resume notifications inside the didFinishNavigation: callback). 2016-07-31 Babak Shafiei Merge r203842. rdar://problem/27553464 2016-07-28 Tim Horton Frequent animation lags when interacting with Safari (sidebar, tab switching, etc.) https://bugs.webkit.org/show_bug.cgi?id=160289 Reviewed by Simon Fraser. API Tests: WebKit2.AnimatedResizeDoesNotHang, WebKit2.ResizeWithHiddenContentDoesNotHang * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): Avoid calling _endAnimatedResize when a commit comes in when we haven't yet received a dynamic viewport update reply (and thus don't have a transaction ID to wait on). Previously, in this case, _resizeAnimationTransformTransactionID would be 0, and *any* commit would cause _endAnimatedResize to be called, causing us to always fall into the worst-case sync wait. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): Make use of waitForDidUpdateViewState instead of having a separate waitForAndDispatchImmediately here, because it knows to do things like dispatch the didUpdate message if it's still pending. This also shortens the sync wait timeout from 1s to 500ms, which makes it consistent with e.g. the newly-parented-view timeout duration, and should be nothing but positive. * Platform/IPC/Connection.cpp: (IPC::Connection::timeoutRespectingIgnoreTimeoutsForTesting): (IPC::Connection::waitForMessage): (IPC::Connection::sendSyncMessageFromSecondaryThread): (IPC::Connection::waitForSyncReply): * Platform/IPC/Connection.h: (IPC::Connection::ignoreTimeoutsForTesting): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration ignoreSynchronousMessagingTimeoutsForTesting]): (-[_WKProcessPoolConfiguration setIgnoreSynchronousMessagingTimeoutsForTesting:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processDidFinishLaunching): Add a mechanism for clients to cause all synchronous message timeouts to be effectively infinite. The new API tests use this to ensure that the test will time out if they ever enter the bad state (otherwise, the shorter sync wait timeout could make the test still pass). 2016-07-31 Babak Shafiei Merge r203909. rdar://problem/27078089 2016-07-28 Ryosuke Niwa Crash with an Invalid Web Process IPC Message ID: WebPageProxy.AttributedStringForCharacterRangeCallback https://bugs.webkit.org/show_bug.cgi?id=160334 Reviewed by Alexey Proskuryakov. The crash is most likely caused by an MESSAGE_CHECK failure in WebPageProxy::attributedStringForCharacterRangeCallback which marks the currently dispatching message was invalid inside the macro. Make sure we never fail this check by sending an empty EditingRange in attributedSubstringForCharacterRangeAsync when the editing range we're about to send to the UIProcess is invalid in WebProcess. Unfortunately, no new tests since we don't have any reproduction and I couldn't spot any code path in which we end up with an invalid EditingRage here with multiple inspection of the relevant code. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::attributedSubstringForCharacterRangeAsync): 2016-07-28 Babak Shafiei Merge r203780. rdar://problem/27569255 2016-07-27 Chris Dumez Fix m_isInBackground initialization for Safari View Services https://bugs.webkit.org/show_bug.cgi?id=160255 Reviewed by Tim Horton. Fix m_isInBackground initialization for Safari View Services. The code was using m_applicationStateMonitor without initializing it. Instead, use the local applicationStateMonitor and make sure we invalidate it before it gets released. * UIProcess/ApplicationStateTracker.mm: (WebKit::ApplicationStateTracker::ApplicationStateTracker): 2016-07-28 Babak Shafiei Merge r203743. rdar://problem/23325160 2016-07-26 David Kilzer Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation https://bugs.webkit.org/show_bug.cgi?id=156947 Reviewed by Alex Christensen. * UIProcess/API/C/WKAuthenticationDecisionListener.cpp: (WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue): * UIProcess/API/C/WKAuthenticationDecisionListener.h: Added new SPI for testing corresponding to calling the completion handler of WKWebView.didReceiveAuthenticationChallenge with NSURLSessionAuthChallengeRejectProtectionSpace. 2016-07-28 Babak Shafiei Merge r203855. rdar://problem/27557968 2016-07-28 Myles C. Maxfield Remove deprecated SPI for video inline / fullscreen controls https://bugs.webkit.org/show_bug.cgi?id=160318 Reviewed by Tim Horton. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAllowsInlineMediaPlaybackWithPlaysInlineAttribute): Deleted. (WKPreferencesGetAllowsInlineMediaPlaybackWithPlaysInlineAttribute): Deleted. (WKPreferencesSetAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute): Deleted. (WKPreferencesGetAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): Deleted. (-[WKWebViewConfiguration copyWithZone:]): Deleted. (-[WKWebViewConfiguration _allowsInlineMediaPlaybackWithPlaysInlineAttribute]): Deleted. (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackWithPlaysInlineAttribute:]): Deleted. (-[WKWebViewConfiguration _allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute]): Deleted. (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Deleted. 2016-07-28 Babak Shafiei Merge r203752. rdar://problem/27557968 2016-07-26 Myles C. Maxfield [iPhone] Playing a video on tudou.com plays only sound, no video https://bugs.webkit.org/show_bug.cgi?id=160178 Reviewed by Eric Carlson and Dan Bernstein. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetInlineMediaPlaybackRequiresPlaysInlineAttribute): (WKPreferencesGetInlineMediaPlaybackRequiresPlaysInlineAttribute): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _inlineMediaPlaybackRequiresPlaysInlineAttribute]): (-[WKWebViewConfiguration _setInlineMediaPlaybackRequiresPlaysInlineAttribute:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-07-28 Babak Shafiei Merge r203741. rdar://problem/27480873 2016-07-26 Anders Carlsson Payment session does not end if user closes all Safari windows https://bugs.webkit.org/show_bug.cgi?id=160213 rdar://problem/27480873 Reviewed by Tim Horton. Listen for the NSWindowWillCloseNotification of the sheet window and hide the payment UI when the sheet window is going to be closed. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): 2016-07-28 Babak Shafiei Merge r203724. rdar://problem/27536113 2016-07-26 Enrica Casucci Support configurable autocapitalization. https://bugs.webkit.org/show_bug.cgi?id=158860 rdar://problem/27536113 Reviewed by Tim Horton. Autocapitalization should be enabled/disabled regardless of whether we are using advance spelling feature. * UIProcess/mac/TextCheckerMac.mm: (WebKit::TextChecker::checkTextOfParagraph): (WebKit::TextChecker::getGuessesForWord): 2016-07-28 Babak Shafiei Merge r203687. rdar://problem/27399998 2016-07-25 Chris Dumez [iOS] Make sure we call the ProcessAssertion invalidation handler on the main thread https://bugs.webkit.org/show_bug.cgi?id=160140 Reviewed by Darin Adler. Based on crash traces, it appears BKSProcessAssertion is calling our invalidation handler on a background thread. This was not anticipated and therefore, this would lead to thread safety issues and crashes. We now make sure to call our invalidation handler on the main thread. We also use a WeakPtr to ensure that the ProcessAssertion is still alive once on the main thread and before calling the invalidation handler. * UIProcess/ProcessAssertion.cpp: (WebKit::ProcessAssertion::ProcessAssertion): * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAssertion::createWeakPtr): * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAssertion::markAsInvalidated): 2016-07-28 Babak Shafiei Merge r203671. rdar://problem/27409315 2016-07-24 Sam Weinig Add specialization for encoding/decoding WebCore::CertificateInfos in the Network Cache https://bugs.webkit.org/show_bug.cgi?id=160144 Reviewed by Chris Dumez. * NetworkProcess/cache/NetworkCacheCoders.cpp: (WebKit::NetworkCache::encodeCFData): (WebKit::NetworkCache::decodeCFData): (WebKit::NetworkCache::encodeSecTrustRef): (WebKit::NetworkCache::decodeSecTrustRef): (WebKit::NetworkCache::encodeCertificateChain): (WebKit::NetworkCache::decodeCertificateChain): (WebKit::NetworkCache::Coder::encode): (WebKit::NetworkCache::Coder::decode): * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::version): Bump the version and lastStableVersion to account for the format change. 2016-07-28 Babak Shafiei Merge r203635. rdar://problem/27505943 2016-07-22 Joseph Pecoraro Web Automation: All key events should be processed before sending response https://bugs.webkit.org/show_bug.cgi?id=160114 Reviewed by Darin Adler. When evaluating performKeyboardInteractions, we were sending all NSEvents synchronously, but because WebPageProxy was doing its own queueing and asynchronous processing of those key events, we would receive and respond to the next Automation command before having completed all of the key events. This change makes performKeyboardInteractions asynchronous. It will be notified only after WebPageProxy has exhausted its queue of key events. * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::keyboardEventsFlushedForPage): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): (WebKit::WebAutomationSession::performKeyboardInteractions): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): 2016-07-28 Babak Shafiei Merge r203631. rdar://problem/24606557 2016-07-22 Zalan Bujtas Handle cases when IOSurface initialization fails. https://bugs.webkit.org/show_bug.cgi?id=160006 Reviewed by Tim Horton and Simon Fraser. This is an additional fix to r203514 to check if IOSurface initialization was successful. Unable to test. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::encode): (WebKit::RemoteLayerBackingStore::display): (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): 2016-07-28 Babak Shafiei Merge r203630. rdar://problem/27504958 2016-07-22 Chelsea Pugh [iOS] Clients should be able to decide if they want secure text entry in a form field https://bugs.webkit.org/show_bug.cgi?id=160109 rdar://problem/27504958 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/_WKFormInputSession.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession forceSecureTextEntry]): Getter. (-[WKFormInputSession setForceSecureTextEntry:]): Setter. (-[WKContentView textInputTraits]): If the form input session has specified that secure text entry is desired, we should use secure text entry. 2016-07-22 Babak Shafiei Merge r203545. rdar://problem/26964090 2016-07-21 Myles C. Maxfield Remove support for deprecated SPI inlineMediaPlaybackRequiresPlaysInlineAttribute https://bugs.webkit.org/show_bug.cgi?id=160066 Reviewed by Dean Jackson. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetInlineMediaPlaybackRequiresPlaysInlineAttribute): Deleted. (WKPreferencesGetInlineMediaPlaybackRequiresPlaysInlineAttribute): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): Deleted. (-[WKWebViewConfiguration copyWithZone:]): Deleted. (-[WKWebViewConfiguration _inlineMediaPlaybackRequiresPlaysInlineAttribute]): Deleted. (-[WKWebViewConfiguration _setInlineMediaPlaybackRequiresPlaysInlineAttribute:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Deleted. 2016-07-22 Babak Shafiei Merge r203520. rdar://problem/26964090 2016-07-21 Myles C. Maxfield [iPhone] Playing a video on tudou.com plays only sound, no video https://bugs.webkit.org/show_bug.cgi?id=159967 Reviewed by Jon Lee, Jeremy Jones, and Anders Carlsson. Add the two preferences to WKWebViewConfiguration and WKPreferences to cover both the Obj-C API and the C SPI. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAllowsInlineMediaPlaybackWithPlaysInlineAttribute): (WKPreferencesGetAllowsInlineMediaPlaybackWithPlaysInlineAttribute): (WKPreferencesSetAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute): (WKPreferencesGetAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _allowsInlineMediaPlaybackWithPlaysInlineAttribute]): (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackWithPlaysInlineAttribute:]): (-[WKWebViewConfiguration _allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute]): (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-07-22 Babak Shafiei Merge r203483. rdar://problem/27455589 2016-07-20 Simon Fraser REGRESSION (r203189): Webpage snapshots are partially or fully blank when edge swiping back https://bugs.webkit.org/show_bug.cgi?id=160000 rdar://problem/27455589 Reviewed by Zalan Bujtas. r203189 triggered a call to -_updateContentRectsWithState: in the middle of a swipe, during which we'd compute the visible rect of the view as having zero width, causing us to not create tiles. -_navigationGestureDidBegin already snapshots the visibleContentRect in _frozenVisibleContentRect, but -_visibleContentRect then clipped that with ancestor views, causing the issue. Fix by having -_visibleContentRect just return _frozenVisibleContentRect if we have one. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _visibleContentRect]): 2016-07-22 Babak Shafiei Merge r203462. rdar://problem/27453189 2016-07-20 Tim Horton Explain the default value of WKWebViewConfiguration's ignoresViewportScaleLimits https://bugs.webkit.org/show_bug.cgi?id=159978 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebViewConfiguration.h: This defaults to NO. 2016-07-22 Babak Shafiei Merge r203392. rdar://problem/27056844 2016-07-18 Alex Christensen webbookmarksd needs to use the same AppCache directory as MobileSafari https://bugs.webkit.org/show_bug.cgi?id=159912 Reviewed by Alexey Proskuryakov. * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultApplicationCacheDirectory): Make webbookmarksd match MobileSafari by adding a matching runtime exception. 2016-07-22 Babak Shafiei Merge r203541. rdar://problem/27450825 2016-07-21 Chelsea Pugh [iOS] Apps using WKWebView will crash if they set the scroll view's delegate and don't nil it out later https://bugs.webkit.org/show_bug.cgi?id=159980 rdar://problem/27450825 Reviewed by Dan Bernstein. The root cause of this crash is that we are not abiding the UIScrollView API that the scroll view delegate property should be weak. If setters of this delegate do not know that, since the WKWebView exposes the scroll view as a UIScrollView, they may forget to nil out the delegate they set and will then crash. * UIProcess/ios/WKScrollView.mm: (-[WKScrollViewDelegateForwarder methodSignatureForSelector:]): Get a RetainPtr holding the external delegate and use where needed. (-[WKScrollViewDelegateForwarder respondsToSelector:]): Ditto. (-[WKScrollViewDelegateForwarder forwardInvocation:]): Ditto. (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]): Ditto. When returning a reference to the external delegate, get a retained and autoreleased reference so the caller needn't release the object when done. (-[WKScrollView delegate]): Ditto. (-[WKScrollView _updateDelegate]): Get a RetainPtr holding the external delegate that can be used throughout this method. Use the RetainPtr to get the external delegate for setting super's delegate as well as creating the delegate forwarder. (-[WKScrollView setDelegate:]): Get a RetainPtr holding the external delegate and use its value for comparison to the object we are setting the external delegate to. 2016-07-22 Babak Shafiei Merge r203442. rdar://problem/27376446 2016-07-19 Brian Burg Web Automation: WebAutomationSessionProxy's HashMaps should support '0' as valid keys https://bugs.webkit.org/show_bug.cgi?id=159957 Reviewed by Joseph Pecoraro. * WebProcess/Automation/WebAutomationSessionProxy.h: Use UnsignedWithZeroKeyHashTraits to avoid problems with zero as a key. 2016-07-22 Babak Shafiei Merge r203414. rdar://problem/26756701 2016-07-19 Anders Carlsson Some payment authorization status values should keep the sheet active https://bugs.webkit.org/show_bug.cgi?id=159936 rdar://problem/26756701 Reviewed by Tim Horton. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completePaymentSession): If the status isn't a final state status, bounce the current state back to active. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Rename the _authorized ivar to _didReachFinalState. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]): (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): Set _didReachFinalState based on the return value of isFinalStateStatus. 2016-07-22 Babak Shafiei Merge r203387. rdar://problem/27018065 2016-07-18 Anders Carlsson Don't null out the IPC::Connection's XPC connection https://bugs.webkit.org/show_bug.cgi?id=159911 rdar://problem/27018065 Reviewed by Alex Christensen. The function that nulls out the XPC connection, platformInvalidate(), is called from the connection queue, whereas the XPC connection is normally accessed from the main thread leading to inconsistencies when the connection is being invalidated while the main thread is trying to access it. Fix this by simply never nulling out the XPC connection. It will be released when the IPC::Connection is destroyed anyway. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::platformInvalidate): 2016-07-22 Babak Shafiei Merge r203385. rdar://problem/27192350 2016-07-18 Tim Horton Tapping on an apple.com tab in tab overview stutters when switching to it https://bugs.webkit.org/show_bug.cgi?id=159904 Reviewed by Simon Fraser. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): In any case where we get to waitForDidUpdateViewState (usually a tab switch), if we have an outstanding didUpdate message, the Web process will not commit a new layer tree until it receives the didUpdate message. However, since waitForDidUpdateViewState synchronously blocks the UI process, we also won't *send* the didUpdate message, so we block for the full timeout duration. Instead, if we get to waitForDidUpdateViewState, just send the didUpdate without waiting for the DisplayLink or anything else, because calling rAF slightly too quickly, once, is certainly better than blocking the UI process for a whole second. 2016-07-22 Babak Shafiei Merge r203371. rdar://problem/26973202 2016-07-18 Tim Horton Mail contents are temporarily obscured by black rectangles when returning from suspend and in app switcher https://bugs.webkit.org/show_bug.cgi?id=159894 Reviewed by Simon Fraser. * UIProcess/ApplicationStateTracker.h: * UIProcess/ApplicationStateTracker.mm: (WebKit::ApplicationStateTracker::ApplicationStateTracker): (WebKit::ApplicationStateTracker::~ApplicationStateTracker): (WebKit::ApplicationStateTracker::applicationDidCreateWindowContext): * UIProcess/ios/WKContentView.mm: (-[WKContentView didMoveToWindow]): (-[WKContentView _applicationDidCreateWindowContext]): (-[WKContentView _applicationWillEnterForeground]): Deleted. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView didMoveToWindow]): (-[WKPDFView _applicationDidCreateWindowContext]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground): Hide content at window context creation time, instead of when the application becomes foregrounded. Otherwise, background snapshots (which create/destroy window contexts, but do not bring the app into the foreground) can have parented layers that have volatile surfaces in them. In the normal case, we will subsequently get foregrounded and re-build the layer tree; in the background snapshot case, we will just have an empty layer tree. In the future, we should consider making ApplicationStateTracker use window context creation/destruction to drive web process lifetime, so that we can actually paint correctly for background snapshots. 2016-07-21 Babak Shafiei Merge r203508. rdar://problem/27392691 2016-07-21 Yongjun Zhang WebBackForwardList's currentIndex could get out of bounds when filtering items. https://bugs.webkit.org/show_bug.cgi?id=159986 When generating a new BackForwardListState object, if we filter out multiple items in the list, the currentIndex could get out of bounds. Reviewed by Dan Bernstein. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::backForwardListState): Make currentIndex point to the last item if it is out of bounds. 2016-07-18 Babak Shafiei Merge patch for rdar://problem/27360961. 2016-06-23 Dean Jackson Disable some features on safari-602-branch. * Configurations/FeatureDefines.xcconfig: 2016-07-18 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.3 release. * gtk/NEWS: Add release notes for 2.13.3. 2016-07-18 Csaba Osztrogonác [Mac][cmake] Unreviewed buildfix after r203338. Just for fun. * PlatformMac.cmake: 2016-07-18 Carlos Garcia Campos MemoryPressureHandler doesn't work if cgroups aren't present in Linux https://bugs.webkit.org/show_bug.cgi?id=155255 Reviewed by Sergio Villar Senin. There's no way to get notifications about memory pressure in Linux without using cgroups that doesn't require a manual polling. We can get that information from /proc/meminfo, but that's not pollable so it requires to manually check its contents in a loop sleeping for a while between checks. This means we would be waking up the process on every poll iteration, most of the times for nothing. That's specially problematic on devices running on battery. And taking into account that there's a memory pressure handler in every secondary process (Web, Network and Plugin), we would be waking up all those process all the time. However, not having a memory pressure handler is even more problematic than the manual polling. This patch adds a class MemoryPressureMonitor to the manual polling of /proc/meminfo, but runs in the UI process, to avoid the weakups in all other secondary processes, and uses an eventFD to notify all other processes. It's only used in case cgroups is not available. The eventFD descriptor is sent to all other processes at startup, and passed to the MemoryPressureHandler before install() is called for the first time. To minimize the wakeups even in the UI process, the poll interval is calculated from 1 to 5 seconds depending on the current memory used, so in case of low memory level we sleep for a longer time. It's also important to make the memory calculations as accurate as possible to avoid cleaning resources in the secondary processes unnecessarily. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): Pass the memory pressure monitor file descriptor to the MemoryPressureHandler. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): Encode memory pressure monitor handle. (WebKit::NetworkProcessCreationParameters::decode): Decode memory pressure monitor handle. * NetworkProcess/NetworkProcessCreationParameters.h: * PlatformEfl.cmake: Add new file to compilation, and update include dirs. * PlatformGTK.cmake: Ditto. * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::initializePluginProcess): Pass the memory pressure monitor file descriptor to the MemoryPressureHandler. * Shared/Plugins/PluginProcessCreationParameters.cpp: (WebKit::PluginProcessCreationParameters::encode): Encode memory pressure monitor handle. (WebKit::PluginProcessCreationParameters::decode): Decode memory pressure monitor handle. * Shared/Plugins/PluginProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): Encode memory pressure monitor handle. (WebKit::WebProcessCreationParameters::decode): Decode memory pressure monitor handle. * Shared/WebProcessCreationParameters.h: * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::didFinishLaunching): Create the memory pressure monitor handle for the plugin process if needed. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Create the memory pressure monitor handle for the network process if needed. (WebKit::WebProcessPool::createNewWebProcess): Create the memory pressure monitor handle for the web process if needed. * UIProcess/linux/MemoryPressureMonitor.cpp: Added. (WebKit::lowWatermarkPages): (WebKit::systemPageSize): (WebKit::calculateMemoryAvailable): (WebKit::systemMemoryUsedAsPercentage): (WebKit::pollIntervalForUsedMemoryPercentage): (WebKit::isSystemdMemoryPressureMonitorAvailable): (WebKit::MemoryPressureMonitor::isEnabled): (WebKit::MemoryPressureMonitor::singleton): (WebKit::MemoryPressureMonitor::MemoryPressureMonitor): (WebKit::MemoryPressureMonitor::createHandle): * UIProcess/linux/MemoryPressureMonitor.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Pass the memory pressure monitor file descriptor to the MemoryPressureHandler. 2016-07-17 Carlos Garcia Campos REGRESSION(r202855): [GTK] ASSERTION FAILED: m_webPage.bounds().contains(bounds) https://bugs.webkit.org/show_bug.cgi?id=159806 Reviewed by Žan Doberšek. The problem is that since r202855, in case of non accelerated mode, the dirty region is updated too late when updating backing store state. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::updateBackingStoreState): Update the dirty region to the new size when not in accelerated compositing mode. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setSize): Update the WebPage size before resizing the frame and calling setNeedsDisplay() to ensure that any call to setNeedsDisplay() uses the new web page bounds. This is actually a regression introduced in r143472, where setNeedsDisplay was changed to use the web page bounds as directy rectangle. Before r143472 the dirty rectangle was passed to setNeedsDisplay and it passed the right one. 2016-07-16 Sam Weinig [WebKit API] Add SPI to track multiple navigations caused by a single user gesture https://bugs.webkit.org/show_bug.cgi?id=159856 Reviewed by Dan Bernstein. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/APIUserInitiatedAction.h: Added. Add new APIObject type, UserInitiatedAction. * UIProcess/API/Cocoa/WKNavigationAction.mm: * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: Expose a _WKUserInitiatedAction on the WKNavigationAction. * UIProcess/API/Cocoa/_WKUserInitiatedAction.h: Added. * UIProcess/API/Cocoa/_WKUserInitiatedAction.mm: Added. (-[_WKUserInitiatedAction consume]): (-[_WKUserInitiatedAction isConsumed]): (-[_WKUserInitiatedAction _apiObject]): * UIProcess/API/Cocoa/_WKUserInitiatedActionInternal.h: Added. Add new _WKUserInitiatedAction type wrapping API::UserInitiatedAction. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode): (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: Store the userGestureTokenIdentifier (as determined from the WebProcess's map) rather than just a single bit. This allows us to track if a user gesture is used for multiple navigations. * UIProcess/API/APINavigationAction.h: Add UserInitiatedAction member and re-implement isProcessingUserGesture in terms of it. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Get the API::UserInitiatedAction from the WebProcessProxy (if it exists), and pass it along to the API::NavigationAction. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shutDown): (WebKit::WebProcessProxy::userInitiatedActivity): (WebKit::WebProcessProxy::didDestroyUserGestureToken): * UIProcess/WebProcessProxy.h: Keep a map of active userInitiatedActivity objects. * UIProcess/WebProcessProxy.messages.in: Add DidDestroyUserGestureToken message to manager API::UserInitiatedActivity lifetimes. * WebKit2.xcodeproj/project.pbxproj: Add new files. * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::didClickNotification): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performFrameLoadURLRequest): (WebKit::PluginView::evaluate): * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::searchWithGoogle): * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionManager::play): (WebKit::WebPlaybackSessionManager::pause): (WebKit::WebPlaybackSessionManager::togglePlayState): (WebKit::WebPlaybackSessionManager::beginScrubbing): (WebKit::WebPlaybackSessionManager::endScrubbing): (WebKit::WebPlaybackSessionManager::seekToTime): (WebKit::WebPlaybackSessionManager::fastSeek): (WebKit::WebPlaybackSessionManager::beginScanningForward): (WebKit::WebPlaybackSessionManager::beginScanningBackward): (WebKit::WebPlaybackSessionManager::endScanning): (WebKit::WebPlaybackSessionManager::selectAudioMediaOption): (WebKit::WebPlaybackSessionManager::selectLegibleMediaOption): Update for new UserGestureIndicator interface. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createWindow): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Get an identifier for the UserGestureToken from the WebProcess singleton to pass to the WebProcess. * WebProcess/WebProcess.cpp: (WebKit::nextUserGestureTokenIdentifier): (WebKit::WebProcess::userGestureTokenIdentifier): (WebKit::WebProcess::userGestureTokenDestroyed): * WebProcess/WebProcess.h: Track UserGestureToken lifetimes utilizing the destructionObserver mechanism off the tokens to indicate destruction. When destroyed, notify the UIProcess to avoid leaks. 2016-07-17 Ryosuke Niwa Rename fastHasAttribute to hasAttributeWithoutSynchronization https://bugs.webkit.org/show_bug.cgi?id=159864 Reviewed by Chris Dumez. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2016-07-17 Jeremy Jones REGRESSION (r191907): Maxthon Browser -After exit full screen video playback the browser window is blank with audio running https://bugs.webkit.org/show_bug.cgi?id=159731 Reviewed by Tim Horton. Primarily written by Jer Noble . When a view is removed from it's superview, and that superview's constraints property references the removed superview, those constraints are removed as well. Make sure to save off a copy of the superview's constraints before swapping in the placeholder view, and reapply those constraints when swapping the web view back into its original superview. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController setSavedConstraints:]): (-[WKFullScreenWindowController savedConstraints]): (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): 2016-07-16 Ryosuke Niwa Rename fastGetAttribute to attributeWithoutSynchronization https://bugs.webkit.org/show_bug.cgi?id=159852 Reviewed by Darin Adler. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): (WebKit::WebPage::performActionOnElement): (WebKit::WebPage::getAssistedNodeInformation): 2016-07-15 Timothy Hatcher Web Automation: Fix element and event coord space issues https://bugs.webkit.org/show_bug.cgi?id=159851 rdar://problem/27375780 Reviewed by Brian Burg. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::performMouseInteraction): Subtract topContentInset() before it goes back out to WebDriver. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::computeElementLayout): When using useViewportCoordinates, subtract topContentInset() so it matches expectations. 2016-07-15 Beth Dakin Mac UI process needs to know about element focus and blur, much like iOS https://bugs.webkit.org/show_bug.cgi?id=159843 -and corresponding- rdar://problem/27229504 Reviewed by Tim Horton. This patch makes the existing iOS machinery to handle focus and blurring of elements cross-platform. Instead of using the existing iOS messages for startAssistingNode/stopAssistingNode, this patch adds a new message that require only a boolean parameter: setEditableElementIsFocused. Now that more of this code is shared, this patch teases m_hasFocusedDueToUserInteraction out into two variables. I realized that it was being used to mean two slightly different things on Mac and iOS, which was very confusing. Now we have m_isAssistingNodeDueToUserInteraction to represent the way iOS was using the variable, and we have m_hasEverFocusedElementDueToUserInteractionSincePageTransition to represent how Mac was using the variable. There should not be any behavior changes with this re-name, just added clarity. WebViewImpl has a new member variable m_editableElementIsFocused. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setEditableElementIsFocused): Pipe the new setEditableElementIsFocused message to WebViewImpl. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setEditableElementIsFocused): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setEditableElementIsFocused): elementDidFocus() and elementDidBlur() are now PLATFORM(COCOA) instead of PLATFORM(IOS) * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::elementDidFocus): (WebKit::WebChromeClient::elementDidBlur): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::elementDidFocus): Deleted. (WebKit::WebChromeClient::elementDidBlur): Deleted. m_hasPendingBlurNotification is no longer iOS-only. * WebProcess/WebPage/WebPage.cpp: Use our two new bools m_isAssistingNodeDueToUserInteraction and m_hasEverFocusedElementDueToUserInteractionSincePageTransition (WebKit::WebPage::didStartPageTransition): (WebKit::WebPage::didChangeSelection): These functions are all newly cross-platform. The Messages they send are still platform-specific, but otherwise the logic is the same. We dispatch_async the blur messages so that the UI process features won’t be flashy when the user is tapping, tabbing, or clicking through form fields. (WebKit::WebPage::resetAssistedNodeForFrame): (WebKit::WebPage::elementDidFocus): (WebKit::WebPage::elementDidBlur): resetAssistedNodeForFrame() is no longer iOS-only. (WebKit::WebPage::didCommitLoad): Move variables and functions around so that they are defined for the right platform, and declare the two new bools in place of the old one. * WebProcess/WebPage/WebPage.h: These functions are now defined in WebPage.cpp * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::resetAssistedNodeForFrame): Deleted. (WebKit::WebPage::elementDidFocus): Deleted. (WebKit::WebPage::elementDidBlur): Deleted. 2016-07-15 Geoffrey Garen Added a makeRef helper https://bugs.webkit.org/show_bug.cgi?id=159835 Reviewed by Andreas Kling. Anders told me to! * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry): * Platform/IPC/Connection.cpp: (IPC::Connection::addWorkQueueMessageReceiver): (IPC::Connection::removeWorkQueueMessageReceiver): (IPC::Connection::invalidate): (IPC::Connection::sendMessage): (IPC::Connection::processIncomingMessage): (IPC::Connection::postConnectionDidCloseOnConnectionWorkQueue): (IPC::Connection::connectionDidClose): (IPC::Connection::enqueueIncomingMessage): * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::receiveSourceEventHandler): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): (WebKit::ThreadedCompositor::setDeviceScaleFactor): (WebKit::ThreadedCompositor::didChangeViewportSize): (WebKit::ThreadedCompositor::didChangeViewportAttribute): (WebKit::ThreadedCompositor::didChangeContentsSize): (WebKit::ThreadedCompositor::scrollTo): (WebKit::ThreadedCompositor::scrollBy): (WebKit::ThreadedCompositor::didChangeVisibleRect): * UIProcess/API/APIUserContentExtensionStore.cpp: (API::UserContentExtensionStore::lookupContentExtension): (API::UserContentExtensionStore::compileContentExtension): (API::UserContentExtensionStore::removeContentExtension): * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::ProcessLauncher): * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker): * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::createSessionStorageNamespace): (WebKit::StorageManager::destroySessionStorageNamespace): (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): (WebKit::StorageManager::cloneSessionStorageNamespace): (WebKit::StorageManager::processDidCloseConnection): (WebKit::StorageManager::getSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins): (WebKit::StorageManager::getLocalStorageOrigins): (WebKit::StorageManager::getLocalStorageOriginDetails): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin): (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::pluginThreadAsyncCall): * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::wheelEvent): (WebKit::EventDispatcher::gestureEvent): (WebKit::EventDispatcher::touchEvent): * WebProcess/WebPage/ViewUpdateDispatcher.cpp: (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate): 2016-07-15 Chris Dumez Use fastGetAttribute() / setAttributeWithoutSynchronization() when possible https://bugs.webkit.org/show_bug.cgi?id=159793 Reviewed by Ryosuke Niwa. Use fastGetAttribute() / setAttributeWithoutSynchronization() when possible, for performance. * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: (WebKit::PDFPlugin::PDFPlugin): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::createPasswordEntryForm): * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::attach): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): 2016-07-15 Ryosuke Niwa Disable custom elements in Safari Tech Preview https://bugs.webkit.org/show_bug.cgi?id=159829 Reviewed by Chris Dumez. Disable custom elements API in Safari Technology Preview. Our implementation is so out of sync with the latest spec that it's actively harmful to have this feature enabled. * Shared/WebPreferencesDefinitions.h: 2016-07-15 Jer Noble Full screen ePub embedded video is playing on 1/4 screen, cut off https://bugs.webkit.org/show_bug.cgi?id=159737 Reviewed by Tim Horton. Set the fixedLayoutSize to CGSizeZero when disabling fixed layout due to the WebView not supporting arbitrary layout modes, and reset to the saved value when the view does begin supporting arbitrary layout modes. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setFixedLayoutSize): (WebKit::WebViewImpl::updateSupportsArbitraryLayoutModes): 2016-07-14 Ryan Haddad Unreviewed, rolling out r203248. This change causes LayoutTests to crash and exit early Reverted changeset: "Use more Refs with WorkQueues" https://bugs.webkit.org/show_bug.cgi?id=159792 http://trac.webkit.org/changeset/203248 2016-07-14 Chris Dumez Use emptyString() instead of "" when possible https://bugs.webkit.org/show_bug.cgi?id=159789 Reviewed by Alex Christensen. Use emptyString() instead of "" when possible to reduce String allocations. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::pasteboardChangedOwner): * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::parseRFC822HeaderFields): (WebKit::NPN_Status): 2016-07-14 Alex Christensen Use more Refs with WorkQueues https://bugs.webkit.org/show_bug.cgi?id=159792 Reviewed by Brady Eidson. * NetworkProcess/CustomProtocols/CustomProtocolManager.h: * Platform/IPC/Connection.cpp: (IPC::Connection::setShouldExitOnSyncMessageSendFailure): (IPC::Connection::addWorkQueueMessageReceiver): * Platform/IPC/Connection.h: * Shared/mac/SecItemShim.cpp: (WebKit::SecItemShim::initializeConnection): * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::create): (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker): * UIProcess/Storage/LocalStorageDatabaseTracker.h: * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded): (WebKit::StorageManager::StorageManager): * UIProcess/Storage/StorageManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection): (WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection): * UIProcess/mac/SecItemShimProxy.cpp: (WebKit::SecItemShimProxy::initializeConnection): (WebKit::SecItemShimProxy::secItemRequest): * WebProcess/Plugins/PluginProcessConnectionManager.cpp: (WebKit::PluginProcessConnectionManager::initializeConnection): (WebKit::PluginProcessConnectionManager::getPluginProcessConnection): * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::initializeConnection): (WebKit::EventDispatcher::wheelEvent): * WebProcess/WebPage/ViewUpdateDispatcher.cpp: (WebKit::ViewUpdateDispatcher::initializeConnection): (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate): 2016-07-14 Timothy Hatcher Web Automation: FrameNotFound errors happen a lot for the main frame https://bugs.webkit.org/show_bug.cgi?id=159777 rdar://problem/27224628 Send both pageID and frameID, and have the WebProcess side resolve the mainFrame from 0 based on the known pageID. This avoids a race waiting for the DidCreateMainFrame message. Reviewed by Brian Burg. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::webFrameIDForHandle): (WebKit::WebAutomationSession::switchToBrowsingContext): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): (WebKit::WebAutomationSession::resolveChildFrameHandle): (WebKit::WebAutomationSession::resolveParentFrameHandle): (WebKit::WebAutomationSession::computeElementLayout): (WebKit::WebAutomationSession::getAllCookies): (WebKit::WebAutomationSession::deleteSingleCookie): (WebKit::WebAutomationSession::webFrameProxyForHandle): Deleted. (WebKit::WebAutomationSession::webFrameIDForHandle): Added. * UIProcess/Automation/WebAutomationSession.h: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal): (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle): (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName): (WebKit::WebAutomationSessionProxy::resolveParentFrame): (WebKit::WebAutomationSessionProxy::focusFrame): (WebKit::WebAutomationSessionProxy::computeElementLayout): (WebKit::WebAutomationSessionProxy::takeScreenshot): (WebKit::WebAutomationSessionProxy::getCookiesForFrame): (WebKit::WebAutomationSessionProxy::deleteCookie): * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: 2016-07-14 Alex Christensen Use SocketProvider to create SocketStreamHandles https://bugs.webkit.org/show_bug.cgi?id=159774 Reviewed by Brady Eidson. * WebProcess/Network/WebSocketProvider.cpp: (WebKit::WebSocketProvider::createSocketStreamHandle): (WebKit::WebSocketProvider::createWebSocketChannel): Deleted. * WebProcess/Network/WebSocketProvider.h: 2016-07-14 Chris Dumez [WK2][iOS] Potential null dereference under ViewGestureController::beginSwipeGesture() https://bugs.webkit.org/show_bug.cgi?id=159776 Reviewed by Tim Horton. Potential null dereference under ViewGestureController::beginSwipeGesture() of: m_webPageProxy.backForwardList().currentItem() The client side is expected to call ViewGestureController::canSwipeInDirection() but this only guarantees that the m_alternateBackForwardListSourceView's currentItem is non-null when m_alternateBackForwardListSourceView is non-null. It does not guarantee that m_webPageProxy's currentItem is non-null. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): 2016-07-14 Csaba Osztrogonác Fix the !ENABLE(WEB_SOCKETS) build after r202930 https://bugs.webkit.org/show_bug.cgi?id=159768 Reviewed by Alex Christensen. * WebProcess/Network/WebSocketProvider.h: 2016-07-14 Chris Dumez Possible crash under NavigationState::NavigationClient::processDidCrash() https://bugs.webkit.org/show_bug.cgi?id=159773 Reviewed by Anders Carlsson. Add a m_navigationState.m_navigationDelegateMethods.webViewWebProcessDidCrash before trying to call it to avoid crashing if the client does not implement it. At the beginning of the method, we abort early only if both webViewWebContentProcessDidTerminate and webViewWebProcessDidCrash are implemented. However, if webViewWebContentProcessDidTerminate implemented but not webViewWebProcessDidCrash we can end up crashing as we fail to check later on before trying to call it. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::processDidCrash): 2016-07-14 Csaba Osztrogonác Fix the DatabaseProcess build with disabled IDB https://bugs.webkit.org/show_bug.cgi?id=159769 Reviewed by Alex Christensen. * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: (WebKit::WebToDatabaseProcessConnection::didClose): 2016-07-14 Hyunjun Ko [ThreadedCompositor] Build fails in debug mode after r202040 https://bugs.webkit.org/show_bug.cgi?id=159757 Reviewed by Michael Catanzaro. Debug mode build failed due to call getter method, which is removed, in ASSERT(). * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::glContext): Deleted. (WebKit::ThreadedCompositor::didChangeVisibleRect): Deleted. (WebKit::ThreadedCompositor::renderLayerTree): Deleted. 2016-07-13 Alex Christensen Modernize WebSocket handle https://bugs.webkit.org/show_bug.cgi?id=159750 Reviewed by Brady Eidson. * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp: (WebKit::connectionCallback): 2016-07-13 Carlos Garcia Campos REGRESSION(r202273): [GTK] Redirected X window is resized to the previous size on size allocate https://bugs.webkit.org/show_bug.cgi?id=159551 Reviewed by Michael Catanzaro. In r202273 I added webkitWebViewBaseResizeRedirectedWindow() helper to remove duplicated code in all places where we were resizing the redirected window to the current drawing area size. But on size allocate, we were updating the redirected window first, and then the drawing area, to ensure that when the drawing area notifies the web process the redirected window is already at the new size. This regression doesn't have any visual effect, because we are ensure the right size always before rendering, but there's a small extra resize in this case. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseSizeAllocate): Resize the redirected window before updating the drawing area size. 2016-07-13 Chris Dumez [WK2] Use more references for connections https://bugs.webkit.org/show_bug.cgi?id=159739 Reviewed by Alex Christensen. Use more references for connections to make it more obvious they cannot be null. * DatabaseProcess/DatabaseToWebProcessConnection.cpp: (WebKit::DatabaseToWebProcessConnection::DatabaseToWebProcessConnection): * DatabaseProcess/DatabaseToWebProcessConnection.h: (WebKit::DatabaseToWebProcessConnection::connection): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::messageSenderConnection): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles): * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::connection): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::messageSenderConnection): * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::messageSenderConnection): (WebKit::preregisterSandboxExtensionsIfNecessary): * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: (WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection): * WebProcess/Databases/WebToDatabaseProcessConnection.h: (WebKit::WebToDatabaseProcessConnection::connection): * 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::NetworkProcessConnection): (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles): * WebProcess/Network/NetworkProcessConnection.h: (WebKit::NetworkProcessConnection::connection): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::remove): (WebKit::WebLoaderStrategy::setDefersLoading): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::messageSenderConnection): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesForDOM): (WebKit::WebPlatformStrategies::setCookiesFromDOM): (WebKit::WebPlatformStrategies::cookiesEnabled): (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): (WebKit::WebPlatformStrategies::getRawCookies): (WebKit::WebPlatformStrategies::deleteCookie): (WebKit::WebPlatformStrategies::addCookie): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::startDownload): (WebKit::WebFrame::convertMainResourceLoadToDownload): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess): (WebKit::WebProcess::networkConnection): (WebKit::WebProcess::prefetchDNS): * WebProcess/WebProcess.h: 2016-07-13 Anders Carlsson Move WKPreferencesRef functions to the correct file https://bugs.webkit.org/show_bug.cgi?id=159741 Reviewed by Sam Weinig. Also, get rid of WKPreferencesGetPaymentsEnabled and WKPreferencesSetPaymentsEnabled. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesGetApplePayEnabled): (WKPreferencesSetApplePayEnabled): (WKPreferencesGetApplePayCapabilityDisclosureAllowed): (WKPreferencesSetApplePayCapabilityDisclosureAllowed): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WKPreferencesGetApplePayEnabled): Deleted. (WKPreferencesSetApplePayEnabled): Deleted. (WKPreferencesGetApplePayCapabilityDisclosureAllowed): Deleted. (WKPreferencesSetApplePayCapabilityDisclosureAllowed): Deleted. (WKPreferencesGetPaymentsEnabled): Deleted. (WKPreferencesSetPaymentsEnabled): Deleted. 2016-07-13 Anders Carlsson Add _applePayCapabilityDisclosureAllowed SPI declaration https://bugs.webkit.org/show_bug.cgi?id=159740 Reviewed by Dan Bernstein. Also, delete an old method that is no longer used. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _paymentsEnabled]): Deleted. (-[WKWebViewConfiguration _setPaymentsEnabled:]): Deleted. 2016-07-13 Zalan Bujtas Blank news article on kottke.org https://bugs.webkit.org/show_bug.cgi?id=159733 Reviewed by Simon Fraser. This patch ensures that we update the visible content rect, when Auto Layout moves the WKWebView around. We normally expect setFrameRect to be called to position WKWebView. However Auto Layout relies on layoutSubviews, and in order to always have up-to-date visible content rect, we need to override layoutSubviews in WKWebView. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView layoutSubviews]): 2016-07-13 Chris Dumez WebKit2 shouldn't signal custom protocol clients from the NSURLConnection loader thread. https://bugs.webkit.org/show_bug.cgi?id=159725 Reviewed by Andy Estes. WebKit2 shouldn't signal custom protocol clients from the NSURLConnection loader thread. Instead, use the RunLoop the WKCustomProtocol was initialized on. * NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm: (-[WKCustomProtocol initWithRequest:cachedResponse:client:]): (WebKit::dispatchOnInitializationRunLoop): (WebKit::CustomProtocolManager::didFailWithError): (WebKit::CustomProtocolManager::didLoadData): (WebKit::CustomProtocolManager::didReceiveResponse): (WebKit::CustomProtocolManager::didFinishLoading): (WebKit::CustomProtocolManager::wasRedirectedToRequest): (WebKit::dispatchOnResourceLoaderRunLoop): Deleted. 2016-07-13 Enrica Casucci Update supported platforms in xcconfig files to match the sdk names. https://bugs.webkit.org/show_bug.cgi?id=159728 Reviewed by Tim Horton. * Configurations/Base.xcconfig: 2016-07-13 Carlos Garcia Campos [Coordinated Graphics] Remove toCoordinatedGraphicsLayer and use downcast instead https://bugs.webkit.org/show_bug.cgi?id=159469 Reviewed by Michael Catanzaro. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::flushPendingLayerChanges): (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded): (WebKit::CompositingCoordinator::mainContentsLayer): 2016-07-13 Carlos Garcia Campos [GTK] WebKitGtk+ uses too many file descriptors https://bugs.webkit.org/show_bug.cgi?id=152316 Reviewed by Michael Catanzaro. The problem is that we are keeping file descriptors open in SharedMemory objects. Those objects can be kept alive for a long time, for example in case of cached resources sent from the network process as shareable resources. The thing is that we keep the file descriptor in the SharedMemory object only to be able to create a Handle, duplicating the file descriptor. However, we are also assuming that we create handles for SharedMemory objects created by another handle which is wrong. SharedMemory objects are created to map a file or data and then a handle is created to send it to another process, or to map an existing file or data for a given handle received from another process. They can also be created to wrap another map, but in that case we don't own the file descritor nor the mapped data. So, after mapping from a handle, we no longer need the file descriptor, and it can be closed to release it, while the mapped memory data will still be alive until munmap() is called. This drastically reduces the amount of file descriptors used by WebKitGTK+. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::readBytesFromSocket): Use setCloseOnExec(). (IPC::Connection::createPlatformConnection): Ditto. * Platform/SharedMemory.h: * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::map): Close the file descriptor right after mmap. (WebKit::SharedMemory::~SharedMemory): Close the file descriptor only if it hasn't been closed yet. (WebKit::SharedMemory::createHandle): Add an ASSERT to ensure we only try to create a handle for SharedMemory objects having a valid file descriptor. Use dupCloseOnExec() to duplicate the handle and set the close on exec flag. * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: (WebKit::ProcessLauncher::launchProcess): Use setCloseOnExec(). 2016-07-12 Simon Fraser [iOS WK2] After zooming and when under memory pressure, page tiles sometimes don't redraw while panning https://bugs.webkit.org/show_bug.cgi?id=159697 rdar://problem/26314075 Reviewed by Benjamin Poulain. When under memory pressure, and after pinching back to minimum scale, WebPage::updateVisibleContentRects() would sometimes always bail under the "boundedScale != currentScale..." condition. This happened because the visibleContentRectUpdateInfo.scale() is a double, but m_page->pageScaleFactor() is a float, and the constraining between min and max scale (which are doubles) caused boundedScale to be always different from currentScale. Fix by using floats throughout. No test because there's no way to simulate memory pressure for testing. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2016-07-12 Chris Dumez [WK2][NetworkSession] Fix unsafe RunLoop::dispatch() in NetworkLoad constructor https://bugs.webkit.org/show_bug.cgi?id=159691 Reviewed by Brady Eidson. Remove unsafe RunLoop::dispatch() in NetworkLoad constructor. It captured |this| but there was no guarantee the NetworkLoad would still be alive by the time the lambda gets executed. Instead, the constructor now takes a NetworkSession& parameter so that the call sites have to retrieve the NetworkSession for a given SessionID and deal with the fact that there may be no such NetworkSession before constructing the NetworkLoad. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::PendingDownload): * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): 2016-07-12 Chris Dumez [WK2] Protect against bad database data in LocalStorageDatabase::importItems() https://bugs.webkit.org/show_bug.cgi?id=159663 Reviewed by Benjamin Poulain. Protect against bad database data in LocalStorageDatabase::importItems(). We crash if the database contains a null key or a null value so protect against it given that we have evidence it can happen. With this change, I can no longer reproduce the UIProcess crash on evernote.com that is documented at . * UIProcess/Storage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::importItems): 2016-07-12 Gyuyoung Kim Remove ENABLE_CSS3_TEXT_LINE_BREAK flag https://bugs.webkit.org/show_bug.cgi?id=159671 Reviewed by Csaba Osztrogonác. ENABLE_CSS3_TEXT_LINE_BREAK feature was implemented without guards. https://bugs.webkit.org/show_bug.cgi?id=89235 So this guard can be removed in build scripts. * Configurations/FeatureDefines.xcconfig: 2016-07-11 Gyuyoung Kim Purge PassRefPtr in platform/efl and platform/mac https://bugs.webkit.org/show_bug.cgi?id=159548 Reviewed by Alex Christensen. Remove all use of PassRefPtr and clean up unnecessary tabs and spaces. WebKit2 codes are also changed because of setBufferForType()'s modification. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::setPasteboardBufferForType): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::setBufferForType): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2016-07-11 Chris Dumez [WK2][iOS] Intermittent crash in [UIApplication beginBackgroundTaskWithName] expiration handler https://bugs.webkit.org/show_bug.cgi?id=159648 Reviewed by Anders Carlsson. We see an intermittent crash in [UIApplication beginBackgroundTaskWithName] expiration handler. From the traces, we noticed the expiration handler can get called on a non-main thread under certain conditions, which our code is designed to deal with. In particular, we get called on a non-main thread when UIKit fails to acquire the assertion. Update our expiration handler to always notify the clients on the main thread. * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]): 2016-07-11 Dan Bernstein Tried to fix the macOS build. * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction description]): 2016-07-11 Dan Bernstein Cleaned up API availability. Requested by Tim Horton. * UIProcess/API/Cocoa/WKNavigationAction.mm: * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: 2016-07-11 Enrica Casucci Add synthetic click origin to WKNavigationAction. https://bugs.webkit.org/show_bug.cgi?id=159584 rdar://problem/25610422 Reviewed by Tim Horton. Adds a private property to WKNavigationAction to retrieve the origin of the synthetic click. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode): (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: * Shared/WebEvent.h: (WebKit::WebMouseEvent::button): (WebKit::WebMouseEvent::menuTypeForEvent): (WebKit::WebMouseEvent::force): (WebKit::WebMouseEvent::syntheticClickType): * Shared/WebMouseEvent.cpp: (WebKit::WebMouseEvent::WebMouseEvent): (WebKit::WebMouseEvent::encode): (WebKit::WebMouseEvent::decode): * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): * UIProcess/API/APINavigationAction.h: * UIProcess/API/Cocoa/WKNavigationAction.mm: (toWKNavigationType): (toWKSyntheticClickType): (-[WKNavigationAction description]): (-[WKNavigationAction sourceFrame]): (-[WKNavigationAction request]): (-[WKNavigationAction _syntheticClickType]): (-[WKNavigationAction modifierFlags]): * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _twoFingerSingleTapGestureRecognized:]): (-[WKContentView _longPressRecognized:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::getSelectionContext): (WebKit::WebPageProxy::handleTwoFingerTapAtPoint): (WebKit::WebPageProxy::selectWithTwoTouches): * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp: (WebKit::mouseButtonForMouseEvent): (WebKit::syntheticClickTypeForMouseEvent): (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction): (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction): (WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction): (WebKit::InjectedBundleNavigationAction::create): (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction): * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h: (WebKit::InjectedBundleNavigationAction::navigationType): (WebKit::InjectedBundleNavigationAction::modifiers): (WebKit::InjectedBundleNavigationAction::mouseButton): (WebKit::InjectedBundleNavigationAction::hitTestResult): (WebKit::InjectedBundleNavigationAction::formElement): (WebKit::InjectedBundleNavigationAction::syntheticClickType): (WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs): (WebKit::InjectedBundleNavigationAction::shouldTryAppLinks): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createWindow): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPage::contextMenuAtPointInWindow): (WebKit::WebPage::dragEnded): (WebKit::WebPage::simulateMouseDown): (WebKit::WebPage::simulateMouseUp): (WebKit::WebPage::simulateMouseMotion): (WebKit::WebPage::setCompositionForTesting): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): (WebKit::WebPage::completeSyntheticClick): (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): (WebKit::WebPage::handleTwoFingerTapAtPoint): (WebKit::WebPage::potentialTapAtPosition): (WebKit::WebPage::inspectorNodeSearchMovedToPosition): 2016-07-11 Anders Carlsson Able to open multiple payment sheets in Safari at the same time https://bugs.webkit.org/show_bug.cgi?id=159637 rdar://problem/26411339 Reviewed by Beth Dakin. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): Add result out parameter. Set the result to false if isShowingPaymentUI is true, otherwise set isShowingPaymentUI to true. (WebKit::WebPaymentCoordinatorProxy::didReachFinalState): Set isShowingPaymentUI to false. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::showPaymentUI): * WebProcess/ApplePay/WebPaymentCoordinator.h: The showPaymentUI message and client functions now return booleans. 2016-07-11 Commit Queue Unreviewed, rolling out r203064. https://bugs.webkit.org/show_bug.cgi?id=159642 This change causes LayoutTest crashes on WK1 ASan (Requested by ryanhaddad on #webkit). Reverted changeset: "Use refs for ResourceLoaders" https://bugs.webkit.org/show_bug.cgi?id=159592 http://trac.webkit.org/changeset/203064 2016-07-11 Nan Wang AX: WKWebView should have API to prevent pinch-to-zoom always being allowed https://bugs.webkit.org/show_bug.cgi?id=158364 Reviewed by Anders Carlsson. Added a property in WKWebViewConfiguration so that developers can toggle the ignoring viewport scale limits setting. Changes are covered in modified tests. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetResourceCachingDisabled): (WKPageSetIgnoresViewportScaleLimits): * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (shouldAllowPictureInPictureMediaPlayback): (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _navigationGestureDidEnd]): (forceAlwaysUserScalableChangedCallback): Deleted. (-[WKWebView _updateForceAlwaysUserScalable]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): (WebKit::WebPageProxy::setForceAlwaysUserScalable): (WebKit::WebPageProxy::setMaximumUnobscuredSize): (WebKit::WebPageProxy::updateForceAlwaysUserScalable): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::disableInspectorNodeSearch): (WebKit::WebPage::setForceAlwaysUserScalable): (WebKit::innerFrameQuad): (WebKit::WebPage::updateForceAlwaysUserScalable): Deleted. 2016-07-08 Alex Christensen Use refs for ResourceLoaders https://bugs.webkit.org/show_bug.cgi?id=159592 Reviewed by Chris Dumez. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad): (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired): (WebKit::WebLoaderStrategy::startLocalLoad): (WebKit::WebLoaderStrategy::remove): (WebKit::WebLoaderStrategy::setDefersLoading): (WebKit::WebLoaderStrategy::crossOriginRedirectReceived): * WebProcess/Network/WebLoaderStrategy.h: 2016-07-11 Antti Koivisto Update stable cache version in NetworkCache::Storage::deleteOldVersions() https://bugs.webkit.org/show_bug.cgi?id=159618 rdar://problem/26715745 Reviewed by Chris Dumez. NetworkCache::Storage::deleteOldVersions() keeps the previous shipped cache version (4) for Mac around so development WebKit doesn’t clobber system Safari cache. Update this to the current version so old caches go away in customer systems. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::deleteOldVersions): * NetworkProcess/cache/NetworkCacheStorage.h: Move lastStableVersion to header next to the current version. 2016-07-10 Beth Dakin Update mediaIcon.pdf https://bugs.webkit.org/show_bug.cgi?id=159613 -and corresponding- rdar://problem/27268111 Reviewed by Sam Weinig. * Resources/mediaIcon.pdf: Replaced. 2016-07-10 Alex Christensen Add self to WebKit2 Owners https://bugs.webkit.org/show_bug.cgi?id=159499 Reviewed by Sam Weinig. * Owners: 2016-07-10 Alex Christensen Fix client certificate authentication after r200463 https://bugs.webkit.org/show_bug.cgi?id=159574 Reviewed by Sam Weinig. * Shared/Authentication/mac/AuthenticationManager.mac.mm: (WebKit::leafCertificate): (WebKit::chain): Handle the different types of CertificateInfos. 2016-07-08 Yongjun Zhang When WKWebView prepares the session state blob, we should be able to filter it. https://bugs.webkit.org/show_bug.cgi?id=159410 Add a SPI to WKWebView so that a client can decide how to filter backforward items when WKWebView perparing session state. Reviewed by Brady Eidson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _sessionStateWithFilter:]): When preparing session state, check each backforward item against the filter block. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add the SPI _sessionStateWithFilter: 2016-07-08 Tim Horton Mail messages don't start loading until scrolling completes https://bugs.webkit.org/show_bug.cgi?id=159585 Reviewed by Andy Estes. * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm: (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:connection:]): When scrolling, NSDefaultRunLoopMode isn't run, but NSRunLoopCommonModes are. CFNetwork uses NSDefaultRunLoopMode if we tell NSURLConnection to "start immediately", but we can instead schedule our NSURLConnection into NSRunLoopCommonModes and start it ourselves, ensuring that it will be able to do work while scrolling is happening. 2016-07-08 Andy Estes [Content Filtering] Load blocked pages more like other error pages are loaded https://bugs.webkit.org/show_bug.cgi?id=159485 Reviewed by Brady Eidson. * Shared/API/c/WKErrorRef.h: Defined kWKErrorCodeFrameLoadBlockedByContentFilter. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added the resource directories of WebCore.framework and WebKit.framework as paths with assumed read access. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::hasAssumedReadAccessToURL): Checked platformPathsWithAssumedReadAccess() as well as m_localPathsWithAssumedReadAccess. (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added a non-Cocoa implementation. * UIProcess/WebProcessProxy.h: * WebProcess/WebCoreSupport/WebErrors.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::blockedByContentFilterError): Called WebKit::blockedByContentFilterError(). * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: (WebKit::blockedByContentFilterError): Returned a ResourceError for kWKErrorCodeFrameLoadBlockedByContentFilter. 2016-07-08 Anders Carlsson Fix 32-bit build. * PluginProcess/mac/PluginProcessShim.mm: 2016-07-07 Anders Carlsson REGRESSION (r196321): Adobe Reader DC + Safari : Zoom level pulldown is not displayed at the correct position https://bugs.webkit.org/show_bug.cgi?id=159531 rdar://problem/26382579 Reviewed by Tim Horton. There's code in the Adobe Acrobat framework that checks if the main bundle identifier is "com.apple.WebKit.PluginProcess" and assumes that it's running inside the Adobe Reader app if it's something else. Since we're now using the XPC service for all plug-ins, the bundle identifier is "com.apple.WebKit.Plugin.64", so the Acrobat framework assumes it's running in the app and doesn't use any special tricks to show the popup menu. Work around this by shimming CFStringCompare, and looking for the exact conditions when this can happen and return kCFCompareEqualTo when all conditions are true. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::isAdobeAcrobatAddress): (WebKit::stringCompare): (WebKit::initializeShim): (WebKit::PluginProcess::platformInitializeProcess): * PluginProcess/mac/PluginProcessShim.h: * PluginProcess/mac/PluginProcessShim.mm: (WebKit::shimCFStringCompare): 2016-07-08 Brady Eidson Unreviewed: Fix case-sensitive filesystem build. * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: 2016-07-08 Commit Queue Unreviewed, rolling out r202944. https://bugs.webkit.org/show_bug.cgi?id=159570 caused some tests to crash under GuardMalloc (Requested by estes on #webkit). Reverted changeset: "[Content Filtering] Load blocked pages more like other error pages are loaded" https://bugs.webkit.org/show_bug.cgi?id=159485 http://trac.webkit.org/changeset/202944 2016-07-08 Keith Rollin Add always-on logging for downloads https://bugs.webkit.org/show_bug.cgi?id=159521 Reviewed by Alex Christensen. Add logging statements that track when a download starts, when it first receives data, and when the download is done (due to completion, cancelation, or failure). * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::Download): (WebKit::Download::didReceiveResponse): (WebKit::Download::didReceiveData): (WebKit::Download::didFinish): (WebKit::Download::didFail): (WebKit::Download::didCancel): (WebKit::Download::isAlwaysOnLoggingAllowed): * NetworkProcess/Downloads/Download.h: (WebKit::Download::Download): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): 2016-07-08 Brady Eidson Clearing LocalStorage doesn't also delete -wal and -shm files. and https://bugs.webkit.org/show_bug.cgi?id=159566 Reviewed by Brent Fulgham. Also helpfully picked over by Andy "Never Forgets" Estes. * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier): 2016-07-07 Andy Estes [Content Filtering] Load blocked pages more like other error pages are loaded https://bugs.webkit.org/show_bug.cgi?id=159485 Reviewed by Brady Eidson. * Shared/API/c/WKErrorRef.h: Defined kWKErrorCodeFrameLoadBlockedByContentFilter. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added the resource directories of WebCore.framework and WebKit.framework as paths with assumed read access. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::hasAssumedReadAccessToURL): Checked platformPathsWithAssumedReadAccess() as well as m_localPathsWithAssumedReadAccess. (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added a non-Cocoa implementation. * UIProcess/WebProcessProxy.h: * WebProcess/WebCoreSupport/WebErrors.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::blockedByContentFilterError): Called WebKit::blockedByContentFilterError(). * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: (WebKit::blockedByContentFilterError): Returned a ResourceError for kWKErrorCodeFrameLoadBlockedByContentFilter. 2016-07-07 Alex Christensen Followup to r202939. https://bugs.webkit.org/show_bug.cgi?id=159526 * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFailLoading): We need the correct destination id when sending a message. 2016-07-07 Alex Christensen Fix crash when sending failure message to closed WebProcess https://bugs.webkit.org/show_bug.cgi?id=159526 Reviewed by Brady Eidson. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFailLoading): Check to see if there is a connection before using it to send a message. Sometimes it was null. I think this could be tested if we had real network loading from TestWebKitAPI by cancelling slow loads and closing WebProcesses around the same time, but no such infrastructure exists yet. 2016-07-07 Alex Christensen Use SocketProvider to create WebSocketChannels https://bugs.webkit.org/show_bug.cgi?id=158776 Reviewed by Brent Fulgham. * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/WebSocketProvider.cpp: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp. (WebKit::WebSocketProvider::createWebSocketChannel): (WebCore::ThreadableWebSocketChannel::create): Deleted. * WebProcess/Network/WebSocketProvider.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_shouldDispatchFakeMouseMoveEvents): 2016-07-07 Antoine Quint with a wide gamut PDF does not display using a wide gamut color space https://bugs.webkit.org/show_bug.cgi?id=158983 Reviewed by Dean Jackson. ColorSpace parameters have been replaced with CGColorSpaceRef parameters for IOSurface. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::decode): (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): 2016-07-07 Anders Carlsson Memory corruption destroying PaymentCoordinator https://bugs.webkit.org/show_bug.cgi?id=159516 rdar://problem/27222517 Reviewed by Tim Horton. Introduce a new MessageReceiverMap::removeMessageReceiver that takes a MessageReceiver and removes all traces of it in the message receiver map. Use it in the WebPaymentCoordinator destructor. * Platform/IPC/MessageReceiverMap.cpp: (IPC::MessageReceiverMap::removeMessageReceiver): * Platform/IPC/MessageReceiverMap.h: * Shared/ChildProcess.cpp: (WebKit::ChildProcess::removeMessageReceiver): * Shared/ChildProcess.h: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::~WebPaymentCoordinator): 2016-07-07 Csaba Osztrogonác [Mac][cmake] Unreviewed buildfix after r202889. Just for fun. * PlatformMac.cmake: 2016-07-06 Tim Horton Some API tests started failing after r202889 https://bugs.webkit.org/show_bug.cgi?id=159498 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadHTMLString): Fix a typo; this is a MIME type, not an encoding :| 2016-07-06 Tim Horton Email from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be https://bugs.webkit.org/show_bug.cgi?id=159498 Reviewed by Sam Weinig. * Shared/Cocoa/LoadParametersCocoa.mm: Added. (WebKit::LoadParameters::platformEncode): (WebKit::LoadParameters::platformDecode): * Shared/LoadParameters.cpp: Added. (WebKit::LoadParameters::encode): (WebKit::LoadParameters::decode): * Shared/LoadParameters.h: Added. Add a struct that knows how to encode all of the different parameters to all of the Load* messages, including the platform-specific DataDetectors parameters. * Shared/mac/ArgumentCodersMac.h: * Shared/mac/ArgumentCodersMac.mm: (IPC::typeFromObject): (IPC::encode): (IPC::decode): Add NSURL coders that defer to the CFURL coders. * UIProcess/API/APIUIClient.h: (API::UIClient::dataDetectionContext): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::dataDetectionContext): Add APIUIClient methods to retrieve the DataDetectors context dictionary. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::addPlatformLoadParameters): Add the DataDetectors context dictionary to the given LoadParameters. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dataDetectionContext): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::dataDetectionContext): Store the dataDetectionContext on WebPage, and make it accessible to WebCore via the FrameLoaderClient (it is used in FrameLoader when the load completes). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadRequest): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::loadHTMLString): (WebKit::WebPageProxy::loadAlternateHTMLString): (WebKit::WebPageProxy::loadPlainTextString): (WebKit::WebPageProxy::loadWebArchiveData): * UIProcess/WebPageProxy.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): (WebKit::WebPage::loadStringImpl): (WebKit::WebPage::loadData): (WebKit::WebPage::loadString): (WebKit::WebPage::loadAlternateHTMLString): (WebKit::WebPage::loadHTMLString): Deleted. (WebKit::WebPage::loadPlainTextString): Deleted. (WebKit::WebPage::loadWebArchiveData): Deleted. * WebProcess/WebPage/WebPage.messages.in: Adopt LoadParameters, taking this opportunity to reduce the number of very similar messages. We can take this further (we should be able to get it down to just LoadRequest and LoadData) in the future. When any load occurs, grab the client's DataDetectorse context dictionary and send it along with the load request, storing it in WebPage. 2016-07-06 Chris Dumez [WK2][Cocoa] Disable ResourceResponse lazy initialization https://bugs.webkit.org/show_bug.cgi?id=159497 Reviewed by Alex Christensen. Disable ResourceResponse lazy initialization for WebKit2 as we always end up initializing all the fields anyway when sending the response to the WebContent process via IPC. Even worse, we always do a partial lazy initialization (common fields only) before the IPC so we always do the initialization in 2 steps. This normally would not be an issue but the 2 steps actually have some overlap because both call CFHTTPMessageCopyAllHeaderFields(), which is expensive (See ) to first get the common HTTP headers, then ALL the HTTP headers. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): 2016-07-06 Chelsea Pugh [iOS] Text suggestions should be cleared when form input session is invalidated https://bugs.webkit.org/show_bug.cgi?id=159477 Reviewed by Dan Bernstein. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession invalidate]): Set input delegate's suggestions to nil when a form input session is invalidated. This will set the keyboard QuickType suggestions back to their default values. 2016-07-06 Alex Christensen Call continueCanAuthenticateAgainstProtectionSpace when cancelling loads waiting for the callback https://bugs.webkit.org/show_bug.cgi?id=159492 Reviewed by Brady Eidson. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::~NetworkLoad): (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): * NetworkProcess/NetworkLoad.h: 2016-07-06 Myles C. Maxfield [RTL Scrollbars] RTL Scrollbars broken with clients creating Web Views via [WKView initWithFrame:contextRef:pageGroupRef:] https://bugs.webkit.org/show_bug.cgi?id=159383 Reviewed by Anders Carlsson. The code which consults with the userInterfaceLayoutDirection of the view is inside [WKWebView _initializeWithConfiguration:]. However, some clients create Web Views via [WKView initWithFrame:contextRef:pageGroupRef:] which doesn't call this code. Therefore, this codepath should do the same kind of direction consulting. * UIProcess/API/mac/WKView.mm: (toUserInterfaceLayoutDirection): (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]): 2016-07-06 Commit Queue Unreviewed, rolling out r202867. https://bugs.webkit.org/show_bug.cgi?id=159491 This change caused an existing LayoutTest to crash on ios- simulator (Requested by ryanhaddad on #webkit). Reverted changeset: " with a wide gamut PDF does not display using a wide gamut color space" https://bugs.webkit.org/show_bug.cgi?id=158983 http://trac.webkit.org/changeset/202867 2016-07-06 Enrica Casucci Limit touch distance for two finger tap. https://bugs.webkit.org/show_bug.cgi?id=159476 rdar://problem/26439052 Reviewed by Beth Dakin. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): * Platform/spi/ios/UIKitSPI.h 2016-07-06 Antoine Quint with a wide gamut PDF does not display using a wide gamut color space https://bugs.webkit.org/show_bug.cgi?id=158983 Reviewed by Tim Horton. ColorSpace parameters have been replaced with CGColorSpaceRef parameters for IOSurface. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::decode): (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): 2016-07-06 Commit Queue Unreviewed, rolling out r202725. https://bugs.webkit.org/show_bug.cgi?id=159473 didn't reduce coreui memory usage (Requested by kling on #webkit). Reverted changeset: "[Mac] Get rid of the old timey rubber-banding linen pattern." https://bugs.webkit.org/show_bug.cgi?id=159329 http://trac.webkit.org/changeset/202725 2016-07-06 Carlos Garcia Campos Duplicated code in DrawingAreaImpl and CoordinatedDrawingArea https://bugs.webkit.org/show_bug.cgi?id=159259 Reviewed by Žan Doberšek. It seems that CoordinatedDrawingArea is just a copy paste of DrawingAreaImpl with non-accelerated code path removed. There's actually nothing (or very little) specific to coordinated graphics in the CoordinatedDrawingArea implementation. This patch renames CoordinatedDrawingArea as AcceleratedDrawingArea and makes DrawingAreaImpl inherit from it, so that in case of accelerated compositing the parent class is used, and DrawingAreaImpl only adds the non accelerated code path. * PlatformEfl.cmake: * PlatformGTK.cmake: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp. (WebKit::AcceleratedDrawingArea::~AcceleratedDrawingArea): (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea): (WebKit::AcceleratedDrawingArea::setNeedsDisplay): (WebKit::AcceleratedDrawingArea::setNeedsDisplayInRect): (WebKit::AcceleratedDrawingArea::scroll): (WebKit::AcceleratedDrawingArea::pageBackgroundTransparencyChanged): (WebKit::AcceleratedDrawingArea::setLayerTreeStateIsFrozen): (WebKit::AcceleratedDrawingArea::forceRepaint): (WebKit::AcceleratedDrawingArea::forceRepaintAsync): (WebKit::AcceleratedDrawingArea::setPaintingEnabled): (WebKit::AcceleratedDrawingArea::updatePreferences): (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): (WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers): (WebKit::AcceleratedDrawingArea::graphicsLayerFactory): (WebKit::AcceleratedDrawingArea::setRootCompositingLayer): (WebKit::AcceleratedDrawingArea::scheduleCompositingLayerFlush): (WebKit::AcceleratedDrawingArea::scheduleCompositingLayerFlushImmediately): (WebKit::AcceleratedDrawingArea::updateBackingStoreState): (WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState): (WebKit::AcceleratedDrawingArea::suspendPainting): (WebKit::AcceleratedDrawingArea::resumePainting): (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon): (WebKit::AcceleratedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage): (WebKit::AcceleratedDrawingArea::viewStateDidChange): (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer): * WebProcess/WebPage/AcceleratedDrawingArea.h: Renamed from Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h. (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModePending): (WebKit::AcceleratedDrawingArea::didUpdateBackingStoreState): (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingMode): * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::create): * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::DrawingAreaImpl): (WebKit::DrawingAreaImpl::setNeedsDisplay): (WebKit::DrawingAreaImpl::setNeedsDisplayInRect): (WebKit::DrawingAreaImpl::scroll): (WebKit::DrawingAreaImpl::forceRepaint): (WebKit::DrawingAreaImpl::setRootCompositingLayer): (WebKit::DrawingAreaImpl::updateBackingStoreState): (WebKit::DrawingAreaImpl::didUpdateBackingStoreState): (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): (WebKit::DrawingAreaImpl::suspendPainting): (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): (WebKit::DrawingAreaImpl::~DrawingAreaImpl): Deleted. (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Deleted. (WebKit::DrawingAreaImpl::updatePreferences): Deleted. (WebKit::DrawingAreaImpl::didUpdate): Deleted. (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Deleted. (WebKit::DrawingAreaImpl::scheduleDisplay): Deleted. (WebKit::DrawingAreaImpl::displayTimerFired): Deleted. (WebKit::DrawingAreaImpl::display): Deleted. (WebKit::shouldPaintBoundsRect): Deleted. (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing): Deleted. * WebProcess/WebPage/DrawingAreaImpl.h: 2016-07-06 Youenn Fablet Refactor NetworkResourceLoadParameters https://bugs.webkit.org/show_bug.cgi?id=159402 Reviewed by Alex Christensen. Making NetworkResourceLoadParameters derive from NetworkLoadParameters. * CMakeLists.txt: Removed NetworkLoadParameters.cpp * NetworkProcess/NetworkLoadParameters.cpp: Deleted. * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): Deleted. * NetworkProcess/NetworkResourceLoadParameters.h: Making it derive from NetworkLoadParameters. * WebKit2.xcodeproj/project.pbxproj: 2016-07-05 Alex Christensen Actually persist changes to cookie accept policy. https://bugs.webkit.org/show_bug.cgi?id=159377 Reviewed by Alexey Proskuryakov. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSession::NetworkSession): Added logging. * UIProcess/mac/WebCookieManagerProxyMac.mm: (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy): When we persist the cookie accept policy, we want to call _saveCookies to actually write the change to disk so that when we create a new process which reads from disk to determine its cookie accept policy, it will read the new cookie accept policy. Before this patch it was reading the old one in some cases where the changes had not yet been persisted to disk. 2016-07-04 Carlos Garcia Campos [Coordinated Graphics] Modernize and cleanup CompositingCoordinator https://bugs.webkit.org/show_bug.cgi?id=159212 Reviewed by Žan Doberšek. Changes done: - Use references instead of pointers when possible. - Add missing final/override keywords. - Reduce the use of PassRefPtr - Move member initializations to the declaration. - Use nullptr instead of 0. - Use HashMap::ensure() instead of complicated code with iterators. - Avoid heap allocation when possible. * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: (WebKit::WebCoordinatedSurface::paintToSurface): * Shared/CoordinatedGraphics/WebCoordinatedSurface.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: (WebKit::ThreadSafeCoordinatedSurface::paintToSurface): * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h: * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp: (WebKit::GeneralAreaAllocator::expand): (WebKit::GeneralAreaAllocator::splitNode): (WebKit::GeneralAreaAllocator::release): (WebKit::GeneralAreaAllocator::GeneralAreaAllocator): Deleted. * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::CompositingCoordinator): (WebKit::CompositingCoordinator::flushPendingLayerChanges): (WebKit::CompositingCoordinator::createImageBackingIfNeeded): (WebKit::CompositingCoordinator::updateImageBacking): (WebKit::CompositingCoordinator::notifyFlushRequired): (WebKit::CompositingCoordinator::paintContents): (WebKit::CompositingCoordinator::createUpdateAtlas): (WebKit::CompositingCoordinator::commitScrollOffset): (WebKit::CompositingCoordinator::paintToSurface): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer): (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer): (WebKit::CoordinatedLayerTreeHost::invalidate): (WebKit::CoordinatedLayerTreeHost::forceRepaint): (WebKit::CoordinatedLayerTreeHost::sizeDidChange): (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect): (WebKit::CoordinatedLayerTreeHost::renderNextFrame): (WebKit::CoordinatedLayerTreeHost::purgeBackingStores): (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): (WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory): (WebKit::CoordinatedLayerTreeHost::scheduleAnimation): (WebKit::CoordinatedLayerTreeHost::commitScrollOffset): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::UpdateAtlas): (WebKit::UpdateAtlas::~UpdateAtlas): (WebKit::UpdateAtlas::buildLayoutIfNeeded): (WebKit::UpdateAtlas::paintOnAvailableBuffer): (WebKit::UpdateAtlasSurfaceClient::UpdateAtlasSurfaceClient): Deleted. * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: 2016-07-04 Brady Eidson WebProcesses don't handle DatabaseProcess going away uncleanly.. https://bugs.webkit.org/show_bug.cgi?id=159371 Reviewed by Alex Christensen. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::terminateDatabaseProcess): Deleted. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::connectionToServerLost): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: (WebKit::WebToDatabaseProcessConnection::didReceiveMessage): (WebKit::WebToDatabaseProcessConnection::didClose): Notify each connection that the database server connection dropped. 2016-07-04 Fujii Hironori [GTK] Null WebCore::Range dereference in WebEditorClient::updateGlobalSelection https://bugs.webkit.org/show_bug.cgi?id=159341 Reviewed by Carlos Garcia Campos. FrameSelection::toNormalizedRange() can return null. Null check is needed. Tests: editing/input/set-value-on-input-and-delete.html editing/selection/selection-in-iframe-removed-crash.html imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-after-content-change.html imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea.html imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application.html * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::WebEditorClient::updateGlobalSelection): Do not update global selection if FrameSelection::toNormalizedRange() returns null. 2016-07-04 Fujii Hironori [GTK] ASSERTION_FAILED: m_key != PTHREAD_KEYS_MAX when defining WEBKIT2_PAUSE_WEB_PROCESS_ON_LAUNCH https://bugs.webkit.org/show_bug.cgi?id=158149 Reviewed by Carlos Garcia Campos. WTF::sleep can not be used at the beginning of web process because WTF is not initialized at the moment yet. * WebProcess/gtk/WebProcessMainGtk.cpp: Use g_usleep instead of WTF::sleep. 2016-07-03 Dan Bernstein Follow-up to r202789. Reviewed by Sam Weinig. Ensure that API that isn’t available at all on a platform is declared under an appropriate TARGET_OS_* conditional. * Shared/API/Cocoa/_WKHitTestResult.h: * Shared/API/Cocoa/_WKHitTestResult.mm: * Shared/API/Cocoa/_WKHitTestResultInternal.h: * UIProcess/API/Cocoa/WKOpenPanelParameters.h: * UIProcess/API/Cocoa/WKOpenPanelParameters.mm: * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h: * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h: * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm: * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2016-07-03 Dan Bernstein [Cocoa] Adopt modern API availability macros https://bugs.webkit.org/show_bug.cgi?id=159378 Reviewed by Sam Weinig. iOS 10 and macOS Sierra introduce new macros for declaring API availability, defined in CFAvailability.h, including API_AVAILABLE, API_DEPRECATED, and API_DEPRECATED_WITH_REPLACEMENT. Rather than having positional parameters for macOS and iOS versions, the new macros take a variable number of function-like parameters, where the function specifies the platform to which it applies. To have WebKit2’s postprocessed headers use the new macros, we make the following changes: - Replace instances of WK_AVAILABLE(_mac, _ios) with WK_API_AVAILABLE(macosx(_mac), ios(_ios)), eliding a platform if its current availability is NA. - Change instances of WK_CLASS_AVAILABLE(_mac, _ios) to WK_CLASS_AVAILABLE(macosx(_mac), ios(_ios)), eliding a platform if its current availability is NA. - Replace instances of WK_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) with WK_API_DEPRECATED_WITH_REPLACEMENT(_replacement, macosx(_macIntro, _macDep), ios(_iosIntro, _iosDep)) when there is a one-for-one replacement, and with WK_API_DEPRECATED(_message, macosx(_macIntro, _macDep), ios(_iosIntro, _iosDep)) when the replacement isn’t one-for-one. Again, if the API doesn’t apply to a platform, then it’s elided. - Replace instances of WK_CLASS_DEPRECATED with WK_CLASS_DEPRECATED_WITH_REPLACEMENT, following the same rules. - Replace instances of the WK_ENUM_* macros with corresponding WK_API_* macros, now that all supported compilers support availability attributes on enum values. * Configurations/WebKit.xcconfig: Disable header postprocessing when building for iOS 9.x, which doesn’t have the new macros. * mac/postprocess-framework-headers.sh: Handle the new WK_* macros: WK_API_AVAILABLE becomes API_AVAILABLE; WK_API_DEPRECATED(_WITH_REPLACEMENT) become API_DEPRECATED(_WITH_REPLACEMENT); WK_CLASS_AVAILABLE and WK_CLASS_DEPRECATED(_WITH_REPLACEMENT) change to the corresponding API_ macros, prefixed with WK_EXTERN. * Shared/API/Cocoa/WKFoundation.h: When header postprocessing is disabled, provide definitions of the new WK_* macros we use. * UIProcess/API/Cocoa/WKWebViewConfiguration.h: In addition to the above, changed one instance of (iOS) 10_0 to WK_IOS_TBA. Made the above changes in the following headers: * Shared/API/Cocoa/WKBrowsingContextHandle.h: * Shared/API/Cocoa/_WKFrameHandle.h: * Shared/API/Cocoa/_WKHitTestResult.h: * Shared/API/Cocoa/_WKRemoteObjectInterface.h: * Shared/API/Cocoa/_WKRemoteObjectRegistry.h: * Shared/API/Cocoa/_WKRenderingProgressEvents.h: * Shared/API/Cocoa/_WKSameDocumentNavigationType.h: * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKBrowsingContextController.h: * UIProcess/API/Cocoa/WKBrowsingContextGroup.h: * UIProcess/API/Cocoa/WKConnection.h: * UIProcess/API/Cocoa/WKError.h: * UIProcess/API/Cocoa/WKErrorPrivate.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKFrameInfoPrivate.h: * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * UIProcess/API/Cocoa/WKNavigationData.h: * UIProcess/API/Cocoa/WKNavigationDelegate.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKOpenPanelParameters.h: * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKPreviewActionItem.h: * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h: * UIProcess/API/Cocoa/WKPreviewElementInfo.h: * UIProcess/API/Cocoa/WKProcessGroup.h: * UIProcess/API/Cocoa/WKProcessPool.h: * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKScriptMessage.h: * UIProcess/API/Cocoa/WKSecurityOrigin.h: * UIProcess/API/Cocoa/WKTypeRefWrapper.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: * UIProcess/API/Cocoa/WKUserScript.h: * UIProcess/API/Cocoa/WKUserScriptPrivate.h: * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/WKWindowFeatures.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: * UIProcess/API/Cocoa/_WKAutomationSession.h: * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h: * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h: * UIProcess/API/Cocoa/_WKDownload.h: * UIProcess/API/Cocoa/_WKElementAction.h: * UIProcess/API/Cocoa/_WKExperimentalFeature.h: * UIProcess/API/Cocoa/_WKFindOptions.h: * UIProcess/API/Cocoa/_WKFormInputSession.h: * UIProcess/API/Cocoa/_WKInputDelegate.h: * UIProcess/API/Cocoa/_WKLayoutMode.h: * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKSessionState.h: * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h: * UIProcess/API/Cocoa/_WKUserContentFilter.h: * UIProcess/API/Cocoa/_WKUserContentWorld.h: * UIProcess/API/Cocoa/_WKUserStyleSheet.h: * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h: * UIProcess/API/Cocoa/_WKVisitedLinkStore.h: * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/_WKWebsiteDataSize.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h: * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: * WebProcess/InjectedBundle/API/mac/WKDOMElement.h: * WebProcess/InjectedBundle/API/mac/WKDOMNode.h: * WebProcess/InjectedBundle/API/mac/WKDOMRange.h: * WebProcess/InjectedBundle/API/mac/WKDOMText.h: * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h: 2016-07-01 Hunseop Jeong [EFL] Many layout tests are timeout after r202532. https://bugs.webkit.org/show_bug.cgi?id=159337 Reviewed by Gyuyoung Kim. WebPageProxy::forceRepaint() wait for the next commit from the web process after r202532, but WebPageProxy::callAfterNextPresentationUpdate() is not implemented in CoordinatedDrawingAreaProxy. * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp: (WebKit::CoordinatedDrawingAreaProxy::contentsRect): (WebKit::CoordinatedDrawingAreaProxy::dispatchAfterEnsuringDrawing): (WebKit::CoordinatedDrawingAreaProxy::sizeDidChange): * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h: (WebKit::CoordinatedDrawingAreaProxy::page): 2016-07-01 Myles C. Maxfield REGRESSION(r189668): Notification tests are flakey https://bugs.webkit.org/show_bug.cgi?id=159375 Reviewed by Alexey Proskuryakov. Implement WKNotificationManagerGetLocalID(). For more information, see the entry in Tools/ChangeLog. * UIProcess/API/C/WKNotificationManager.cpp: (WKNotificationManagerGetLocalID): * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::notificationLocalIDForTesting): * UIProcess/Notifications/WebNotificationManagerProxy.h: * WebKit2.xcodeproj/project.pbxproj: 2016-07-01 Jer Noble REGRESSION(r201405): Fullscreen video no longer enters low-power mode https://bugs.webkit.org/show_bug.cgi?id=159220 Reviewed by Beth Dakin. In r201405, we removed the call to setTopContentInset(0) to avoid a flash during repainting where the WebProcess still thought it had an inset and the UIProcess did not, but the >0 inset breaks low power video playback in fullscreen. So, instead, fix the repaint issue by setting a CALayer fence which makes sure both the UIProcess and WebProcess paint simultaneously after resizing and changing the top content inset. This requires a new message from WebPageProxy -> WebPage: setTopContentInsetFenced(). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setTopContentInset): * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setTopContentInsetFenced): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-07-01 Dan Bernstein [Mac] Get rid of support for old SDKs https://bugs.webkit.org/show_bug.cgi?id=159369 Reviewed by Anders Carlsson. * Shared/API/Cocoa/WKFoundation.h: Removed the WK_ARRAY, WK_DICTIONARY, and WK_SET macros, which were only needed for pre-10.11 SDKs. * Shared/mac/WebEventFactory.mm: (WebKit::mouseButtonForEvent): Removed checking for pre-10.10.3 SDKs. (WebKit::globalPointForEvent): Ditto. (WebKit::pointForEvent): Ditto. (WebKit::WebEventFactory::createWebMouseEvent): Ditto. * UIProcess/API/Cocoa/WKBackForwardList.h: Replaced WK_ARRAY(...) with NSArray<...>. * UIProcess/API/Cocoa/WKPreferences.mm: Ditto. (-[WKPreferences _setFixedPitchFontFamily:]): (+[WKPreferences _experimentalFeatures]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Ditto. * UIProcess/API/Cocoa/WKUIDelegate.h: Ditto. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Ditto. * UIProcess/API/Cocoa/WKUserContentController.h: Ditto. * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Ditto. * UIProcess/API/Cocoa/WKUserScriptPrivate.h: Ditto. * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Replaced WK_SET(...) with NSSet<...>. * UIProcess/API/Cocoa/WKWebsiteDataStore.h: Ditto. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: Ditto. (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]): (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Ditto. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Replaced WK_ARRAY(...) with NSArray<...>. * UIProcess/API/Cocoa/_WKUserStyleSheet.h: Ditto. * UIProcess/API/Cocoa/_WKUserStyleSheet.mm: Ditto. (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:]): (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]): (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]): * UIProcess/API/Cocoa/_WKWebsiteDataSize.h: Replaced WK_SET(...) with NSSet<...>. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::pressureChangeWithEvent): Removed checking for pre-10.10.3 SDKs. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: Replaced WK_ARRAY(...) with NSArray<...>. * mac/postprocess-framework-headers.sh: Removed sed rules for WK_ARRAY, WK_DICTIONARY and WK_SET. 2016-07-01 Chris Dumez [iOS] Possible null Range dereference under computeAutocorrectionContext() https://bugs.webkit.org/show_bug.cgi?id=159328 Reviewed by Benjamin Poulain. The code in computeAutocorrectionContext() was checking Editor::hasComposition() before dereferencing Editor::compositionRange(). However, compositionRange() can also return null in other cases (e.g. compositionStart == compositionEnd). Drop the check for hasComposition() and do a null check on the value returned by compositionRange() instead. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::computeAutocorrectionContext): 2016-07-01 Brent Fulgham Prevent crash when attempting to copy an image https://bugs.webkit.org/show_bug.cgi?id=159288 Reviewed by Brady Eidson. WebKit could crash if the HTMLImageElement had a null cachedImage member. A little investigation showed that the URL we retrieve from the cachedImage is never used, so rather than adding a null check, let's just pass a default argument. The actual URL gets read from elsewhere in the pasteboard processing code. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performActionOnElement): Don't bother passing the unused URL argument to the pasteboard method. 2016-07-01 Brady Eidson Blob content type not preserved when retrieving blobs from IndexedDB. and https://bugs.webkit.org/show_bug.cgi?id=159360 Reviewed by Alex Christensen. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked): * WebProcess/FileAPI/BlobRegistryProxy.h: 2016-07-01 Dan Bernstein [Cocoa] Get rid of WK_NULLABLE_SPECIFIER now that all supported compilers understand _Nullable https://bugs.webkit.org/show_bug.cgi?id=159361 Reviewed by Anders Carlsson. * Shared/API/Cocoa/WKFoundation.h: * UIProcess/API/Cocoa/WKNavigationDelegate.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKWebView.h: * mac/postprocess-framework-headers.sh: 2016-07-01 Youenn Fablet Add a runtime flag for DOM iterators https://bugs.webkit.org/show_bug.cgi?id=159300 Reviewed by Alex Christensen. * Shared/WebPreferencesDefinitions.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-07-01 Andreas Kling [Mac] Get rid of the old timey rubber-banding linen pattern. Reviewed by Benjamin Poulain. * Shared/mac/RemoteLayerTreePropertyApplier.mm: (WebKit::updateCustomAppearance): 2016-06-30 Tina Liu Add SPI to allow restoring session state without navigation in WKPage https://bugs.webkit.org/show_bug.cgi?id=159326 Reviewed by Brady Eidson. * UIProcess/API/C/WKPage.cpp: (restoreFromSessionState): Added a helper function that takes a bool parameter to specify whether to navigate or not when restoring from the session state. (WKPageRestoreFromSessionState): Calling restoreFromSessionState, passing navigate = true. (WKPageRestoreFromSessionStateWithoutNavigation): Ditto but passing navigate = false. * UIProcess/API/C/WKPagePrivate.h: 2016-06-30 Chris Dumez [iOS] WebContent processes do not exit promptly https://bugs.webkit.org/show_bug.cgi?id=159301 Reviewed by Anders Carlsson. WebContent processes do not exit promptly, they hang around for 10 seconds until the watchdog forcefully calls exit(). This patch addresses the issue by asking XPC to exit when clean. It also fixes 2 XPC transactions that were leaking so that XPC can become clean. * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm: (DatabaseServiceInitializer): * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm: (NetworkServiceInitializer): * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm: (PluginServiceInitializer): * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm: (WebContentServiceInitializer): Add extra priorityBoostMessage parameter which is then passed along to ChildProcess via initialization parameters. ChildProcess is now in charge of retaining the message for as long as it needs the priority boost. In particular, ChildProcess now takes care of releasing the boost message before existing to avoid leaking an XPC transaction. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::initialize): Retain priorityBoostMessage as a data member. (WebKit::ChildProcess::stopRunLoop): (WebKit::ChildProcess::platformStopRunLoop): * Shared/ios/ChildProcessIOS.mm: (WebKit::ChildProcess::platformStopRunLoop): On iOS, call XPCServiceExit() to exit instead of RunLoop::main().stop() which did not work. * Shared/ChildProcess.h: * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): Set priorityBoostMessage on ChildProcessInitializationParameters. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceExit): Add XPCServiceExit() function which destroys the priority boost message, calls xpc_transaction_end() to balance the xpc_transaction_begin() in XPCServiceInitializer() and then call xpc_transaction_exit_clean() to ask XPC to exit when clean. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceEventHandler): Leaking the "pre-bootstrap" event for priority boosting would cause us to leak an XPC transaction, which would prevent XPC from becoming clean and exiting. Instead, we now pass it along to the initialization function. We then pass it to ChildProcess which manages the lifetime of this message instead of leaking it. 2016-06-30 Brian Burg REGRESSION(r202329): WebInspectorProxy's WKPagePolicyClient callbacks are not being called https://bugs.webkit.org/show_bug.cgi?id=159308 Reviewed by Tim Horton. Adopt WKPageNavigationClient and ditch WKPolicyClient and WKPageLoaderClient. After r202329, it's not possible to set a WKPolicyClient for a WKPage/WebPageProxy that backs a WKWebView. * UIProcess/WebInspectorProxy.cpp: (WebKit::isMainOrTestInspectorPage): Take a WebCore::ResourceRequest. (WebKit::processDidCrash): Deleted. (WebKit::webProcessDidCrash): Rename to match new client callback name. (WebKit::decidePolicyForNavigationAction): Rework this to take new argument types. (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Install a WKPageNavigationClient. 2016-06-30 Chris Dumez [iOS] Process suspension is prevented for 30 seconds after closing a tab https://bugs.webkit.org/show_bug.cgi?id=159280 Reviewed by Gavin Barraclough. When closing a tab, ConnectionTerminationWatchdog takes a background assertion on behalf of the WebContent process and only releases it after 30 seconds, allowing for the WebContent process to exit cleanly without worrying about getting suspended too early. However, the child process normally exits much sooner than this and we end up holding a process assertion for no reason for a full 30 seconds anyway. This patch addresses the issue by registering an invalidation handler with the BKSProcessAssertion and releasing our our assertion in such case. The invalidation handler gets called as soon as the child process exits. * Platform/spi/ios/AssertionServicesSPI.h: * UIProcess/ProcessAssertion.cpp: (WebKit::ProcessAssertion::ProcessAssertion): * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAssertion::validity): * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAssertion::~ProcessAssertion): (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount): (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion): (WebKit::ProcessAssertion::setState): Deleted. 2016-06-30 Tim Horton Keep track of when a WKWebView is blank before the initial non-empty layout https://bugs.webkit.org/show_bug.cgi?id=159217 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]): (-[WKWebView _didFirstVisuallyNonEmptyLayoutForMainFrame]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame): 2016-06-29 Gavin Barraclough Cleanup ProcessAssertion RunInBackground management https://bugs.webkit.org/show_bug.cgi?id=159284 Reviewed by Chris Dumez. Factor out code that handles taking a background assertion on the UI app into ProcessAndUIAssertion::updateRunInBackgroundCount helper. This patch just cleanup to enable a futher fix. * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::state): - Added ProcessAndUIAssertion::updateRunInBackgroundCount - Added ProcessAndUIAssertion::m_isHoldingBackgroundAssertionOnApp * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount): - helper to manage calls to incrementNeedsToRunInBackgroundCount/decrementNeedsToRunInBackgroundCount (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion): - call updateRunInBackgroundCount (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion): changed to use m_isHoldingBackgroundAssertionOnApp (WebKit::ProcessAndUIAssertion::setState): - call updateRunInBackgroundCount 2016-06-30 Carlos Garcia Campos [Coordinated Graphics] Move CompositingCoordinator from platform to WebKit2 layer https://bugs.webkit.org/show_bug.cgi?id=159209 Reviewed by Žan Doberšek. Move CompositingCoordinator and its helper classes to the WebKit2 layer. * PlatformEfl.cmake: * PlatformGTK.cmake: * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.cpp. (WebKit::AreaAllocator::AreaAllocator): (WebKit::AreaAllocator::~AreaAllocator): (WebKit::AreaAllocator::expand): (WebKit::AreaAllocator::expandBy): (WebKit::AreaAllocator::release): (WebKit::AreaAllocator::overhead): (WebKit::AreaAllocator::roundAllocation): (WebKit::GeneralAreaAllocator::GeneralAreaAllocator): (WebKit::GeneralAreaAllocator::~GeneralAreaAllocator): (WebKit::GeneralAreaAllocator::freeNode): (WebKit::GeneralAreaAllocator::expand): (WebKit::fitsWithin): (WebKit::GeneralAreaAllocator::allocate): (WebKit::GeneralAreaAllocator::allocateFromNode): (WebKit::GeneralAreaAllocator::splitNode): (WebKit::GeneralAreaAllocator::updateLargestFree): (WebKit::GeneralAreaAllocator::release): (WebKit::GeneralAreaAllocator::overhead): * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.h. (WebKit::nextPowerOfTwo): (WebKit::AreaAllocator::size): (WebKit::AreaAllocator::minimumAllocation): (WebKit::AreaAllocator::setMinimumAllocation): (WebKit::AreaAllocator::margin): (WebKit::AreaAllocator::setMargin): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp. (WebKit::CompositingCoordinator::CompositingCoordinator): (WebKit::CompositingCoordinator::~CompositingCoordinator): (WebKit::CompositingCoordinator::setRootCompositingLayer): (WebKit::CompositingCoordinator::setViewOverlayRootLayer): (WebKit::CompositingCoordinator::sizeDidChange): (WebKit::CompositingCoordinator::flushPendingLayerChanges): (WebKit::CompositingCoordinator::timestamp): (WebKit::CompositingCoordinator::syncDisplayState): (WebKit::CompositingCoordinator::nextAnimationServiceTime): (WebKit::CompositingCoordinator::clearPendingStateChanges): (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded): (WebKit::CompositingCoordinator::createRootLayer): (WebKit::CompositingCoordinator::syncLayerState): (WebKit::CompositingCoordinator::createImageBackingIfNeeded): (WebKit::CompositingCoordinator::createImageBacking): (WebKit::CompositingCoordinator::updateImageBacking): (WebKit::CompositingCoordinator::clearImageBackingContents): (WebKit::CompositingCoordinator::removeImageBacking): (WebKit::CompositingCoordinator::flushPendingImageBackingChanges): (WebKit::CompositingCoordinator::notifyAnimationStarted): (WebKit::CompositingCoordinator::notifyFlushRequired): (WebKit::CompositingCoordinator::paintContents): (WebKit::CompositingCoordinator::createGraphicsLayer): (WebKit::CompositingCoordinator::deviceScaleFactor): (WebKit::CompositingCoordinator::pageScaleFactor): (WebKit::CompositingCoordinator::createUpdateAtlas): (WebKit::CompositingCoordinator::removeUpdateAtlas): (WebKit::CompositingCoordinator::visibleContentsRect): (WebKit::CompositingCoordinator::mainContentsLayer): (WebKit::CompositingCoordinator::setVisibleContentsRect): (WebKit::CompositingCoordinator::deviceOrPageScaleFactorChanged): (WebKit::CompositingCoordinator::detachLayer): (WebKit::CompositingCoordinator::commitScrollOffset): (WebKit::CompositingCoordinator::renderNextFrame): (WebKit::CompositingCoordinator::purgeBackingStores): (WebKit::CompositingCoordinator::paintToSurface): (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h. (WebKit::CompositingCoordinator::clearRootLayer): (WebKit::CompositingCoordinator::rootLayer): (WebKit::CompositingCoordinator::state): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.cpp. (WebKit::UpdateAtlasSurfaceClient::UpdateAtlasSurfaceClient): (WebKit::UpdateAtlas::UpdateAtlas): (WebKit::UpdateAtlas::~UpdateAtlas): (WebKit::UpdateAtlas::buildLayoutIfNeeded): (WebKit::UpdateAtlas::didSwapBuffers): (WebKit::UpdateAtlas::paintOnAvailableBuffer): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.h. (WebKit::UpdateAtlas::size): (WebKit::UpdateAtlas::supportsAlpha): (WebKit::UpdateAtlas::addTimeInactive): (WebKit::UpdateAtlas::isInactive): (WebKit::UpdateAtlas::isInUse): 2016-06-29 Hunseop Jeong Unreviewed, CMake build fix. * PlatformMac.cmake: 2016-06-29 Beth Dakin Add media_icon to WebKit2 https://bugs.webkit.org/show_bug.cgi?id=159273 -and corresponding- rdar://problem/27087714 Reviewed by Dean Jackson. * Resources/mediaIcon.pdf: Added. * WebKit2.xcodeproj/project.pbxproj: 2016-06-29 Anders Carlsson Rename addressFields to contactFields https://bugs.webkit.org/show_bug.cgi?id=159271 rdar://problem/27086955 Reviewed by Beth Dakin. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKAddressField): (WebKit::toPKPaymentRequest): 2016-06-29 Jer Noble Adopt MediaRemote. https://bugs.webkit.org/show_bug.cgi?id=159250 Reviewed by Eric Carlson. Add a sandbox exception allowing access to the mediaremoted XPC service. * WebProcess/com.apple.WebProcess.sb.in: 2016-06-29 Alex Christensen WKWebView should ask WKNavigationDelegate about bad ssl certificates https://bugs.webkit.org/show_bug.cgi?id=159176 rdar://problem/26864882 Reviewed by Sam Weinig. This can be tested manually by visiting a site in MiniBrowser that has invalid ssl certificates, but we don't have proper ssl testing yet. Before this change, we would just open the site as if nothing were invalid, now we call the WKNavigationDelegate's didReceiveAuthenticationChallenge like we did before using NSURLSession, and we do not open the page, also like we did before using NSURLSession. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): When using NSURLConnection and responding to canAuthenticateAgainstProtectionSpace with YES, we get an NSURLAuthenticationChallenge when a bad ssl certificate is encountered in the handshake. When using NSURLSession, we want to call webView:didReceiveAuthenticationChallenge:completionHandler: in this case. The default implementation of NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace returns true if there is an implementation of webView:didReceiveAuthenticationChallenge:completionHandler: in its WKNavigationDelegate. Internal clients can implement _webView:canAuthenticateAgainstProtectionSpace: and Safari uses canHandleHTTPSServerTrustEvaluation, so it will be unaffected. 2016-06-29 Beth Dakin Delete WKElementInfo since it's not used https://bugs.webkit.org/show_bug.cgi?id=159265 Reviewed by Sam Weinig. * Shared/API/Cocoa/WebKit.h: * UIProcess/API/Cocoa/WKElementInfo.h: Removed. * UIProcess/API/Cocoa/WKElementInfo.mm: Removed. * UIProcess/API/Cocoa/WKElementInfoInternal.h: Removed. * UIProcess/API/Cocoa/WKPreviewElementInfo.h: * UIProcess/API/Cocoa/WKPreviewElementInfo.mm: (-[WKPreviewElementInfo _initWithLinkURL:]): (-[WKPreviewElementInfo copyWithZone:]): (-[WKPreviewElementInfo linkURL]): * UIProcess/API/Cocoa/WKPreviewElementInfoInternal.h: * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h: * UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm: (-[_WKContextMenuElementInfo copyWithZone:]): * WebKit2.xcodeproj/project.pbxproj: 2016-06-29 Jeremy Jones Replace MPAudioVideoRoutingActionSheet with MPAVRoutingSheet. https://bugs.webkit.org/show_bug.cgi?id=159161 Reviewed by Sam Weinig. MPAudioVideoRoutingActionSheet is being replaced by MPAVRoutingSheet, with only minor changes to the interface. * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: (-[WKAirPlayRoutePicker dealloc]): (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): 2016-06-29 Carlos Garcia Campos Too much duplicated code in LayerTreeHosts implementations https://bugs.webkit.org/show_bug.cgi?id=159144 Reviewed by Žan Doberšek. There's some code common and duplicated in all current LayerTreeHosts implementations (Gtk, Coordinated, and ThreadedCoordinated). The thing is even worse in the case of ThreadedCoordinated and Coordinated, where the former is actually a special case of the later, and it seems like code was copy pasted and then modified to add ThreadedCoordinated specific code. The problem of that approach, apart from the code duplication, is that common parts end up diverging too. This patch moves the common parts to the base class LayerTreeHost and makes ThreadedCoordinatedLayerTreeHost inherit from CoordinatedLayerTreeHost, to share the common code and simply add the specific one. * PlatformGTK.cmake: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush): (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer): (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer): (WebKit::CoordinatedLayerTreeHost::invalidate): (WebKit::CoordinatedLayerTreeHost::sizeDidChange): (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): (WebKit::CoordinatedLayerTreeHost::commitSceneState): (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface): (WebKit::CoordinatedLayerTreeHost::cancelPendingLayerFlush): Deleted. (WebKit::CoordinatedLayerTreeHost::forceRepaint): Deleted. (WebKit::CoordinatedLayerTreeHost::forceRepaintAsync): Deleted. (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer): Deleted. (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Deleted. (WebKit::CoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Deleted. (WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange): (WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect): (WebKit::ThreadedCoordinatedLayerTreeHost::commitSceneState): (WebKit::ThreadedCoordinatedLayerTreeHost::create): Deleted. (WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): Deleted. (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Deleted. (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Deleted. (WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged): Deleted. (WebKit::ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::layerHostDidFlushLayers): * WebProcess/WebPage/DrawingAreaImpl.h: * WebProcess/WebPage/LayerTreeHost.cpp: (WebKit::LayerTreeHost::~LayerTreeHost): (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): (WebKit::LayerTreeHost::pauseRendering): (WebKit::LayerTreeHost::resumeRendering): (WebKit::LayerTreeHost::invalidate): * WebProcess/WebPage/LayerTreeHost.h: (WebKit::LayerTreeHost::layerTreeContext): (WebKit::LayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush): (WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplay): (WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplayInRect): (WebKit::LayerTreeHost::scrollNonCompositedContents): (WebKit::LayerTreeHost::graphicsLayerFactory): (WebKit::LayerTreeHost::contentsSizeChanged): (WebKit::LayerTreeHost::didChangeViewportProperties): (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing): (WebKit::LayerTreeHost::setViewOverlayRootLayer): (WebKit::LayerTreeHost::forceRepaintAsync): Deleted. * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::invalidate): (WebKit::LayerTreeHostGtk::setViewOverlayRootLayer): (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Deleted. (WebKit::LayerTreeHostGtk::setRootCompositingLayer): Deleted. (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay): Deleted. (WebKit::LayerTreeHostGtk::scrollNonCompositedContents): Deleted. (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing): Deleted. * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: 2016-06-28 Commit Queue Unreviewed, rolling out r202586 and r202595. https://bugs.webkit.org/show_bug.cgi?id=159247 These changes broke the iOS build (Requested by ryanhaddad on #webkit). Reverted changesets: "Keep track of when a WKWebView is blank before the initial non-empty layout" https://bugs.webkit.org/show_bug.cgi?id=159217 http://trac.webkit.org/changeset/202586 "Try to fix the build." http://trac.webkit.org/changeset/202595 2016-06-28 Commit Queue Unreviewed, rolling out r202580. https://bugs.webkit.org/show_bug.cgi?id=159245 Caused all WKTR tests to fail on GuardMalloc and Production only for unknown reasons, investigating offline. (Requested by brrian on #webkit). Reverted changeset: "RunLoop::Timer should use constructor templates instead of class templates" https://bugs.webkit.org/show_bug.cgi?id=159153 http://trac.webkit.org/changeset/202580 2016-06-28 Commit Queue Unreviewed, rolling out r202598. https://bugs.webkit.org/show_bug.cgi?id=159244 broke the build. (Requested by keith_miller on #webkit). Reverted changeset: "Try to fix the build." http://trac.webkit.org/changeset/202598 2016-06-28 Tim Horton Try to fix the build. * UIProcess/API/Cocoa/WKWebView.mm: (convertSystemLayoutDirection): (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]): (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: 2016-06-28 Tim Horton Try to fix the build. * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/Cocoa/WKWebViewInternal.h: 2016-06-28 Tim Horton Keep track of when a WKWebView is blank before the initial non-empty layout https://bugs.webkit.org/show_bug.cgi?id=159217 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]): (-[WKWebView _didFirstVisuallyNonEmptyLayoutForMainFrame]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame): 2016-06-28 Anders Carlsson PaymentMerchantSession should wrap a PKPaymentMerchantSession https://bugs.webkit.org/show_bug.cgi?id=159218 rdar://problem/26872118 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Use NSCoder. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: PaymentMerchantSession is now a class. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: PaymentMerchantSession is now a class. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompleteMerchantValidation): Just get the underlying PKPaymentMerchantSession from the PaymentMerchantSession object. (WebKit::toPKPaymentMerchantSession): Deleted. 2016-06-28 Brian Burg RunLoop::Timer should use constructor templates instead of class templates https://bugs.webkit.org/show_bug.cgi?id=159153 Reviewed by Alex Christensen. Remove the RunLoop::Timer class template argument, and pass its constructor a reference to `this` instead of a pointer to `this`. * NetworkProcess/Downloads/soup/DownloadSoup.cpp: * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::PluginControllerProxy): * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::PluginProcess): * PluginProcess/PluginProcess.h: * Shared/ChildProcess.cpp: (WebKit::ChildProcess::ChildProcess): * Shared/ChildProcess.h: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm: (API::SharedJSContext::SharedJSContext): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate): * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::DrawingAreaProxy): * UIProcess/DrawingAreaProxy.h: * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): * UIProcess/DrawingAreaProxyImpl.h: * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::PluginInfoCache): * UIProcess/Plugins/gtk/PluginInfoCache.h: * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::ProcessThrottler): * UIProcess/ProcessThrottler.h: * UIProcess/ResponsivenessTimer.cpp: (WebKit::ResponsivenessTimer::ResponsivenessTimer): * UIProcess/ResponsivenessTimer.h: * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker): * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::VisitedLinkStore): * UIProcess/VisitedLinkStore.h: * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::WebInspectorProxy): * UIProcess/WebInspectorProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::m_hiddenPageThrottlingTimer): * UIProcess/WebProcessPool.h: * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::DragGesture::DragGesture): (WebKit::GestureController::ZoomGesture::ZoomGesture): * UIProcess/gtk/GestureController.h: * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk): * UIProcess/gtk/WebPopupMenuProxyGtk.h: * UIProcess/mac/ViewGestureController.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::WebLoaderStrategy): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::NPRuntimeObjectMap): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::NetscapePlugin): (WebKit::NetscapePlugin::Timer::Timer): * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::PluginView): * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::DrawingAreaImpl): * WebProcess/WebPage/DrawingAreaImpl.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::RenderFrameScheduler::RenderFrameScheduler): * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): 2016-06-28 Chris Dumez [WK2] Add some logging related to NetworkProcess suspension https://bugs.webkit.org/show_bug.cgi?id=159178 Reviewed by Andreas Kling. Add some logging related to NetworkProcess suspension to help debug suspension issues. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::cancelPrepareToSuspend): (WebKit::NetworkProcess::processDidResume): 2016-06-28 Chris Dumez Add some more UIProcess-side logging related to process assertions https://bugs.webkit.org/show_bug.cgi?id=159188 Reviewed by Andreas Kling. Add some more UIProcess-side logging related to process assertions to help debug process suspension issues. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::updateAssertionNow): (WebKit::ProcessThrottler::updateAssertion): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityToken): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): (WebKit::WebProcessProxy::didSetAssertionState): 2016-06-28 Chris Dumez [WK2] Do not suppress navigation snapshotting on session restore if we are not navigating right away https://bugs.webkit.org/show_bug.cgi?id=159216 Reviewed by Andreas Kling. Do not suppress navigation snapshotting on session restore if we are not navigating right away. The snapshot we already have may be outdated by the time we actually navigate (e.g. Because the user scrolled) so we don't want to suppress snapshotting in this case. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::restoreFromSessionState): 2016-06-27 Anders Carlsson WebKit::WebPaymentCoordinator leak https://bugs.webkit.org/show_bug.cgi?id=159168 rdar://problem/26929772 Reviewed by Beth Dakin. Update for WebCore changes. * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::paymentCoordinatorDestroyed): (WebKit::WebPaymentCoordinator::mainFrameDestroyed): Deleted. * WebProcess/ApplePay/WebPaymentCoordinator.h: 2016-06-27 Simon Fraser Fix TestWebKitAPI crash introduced in r202532. WebPageProxy::forceRepaint() could trigger a call to the didForceRepaintCallback() after the WebPageProxy had been invalidated, causing a null de-ref of m_drawingArea. Fix by checking for error and isValid(). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::forceRepaint): 2016-06-27 Simon Fraser [iOS] Make DumpRenderTree and WebKitTestRunner in the simulator use render server snapshotting https://bugs.webkit.org/show_bug.cgi?id=159077 Reviewed by Tim Horton. Fix WebPageProxy::forceRepaint() to correctly wait for the next commit from the web process, which is necessary for UI-side compositing. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::forceRepaint): 2016-06-27 Joseph Pecoraro Web Inspector: When modifying sessionStorage, localStorage gets updated https://bugs.webkit.org/show_bug.cgi?id=159181 Reviewed by Timothy Hatcher. * WebProcess/Storage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::dispatchSessionStorageEvent): This should be dispatching storage events. 2016-06-27 Alex Christensen Fix flakiness on Sierra after r202511 https://bugs.webkit.org/show_bug.cgi?id=159071 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSession::clearCredentials): Replacing the NSURLSessions immediately caused assertions because the tasks are not always all stopped immediately when tearing down a test. Stopping an NSURLSession needs to be done asynchronously. I'll try a different testing technique for r202511. 2016-06-27 Alex Christensen Send canAuthenticateAgainstProtectionSpace calls from NetworkProcess directly to UIProcess https://bugs.webkit.org/show_bug.cgi?id=159071 Reviewed by Brady Eidson. When CFNetwork asks the NetworkProcess if we can authenticate against this protection space, we used to ask the WebProcess, which would call ResourceLoader::canAuthenticateAgainstProtectionSpace which would ask the FrameLoaderClient, which would synchronously ask the UIProcess. Going directly from the NetworkProcess to the UIProcess gives us many advantages: 1. It reduces IPC because we ask fewer loads. 2. It reduces synchronous IPC because we are not using the same code path as WebKit1 any more. 3. It allows us to check if the NetworkProcess is still valid in sendToNetworkingProcess, possibly fixing rdar://problem/26825408 4. It allows us to ask the UIProcess when we get authentication challenges for synchronous xhr. I added a new test http/tests/xmlhttprequest/sync-delegate-callbacks.html to verify the change in behavior of synchronous xhr. In order to make this test not flaky on platforms using NSURLSession, we clear the NSURLSessions used by WebKitTestRunner to make sure that the TLS session cache is cleared so we get NSURLAuthenticationChallenges corresponding to the NSURLConnection canAuthenticateAgainstProtectionSpace callback when we initiate the first HTTPS connection to 127.0.0.1 with this session. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveChallenge): (WebKit::NetworkLoad::didReceiveResponseNetworkSession): (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::clearCachedCredentials): (WebKit::NetworkProcess::ensurePrivateBrowsingSession): (WebKit::NetworkProcess::cancelDownload): (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace): (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace): (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/NetworkResourceLoader.messages.in: * NetworkProcess/NetworkSession.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSession::networkStorageSession): (WebKit::NetworkSession::clearCredentials): (WebKit::NetworkSession::dataTaskForIdentifier): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): (WebKit::DownloadProxy::willSendRequest): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::logSampledDiagnosticMessageWithValue): (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::backForwardClear): (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpace): (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResource): (WebKit::WebResourceLoader::isAlwaysOnLoggingAllowed): (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace): Deleted. * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::clearCachedCredentials): (WebKit::WebProcess::focusedWebPage): 2016-06-27 Anders Carlsson Discounted items are displayed with positive values https://bugs.webkit.org/show_bug.cgi?id=159160 rdar://problem/26980772 Reviewed by Dean Jackson. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toDecimalNumber): Add new helper function. Correctly compute the mantissa. (WebKit::toPKPaymentSummaryItem): (WebKit::toPKShippingMethod): Use toDecimalNumber. 2016-06-27 Miguel Gomez [GTK][EFL] Build with threaded compositor enabled is broken https://bugs.webkit.org/show_bug.cgi?id=159138 Reviewed by Carlos Garcia Campos. Replace the usage of NoncopyableFunction with Function, to follow the changes in r202439. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::performTask): (WebKit::CompositingRunLoop::performTaskSync): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: 2016-06-24 Brian Burg REGRESSION(r201171): CRASH at WebKit::WebInspectorProxy::open() + 31 when running inspector layout tests https://bugs.webkit.org/show_bug.cgi?id=159070 Reviewed by Joseph Pecoraro. We have been seeing a few crashes underneath WebInspectorProxy::bringToFront() on the bots. Previously, this code didn't use m_inspectorPage so there was nothing to null-dereference. However, it doesn't make sense that we would hit the null dereference here: - The only caller of bringToFront() on the WebProcess side is InspectorController::show(). It only tries to bring to front if there is already a local frontend connection, which shouldn't be the case if m_inspectorPage is null. - It's guarded by m_underTest, which should have been set to true in createInspectorPage(). These clues lead me to believe that we may be improperly tearing down the inspector between tests. For example, it seems possible that a local frontend connection is not being torn down, so InspectorController never asks to create a inspector page when the next test calls showWebInspector. Since this crash is not easy to reproduce, we don't have much to go on. For now, this patch adds an early return in the case where m_inspectorPage is null when calling open(). * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::open): 2016-06-24 Jer Noble Vimeo.com videos do not get playback controls https://bugs.webkit.org/show_bug.cgi?id=159082 Reviewed by Eric Carlson. When the HasAudioOrVideo media state changes, let the video controls recalculate by calling videoControlsManagerDidChange(). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): 2016-06-24 Beth Dakin Include enclosingListType in EditorState https://bugs.webkit.org/show_bug.cgi?id=159102 -and corresponding- rdar://problem/26932490 Reviewed by Enrica Casucci. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState): 2016-06-24 Anders Carlsson Inline more of the Apple Pay source code https://bugs.webkit.org/show_bug.cgi?id=159099 Reviewed by Andreas Kling. * Shared/Cocoa/WebCoreArgumentCodersCocoa.h: Removed. * Shared/WebCoreArgumentCoders.h: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _applePayCapabilityDisclosureAllowed]): (-[WKPreferences _setApplePayCapabilityDisclosureAllowed:]): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _applePayEnabled]): (-[WKWebViewConfiguration _setApplePayEnabled:]): (-[WKWebViewConfiguration _paymentsEnabled]): (-[WKWebViewConfiguration _setPaymentsEnabled:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_userInterfaceLayoutDirection): (WebKit::WebPage::updatePreferences): 2016-06-21 Anders Carlsson Rename NoncopyableFunction to Function https://bugs.webkit.org/show_bug.cgi?id=158354 Reviewed by Chris Dumez. * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::clearDiskCacheEntries): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::traverse): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::runTaskInQueue): * NetworkProcess/cache/NetworkCacheStorage.h: 2016-06-22 Anders Carlsson Move WebKit2 Apple Pay code to the open source repository https://bugs.webkit.org/show_bug.cgi?id=159041 Reviewed by Sam Weinig. * DerivedSources.make: * Shared/Cocoa/WebCoreArgumentCodersCocoa.h: Added. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Added. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: Added. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: Added. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Added. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Added. * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Added. * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Added. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: Added. * WebProcess/ApplePay/WebPaymentCoordinator.h: Added. * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: Added. 2016-06-24 Chris Dumez [WK2] PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed https://bugs.webkit.org/show_bug.cgi?id=159080 Reviewed by Anders Carlsson. PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed. This leads to WebPageProxy object leaks when the client keeps chaining related views. In this patch, we null our the PageConfiguration's relatedPage in WebPageProxy::close() to break the chain and make sure we only keep alive 1 relatedPage rather than a chain of them. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): 2016-06-24 Jer Noble Playback controls refer to wrong element when playing multiple items in a page. https://bugs.webkit.org/show_bug.cgi?id=159076 Reviewed by Beth Dakin. clearPlaybackControlsManager() no longer takes a parameter. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::clearPlaybackControlsManager): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager): Make sure to removeClientForContext() if the old context refers to a live media element. (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager): 2016-06-24 Brady Eidson IDB tests crashing attempting to register sandbox extensions for blob files. https://bugs.webkit.org/show_bug.cgi?id=159094. Reviewed by Sam Weinig. Already tested by storage/indexeddb/modern/handle-user-delete.html * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::preregisterSandboxExtensionsIfNecessary): Check whether the IDBResultData actually contains a getResult before trying to access it. 2016-06-23 Brady Eidson Retrieving Blobs from IndexedDB using cursors fails in WK2 (Sandboxing) https://bugs.webkit.org/show_bug.cgi?id=158991 Reviewed by Alex Christensen. * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles): (WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::handleGetResult): Handle creation of sandbox extensions for any result that might contain blob values. (WebKit::WebIDBConnectionToClient::didGetRecord): (WebKit::WebIDBConnectionToClient::didOpenCursor): (WebKit::WebIDBConnectionToClient::didIterateCursor): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * Shared/Databases/IndexedDB/WebIDBResult.cpp: Added. (WebKit::WebIDBResult::encode): (WebKit::WebIDBResult::decode): * Shared/Databases/IndexedDB/WebIDBResult.h: Added. (WebKit::WebIDBResult::WebIDBResult): (WebKit::WebIDBResult::resultData): (WebKit::WebIDBResult::handles): * Shared/SandboxExtension.h: Make SandboxExtension handles moveable. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::preregisterSandboxExtensionsIfNecessary): Register sandbox extensions with the Networking process for any result that might contain blob values. (WebKit::WebIDBConnectionToServer::didGetRecord): (WebKit::WebIDBConnectionToServer::didOpenCursor): (WebKit::WebIDBConnectionToServer::didIterateCursor): (WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): Deleted. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in: 2016-06-23 Alex Christensen Remove unused didCancelAuthenticationChallenge https://bugs.webkit.org/show_bug.cgi?id=158819 Reviewed by David Kilzer. * NetworkProcess/Downloads/mac/DownloadMac.mm: (-[WKDownloadAsDelegate download:didCancelAuthenticationChallenge:]): Deleted. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didCancelAuthenticationChallenge): Deleted. * NetworkProcess/NetworkLoad.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2016-06-23 Benjamin Poulain Specialize synchronous event tracking per event type https://bugs.webkit.org/show_bug.cgi?id=158826 Reviewed by Simon Fraser. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::eventTrackingTypeForPoint): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::mergeTrackingTypes): (WebKit::WebPageProxy::updateTouchEventTracking): (WebKit::WebPageProxy::touchEventTrackingType): (WebKit::WebPageProxy::handleTouchEventSynchronously): (WebKit::WebPageProxy::handleTouchEventAsynchronously): (WebKit::WebPageProxy::handleTouchEvent): (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::TouchEventTracking::isTrackingAnything): (WebKit::WebPageProxy::TouchEventTracking::reset): 2016-06-23 Said Abou-Hallawa requestFrameAnimation() callback timestamp should be very close to Performance.now() https://bugs.webkit.org/show_bug.cgi?id=159038 Reviewed by Simon Fraser. * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm: (WebKit::RemoteLayerTreeDisplayRefreshMonitor::didUpdateLayers): 2016-06-23 Chris Dumez [iOS] A WebPageProxy in closed state should not be allowed to hold a process assertion https://bugs.webkit.org/show_bug.cgi?id=159068 Reviewed by Tim Horton. A WebPageProxy in closed state should not be allowed to hold a process assertion. It currently happens that WebPageProxy::close() gets called but that the WebPageProxy is kept alive by Safari (e.g. In case of top-hit preloading). In such cases, we fail to release the foreground process assertion that the WebPageProxy holds. We should clear the foreground process assertion that the WebPageProxy holds as soon as WebPageProxy::close() is called. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): 2016-06-23 Brent Fulgham [OS X][WK2] Expand sandbox for new mach endpoints https://bugs.webkit.org/show_bug.cgi?id=159040 Reviewed by Alexey Proskuryakov. Grant the WebContent and Networking processes the mach lookup capability for various Security-related mach endpoints.. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2016-06-23 Commit Queue Unreviewed, rolling out r201194. https://bugs.webkit.org/show_bug.cgi?id=159059 Not needed for iOS (Requested by bfulgham on #webkit). Reverted changeset: "[OS X][WK2] Expand sandbox for new mach endpoints" https://bugs.webkit.org/show_bug.cgi?id=157919 http://trac.webkit.org/changeset/201194 2016-06-23 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.2 release. * gtk/NEWS: Add release notes for 2.13.2. 2016-06-22 Carlos Garcia Campos REGRESSION(r201880): WebSockets based remote inspector is broken since r201880 https://bugs.webkit.org/show_bug.cgi?id=158613 Reviewed by Michael Catanzaro. In r201880 SocketStreamHandleClient was modified to receive references instead of pointers. WebSocketServerConnection also implements SocketStreamHandleClient but since it's doesn't use override, it was unnoticed and not updated, so we ended up using the default empty implementation instead of the WebSocketServerConnection one. * UIProcess/InspectorServer/WebSocketServerConnection.cpp: (WebKit::WebSocketServerConnection::WebSocketServerConnection): (WebKit::WebSocketServerConnection::setSocketHandle): (WebKit::WebSocketServerConnection::shutdownNow): (WebKit::WebSocketServerConnection::didCloseSocketStream): (WebKit::WebSocketServerConnection::didReceiveSocketStreamData): (WebKit::WebSocketServerConnection::didUpdateBufferedAmount): (WebKit::WebSocketServerConnection::didFailSocketStream): Deleted. * UIProcess/InspectorServer/WebSocketServerConnection.h: 2016-06-22 Brent Fulgham [iOS][WK2] Expand sandbox to read voice services preferences https://bugs.webkit.org/show_bug.cgi?id=159046 Reviewed by Alexey Proskuryakov. Expand the sandbox to permit read-only access to voice services preferences. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2016-06-22 Sam Weinig Add SPI to allow creating a WKCertificateInfoRef from a SecTrustRef https://bugs.webkit.org/show_bug.cgi?id=159025 Reviewed by Tim Horton. * Shared/API/c/mac/WKCertificateInfoMac.h: * Shared/API/c/mac/WKCertificateInfoMac.mm: (WKCertificateInfoCreateWithServerTrust): 2016-06-22 Brady Eidson DatabaseProcess doesn't handle WebProcesses going away uncleanly. https://bugs.webkit.org/show_bug.cgi?id=158894 Reviewed by Alex Christensen. * DatabaseProcess/DatabaseToWebProcessConnection.cpp: (WebKit::DatabaseToWebProcessConnection::didClose): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): Actually unregister this connection from the IDBServer so it can clean up. (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient): 2016-06-22 Chris Dumez Stop using PassRefPtr in ShareableResource https://bugs.webkit.org/show_bug.cgi?id=159043 Reviewed by Alex Christensen. Stop using PassRefPtr in ShareableResource. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::store): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord): * Shared/ShareableResource.cpp: (WebKit::shareableResourceDeallocate): (WebKit::ShareableResource::wrapInSharedBuffer): (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer): (WebKit::ShareableResource::create): (WebKit::ShareableResource::map): (WebKit::ShareableResource::ShareableResource): * Shared/ShareableResource.h: 2016-06-17 Dean Jackson REGRESSION: Double tap to zoom does not work on yahoo finance https://bugs.webkit.org/show_bug.cgi?id=158886 Reviewed by Simon Fraser. We shouldn't enable fast click on pages that have had to shrink to fit. In other words, we should enable double-tap-to-zoom if the page has already zoomed. Test: fast/events/ios/viewport-shrink-to-fit-allows-double-tap.html * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _allowsDoubleTapGestures]): 2016-06-22 Brian Burg Web Automation: Automation.inspectBrowsingContext should have an option to enable timeline auto-capturing https://bugs.webkit.org/show_bug.cgi?id=159004 Reviewed by Joseph Pecoraro. Automation.inspectBrowsingContext was added to make it easier to hit breakpoints inside of code evaluated using Automation.evaluateJavaScriptFunction. I recently changed the behavior of this command to automatically start profiling the page as soon as the inspector attached so that a full timeline recording could be obtained. However, starting a timeline recording turns off the debugger, so this command is not so useful for debugging right now. Add a new option, enableAutoCapturing, to the inspectBrowsingContext command. Don't toggle profiling automatically unless this optional flag is present and set to true. * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::inspectBrowsingContext): (WebKit::WebAutomationSession::inspectorFrontendLoaded): Deleted. * UIProcess/Automation/WebAutomationSession.h: 2016-06-22 Tim Horton Mail snapshot has black webview in multitasking switcher https://bugs.webkit.org/show_bug.cgi?id=159036 Reviewed by Simon Fraser. There is a window of time between an application going into the background and SpringBoard's snapshotting mechanism completing where it is possible (though difficult, timing-wise) for RemoteLayerBackingStoreCollection to make still-needed surfaces volatile (and, even worse, for them to get emptied). UIKit suggested instead waiting for the window context teardown notification, which does indeed seem to fire after the snapshotting is complete. This may have the convenient side effect of making the volatility timer repeat fewer times in general, because it is now started closer to the last time that the surfaces will be in-use. * UIProcess/ApplicationStateTracker.h: * UIProcess/ApplicationStateTracker.mm: (WebKit::ApplicationStateTracker::ApplicationStateTracker): (WebKit::ApplicationStateTracker::~ApplicationStateTracker): (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didMoveToWindow]): (-[WKContentView _applicationDidFinishSnapshottingAfterEnteringBackground]): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView didMoveToWindow]): (-[WKPDFView _applicationDidFinishSnapshottingAfterEnteringBackground]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applicationDidEnterBackground): (WebKit::WebPage::applicationDidFinishSnapshottingAfterEnteringBackground): 2016-06-22 Chris Dumez Add logging related to process assertions to help debug process suspension issues https://bugs.webkit.org/show_bug.cgi?id=159001 Reviewed by Antti Koivisto. Add logging related to process assertions to help debug process suspension issues. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::didChangeIsLoading): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityToken): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::setIsHoldingLockedFiles): 2016-06-21 Sam Weinig WKWebView with no WKNavigationDelegate does not follow universal links https://bugs.webkit.org/show_bug.cgi?id=158997 Reviewed by Dan Bernstein. API Test: WKWebView.DefaultNavigationDelegate * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): When initializing the WKWebView, set a default navigation client. 2016-06-21 Chris Dumez Unreviewed, rolling out r202296. Broke basic browsing in Safari Reverted changeset: "WKWebView with no WKNavigationDelegate does not follow universal links" https://bugs.webkit.org/show_bug.cgi?id=158997 http://trac.webkit.org/changeset/202296 2016-06-21 Anders Carlsson Fix build. * Configurations/FeatureDefines.xcconfig: 2016-06-21 Anders Carlsson Begin moving the Apple Pay code to the open source repository https://bugs.webkit.org/show_bug.cgi?id=158998 Reviewed by Tim Horton. * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLE_PAY. 2016-06-21 Said Abou-Hallawa Add system tracing points for requestAnimationFrame() workflow https://bugs.webkit.org/show_bug.cgi?id=158723 Reviewed by Simon Fraser. Add trace points for requestAnimationFrame(). * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::buildTransaction): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::didUpdate): (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush): 2016-06-21 Sam Weinig WKWebView with no WKNavigationDelegate does not follow universal links https://bugs.webkit.org/show_bug.cgi?id=158997 Reviewed by Dan Bernstein. API Test: WKWebView.DefaultNavigationDelegate * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): When initializing the WKWebView, set a default navigation client. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setLoaderClient): Be sure to clear out a navigation client, if present, when setting a loader client, as they are mutually exclusive. 2016-06-20 Simon Fraser Focus event dispatched in iframe causes parent document to scroll incorrectly https://bugs.webkit.org/show_bug.cgi?id=158629 rdar://problem/26521616 Reviewed by Tim Horton. Pass SelectionRevealMode::Reveal in existing code. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::centerSelectionInVisibleArea): 2016-06-21 Said Abou-Hallawa [iOS][WK2] When an animation frame is missed, the UI process should immediately notify the Web process once a frame is committed https://bugs.webkit.org/show_bug.cgi?id=158933 Reviewed by Simon Fraser. When a frame is committed, the UI process schedules a CADisplayLink and waits until the next didRefreshDisplay event is fired. This causes more delay in the scenario where there are frames are dropped. didRefreshDisplay() should be called immediately when commitLayerTree message is received and the last frame was dropped. The fix is to have the CADisplayLink active all the times. It should be paused only when we detect at least one frame is dropped. In this case we should not send a message to the UI process since it has not sent the last requested LayerTree. Also we should not waste the CPU time by scheduling a new CADisplayLink since we have not processed the last event. We should resume CADisplayLink timer once a commitLayerTree message is received. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler pause]): (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): (-[WKOneShotDisplayLinkHandler displayLinkFired:]): 2016-06-21 Amir Alavi Upstream WKHTTPCookiesForURL from WebKitSystemInterface to OpenSource https://bugs.webkit.org/show_bug.cgi?id=158967 Reviewed by Brent Fulgham. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): Deleted. 2016-06-21 Dan Bernstein Inlined some picture-in-picture code. https://bugs.webkit.org/show_bug.cgi?id=158977 Reviewed by Eric Carlsson. This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen, Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones, Jon Lee, Remy Demarest, and Zach Li. * Shared/WebPreferencesStoreDefaultsAdditions.cpp: Define and use DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK. * Shared/WebPreferencesStore.cpp: (WebKit::defaults): Removed include of WebPreferencesStoreDefaultsAdditions.cpp now that the default is defined correctly in WebPreferencesStoreDefaultsAdditions.cpp. * UIProcess/API/C/WKPreferences.cpp: Inlined WKPreferencesAdditions.cpp. * UIProcess/API/C/WKPreferencesRefPrivate.h: Ditto. * WebProcess/cocoa/WebVideoFullscreenManager.mm: Inlined WebVideoFullscreenManagerSupportsVideoFullscreenMac.mm. 2016-06-21 Carlos Garcia Campos [GTK] Web view is not redrawn when reparented in force compositing mode https://bugs.webkit.org/show_bug.cgi?id=158689 Reviewed by Žan Doberšek. When the web view is reparented in accelerated compositing mode, the UI process always exits the accelerated mode when the view is unrealized, because the native surface handle for compositing is destroyed, but it doesn't enter again when the view is realized and a new native surface handle for compositing is used. This happens because the UI and Web processes are not in sync regarding whether the page is in accelerated compositing or not. The Web process never exits accelerated mode when compositing mode is forced, but the UI process doesn't check that setting at all. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseResizeRedirectedWindow): Helper function to ensure the redirected window size is properly updated. (webkitWebViewBaseRealize): Resize the redirected window if the view is already in AC mode when realized. (webkitWebViewRenderAcceleratedCompositingResults): Use webkitWebViewBaseResizeRedirectedWindow(). (webkitWebViewBaseSizeAllocate): Ditto. (webkitWebViewBaseWillEnterAcceleratedCompositingMode): Ditto. * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::alwaysUseCompositing): Return true in force compositing mode. (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode): Update assert. (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode): Do not exit AC mode compositing mode is always enabled. * UIProcess/DrawingAreaProxyImpl.h: (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode): Return true also in force compositing mode. * UIProcess/gtk/RedirectedXCompositeWindow.cpp: (WebKit::RedirectedXCompositeWindow::surface): Ensure we never return an uninitialized surface to prevent rendering artifacts in in force compositing mode when waiting for the first update on the redirected window. 2016-06-20 Commit Queue Unreviewed, rolling out r202243. https://bugs.webkit.org/show_bug.cgi?id=158972 Broke Windows build and iOS tests (Requested by ap on #webkit). Reverted changeset: "Focus event dispatched in iframe causes parent document to scroll incorrectly" https://bugs.webkit.org/show_bug.cgi?id=158629 http://trac.webkit.org/changeset/202243 2016-06-20 Brent Fulgham Allow Spotlight suggestions to be read by any process https://bugs.webkit.org/show_bug.cgi?id=158950 Reviewed by Alexey Proskuryakov. Extend sandbox to allow all web processes to read Spotlight results. * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: * WebProcess/com.apple.WebProcess.sb.in: 2016-06-20 Simon Fraser Focus event dispatched in iframe causes parent document to scroll incorrectly https://bugs.webkit.org/show_bug.cgi?id=158629 rdar://problem/26521616 Reviewed by Tim Horton. Pass SelectionRevealMode::Reveal in existing code. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::centerSelectionInVisibleArea): 2016-06-20 Keith Rollin Remove RefPtr::release() and change calls sites to use WTFMove() https://bugs.webkit.org/show_bug.cgi?id=158369 Reviewed by Chris Dumez. RefPtr::release() releases its managed pointer awkwardly. It's more direct and clearer to use WTFMove to transfer ownership of the managed pointer. As part of this cleanup, also change a lot of explicit data types to 'auto'. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::createDatabaseToWebProcessConnection): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord): * Platform/mac/SharedMemoryMac.cpp: (WebKit::SharedMemory::allocate): (WebKit::SharedMemory::create): (WebKit::SharedMemory::map): * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::createWebProcessConnection): * Shared/API/Cocoa/WKRemoteObjectCoder.mm: (encodeToObjectStream): * Shared/API/c/WKImage.cpp: (WKImageCreate): * Shared/API/c/WKNumber.cpp: (WKBooleanCreate): (WKDoubleCreate): (WKUInt64Create): * Shared/API/c/WKSecurityOriginRef.cpp: (WKSecurityOriginCreate): * Shared/API/c/WKSerializedScriptValue.cpp: (WKSerializedScriptValueCreate): (WKSerializedScriptValueCreateWithInternalRepresentation): * Shared/API/c/cairo/WKImageCairo.cpp: (WKImageCreateFromCairoSurface): * Shared/API/c/cg/WKImageCG.cpp: (WKImageCreateFromCGImage): * Shared/API/c/mac/WKCertificateInfoMac.mm: (WKCertificateInfoCreateWithCertficateChain): * Shared/API/c/mac/WKObjCTypeWrapperRef.mm: (WKObjCTypeWrapperCreate): * Shared/API/c/mac/WKWebArchive.cpp: (WKWebArchiveCreate): (WKWebArchiveCreateWithData): (WKWebArchiveCreateFromRange): (WKWebArchiveCopyMainResource): (WKWebArchiveCopySubresources): (WKWebArchiveCopySubframeArchives): * Shared/API/c/mac/WKWebArchiveResource.cpp: (WKWebArchiveResourceCreate): * Shared/APIWebArchive.mm: (API::WebArchive::WebArchive): * Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::getOrCreate): * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::map): * Shared/gtk/ArgumentCodersGtk.cpp: (IPC::ArgumentCoder::decode): * UIProcess/API/C/CoordinatedGraphics/WKView.cpp: (WKViewCreate): * UIProcess/API/C/WKBatteryStatus.cpp: (WKBatteryStatusCreate): * UIProcess/API/C/WKGeolocationPosition.cpp: (WKGeolocationPositionCreate_b): * UIProcess/API/C/WKGrammarDetail.cpp: (WKGrammarDetailCreate): * UIProcess/API/C/WKPage.cpp: (WKPageCopySessionState): * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupCreateWithIdentifier): * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesCreate): (WKPreferencesCreateWithIdentifier): (WKPreferencesCreateCopy): * UIProcess/API/C/WKSessionRef.cpp: (WKSessionCreate): * UIProcess/API/C/WKSessionStateRef.cpp: (WKSessionStateCopyData): * UIProcess/API/C/mac/WKContextPrivateMac.mm: (WKContextCopyPlugInInfoForBundleIdentifier): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView loadRequest:]): (-[WKWebView loadFileURL:allowingReadAccessToURL:]): (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]): (-[WKWebView goToBackForwardListItem:]): (-[WKWebView goBack]): (-[WKWebView goForward]): (-[WKWebView reload]): (-[WKWebView reloadFromOrigin]): (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]): (-[WKWebView _reloadWithoutContentBlockers]): (-[WKWebView _sessionStateData]): (-[WKWebView _restoreSessionState:andNavigate:]): * UIProcess/API/efl/ewk_database_manager.cpp: (EwkDatabaseManager::createOriginList): * UIProcess/API/efl/ewk_storage_manager.cpp: (EwkStorageManager::createOriginList): * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewCreateNewPage): (webkitWebViewPrintFrame): (getContentsAsMHTMLDataCallback): * UIProcess/Cocoa/SessionStateCoding.mm: (WebKit::encodeSessionState): * UIProcess/GenericCallback.h: (WebKit::CallbackMap::take): * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::createRequest): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::createRequest): * UIProcess/Plugins/PluginProcessManager.cpp: (WebKit::PluginProcessManager::getOrCreatePluginProcess): * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::StorageArea::setItem): (WebKit::StorageManager::StorageArea::removeItem): (WebKit::StorageManager::createLocalStorageMap): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::addItem): (WebKit::WebBackForwardList::clear): * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::installViewStateChangeCompletionHandler): * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::createWithLegacyDefaults): (WebKit::WebPreferences::copy): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::~WebProcessPool): * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::recordSnapshot): * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _webHitTestResult]): * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _askPageToComputePageRects]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setDragImage): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame hitTest:]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm: (-[WKWebProcessPlugInHitTestResult nodeHandle]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]): (-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm: (+[WKWebProcessPlugInScriptWorld world]): * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundlePostSynchronousMessage): * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp: (WKBundleDOMWindowExtensionCreate): * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp: (WKBundleHitTestResultCopyNodeHandle): (WKBundleHitTestResultCopyURLElementHandle): * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp: (WKBundleNavigationActionCopyHitTestResult): (WKBundleNavigationActionCopyFormElement): * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: (WKBundleNodeHandleCreate): (WKBundleNodeHandleCopyDocument): (WKBundleNodeHandleCopySnapshotWithOptions): (WKBundleNodeHandleCopyVisibleRange): (WKBundleNodeHandleCopyHTMLTableCellElementCellAbove): (WKBundleNodeHandleCopyDocumentFrame): (WKBundleNodeHandleCopyHTMLFrameElementContentFrame): (WKBundleNodeHandleCopyHTMLIFrameElementContentFrame): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageCreateSnapshotWithOptions): (WKBundlePageCreateSnapshotInViewCoordinates): (WKBundlePageCreateSnapshotInDocumentCoordinates): (WKBundlePageCreateScaledSnapshotInDocumentCoordinates): (WKBundlePagePostSynchronousMessageForTesting): * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp: (WKBundleRangeHandleCreate): (WKBundleRangeHandleCopySnapshotWithOptions): * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp: (WKBundleScriptWorldCreateWorld): * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm: (-[WKDOMNode _copyBundleNodeHandleRef]): * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm: (-[WKDOMRange _copyBundleRangeHandleRef]): * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp: (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): (WebKit::InjectedBundleNodeHandle::renderedImage): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::getOrCreate): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::create): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::loadURL): * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: (WebKit::PDFPlugin::createScrollbar): * WebProcess/Storage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::applyChange): * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toFormData): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::createPlugin): (WebKit::WebFrameLoaderClient::recreatePlugin): (WebKit::WebFrameLoaderClient::createJavaAppletWidget): (WebKit::WebFrameLoaderClient::createNetworkingContext): * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::highlight): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::getOrCreate): (WebKit::VisitedLinkTableController::setVisitedLinkTable): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createWithCoreMainFrame): (WebKit::WebFrame::createSubframe): (WebKit::WebFrame::create): (WebKit::WebFrame::createSelectionSnapshot): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): (WebKit::WebPage::snapshotAtSize): (WebKit::WebPage::snapshotNode): (WebKit::WebPage::willPerformLoadDragDestinationAction): (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad): (WebKit::WebPage::SandboxExtensionTracker::didCommitProvisionalLoad): (WebKit::WebPage::drawRectToImage): * WebProcess/WebPage/WebPageGroupProxy.cpp: (WebKit::WebPageGroupProxy::create): * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::Properties::decode): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::create): (WebKit::PlatformCALayerRemote::clone): * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::create): (WebKit::PlatformCALayerRemoteCustom::clone): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor): 2016-06-20 Commit Queue Unreviewed, rolling out r202179. https://bugs.webkit.org/show_bug.cgi?id=158946 The test either fails or times out 100% of the time (Requested by ap on #webkit). Reverted changeset: "REGRESSION: Double tap to zoom does not work on yahoo finance" https://bugs.webkit.org/show_bug.cgi?id=158886 http://trac.webkit.org/changeset/202179 2016-06-20 Tim Horton REGRESSION (r191499): Tab content "jumps" down when focusing tabs that load in the background https://bugs.webkit.org/show_bug.cgi?id=158904 Reviewed by Sam Weinig. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::viewDidMoveToWindow): During the large refactor that was r191499, we somehow ended up with two different members for the same thing - one that got written, and one that got read. We should only have one. 2016-06-20 Tim Horton Try to fix the iOS build after r202142 and r202224. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): 2016-06-19 Simon Fraser Fix erroneously commented line added in r202142. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): 2016-06-16 Enrica Casucci Support configurable autocapitalization. https://bugs.webkit.org/show_bug.cgi?id=158860 rdar://problem/26231403 Reviewed by Tim Horton. The behavior of spellchecker should be configurable to avoid unwanted autocapitalization. * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy): * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::initialCapitalizationEnabled): (API::PageConfiguration::setInitialCapitalizationEnabled): * UIProcess/API/C/WKPageConfigurationRef.cpp: (WKPageConfigurationSetIntialCapitalizationEnabled): * UIProcess/API/C/WKPageConfigurationRef.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _initialCapitalizationEnabled]): (-[WKWebViewConfiguration _setInitialCapitalizationEnabled:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/TextChecker.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::checkTextOfParagraph): (WebKit::WebPageProxy::getGuessesForWord): * UIProcess/WebPageProxy.h: * UIProcess/efl/TextCheckerEfl.cpp: (WebKit::TextChecker::checkTextOfParagraph): (WebKit::TextChecker::getGuessesForWord): * UIProcess/gtk/TextCheckerGtk.cpp: (WebKit::TextChecker::getGuessesForWord): (WebKit::TextChecker::checkTextOfParagraph): * UIProcess/ios/TextCheckerIOS.mm: (WebKit::TextChecker::checkTextOfParagraph): (WebKit::TextChecker::getGuessesForWord): * UIProcess/mac/TextCheckerMac.mm: (WebKit::TextChecker::checkTextOfParagraph): (WebKit::TextChecker::getGuessesForWord): 2016-06-17 Chris Dumez Use WTF::NoncopyableFunction in NetworkDataTaskClient https://bugs.webkit.org/show_bug.cgi?id=158887 Reviewed by Alex Christensen. Use WTF::NoncopyableFunction in NetworkDataTaskClient instead of std::function and consistently move it around. This avoids some unnecessary copying. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::willDecidePendingDownloadDestination): (WebKit::DownloadManager::continueDecidePendingDownloadDestination): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::willPerformHTTPRedirection): (WebKit::NetworkLoad::didReceiveChallenge): (WebKit::NetworkLoad::didReceiveResponseNetworkSession): (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::findPendingDownloadLocation): * NetworkProcess/NetworkProcess.h: * NetworkProcess/PingLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTask::didReceiveChallenge): (WebKit::NetworkDataTask::didReceiveResponse): (WebKit::NetworkDataTask::willPerformHTTPRedirection): (WebKit::NetworkDataTask::tryPasswordBasedAuthentication): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::addChallengeToChallengeMap): (WebKit::AuthenticationManager::coalesceChallengesMatching): (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): (WebKit::AuthenticationManager::useCredentialForSingleChallenge): * Shared/Authentication/AuthenticationManager.h: * Shared/Authentication/mac/AuthenticationManager.mac.mm: (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): 2016-06-17 Antoine Quint Web video playback controls should have RTL volume slider https://bugs.webkit.org/show_bug.cgi?id=158856 Reviewed by Tim Horton. We now call setUserInterfaceLayoutDirection() on WebCore::Page to propagate the user interface layout direction down to the Web content. To facilitate this, the UserInterfaceLayoutDirection enum is now defined in WebCore. * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKWebView.mm: (convertSystemLayoutDirection): (toUserInterfaceLayoutDirection): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::toUserInterfaceLayoutDirection): (WebKit::WebViewImpl::userInterfaceLayoutDirection): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::userInterfaceLayoutDirection): (WebKit::WebPageProxy::setUserInterfaceLayoutDirection): * UIProcess/WebPageProxy.h: * UIProcess/efl/WebView.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::userInterfaceLayoutDirection): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::userInterfaceLayoutDirection): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): (WebKit::ViewGestureController::isPhysicallySwipingLeft): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_userInterfaceLayoutDirection): (WebKit::WebPage::setUserInterfaceLayoutDirection): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performNonEditingBehaviorForSelector): 2016-06-17 Dean Jackson REGRESSION: Double tap to zoom does not work on yahoo finance https://bugs.webkit.org/show_bug.cgi?id=158886 Reviewed by Simon Fraser. We shouldn't enable fast click on pages that have had to shrink to fit. In other words, we should enable double-tap-to-zoom if the page has already zoomed. Test: fast/events/ios/viewport-shrink-to-fit-allows-double-tap.html * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _allowsDoubleTapGestures]): 2016-06-16 Chris Dumez No need to ref connection in lambda inside NetworkResourceLoader::tryStoreAsCacheEntry() https://bugs.webkit.org/show_bug.cgi?id=158862 Reviewed by Darin Adler. No need to ref connection in lambda inside NetworkResourceLoader::tryStoreAsCacheEntry(). We already ref the NetworkResourceLoader which hold a ref to the connection. Also update the lambda capture to use Ref<> for the NetworkResourceLoader instead of RefPtr<>. Switch callback type from std::function to WTF::NoncopyableFunction so we can capture a Ref<>. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::store): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation): * NetworkProcess/cache/NetworkCacheStorage.h: 2016-06-16 Chris Dumez [WK2] Improve serialization of SubresourcesEntry to network disk cache https://bugs.webkit.org/show_bug.cgi?id=158851 Reviewed by Antti Koivisto. Improve serialization of SubresourcesEntry to network disk cache: - Do not bother serializing SubresourceInfo's first party for cookies and HTTP headers data members if the resource is transient. This is because those are never used for transient resources. This patch also makes it so that we do not even bother initializing those data members if the transient flag is set. - Update SubresourceInfo::encode() / decode() to encode and decode the HTTPHeaderMap data member with the right NetworkCache::Coder template specialization instead of using directly HTTPHeaderMap::decode() and HTTPHeaderMap::encode(). HTTPHeaderMap::decode() / encode() is unsafe in the disk cache case (see r200394). Also update entry types as so: - "resource" -> "Resource" - "subresources" -> "SubResources" These entry types are used a folder names in the disk cache and other folder names were capitalized. Antti suggested this was a good time to harmonize since we're bumping the cache version. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::constructRevalidationRequest): (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h: * NetworkProcess/cache/NetworkCacheStorage.h: * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: (WebKit::NetworkCache::SubresourceInfo::encode): (WebKit::NetworkCache::SubresourceInfo::decode): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h: (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo): (WebKit::NetworkCache::SubresourceInfo::isTransient): (WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies): (WebKit::NetworkCache::SubresourceInfo::requestHeaders): 2016-06-16 Anders Carlsson Fix macOS Sierra build https://bugs.webkit.org/show_bug.cgi?id=158849 Reviewed by Tim Horton. Add WebCore:: qualifiers for IOSurface, to avoid conflicts with the IOSurface Objective-C class and adopt IOSurface::asLayerContents(). * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::decode): (WebKit::RemoteLayerBackingStore::bytesPerPixel): (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): (WebKit::RemoteLayerBackingStore::setBufferVolatility): (WebKit::RemoteLayerBackingStore::Buffer::discard): * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshot::create): (WebKit::ViewSnapshot::ViewSnapshot): (WebKit::ViewSnapshot::asLayerContents): 2016-06-16 Brady Eidson When a WebsiteDataStore finds no ProcessPools and creates one from scratch, it should represent the data store's config. rdar://problem/26586991 and https://bugs.webkit.org/show_bug.cgi?id=158844 Reviewed by Anders Carlsson. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::processPools): * UIProcess/WebsiteData/WebsiteDataStore.h: 2016-06-15 Simon Fraser [iOS WK2] On iPad, indirect focussing of a text field doesn't always scroll to the correct location https://bugs.webkit.org/show_bug.cgi?id=158828 Reviewed by Enrica Casucci. WebPage::getAssistedNodeInformation() unconditionally set information.selectionRect() to a 1x1 rect at the last interaction location. This caused -[WKWebView _zoomToFocusRect:...] to early return under the !forceScroll clause if the last interaction rect was visible, but the elementRect was not. This would happen, for example, if a click in a