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