2017-04-12 Jason Marcell Cherry-pick 214376. rdar://problem/31502340 2017-03-24 Alex Christensen Fix assertions after r214358. https://bugs.webkit.org/show_bug.cgi?id=169167 * UIProcess/API/APIContentExtensionStore.cpp: (API::ContentExtensionStore::compileContentExtension): AtomicString::init must be called for the first time from the main thread. We were calling it for the first time from a non-main thread sometimes. Call it from the main thread before initiating compiling on another thread. 2017-04-03 Jason Marcell Cherry-pick r211601. rdar://problem/31387958 2017-02-02 Megan Gardner Don't attempt wide gammut on older OSes https://bugs.webkit.org/show_bug.cgi?id=167754 Reviewed by Tim Horton. We need to guard our extended color checks the same way throughout the code, or we will attempt to set up support for wide gamut partially, which causes crashes when using sharable bitmap. * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): 2017-04-02 Jason Marcell Cherry-pick r214559. rdar://problem/31371683 2017-03-29 Antti Koivisto Increment the last stable network cache version on Mac https://bugs.webkit.org/show_bug.cgi?id=170248 Reviewed by Chris Dumez. Bump to the latest release. * NetworkProcess/cache/NetworkCacheStorage.h: 2017-03-30 Jason Marcell Merge r214003. rdar://problem/31331131 2017-03-15 Wenson Hsieh WebContent crash due to bad variant access in WebKit: WebKit::WebPage::expandedRangeFromHandle https://bugs.webkit.org/show_bug.cgi?id=169657 Reviewed by Tim Horton. In WebPageIOS.mm, the call to unionDOMRanges from WebPage::expandedRangeFromHandle invokes Range::compareBoundaryPoints, assuming that the return value is not an exception, and then attempts to perform integer comparison on the result. This is one speculative cause of the web content crash in the radar. There isn't a known way to reproduce this crash. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::unionDOMRanges): 2017-03-20 Matthew Hanson Merge r213253. rdar://problem/30773140 2017-03-01 Chris Dumez [WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor https://bugs.webkit.org/show_bug.cgi?id=169060 Reviewed by Darin Adler. In the !NETWORK_SESSION code path, we were failing to use the suggested filename coming from the network layer in the case where the download attribute is present but has no value. We were ending up passing an empty string as suggested filename to Safari which is not handled properly. * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): 2017-03-16 Jason Marcell Merge r212726. rdar://problem/30921822 2017-02-21 Maureen Daum Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion. https://bugs.webkit.org/show_bug.cgi?id=168659 rdar://problem/22781730 Reviewed by Brady Eidson. Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion. It is possible that another process has caused information to be added to LocalStorage after we created this LocalStorageDatabaseTracker instance, so we should update our internal state by checking the contents of StorageTracker.db and the other local storage files so we know what databases actually exist. By calling importOriginIdentifiers() at the start of deleteDatabasesModifiedSince(), m_origins will now have the up-to-date list of origins LocalStorage contains data for. * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): 2017-02-24 Matthew Hanson Rollout r212537. rdar://problem/30699480 2017-02-28 Matthew Hanson Merge r213078. rdar://problem/30704432 2017-02-27 Matthew Hanson Merge r213010. rdar://problem/30704432 2017-02-26 Chris Dumez HitTestResult's linkSuggestedFilename should sanitize download attribute https://bugs.webkit.org/show_bug.cgi?id=168856 Reviewed by Antti Koivisto. HitTestResult's linkSuggestedFilename should sanitize download attribute. This is used by the context menu's "Download Linked File" & "Download Linked File As..." actions. * Shared/WebHitTestResultData.cpp: (WebKit::WebHitTestResultData::WebHitTestResultData): * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename): 2017-02-17 JF Bastien A/B test concurrent GC https://bugs.webkit.org/show_bug.cgi?id=168453 Reviewed by Phil Pizlo. Initialize WTF::SplitTest early enough that other initialization can use it. * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm: (WebContentServiceInitializer): 2017-02-20 Matthew Hanson Rollout r212660. rdar://problem/30553220 2017-02-20 Matthew Hanson Merge r212666. rdar://problem/30239618 2017-02-20 David Quesada Don’t set NSURLSessionConfiguration’s _sourceApplicationAuditTokenData if _sourceApplicationBundleIdentifier is also set. https://bugs.webkit.org/show_bug.cgi?id=168607 rdar://problem/30239618 Reviewed by Geoffrey Garen. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): If the process pool configuration sets a source application bundle identifier, don't give the NSURLSession configuration the audit token from the UI process, as it may be associated with an application with a conflicting bundle identifier. 2017-02-20 Matthew Hanson Rollout r212538. rdar://problem/30541748 2017-02-17 Matthew Hanson A/B test concurrent GC https://bugs.webkit.org/show_bug.cgi?id=168453 Landed on behalf of JF Bastien. Reviewed by Alexey Proskuryakov. Initialize WTF::SplitTest early enough that other initialization can use it. * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm: (WebContentServiceInitializer): 2017-02-17 Matthew Hanson Merge r212244. rdar://problem/23676252 2017-02-13 Antti Koivisto Disable mmap'd cache files if container is class A https://bugs.webkit.org/show_bug.cgi?id=168241 Reviewed by JF Bastien and Chris Dumez. If the mmap'd cache file gets evicted and the device is locked, then WebContent won't be able to bring the file back in under class A, causing SIGBUS. In those circumstances, don't use mmap'd files. * NetworkProcess/cache/NetworkCache.h: (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord): Don't initialize the shareable resource handle for the map if forbidden. * NetworkProcess/cache/NetworkCacheFileSystem.cpp: (WebKit::NetworkCache::canUseSharedMemoryForPath): Query the system for the protection status of the cache path. * NetworkProcess/cache/NetworkCacheFileSystem.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::Storage): * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData): 2017-02-17 Matthew Hanson Rollout r212500. rdar://problem/29904368 2017-02-16 Matthew Hanson Merge r212518. rdar://problem/30541748 2017-02-16 Daniel Bates Remove Chromium-specific code to call FrameLoaderClient::redirectDataToPlugin(nullptr) https://bugs.webkit.org/show_bug.cgi?id=168417 Reviewed by Brent Fulgham. Update override of FrameLoaderClient::redirectDataToPlugin() to take a Widget& instead of a Widget* as it is always called with a valid Widget. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::redirectDataToPlugin): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * mac/WebKit2.order: Remove symbol for WebFrameLoaderClient::redirectDataToPlugin() that took a Widget* as it no longer exists. I am unclear if this file is still meaningful as it was last modified in r180570 (2 years ago) though Xcode still references this ordering file (why?). 2017-02-16 Matthew Hanson Merge r212459. rdar://problem/29322051 2017-02-16 Tim Horton WKWebView inside a UICollectionView flashes when items are inserted above it https://bugs.webkit.org/show_bug.cgi?id=168376 Reviewed by Simon Fraser. Previously, we would immediately send visible content rect updates whenever we scrolled, or our frame or bounds changed, or ... a whole bunch of other things. This message would be immediately sent to the Web Content process, and coalesced at the whims of the Web Content process main thread. However, if we received multiple such updates within the same runloop cycle in the UI process, the Web Content process could send back layer tree commits for intermediate states that would never make it to the screen. In the UICollectionView case, UIKit would first scroll to the new location (potentially putting the WKWebView totally off-screen), and then update our frame (back on screen), and we would get two layer tree commits; one, with less tile coverage than needed to cover the area, and another with full coverage. Instead, wait until just before we commit the UI-side layer tree (and thus everyone is done moving things around) to push the new visible rect info to the Web Content process. So far, I have not found a way to test that reliably fails before and reliably passes after without adding a ton of supporting code to WebKit. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _didFinishScrolling]): (-[WKWebView scrollViewDidScroll:]): (-[WKWebView scrollViewDidZoom:]): (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): (-[WKWebView _scrollViewDidInterruptDecelerating:]): (-[WKWebView _didScroll]): (-[WKWebView _enclosingScrollerScrollingEnded:]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _scheduleVisibleContentRectUpdate]): (-[WKWebView _scrollViewIsInStableState:]): (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _endInteractiveObscuredInsetsChange]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _updateVisibleContentRects]): Deleted. (-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _didCommitLayerTree:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): (-[WKContentView _stopAssistingNode]): * UIProcess/ios/WKScrollView.mm: (-[WKScrollView setContentInset:]): Have existing callers of _updateVisibleContentRect* instead call _scheduleVisibleContentRectUpdate*. In _scheduleVisibleContentRectUpdate, schedule a pre-commit callback in which we will compute the new visible content rect information and send it to the Web Content process. Keep track of the stable state of the scroll view which most recently scheduled an update, and use that to inform _updateVisibleContentRects. This matches the previous behavior where the updates might get coalesced in the Web Content process, and the most recent update wins. Make a few callers of _updateVisibleContentRectAfterScrollInView that passed in our scroll view just use _scheduleVisibleContentRectUpdate instead. 2017-02-16 Matthew Hanson Merge r212312. rdar://problem/30505482 2017-02-14 Simon Fraser Add logging and defensive fixes to try to detect problems causing blank tabs https://bugs.webkit.org/show_bug.cgi?id=168270 rdar://problem/30505482 Reviewed by Jon Lee. Add release logging when -[WKWebView _beginAnimatedResizeWithUpdates:] and -[WKWebView _endAnimatedResize] are unbalanced across a commit, to detect cases where _endAnimatedResize wasn't called enough times. Also log when RemoteLayerTreeHost::updateLayerTree() fails to find a root layer, which should never happen. In WebPageProxy, clear m_firstLayerTreeTransactionIdAfterDidCommitLoad on a web process crash. * Platform/Logging.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::isAlwaysOnLoggingAllowed): * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): (WebKit::RemoteLayerTreeHost::clearLayers): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::WebFrame): * WebProcess/WebPage/WebFrame.h: 2017-02-16 Matthew Hanson Merge r212260. rdar://problem/30481079 2017-02-13 Simon Fraser Call WKDestroyRenderingResources() on iOS when tabs are backgrounded https://bugs.webkit.org/show_bug.cgi?id=168261 rdar://problem/30481079 Reviewed by Tim Horton. There's code to call CABackingStoreCollectBlocking() on a 10s timer that exists for Mac, but on iOS the web processes are suspended before this timer fires. So call CABackingStoreCollectBlocking() from WebProcess::actualPrepareToSuspend(), which is where we also trigger the markAllLayersVolatile() code. Also add CABackingStoreCollectBlocking() to QuartzCoreSPI.h so we can use it without using WKSI. Release-log how long this takes, in case we get reports of bad performance. In my testing it could be up to 10ms. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::actualPrepareToSuspend): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::destroyRenderingResources): 2017-02-16 Matthew Hanson Merge r212256. rdar://problem/30313696 2017-02-13 Brady Eidson Followup to: Replace all WebKit Library Version checks in WK2 with SDK version checks. https://bugs.webkit.org/show_bug.cgi?id=168124 Reviewed by Geoffrey Garen. * UIProcess/Cocoa/VersionChecks.h: 2017-02-16 Matthew Hanson Merge r212134. rdar://problem/30313696 2017-02-10 Brady Eidson Replace all WebKit Library Version checks in WK2 with SDK version checks. https://bugs.webkit.org/show_bug.cgi?id=168124 Reviewed by Geoffrey Garen. This change gets rid of WebKit Library Version checks and replaces them with SDK version checks. To allow our tools to still be able to test new behaviors even when built against older SDKs, it also opts them into an SPI default to have "linkedOnOrAfter()" always return true. * Shared/Cocoa/CompletionHandlerCallChecker.mm: (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): * UIProcess/Cocoa/VersionChecks.h: (WebKit::linkedOnOrAfter): Deleted. * UIProcess/Cocoa/VersionChecks.mm: (WebKit::linkedOnOrAfter): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::isNetworkCacheEnabled): 2017-02-16 Matthew Hanson Merge r212198. rdar://problem/29813868 2017-02-11 Alex Christensen Fix crashes after [NSURLSession invalidateAndCancel] https://bugs.webkit.org/show_bug.cgi?id=168181 Reviewed by Brady Eidson. When we call NetworkSessionCocoa::invalidateAndCancel, we intend for the session to immediately become invalid and stop doing things. [NSURLSession invalidateAndCancel] asynchronously cancels everything and then calls the delegate's didBecomeInvalidWithError, so before this change there is a time when we have torn down the session with SessionTracker::destroySession but we can still get a delegate callback which assumes the session and its NetworkStorageSession exists. If we get any delegate callbacks after a NetworkSession has been invalidated, we will want to ignore them. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate sessionInvalidated]): (-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]): (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]): (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]): (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]): (-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): The pointer to the NetworkSessionCocoa can now be null. We need to check it. (WebKit::NetworkSessionCocoa::invalidateAndCancel): Synchronously remove the connection between the delegates and the NetworkSessionCocoa. 2017-02-16 Matthew Hanson Merge r212173. rdar://problem/29904368 2017-02-10 Daniel Bates Detach frame from document when entering page cache https://bugs.webkit.org/show_bug.cgi?id=166774 Reviewed by Chris Dumez. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAllowsPageCacheWithWindowOpener): Deleted. (WKPreferencesGetAllowsPageCacheWithWindowOpener): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-02-16 Matthew Hanson Merge r212167. rdar://problem/30428673 2017-02-10 Tim Horton Infinite UI process hang under ensurePositionInformationIsUpToDate https://bugs.webkit.org/show_bug.cgi?id=168154 Reviewed by Simon Fraser. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): If the web process crashes or we're being torn down for another reason, assume that we aren't ever going to receive any pending async interaction information update. Otherwise, ensurePositionInformationIsUpToDate can end up waiting for it forever. 2017-02-16 Matthew Hanson Merge r212000. rdar://problem/30313696 2017-02-09 Brady Eidson Transition "WebKit Library Version" checks to SDK version checks. and https://bugs.webkit.org/show_bug.cgi?id=168056 Reviewed by Geoffrey Garen. When doing linkedOnOrAfter checks, relying solely on the WebKit library version number is error prone, since apps may not link against WebKit directly and therefore the linked WebKit is unknown. We should first prefer a version check on the SDK that the app was built with. If that check fails, we can fallback to the linked WebKit library version number if it exists. * Shared/Cocoa/CompletionHandlerCallChecker.mm: (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): For each "linked-on-or-after" feature, include both the WebKit library version and SDK version: * UIProcess/Cocoa/VersionChecks.h: (WebKit::linkedOnOrAfter): * UIProcess/Cocoa/VersionChecks.mm: (WebKit::linkedOnOrAfter): (WebKit::linkTimeVersion): Deleted. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::isNetworkCacheEnabled): 2017-02-16 Matthew Hanson Merge r211688. rdar://problem/30467177 2017-02-05 Simon Fraser Remove unparentsOffscreenTiles logic in TileController https://bugs.webkit.org/show_bug.cgi?id=167823 Reviewed by Tim Horton. Drive-by fix: make sure we put the tiled scrolling indicator's layer back when switching tabs. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updateRootLayers): 2017-02-16 Matthew Hanson Merge r212398. rdar://problem/29906848 2017-02-15 Jer Noble REGRESSION(r183937): Fullscreen Exit animation missing mask https://bugs.webkit.org/show_bug.cgi?id=168360 Reviewed by Eric Carlson. In r183937, the fullscreen window's clip layer has it's mask removed when the enter fullscreen animation completes, allowing low-power video playback mode to be entered. But this breaks the exit fullscreen animaiton, which assumes a mask is present. Abstract the mask creation code out into a static helper method, and use it at the beginning of the exit fullscreen animation to re-create the mask before adding animations to it. * UIProcess/mac/WKFullScreenWindowController.mm: (createMask): (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): 2017-02-09 Matthew Hanson Roll out r209845. rdar://problem/30114564 2016-12-14 Simon Fraser Fix cause of viewport-related flakiness in iOS tests https://bugs.webkit.org/show_bug.cgi?id=165878 Reviewed by Tim Horton. Try un-flaking some viewport tests. * platform/ios-simulator-wk2/TestExpectations: 2017-02-09 Matthew Hanson Merge r211915. rdar://problem/27607520 2017-02-08 Andy Estes Custom protocols should not continue loading after a network process crash https://bugs.webkit.org/show_bug.cgi?id=168028 Reviewed by Brady Eidson. WKCustomProtocolLoaders are meant to be owned by CustomProtocolManagerProxy and have their loads cancelled when CustomProtocolManagerProxy is destroyed. However, WKCustomProtocolLoader creates a NSURLConnection for which it is the client, so NSURLConnection retains it for the duration of the load. These loaders should be explicitly cancelled when their CustomProtocolManagerProxy is destroyed. New API test: WebKit2CustomProtocolsTest.CloseDuringCustomProtocolLoad * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm: (-[WKCustomProtocolLoader customProtocolManagerProxyDestroyed]): Added. Cancels the _urlConnection and sets _customProtocolManagerProxy to nullptr. (WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy): Called -customProtocolManagerProxyDestroyed on every loader in m_loaderMap. 2017-02-09 Matthew Hanson Merge r211893. rdar://problem/30423806 2017-02-08 Jer Noble Unreviewed build fix; FullscreenClient only avaialble on 32-bit builds. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): 2017-02-09 Matthew Hanson Merge r211891. rdar://problem/30423806 2017-02-08 Jer Noble Move FullscreenClient creation into WebViewImpl, for use in (deprecated) WKView. https://bugs.webkit.org/show_bug.cgi?id=168007 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: * UIProcess/Cocoa/FullscreenClient.h: * UIProcess/Cocoa/FullscreenClient.mm: (WebKit::FullscreenClient::FullscreenClient): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): 2017-02-09 Matthew Hanson Merge r211094. rdar://problem/30423806 2017-01-24 Jer Noble Make _WKFullscreenDelegate available to users of the WebKit2 C-API. https://bugs.webkit.org/show_bug.cgi?id=165255 Reviewed by Anders Carlsson. Add a getter and setter to WKPagePrivate allowing clients to set/get the _WKFullscreenDelegate associated with the page. * UIProcess/API/C/mac/WKPagePrivateMac.h: * UIProcess/API/C/mac/WKPagePrivateMac.mm: (WKPageSetFullscreenDelegate): (WKPageGetFullscreenDelegate): 2017-02-09 Matthew Hanson Merge r211835. rdar://problem/27439617 2017-02-07 Alex Christensen Revert r166597 https://bugs.webkit.org/show_bug.cgi?id=167951 Reviewed by Andreas Kling. CFURLConnectionInvalidateConnectionCache is not commonly called and is likely causing CFNetwork to be in a strange state when using NSURLSession and invalidating the connection cache during authentication, especially server trust evaluation. Right now we only call it when handling memory pressure, and it isn't worth getting into such a strange state in a poorly tested situation. See rdar://problem/27439617 * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::lowMemoryHandler): (WebKit::NetworkProcess::initializeSandbox): (WebKit::NetworkProcess::platformLowMemoryHandler): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformLowMemoryHandler): Deleted. 2017-02-09 Matthew Hanson Merge r211747. rdar://problem/30183825 2017-02-06 Anders Carlsson Crash child processes if they receive an invalid message https://bugs.webkit.org/show_bug.cgi?id=167900 Reviewed by Dan Bernstein. Previously, some processes would try to gracefully exit, others would just drop messages leading to weird bugs. Instead, set app-specific crash information to the message that failed to be decoded, and then crash. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::didReceiveInvalidMessage): Deleted. * DatabaseProcess/DatabaseProcess.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didReceiveInvalidMessage): Deleted. * NetworkProcess/NetworkProcess.h: * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::didReceiveInvalidMessage): Deleted. * PluginProcess/PluginProcess.h: * Shared/ChildProcess.h: * Shared/Cocoa/ChildProcessCocoa.mm: Added. (WebKit::ChildProcess::didReceiveInvalidMessage): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didReceiveInvalidMessage): Deleted. * WebProcess/WebProcess.h: 2017-02-09 Matthew Hanson Merge r211736. rdar://problem/30229358 2017-02-06 Anders Carlsson Null check the WebKit::RemoteObjectProxy object before calling it https://bugs.webkit.org/show_bug.cgi?id=167891 rdar://problem/30229358 Reviewed by Tim Horton. If a _WKRemoteObjectRegistry invocation reply block outlives its underlying WebKit::RemoteObjectProxy object, we'll crash trying to send an unused reply to it. Work around this crash by adding a null check before calling sendUnusedReply. While this fixes the crash it will lead to leaks in the process that holds on to the reply block. A more long term fix would be to manage the reply block checkers and call sendUnusedReply when invalidating the _WKRemoteObjectRegistry. * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm: (-[_WKRemoteObjectRegistry _invokeMethod:]): 2017-02-09 Matthew Hanson Merge r211655. rdar://problem/30344753 2017-02-03 Anders Carlsson Revert toString behavior to what we had in the last version we shipped https://bugs.webkit.org/show_bug.cgi?id=167814 rdar://problem/30344753 Reviewed by Tim Horton. This is a speculative fix for a crash that we've seen on recent builds. It simply reverts the toString call back to what we have in the last version of Safari we shipped. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): 2017-02-09 Matthew Hanson Merge r211652. rdar://problem/30040618 2017-02-03 Jeremy Jones Require keyboard focus for pointer lock. https://bugs.webkit.org/show_bug.cgi?id=167750 Reviewed by Tim Horton. When keyboard focus leaves the page, end pointer lock Prevent pointer lock when the page doesn't have keyboard focus. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::requestPointerLock): 2017-02-09 Matthew Hanson Merge r211622. rdar://problem/30116072 2017-02-02 Andreas Kling [Mac] In-process memory pressure monitor for WebContent processes AKA websam Reviewed by Antti Koivisto. Enable the in-process memory monitor for WebContent processes on macOS 10.12+ * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-02-09 Matthew Hanson Merge r211254. rdar://problem/30188490 2017-01-26 Chris Dumez Crash when navigating back to a page in PacheCache when one of its frames has been removed https://bugs.webkit.org/show_bug.cgi?id=167421 Reviewed by Darin Adler. Add a new setting allowing layout tests to enable PageCache in a window that has an opener, for convenience. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAllowsPageCacheWithWindowOpener): (WKPreferencesGetAllowsPageCacheWithWindowOpener): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-02-06 Matthew Hanson Merge r211666. rdar://problem/30167791 2017-02-03 Joseph Pecoraro Unreviewed rollout of r211486, r211629. Original change is not ideal and is causing issues. * Shared/WebKit2Initialize.cpp: (WebKit::InitializeWebKit2): 2017-02-06 Matthew Hanson Merge r211653. rdar://problem/29872943 2017-02-03 Chris Dumez Dismiss HTML form validation popover when pressing Escape key https://bugs.webkit.org/show_bug.cgi?id=167716 Reviewed by Simon Fraser. Override ValidationMessageClient::hideAnyValidationMessage(). * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: (WebKit::WebValidationMessageClient::hideAnyValidationMessage): * WebProcess/WebCoreSupport/WebValidationMessageClient.h: 2017-02-05 Matthew Hanson Merge r211482. rdar://problem/29711409 2017-02-01 Andreas Kling Implement the alwaysRunsAtBackgroundPriority WK2 setting using thread QoS. Reviewed by Antti Koivisto. Remove the old ProcessThrottlerClient implementation of alwaysRunsAtBackgroundPriority and replace it with WTF::setGlobalMaxQOSClass(). If the setting is enabled, it's passed over to each WK2 child process along with its bootstrap parameter, and we notify WTF in XPCServiceInitializer(), before anything too threading related happens. * Platform/IPC/Connection.cpp: (IPC::Connection::processIncomingMessage): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::ChildProcessProxy): (WebKit::ChildProcessProxy::getLaunchOptions): * UIProcess/ChildProcessProxy.h: * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::DatabaseProcessProxy): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): (WebKit::NetworkProcessProxy::alwaysRunsAtBackgroundPriority): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::assertionState): * UIProcess/ProcessThrottlerClient.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): (WebKit::WebProcessProxy::alwaysRunsAtBackgroundPriority): Deleted. * UIProcess/WebProcessProxy.h: 2017-02-05 Matthew Hanson Merge r211569. rdar://problem/30229990 2017-02-02 Chris Dumez [Crash] com.apple.WebKit.WebContent at WebKit: WebKit::WebPage::fromCorePage() https://bugs.webkit.org/show_bug.cgi?id=167738 Reviewed by Andreas Kling. The BackForwardClient no longer needs to worry about removing HistoryItems from the PageCache now that WebCore takes care of it. * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItemFromUIProcess): (WebKit::WebBackForwardListProxy::addItem): (WebKit::WebBackForwardListProxy::close): * WebProcess/WebPage/WebBackForwardListProxy.h: 2017-02-05 Matthew Hanson Merge r211565. rdar://problem/28896113 2017-02-01 Anders Carlsson Handle m_processLauncher being null in ChildProcessProxy::processIdentifier() https://bugs.webkit.org/show_bug.cgi?id=167713 rdar://problem/28896113 Reviewed by Dan Bernstein. This can happen if the process has been explicitly terminated. * UIProcess/ChildProcessProxy.h: (WebKit::ChildProcessProxy::processIdentifier): 2017-02-05 Matthew Hanson Merge r211628. rdar://problem/26685576 2017-02-03 Csaba Osztrogonác [Mac][cmake] One more unreviewed speculative buildfix after r211403. https://bugs.webkit.org/show_bug.cgi?id=165478 * UIProcess/API/Cocoa/WKWebView.mm: WebSQLiteDatabaseTrackerClient.h is an iOS specific header in platform/ios directory which shouldn't and can't be included on non iOS build. 2017-02-05 Matthew Hanson Merge r211626. rdar://problem/26685576 2017-02-03 Csaba Osztrogonác [Mac][cmake] Unreviewed speculative buildfix after r211403. https://bugs.webkit.org/show_bug.cgi?id=165478 * UIProcess/API/Cocoa/WKWebView.mm: WebBackgroundTaskController.h is an iOS specific header in platform/ios directory which shouldn't and can't be included on non iOS build. 2017-02-05 Matthew Hanson Merge r211551. rdar://problem/26685576 2017-02-02 Yongjun Zhang In iOS, we should take background assertion when accessing localstorage databases. https://bugs.webkit.org/show_bug.cgi?id=165478 Just like in WebKit1, when initializing a WKWebView, initialize the database transaction tracker client. Also, we should set up the start and end background task blocks here. In WebKit1, this is done inside UIKit. Reviewed by Brady Eidson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setUpSQLiteDatabaseTrackerClient]): Set up the start/end background task blocks and database transaction tracker client. 2017-02-05 Matthew Hanson Merge r211656. rdar://problem/30102568 2017-02-03 Daniel Bates [Mac][WK2] Add SPI to override the Content Security Policy of a page https://bugs.webkit.org/show_bug.cgi?id=167810 Reviewed by Anders Carlsson. Add SPI to WKWebViewConfiguration so that an embedding client can define a custom Content Security Policy that overrides the Content Security Policy of any page loaded in the web view. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): Encode instance variable overrideContentSecurityPolicy. (WebKit::WebPageCreationParameters::decode): Decode instance variable overrideContentSecurityPolicy. * Shared/WebPageCreationParameters.h: * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy): Copy instance variable overrideContentSecurityPolicy. * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::overrideContentSecurityPolicy): Added. (API::PageConfiguration::setOverrideContentSecurityPolicy): Added. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): Copy overrideContentSecurityPolicy set on the WKWebViewConfiguration object to the API::PageConfiguration object if non-nil. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): Copy the instance variable overrideContentSecurityPolicy. (-[WKWebViewConfiguration _overrideContentSecurityPolicy]): Added. (-[WKWebViewConfiguration _setOverrideContentSecurityPolicy:]): Added. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Define SPI property _overrideContentSecurityPolicy. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Initialize m_overrideContentSecurityPolicy from the passed page configuration. (WebKit::WebPageProxy::creationParameters): Set WebPageCreationParameters::overrideContentSecurityPolicy so that the WebPage object (in the WebProcess) will know the overridden Content Security Policy to apply to the document. * UIProcess/WebPageProxy.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::overrideContentSecurityPolicy): Added. Returns the custom Content Security Policy to apply to a new document. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::overrideContentSecurityPolicy): Added. 2017-02-02 Matthew Hanson Merge r211541. rdar://problem/30100286 2017-02-01 Simon Fraser [iOS WK2] With visual viewports, a fixed bottom bar can be clipped out when the keyboard is visible https://bugs.webkit.org/show_bug.cgi?id=167710 rdar://problem/30100286 Reviewed by Wenson Hsieh. The unobscuredRectInContentCoordinates passed to -didUpdateVisibleRect:... could project outside of the bounds of the document, which is OK when rubber-banding, but not when we're in a stable state, because that can cause fixed elements to get pushed outside the doc. This happened when the keyboard triggered bottom content insets on the scroll view. Fix by computing a rectangle which is the "allowed" bounds of fixed content, which is permitted to extend outside the document bounds only when rubber-banding, and intersect unobscuredRectInContentCoordinates with that rectangle. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _contentBoundsExtendedForRubberbandingWithScale:]): (-[WKWebView _updateContentRectsWithState:]): 2017-02-02 Matthew Hanson Merge r211538. rdar://problem/30229620 2017-02-01 Enrica Casucci WebProcess crashes in int WTF::__throw_bad_variant_access when expanding/shrinking a block selection. https://bugs.webkit.org/show_bug.cgi?id=167673 rdar://problem/30229620 Reviewed by Anders Carlsson This is a speculative fix for a bug that might have been introduced with http://trac.webkit.org/changeset/208479. The code in containsRange inline fuction in WebPageIOS.mm has not been updated when the return value of Range::compareBoundaryPoints was changed to ExceptionOr. Since there is already a method containsRange in the Range class that does the right thing, expandedRangeFromHandle now uses that. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::expandedRangeFromHandle): (WebKit::containsRange): Deleted. 2017-01-31 Matthew Hanson Merge r211387. rdar://problem/29500273 2017-01-30 Simon Fraser [iOS] position:fixed inside touch-scrollable overflow is mispositioned https://bugs.webkit.org/show_bug.cgi?id=167604 rdar://problem/29500273 Reviewed by Zalan Bujtas. Make sure we tell m_webPageProxy.computeCustomFixedPositionRect() when visual viewports are enabled. * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect): 2017-01-31 Matthew Hanson Merge r211295. rdar://problem/30236297 2017-01-27 Chris Dumez Round CPU Usage diagnostic logging to 2 significant digits https://bugs.webkit.org/show_bug.cgi?id=167515 Reviewed by Antti Koivisto. Round CPU Usage diagnostic logging to 2 significant digits as requested by diagnostic logging team. * UIProcess/PerActivityStateCPUUsageSampler.cpp: (WebKit::toStringRoundingSignificantFigures): (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired): 2017-01-26 Matthew Hanson Merge r211239. rdar://problem/30221723 2017-01-26 Chris Dumez Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler https://bugs.webkit.org/show_bug.cgi?id=167471 Reviewed by Alex Christensen. Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler to use numeric values for logDiagnosticMessageWithValue(). * UIProcess/PerActivityStateCPUUsageSampler.cpp: (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired): (WebKit::loggingKeyForCPUUsage): Deleted. 2017-01-26 Matthew Hanson Merge r211234. rdar://problem/29899862 2017-01-26 Jeremy Jones Request pointer unlock on navigation and re-enable pointer-lock tests for WK2. https://bugs.webkit.org/show_bug.cgi?id=166765 Reviewed by Tim Horton. When the main frame is load is committed, pointer lock should end. This resets pointer lock state between tests and allows tests to succeed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): 2017-01-26 Matthew Hanson Merge r211229. rdar://problem/30216981 2017-01-26 Chris Dumez Fix WebGL diagnostic logging https://bugs.webkit.org/show_bug.cgi?id=167463 Reviewed by Alex Christensen. Fix WebGL diagnostic logging so that it no longer uses logDiagnosticMessageWithValue(). This is because the value apparently needs to be numeric on Mac. * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: (WebKit::HighPerformanceGraphicsUsageSampler::timerFired): 2017-01-26 Matthew Hanson Merge r211223. rdar://problem/30181179 2017-01-26 Anders Carlsson Don't use _CFBundleCreateUnique on Yosemite, it's not available there https://bugs.webkit.org/show_bug.cgi?id=167459 rdar://problem/30181179 Reviewed by Beth Dakin. * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::getPluginInfo): 2017-01-25 Matthew Hanson Merge r211126. rdar://problem/30174873 2017-01-24 Simon Fraser [iOS WK2] Avoid IOSurface readback for snapshot creation https://bugs.webkit.org/show_bug.cgi?id=167397 rdar://problem/30174873 Reviewed by Tim Horton. Use IOSurface::sinkIntoImage() for snapshots, to avoid GPU readback. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): 2017-01-25 Matthew Hanson Merge r211121. rdar://problem/22938927 2017-01-24 Tim Horton Script gets touch events even after navigation swipe begins https://bugs.webkit.org/show_bug.cgi?id=167383 Reviewed by Simon Fraser. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isNavigationSwipeGestureRecognizer:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/ViewGestureController.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (-[WKSwipeTransitionController isNavigationSwipeGestureRecognizer:]): (WebKit::ViewGestureController::isNavigationSwipeGestureRecognizer): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]): Require the navigation swipe gesture recognizer to fail before the UIWebTouchEventsGestureRecognizer can recognize. This way, the page doesn't get touch events during the swipe, which previously led to e.g. carousels scrolling while swiping. 2017-01-25 Dean Jackson Disable Variation fonts on this branch. * Configurations/FeatureDefines.xcconfig: 2017-01-25 Matthew Hanson Merge r211052. rdar://problem/29857388 2017-01-20 Anders Carlsson When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!) https://bugs.webkit.org/show_bug.cgi?id=167268 rdar://problem/29857388 Reviewed by Sam Weinig. * WebProcess/Plugins/WebPluginInfoProvider.h: Make refreshPlugins() private. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::refreshPlugins): Call the newly added PluginInfoProvider::refresh(). 2017-01-24 Matthew Hanson Merge r211086. rdar://problem/29948645 2017-01-23 Anders Carlsson The Score Esports crashes on launch https://bugs.webkit.org/show_bug.cgi?id=167338 rdar://problem/29948645 Reviewed by Dan Bernstein. * Shared/Cocoa/WKObject.mm: (+[WKObject conformsToProtocol:]): Add a class method implementation in case an app ends up calling +[WKObject conformsToProtocol:] for some reason. 2017-01-24 Matthew Hanson Merge r211054. rdar://problem/28891161 2017-01-23 Joseph Pecoraro Web Inspector: Asserts seen opening and closing Remote Web Inspector windows https://bugs.webkit.org/show_bug.cgi?id=167316 Reviewed by Alexey Proskuryakov. * UIProcess/RemoteWebInspectorProxy.cpp: (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow): Assume read access, like the local web inspector, to Web Inspector resources. * WebProcess/WebPage/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::closeWindow): Clear ourselves as the inspector frontend client when closing. 2017-01-24 Matthew Hanson Merge r211045. rdar://problem/29486368 2017-01-23 Jer Noble Video details does not apear and missing scrubber in Control Center https://bugs.webkit.org/show_bug.cgi?id=167233 Reviewed by Alex Christensen. Make requestActiveNowPlayingSessionInfo() and handleActiveNowPlayingSessionInfoResponse() work in PLATFORM(IOS). * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestActiveNowPlayingSessionInfo]): (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]): * 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/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::requestActiveNowPlayingSessionInfo): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Deleted. 2017-01-24 Matthew Hanson Merge r211007. rdar://problem/28620919 2017-01-20 Brady Eidson Require a button press on a gamepad for them to be exposed to the DOM. and https://bugs.webkit.org/show_bug.cgi?id=167272 Reviewed by Alex Christensen. * UIProcess/Gamepad/UIGamepadProvider.cpp: (WebKit::UIGamepadProvider::gamepadSyncTimerFired): (WebKit::UIGamepadProvider::platformGamepadInputActivity): * UIProcess/Gamepad/UIGamepadProvider.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::gamepadActivity): * UIProcess/WebPageProxy.h: * WebProcess/Gamepad/WebGamepadProvider.cpp: (WebKit::WebGamepadProvider::gamepadActivity): * WebProcess/Gamepad/WebGamepadProvider.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::gamepadActivity): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-01-24 Matthew Hanson Merge r210603. rdar://problem/29839194 2017-01-11 Anders Carlsson navigator.plugins.refresh and WKContextRefreshPlugIns doesn't pick up changes to already-present plug-ins https://bugs.webkit.org/show_bug.cgi?id=166942 rdar://problem/29839194 Reviewed by Sam Weinig. Use _CFBundleCreateUnique so the resulting bundle won't be cached. * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::getPluginInfo): 2017-01-20 Matthew Hanson Merge r210949. rdar://problem/30108531 2017-01-19 Chris Dumez iterable<> should be enabled on WK1 https://bugs.webkit.org/show_bug.cgi?id=167221 Reviewed by Youenn Fablet. * Shared/WebPreferencesDefinitions.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-01-20 Matthew Hanson Merge r210936. rdar://problem/30058349 2017-01-19 Chris Dumez Implement per activity state CPU usage reporting using diagnostic logging https://bugs.webkit.org/show_bug.cgi?id=167163 Reviewed by Andreas Kling. Implement per activity state CPU usage reporting using diagnostic logging. * Platform/Logging.h: * UIProcess/PerActivityStateCPUUsageSampler.cpp: Added. (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler): (WebKit::PerActivityStateCPUUsageSampler::~PerActivityStateCPUUsageSampler): (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime): (WebKit::loggingKeyForActivityState): (WebKit::loggingKeyForCPUUsage): (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired): (WebKit::PerActivityStateCPUUsageSampler::pageForLogging): * UIProcess/PerActivityStateCPUUsageSampler.h: Copied from Source/WebCore/page/ActivityState.h. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::reportWebContentCPUTime): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessPool.messages.in: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::reportProcessCPUTime): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-01-20 Matthew Hanson Merge r210913. rdar://problem/30086738 2017-01-18 Said Abou-Hallawa [iOS][WK2] Remove the WebView private configuration contentUpdateFrequency https://bugs.webkit.org/show_bug.cgi?id=167188 Reviewed by Simon Fraser. This patch reverts r209294. This configuration is not needed anymore. The CADisplayLink::preferredFramesPerSecond for WK2 will be set to the default value always. * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::setAlwaysRunsAtForegroundPriority): (API::PageConfiguration::contentUpdateFrequency): Deleted. (API::PageConfiguration::setContentUpdateFrequency): Deleted. (): Deleted. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]): (-[WKWebViewConfiguration _contentUpdateFrequency]): Deleted. (-[WKWebViewConfiguration _setContentUpdateFrequency:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]): (WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency): Deleted. 2017-01-20 Matthew Hanson Merge r210939. rdar://problem/29885052 2017-01-19 Chris Dumez Make sure HTML validation bubble gets dismissed when its associated element's frame gets detached https://bugs.webkit.org/show_bug.cgi?id=167215 Reviewed by Andreas Kling. Make sure HTML validation bubble gets dismissed when its associated element's frame gets detached and that we do not crash. * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: (WebKit::WebValidationMessageClient::documentDetached): * WebProcess/WebCoreSupport/WebValidationMessageClient.h: 2017-01-18 Matthew Hanson Merge r210861. rdar://problem/30015304 2017-01-18 Megan Gardner Ignore Connection Assertion if we are not using connection to send messages https://bugs.webkit.org/show_bug.cgi?id=167022 Reviewed by Darin Adler. Ask the process about a particular connection rather that getting it and making the comparison ourselves. * UIProcess/ChildProcessProxy.h: (WebKit::ChildProcessProxy::hasConnection): Check to see the the ProcessProxy has this particular connection. This get around the assert that we would run into when just requesting the connection directly. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType): Use the new check instead of getting the raw connection. 2017-01-18 Matthew Hanson Merge r210753. rdar://problem/29883469 2017-01-13 Chris Dumez [WK2] Add diagnostic logging to measure WebGL usage https://bugs.webkit.org/show_bug.cgi?id=166730 Reviewed by Alex Christensen. Add diagnostic logging to measure high performance WebGL usage. We report at regular intervals in which WebGL state Safari is: - Inactive - ActiveInForegroundTab - ActiveInBackgroundTabOnly This should give us an estimate of: - What % of the time is Safari using high performance graphics - What % of this time is only due to background tabs * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: Added. (WebKit::HighPerformanceGraphicsUsageSampler::HighPerformanceGraphicsUsageSampler): (WebKit::HighPerformanceGraphicsUsageSampler::timerFired): * UIProcess/HighPerformanceGraphicsUsageSampler.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::setIsUsingHighPerformanceWebGL): (WebKit::WebPageProxy::isUsingHighPerformanceWebGL): * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::m_highPerformanceGraphicsUsageSampler): * UIProcess/WebProcessPool.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_userInterfaceLayoutDirection): 2017-01-18 Matthew Hanson Merge r210827. rdar://problem/28620865 2017-01-17 Brady Eidson An update to one gamepad's values should only change that gamepad's modified timestamp. and https://bugs.webkit.org/show_bug.cgi?id=167139 Reviewed by Andy Estes. Track the lastModifiedTime for a gamepad in the UI process, and pass it along to web processes. * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::GamepadData): (WebKit::GamepadData::encode): (WebKit::GamepadData::decode): * Shared/Gamepad/GamepadData.h: (WebKit::GamepadData::lastUpdateTime): * UIProcess/Gamepad/UIGamepad.cpp: (WebKit::UIGamepad::UIGamepad): (WebKit::UIGamepad::updateFromPlatformGamepad): (WebKit::UIGamepad::condensedGamepadData): (WebKit::UIGamepad::fullGamepadData): * UIProcess/Gamepad/UIGamepad.h: * WebProcess/Gamepad/WebGamepad.cpp: (WebKit::WebGamepad::updateValues): 2017-01-18 Matthew Hanson Merge r210761. rdar://problem/29544024 2017-01-13 Brady Eidson Crash when visiting a webpage that uses Gamepads in a new WebProcess after a previous page has used gamepads.. https://bugs.webkit.org/show_bug.cgi?id=167033 Reviewed by Alex Christensen. * UIProcess/Gamepad/UIGamepadProvider.cpp: (WebKit::UIGamepadProvider::processPoolStartedUsingGamepads): Don't schedule a state update here. (WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads): Ditto. * UIProcess/Gamepad/UIGamepadProvider.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::startedUsingGamepads): Populate the WebProcess with initial gamepads. 2017-01-18 Matthew Hanson Merge r210829. rdar://problem/30044439 2017-01-17 Filip Pizlo JSCell::classInfo() shouldn't have a bunch of mitigations for being called during destruction https://bugs.webkit.org/show_bug.cgi?id=167066 Reviewed by Keith Miller and Michael Saboff. Just remove now-erroneous use of jsCast<>. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::finalize): 2017-01-18 Matthew Hanson Merge r210822. rdar://problem/15607819 2017-01-17 Joseph Pecoraro Crash when closing tab with debugger paused https://bugs.webkit.org/show_bug.cgi?id=161746 Reviewed by Brian Burg and Brent Fulgham. * WebProcess/WebPage/WebPage.cpp: (WebKit::DeferredPageDestructor::createDeferredPageDestructor): (WebKit::DeferredPageDestructor::DeferredPageDestructor): (WebKit::DeferredPageDestructor::tryDestruction): (WebKit::WebPage::close): Defer destruction of the Page and WebPage if we are in a nested runloop. Also, proactively close all inspector frontends, including remote frontends. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): (WebKit::WebPage::completeSyntheticClick): Return early in some cases where a nested run loop may have closed the WebPage on us while handling JavaScript events. 2017-01-13 Matthew Hanson Rollout r210726. rdar://problem/29428877 2017-01-12 Matthew Hanson Merge r209189. rdar://problem/29428877 2016-12-01 Antti Koivisto Revert r208931 https://bugs.webkit.org/show_bug.cgi?id=164924 PLT regression. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeCacheKey): (WebKit::NetworkCache::Cache::makeCacheKey): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: (WebKit::NetworkCache::BlobStorage::BlobStorage): (WebKit::NetworkCache::BlobStorage::add): (WebKit::NetworkCache::BlobStorage::get): * NetworkProcess/cache/NetworkCacheBlobStorage.h: * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::computeSHA1): (WebKit::NetworkCache::makeSalt): Deleted. (WebKit::NetworkCache::readOrMakeSalt): Deleted. * NetworkProcess/cache/NetworkCacheData.h: * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::noPartitionString): (WebKit::NetworkCache::Key::Key): (WebKit::NetworkCache::Key::hasPartition): (WebKit::NetworkCache::Key::computeHash): (WebKit::NetworkCache::Key::hashAsString): (WebKit::NetworkCache::Key::computePartitionHash): Deleted. * NetworkProcess/cache/NetworkCacheKey.h: (WebKit::NetworkCache::Key::hash): (WebKit::NetworkCache::Key::partitionHash): Deleted. (WebKit::NetworkCache::Key::hashAsString): Deleted. (WebKit::NetworkCache::Key::partitionHashAsString): Deleted. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::makeSubresourcesKey): (WebKit::NetworkCache::constructRevalidationRequest): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::open): (WebKit::NetworkCache::traverseRecordsFiles): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::recordDirectoryPathForKey): (WebKit::NetworkCache::decodeRecordHeader): (WebKit::NetworkCache::Storage::readRecord): (WebKit::NetworkCache::Storage::encodeRecord): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::makeSaltFilePath): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::salt): Deleted. 2017-01-12 Matthew Hanson Merge r209554. rdar://problem/29428877 2016-12-08 Antti Koivisto Salt network cache hashes https://bugs.webkit.org/show_bug.cgi?id=164924 Reviewed by Alex Christensen. To enhance privacy make cache content unidentifiable from file names alone. This is done by generating a unique persistent salt for each cache instance. It is used when computing hashes used in file names. The patch also replaces plain text partition directory names with salted hashes. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::makeCacheKey): (WebKit::NetworkCache::makeCacheKey): Deleted. * NetworkProcess/cache/NetworkCache.h: Increment cache version. * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: (WebKit::NetworkCache::BlobStorage::BlobStorage): (WebKit::NetworkCache::BlobStorage::add): (WebKit::NetworkCache::BlobStorage::get): Use salt for blob content hash. * NetworkProcess/cache/NetworkCacheBlobStorage.h: * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::computeSHA1): For simplicity all SHA1s are now salted. (WebKit::NetworkCache::makeSalt): (WebKit::NetworkCache::readOrMakeSalt): Read salt if it exists, generate and persist it otherwise. * NetworkProcess/cache/NetworkCacheData.h: * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::Key::Key): Remove the "No partition" string and just empty. That was only needed to have a directory name of some sort. (WebKit::NetworkCache::Key::computeHash): Use salt for key hash. (WebKit::NetworkCache::Key::computePartitionHash): Separate hash for partition. * NetworkProcess/cache/NetworkCacheKey.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::makeSubresourcesKey): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::makeSaltFilePath): (WebKit::NetworkCache::Storage::open): Cache can't be opened if we can't read or persist a salt. (WebKit::NetworkCache::traverseRecordsFiles): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::synchronize): (WebKit::NetworkCache::Storage::recordDirectoryPathForKey): Use the partition hash in the directory name instead of a plain text name. (WebKit::NetworkCache::decodeRecordHeader): (WebKit::NetworkCache::Storage::readRecord): (WebKit::NetworkCache::Storage::encodeRecord): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::Storage::clear): * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::salt): 2017-01-12 Matthew Hanson Merge r210586. rdar://problem/29861147 2017-01-11 Chris Dumez [iOS][WK2] KeyboardEvent.key always returns an empty string https://bugs.webkit.org/show_bug.cgi?id=166918 Reviewed by Wenson Hsieh. Make sure that KeyboardEvent.key gets properly initialized on iOS / WK2. * Shared/WebEvent.h: * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): * Shared/ios/WebIOSEventFactory.mm: (WebIOSEventFactory::createWebKeyboardEvent): 2017-01-12 Matthew Hanson Merge r210689. rdar://problem/29985957 2017-01-12 Chris Dumez [iOS] HTML form validation popover sometimes does not go away https://bugs.webkit.org/show_bug.cgi?id=166990 Reviewed by Tim Horton. Update code using ValidationBubble now that it is RefCounted. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::createValidationBubble): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::createValidationBubble): 2017-01-12 Matthew Hanson Merge r210687. rdar://problem/29388806 2017-01-12 Enrica Casucci Do not allow selection of editable content when not editing. https://bugs.webkit.org/show_bug.cgi?id=166897 Reviewed by Tim Horton. Test: fast/events/touch/ios/long-press-on-editable.html When retrieving the position information, we should not consider as candidates for selection editable elements, since this is only used for non editable selections. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::isAssistableElement): Moved within the file. (WebKit::WebPage::getPositionInformation): 2017-01-12 Matthew Hanson Merge r210683. rdar://problem/11187315 2017-01-12 Megan Gardner Double Check URLs on UI side before putting in pasteboard https://bugs.webkit.org/show_bug.cgi?id=166945 Reviewed by Tim Horton. Check URLs sent from the web process before putting the on pasteboard. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType): Add a check to make sure the URLs we've received are valid and not compromising to the user's system. * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::addWebProcessProxy): Keep track of the webProcesses associated with the pasteboard proxies specifically, so that we can use it to check the URLs before putting them on pasteboard. (WebKit::WebPasteboardProxy::removeWebProcessProxy): Remove dead webProcesses. * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: Allow for the connection to be passed in, so that we can determine which webProcess we need to check the URLs of. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::~WebProcessProxy): Make sure to remove WebProcessProxys from the list stored in WebPasteboardProxy 2017-01-12 Matthew Hanson Merge r210666. rdar://problem/28904157 2017-01-12 Andreas Kling WebBackForwardListProxy should remove restored session history items from PageCache on close. Reviewed by Brady Eidson. Register history item ID's from the UIProcess with the associated-items map so that we can remove any PageCache entries associated with them immediately when closing a WebPage. Otherwise they might not get removed until the next PageCache pruning happens. This patch is a speculative fix for what looks like it might be weirdness related to a PageCache entry outliving its originating Page. * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItemFromUIProcess): * WebProcess/WebPage/WebBackForwardListProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::restoreSessionInternal): 2017-01-12 Matthew Hanson Merge r210619. rdar://problem/27745004 2017-01-11 Brent Fulgham [WK2][Cocoa] Avoid null dereference in FullScreen code. https://bugs.webkit.org/show_bug.cgi?id=166957 Reviewed by Eric Carlson. * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::didSetupFullscreen): Use protected reference to 'this', and check for valid page before attempting to use it. 2017-01-12 Matthew Hanson Merge r210596. rdar://problem/29757269 2017-01-11 Anders Carlsson REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_ptr >) + 27 https://bugs.webkit.org/show_bug.cgi?id=165854 rdar://problem/29757269 Reviewed by Tim Horton. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::sendMessage): Add assertion. (IPC::Connection::initializeSendSource): Turns out the event handler can be called spuriously, so guard against that. 2017-01-12 Matthew Hanson Merge r210525. rdar://problem/29931470 2017-01-09 Enrica Casucci Selection animation flashing on editable content when zooming. https://bugs.webkit.org/show_bug.cgi?id=166863 rdar://problem/29931470 Reviewed by Tim Horton. Implementing _allowAnimatedUpdateSelectionRectView and returning NO, prevents the selection animation in UIKit. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _allowAnimatedUpdateSelectionRectViews]): 2017-01-12 Matthew Hanson Merge r210281. rdar://problem/29849769 2017-01-04 Jeremy Jones Release pointer lock when page state is reset for any reason, not just for process exited. https://bugs.webkit.org/show_bug.cgi?id=166654 Reviewed by Tim Horton. Pointer lock was not being released when the window is closed. Move the pointer lock to resetState() so it happens whenever the page is reset, not just when it is reset after process exit. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): Release here. (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't release here. 2017-01-06 Matthew Hanson Merge r210221. rdar://problem/29449474 2017-01-01 Jeff Miller Update user-visible copyright strings to include 2017 https://bugs.webkit.org/show_bug.cgi?id=166278 Reviewed by Dan Bernstein. * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist: * Info.plist: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: 2017-01-05 Matthew Hanson Merge r210363. rdar://problem/19595567 2017-01-05 Enrica Casucci Unreviewed build fix after https://trac.webkit.org/changeset/210360 * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::performDragOperation): 2017-01-05 Matthew Hanson Merge r210360. rdar://problem/19595567 2017-01-05 Enrica Casucci Support File Promise during drag for macOS. https://bugs.webkit.org/show_bug.cgi?id=165204 rdar://problem/19595567 Reviewed by Tim Horton. Adds support for dropping a File Promise in a WKWebView. The implementation uses new File Promise API available in Sierra. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/mac/PasteboardTypes.mm: (WebKit::PasteboardTypes::forURL): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded): (WebKit::WebViewImpl::performDragOperation): (WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted. (WebKit::createSandboxExtensionsForFileUpload): Deleted. 2017-01-05 Matthew Hanson Merge r210266. rdar://problem/29447824 2017-01-03 Tim Horton NSSpellChecker's recordResponse isn't called for unseen automatic corrections https://bugs.webkit.org/show_bug.cgi?id=166450 Reviewed by Darin Adler. * UIProcess/mac/CorrectionPanel.h: * UIProcess/mac/CorrectionPanel.mm: (WebKit::CorrectionPanel::recordAutocorrectionResponse): (WebKit::CorrectionPanel::handleAcceptedReplacement): Funnel all calls to recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag: through recordAutocorrectionResponse, for debugging's sake. Drop the NSView parameter because we don't need it, just the tag. * UIProcess/mac/PageClientImpl.mm: (WebKit::toCorrectionResponse): (WebKit::PageClientImpl::recordAutocorrectionResponse): Convert the new AutocorrectionResponseType value to its corresponding NSCorrectionResponse value. 2017-01-05 Matthew Hanson Merge r210118. rdar://problem/29732407 2016-12-22 Tim Horton Null deref under WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground https://bugs.webkit.org/show_bug.cgi?id=166433 Reviewed by Daniel Bates. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground): m_drawingArea can be null if the process is not valid. 2017-01-05 Matthew Hanson Merge r210041. rdar://problem/29593525 2016-12-20 Simon Fraser [iOS WK2] Switching or closing a tab leads to all-white tab content if the status bar is double height https://bugs.webkit.org/show_bug.cgi?id=166286 rdar://problem/29593525 Reviewed by Tim Horton. A double-height status bar triggers view resize while snapshotting in the background, which also triggers calls to _endAnimatedResize on tab resume. However, it was possible for _endAnimatedResize to re-enter via synchronizeDynamicViewportUpdate()/didCommitLayerTree(), causing us to use a nil _resizeAnimationView for scale computations, thus setting a zero scale on the WKContentView. Fix by checking _dynamicViewportUpdateMode again after the call to synchronizeDynamicViewportUpdate(), and do a belt-and-braces check for a nil _resizeAnimationView. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _endAnimatedResize]): 2017-01-05 Matthew Hanson Merge r209995. rdar://problem/29626731 2016-12-19 Anders Carlsson REGRESSION: Crash in com.apple.WebKit:IPC::Connection::platformCanSendOutgoingMessages() const + 0 https://bugs.webkit.org/show_bug.cgi?id=165817 rdar://problem/29626731 Reviewed by Dan Bernstein. If the receive right is invalidated before we send the message, the kernel won't be able to create a send right, and we'll crash due to mach_msg returning MACH_SEND_INVALID_RIGHT. Fix this by immediately creating a send right, and passing MACH_MSG_TYPE_MOVE_SEND to the attachment constructor. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openFrontendConnection): 2016-12-20 Babak Shafiei Merge r210031. 2016-12-20 Andy Estes [Cocoa] REGRESSION (r209558): Calling decisionHandler multiple times in webView:decidePolicyForNavigationAction:decisionHandler: leads to a crash https://bugs.webkit.org/show_bug.cgi?id=165992 Reviewed by Brady Eidson. r209558 added additional move semantics to the decisionHandler block passed to -webView:decidePolicyForNavigationAction:decisionHandler:, resulting in a null pointer dereference in clients that call the decisionHandler block more than once. None of the completion handlers we expose in the WebKit API are intended to be called more than once, and we ASSERT in CompletionHandlerCallChecker::didCallCompletionHandler() that this doesn't happen. This change strenghtens that protection by returning immediately in completion handlers called more than once. And in programs linked on or after WebKit 603.1.17, an NSException is thrown if a completion handler is called a second time, like we do for completion handlers that are never called. New API test: WebKit2.DuplicateCompletionHandlerCalls * Shared/Cocoa/CompletionHandlerCallChecker.h: Declared completionHandlerHasBeenCalled(). * Shared/Cocoa/CompletionHandlerCallChecker.mm: (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall): Added. Returns true if the program is linked on or after LibraryVersion::FirstWithExceptionsForDuplicateCompletionHandlerCalls. (WebKit::CompletionHandlerCallChecker::completionHandlerHasBeenCalled): Added. Returns whether or not the completion handler has been called. If it has, and shouldThrowExceptionForDuplicateCompletionHandlerCall() returns true, throws an NSInternalInconsistencyException. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): Added an early return if the completion handler has already been called. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): Ditto. (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): Ditto. (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): Ditto. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::runJavaScriptAlert): Ditto. (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): Ditto. (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): Ditto. (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Ditto. (WebKit::UIDelegate::UIClient::runOpenPanel): Ditto. (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): Ditto. * UIProcess/Cocoa/VersionChecks.h: Added FirstWithExceptionsForDuplicateCompletionHandlerCalls with the version number for 603.1.17. 2016-12-19 Dean Jackson Another feature toggle for rdar://problem/29466493. 2016-12-19 Dean Jackson Enable Gamepad by default. * Shared/WebPreferencesDefinitions.h: 2016-12-19 Dean Jackson Merge another patch for rdar://problem/29466493. 2016-12-19 Dean Jackson Disable some features on the safari-603-branch. * Configurations/FeatureDefines.xcconfig: 2016-12-19 Babak Shafiei Merge patch for rdar://problem/29466493. 2016-12-19 Dean Jackson Disable some features on the safari-603-branch. - Force the default state of experimental features to off. - Move some experimental features that should be enabled on this branch into the general feature list, so they can't be disabled. - Disable some features that are not ready. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: 2016-12-18 Simon Fraser Expose a way for MiniBrowser to simulate header and footer banners https://bugs.webkit.org/show_bug.cgi?id=166005 Reviewed by Wenson Hsieh. Expose testing SPI that allows a client to simulate the presence of header and footer banners. These are simply plumbed through to set FrameView's m_headerHeight and m_footerHeight. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setHeaderBannerHeightForTesting:]): (-[WKWebView _setFooterBannerHeightForTesting:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setHeaderBannerHeightForTesting): (WebKit::WebPageProxy::setFooterBannerHeightForTesting): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setHeaderBannerHeightForTesting): (WebKit::WebPage::setFooterBannerHeightForTesting): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-12-16 Dave Hyatt [CSS Values] Make separate wrapper classes for the deprecated CSS Values OM https://bugs.webkit.org/show_bug.cgi?id=165968 Reviewed by Andreas Kling. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp: (WebKit::kit): (WebKit::core): (WebKit::wrapCSSValue): (webkit_dom_css_value_constructor): (webkit_dom_css_value_get_css_text): (webkit_dom_css_value_set_css_text): (webkit_dom_css_value_get_css_value_type): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h: 2016-12-17 Wenson Hsieh Visual viewports: bottom fixed elements disappear behind the keyboard https://bugs.webkit.org/show_bug.cgi?id=165983 Reviewed by Simon Fraser. Accounts for input view bounds in WebPageProxy::computeCustomFixedPositionRect. To do this, we introduce and pass unobscuredContentRectRespectingInputViewBounds along with the regular unobscuredContentRect (which does not respect the obscuring keyboard rect). This unobscuredContentRectRespectingInputViewBounds is then used when computing the origin of the updated layout viewport rect (and also, when we are _not_ below minimum scale), Additionally, the size is computed using the (unconstrained) unobscured rect. This is because we previously would use the document-constrained version of the unobscured rect, which caused the layout viewport to shrink when approaching the max scroll extents of the document while the keyboard is up, since the unobscured rect would spill out of the document rect. However, using this unconstrained rect's size also means that if the user rubber-bands out of the document rect, we would end up pushing the layout viewport rect out of the document, with no way of adjusting it back in without the user scrolling to push the layout viewport into back document bounds. To address this, we move the layout rect to be within document bounds after computing its size and location. Added a new layout test: fast/visual-viewport/ios/fixed-element-on-bottom-with-keyboard.html, and also tweaked fixed-caret-position-after-scroll.html to cover these changes. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::unobscuredContentRectRespectingInputViewBounds): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateContentRectsWithState:]): (-[WKWebView _inputViewBounds]): Returns the current bounds of the input view. For testing purposes. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::unobscuredContentRectRespectingInputViewBounds): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]): Helper to compute the unobscured rect, accounting for the bounds of the current input view. (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView _didCommitLayerTree:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeCustomFixedPositionRect): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 2016-12-16 Ryosuke Niwa Deleting a character converted from pinyin after an image causes a Safari crash https://bugs.webkit.org/show_bug.cgi?id=165839 Reviewed by Darin Adler. The crash was caused by the payload of the IPC not being decoded correctly when the encoded attributed string contains a NSTextAttachment but send<> would still gladly send it to the UIProcess. Fixed it by omitting the image as done in r176412 since encoding NSFileWrapper, etc... would require quite a bit of work, and IME doesn't really need to see the image in its attributed string. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::attributedSubstringForCharacterRangeAsync): Fixed the bug. 2016-12-16 Andy Estes Add a setting to suppress keyboard input during provisional navigation https://bugs.webkit.org/show_bug.cgi?id=165830 Reviewed by Brent Fulgham. * Shared/WebPreferencesDefinitions.h: Defined shouldSuppressKeyboardDOMEventsDuringProvisionalNavigation. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added. (WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added. * UIProcess/API/C/WKPreferencesRefPrivate.h: Declared a getter and setter for the new preference. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]): Added. (-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]): Added. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared a property for the new preference. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Mapped the new preference to its corresponding WebCore::Setting. 2016-12-16 Chris Dumez HTML form validation bubble should be dismissed on navigation https://bugs.webkit.org/show_bug.cgi?id=165960 Reviewed by Simon Fraser. Dismiss HTML form validation bubble on top-level navigation on WK2. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): 2016-12-16 Jer Noble Small refactor: Use HashCountedSet rather than HashMap<..., int> to store client counts in WebPlaybackSessionManager{,Proxy}. https://bugs.webkit.org/show_bug.cgi?id=165807 Reviewed by Eric Carlson. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionManagerProxy::addClientForContext): (WebKit::WebPlaybackSessionManagerProxy::removeClientForContext): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionManager::addClientForContext): (WebKit::WebPlaybackSessionManager::removeClientForContext): 2016-12-16 Wenson Hsieh Visual viewports: carets and selection UI are incorrectly positioned when editing fixed elements https://bugs.webkit.org/show_bug.cgi?id=165767 Reviewed by Simon Fraser. When focusing an input, the position of the caret on iOS is determined by the overridden layout viewport rect in the web process. However, this rect is not updated until the end the scroll gesture. Whereas this is fine for non-fixed inputs since their document location does not change, fixed inputs effectively change their position in the document as the user scrolls. This causes the caret to be 'left behind' in the document position it was in at the start of the scroll. To fix this, we deactivate the selection when exiting stable state if the assisted node is in a fixed position container, and reenable it upon receiving the next stable state EditorState update (as indicated by postLayoutData().isStableStateUpdate). Additionally, we apply similar treatment to the web selection assistant -- this time, we need to force the selection view to hide (analagous to deactivating the text selection assistant) and show it again upon receiving the next selection change update when the WebPage (in the web process) is stable. Furthermore, adds test support for querying text caret and selection rects, as well as perform a callback after the WebPage has indicated that it is stable, both as SPI on the WKWebView. Covered by 4 new layout tests in fast/editing/caret/ios and fast/editing/selection/ios. * Platform/spi/ios/UIKitSPI.h: * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: Introduce isStableStateUpdate, which is true when the WebPage is known to be in stable state, as well as insideFixedPosition, which is true when the current selection is inside a fixed position container. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::isInStableState): (WebKit::RemoteLayerTreeTransaction::setIsInStableState): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): (WebKit::RemoteLayerTreeTransaction::description): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _uiTextCaretRect]): Introduced a new SPI method for fetching the current rect of the text assistant's caret view, at keyPath "selectionView.selection.caretRect". (-[WKWebView _uiTextSelectionRects]): Renamed (and refactored) from _uiTextSelectionRectViews, which was previously fetching an array of UIViews. I found this to cause character-granularity-rect.html to fail due to the array of UIViews here being empty, so I refactored this to simply return an array of rects from the keyPath "selectionView.selection.selectionRects" for the text selection assistant and @"selectionView.selectionRects" for the web selection assistant. (-[WKWebView _doAfterNextStablePresentationUpdate:]): Runs the given block after both the UI process and web processes agree that the visible content rect state is stable. To do this, we fire presentation updates until the UI process (via RemoteLayerTreeTransactions) discovers that the web page is in stable state. This is used solely for testing purposes. (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]): (-[WKWebView _uiTextSelectionRectViews]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::inStableState): * UIProcess/ios/WKContentView.mm: (-[WKContentView _didExitStableState]): Deactivate the text selection if the assisted node is inside a fixed container. (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView shouldHideSelectionWhenScrolling]): (-[WKContentView _uiTextSelectionRects]): (-[WKContentView _didEndScrollingOrZooming]): (-[WKContentView _updateChangedSelection:]): If the EditorState was created after a stable state update, reactivate the text selection assistant if it exists. Additionally, if we are deferring the end scrolling selection update until after the first stable editor state update arrives from the web process, we need to also call [_textSelectionAssistant didEndScrollingOverflow] and [_webSelectionAssistant didEndScrollingOrZoomingPage] here instead of doing so immediately after scrolling finishes. This ensures that selection UI (the callout and selection highlights) do not flicker from their old position to the new position when scrolling finishes. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willCommitLayerTree): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState): (WebKit::WebPage::updateVisibleContentRects): When updating the layout viewport override rect, also recompute the caret if needed and send an updated EditorState over to the UI process. 2016-12-16 Claudio Saavedra [WK2] SharedMemory: include cleanups https://bugs.webkit.org/show_bug.cgi?id=165950 Reviewed by Žan Doberšek. The WTFString include is not needed in the header, so move to the Unix file. Use the existing UNIX_DOMAIN_SOCKETS define. Also include the WTFOptional header where needed. * Platform/SharedMemory.h: * Platform/unix/SharedMemoryUnix.cpp: 2016-12-16 Joonghun Park [EFL] Fix build break since r209907. Unreviewed. https://bugs.webkit.org/show_bug.cgi?id=165954 * UIProcess/efl/TextCheckerEfl.cpp: Change the remaining TextBreakIterator to UBreakIterator (WebKit::nextWordOffset): (WebKit::TextChecker::checkTextOfParagraph): 2016-12-15 Darin Adler Use asString instead of toWTFString, toString, or getString when we already checked isString https://bugs.webkit.org/show_bug.cgi?id=165895 Reviewed by Yusuke Suzuki. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): Use asString/value instead of toWTFString. 2016-12-15 Chris Dumez Make sure HTML validation bubble's state is updated after layout https://bugs.webkit.org/show_bug.cgi?id=165922 Reviewed by Simon Fraser. Make sure HTML validation bubble's state is updated after layout. In particular, if the validation bubble's associated element has moved or is no longer visible, we now hide the bubble. * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: (WebKit::WebValidationMessageClient::showValidationMessage): (WebKit::WebValidationMessageClient::hideValidationMessage): (WebKit::WebValidationMessageClient::updateValidationBubbleStateIfNeeded): * WebProcess/WebCoreSupport/WebValidationMessageClient.h: 2016-12-15 Alex Christensen Improve NetworkSession logging https://bugs.webkit.org/show_bug.cgi?id=165941 Reviewed by Tim Horton. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): One of the "didReceiveResponse completionHandler (cancel)" messages was wrong, and other messages could have more useful information without being overwhelming. 2016-12-15 Myles C. Maxfield Sort Xcode project files https://bugs.webkit.org/show_bug.cgi?id=165937 Reviewed by Simon Fraser. * WebKit2.xcodeproj/project.pbxproj: 2016-12-15 Anders Carlsson Add more mach_msg logging instrumentation https://bugs.webkit.org/show_bug.cgi?id=165914 Reviewed by Darin Adler. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::sendMessage): (IPC::Connection::sendOutgoingMessage): * Platform/IPC/mac/MachMessage.h: (IPC::MachMessage::messageName): (IPC::MachMessage::setMessageName): 2016-12-15 Konstantin Tokarev Added missing override and final specifiers https://bugs.webkit.org/show_bug.cgi?id=165903 Reviewed by Darin Adler. * UIProcess/API/gtk/WebKitGeolocationProvider.h: * UIProcess/WebFormSubmissionListenerProxy.h: * UIProcess/WebFramePolicyListenerProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.h: * WebProcess/MediaCache/WebMediaKeyStorageManager.h: * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: * WebProcess/WebCoreSupport/WebPlugInClient.h: * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h: * WebProcess/WebPage/FindController.h: 2016-12-15 Simon Fraser [iOS WK2] Don't disable position:fixed when a form element has focus https://bugs.webkit.org/show_bug.cgi?id=165891 rdar://problem/29271694 Reviewed by Wenson Hsieh. Before visual viewports, we had to lay out position:fixed relative to the document rect (effectively disabling position:fixed) when a form element was focused, to ensure that we could scroll to inputs inside position:Fixed. When visual viewports are enabled, we can do a better job of this, and keep position:fixed active. Test: fast/visual-viewport/ios/zoomed-focus-in-fixed.html * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Soon this will use insideFixed to have better scroll-into-view behavior. (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): (-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _displayFormNodeInputView]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeCustomFixedPositionRect): Don't fall back to using the documentRect as the fixed position rect if visual viewports are enabled. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): Don't reset the customtFixedPositionRect around computing element coordinates if visual viewports are enabled. 2016-12-15 Andreas Kling Always clear RenderLayer backing stores when going into page cache. Reviewed by Simon Fraser. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): 2016-12-15 Darin Adler Remove custom binding for MediaDevices https://bugs.webkit.org/show_bug.cgi?id=165894 Reviewed by Eric Carlson. * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: Added include of MediaConstraintsImpl.h, now needed because we removed some unneeded includes from the WebCore headers. 2016-12-15 Dave Hyatt [CSS Parser] Enable CSS Deferred Parsing https://bugs.webkit.org/show_bug.cgi?id=165869 Reviewed by Sam Weinig. * Shared/WebPreferencesDefinitions.h: 2016-12-14 Andreas Kling Only send Messages::WebPageProxy::DidSaveToPageCache once when entering page cache. Reviewed by Brady Eidson. We were sending one of these IPC messages per frame when a page enters the page cache, and we really only need one, so only do it for the main frame. (This message is used to adopt the page cache on the UI process side, in case another web process currently owns the cache. That happens in WebProcessPool::processDidCachePage().) * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::didSaveToPageCache): 2016-12-14 Simon Fraser Fix cause of viewport-related flakiness in iOS tests https://bugs.webkit.org/show_bug.cgi?id=165878 Reviewed by Tim Horton. When TestController::platformConfigureViewForTest() changes the view size for a flexible viewport test, the page would not have updated with the new scale by the time the load event fired, causing flakiness depending on test order. This was caused by code added in r170325 that delayed visible content rect updates until after the UI process has received the transaction after didCommitLoad. So fix by overriding this mechanism if the view has been resized. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::isFirstUpdateForNewViewSize): (WebKit::operator==): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _updateContentRectsWithState:]): * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::setSize): * UIProcess/DrawingAreaProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2016-12-04 Sam Weinig [WebIDL] Add support for converting dictionaries to JS https://bugs.webkit.org/show_bug.cgi?id=165367 Reviewed by Chris Dumez. * CMakeLists.txt: Add missing directories to look in for headers. 2016-12-14 Anders Carlsson Add WKContextRefreshPlugIns https://bugs.webkit.org/show_bug.cgi?id=165879 rdar://problem/29602414 Reviewed by Tim Horton. * UIProcess/API/C/WKContext.cpp: (WKContextRefreshPlugIns): * UIProcess/API/C/WKContext.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::refreshPlugins): * UIProcess/WebProcessPool.h: * WebProcess/Plugins/WebPluginInfoProvider.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::refreshPlugins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2016-12-14 Tim Horton API Test Fullscreen.TopContentInset is asserting on Yosemite https://bugs.webkit.org/show_bug.cgi?id=165877 Reviewed by Brady Eidson. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setTopContentInset): * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: We don't use fences on Yosemite, but this codepath still tried to. Instead of guarding with PLATFORM(COCOA), make use of the more accurate HAVE(COREANIMATION_FENCES) guard. 2016-12-14 Anders Carlsson Add some instrumentation to try to detect a crash on the bots https://bugs.webkit.org/show_bug.cgi?id=165866 Reviewed by Sam Weinig. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::sendMessage): 2016-12-14 Dave Hyatt [CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes https://bugs.webkit.org/show_bug.cgi?id=165743 Reviewed by Dean Jackson. Repurpose the newCSSParserEnabled preference for deferred parsing. Just change the name from "new" to "deferred." * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDeferredCSSParserEnabled): (WKPreferencesGetDeferredCSSParserEnabled): (WKPreferencesSetNewCSSParserEnabled): Deleted. (WKPreferencesGetNewCSSParserEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-12-14 Brent Fulgham Unreviewed test fix after r209806. Plugin-common doesn't define 'home-subpath'. Instead it has 'home-library-subpath'. Switch to the correct function. Also, 'home-library-subpath' adds '/Library' to the path, so revise the arguments so that we do not generate paths like '/home/username/Library/Library/Keychains'. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2016-12-14 Brent Fulgham Unreviewed test fix after r209779. The 'Keygen' element requires the ability to create new keys in '$HOME/Library/Keychains'. Remove the WebProcess and Plugin sandbox restrictions on per-user Keychain creation to support this use. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2016-12-13 Yusuke Suzuki Use JSValue::toWTFString instead of calling toString(exec) and value(exec) https://bugs.webkit.org/show_bug.cgi?id=165795 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): 2016-12-14 Enrique Ocaña González REGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and crashes, bots exiting early https://bugs.webkit.org/show_bug.cgi?id=164022 Reviewed by Xabier Rodriguez-Calvar. * Shared/WebPreferencesDefinitions.h: New GStreamerEnabled preference, defaults to true. * WebProcess/WebPage/WebPage.cpp: Ditto. (WebKit::WebPage::updatePreferences): 2016-12-13 Commit Queue Unreviewed, rolling out r209792. https://bugs.webkit.org/show_bug.cgi?id=165841 Cause build failures (Requested by yusukesuzuki on #webkit). Reverted changeset: "Use JSValue::toWTFString instead of calling toString(exec) and value(exec)" https://bugs.webkit.org/show_bug.cgi?id=165795 http://trac.webkit.org/changeset/209792 2016-12-13 Yusuke Suzuki Use JSValue::toWTFString instead of calling toString(exec) and value(exec) https://bugs.webkit.org/show_bug.cgi?id=165795 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): 2016-12-13 Alex Christensen Fix CMake build. * PlatformMac.cmake: 2016-12-13 Jer Noble Fullscreen in WebKit2 does not restore topContentInset upon exiting; leaves top of page not visible https://bugs.webkit.org/show_bug.cgi?id=165697 Delegate the values of topContentInset() from WebViewImpl (used by WKWebView and WKView) to the WebPageProxy, so that setting the topContentInset() on WebPageProxy is reflected in the getters for the two view classes. Reviewed by Tim Horton. * UIProcess/Cocoa/WebViewImpl.h: (WebKit::WebViewImpl::topContentInset): Deleted. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateContentInsetsIfAutomatic): (WebKit::WebViewImpl::topContentInset): (WebKit::WebViewImpl::setTopContentInset): (WebKit::WebViewImpl::dispatchSetTopContentInset): * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): (-[WKFullScreenWindowController _saveTopContentInset]): Deleted. (-[WKFullScreenWindowController _restoreTopContentInset]): Deleted. 2016-12-13 Brent Fulgham [Mac][WK2] Tighten Keychain directory access https://bugs.webkit.org/show_bug.cgi?id=165818 Reviewed by Anders Carlsson. Lock down Keychain directory access to just the file-read-data, file-read-metadata, and file-write-data operations we actually need. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2016-12-13 Andy Estes [Cocoa] Implement -shouldInsertText: on WKWebProcessPlugInEditingDelegate https://bugs.webkit.org/show_bug.cgi?id=165785 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Defined WKEditorInsertAction and declared -_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction:. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (toWK): Added. Mapped a WebCore::EditorInsertAction to a WKEditorInsertAction. (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Implemented EditorClient::shouldInsertText() by calling -_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction: with the text, wrapped range handle, and action. Added shouldInsertText to DelegateMethods and initialized it according to whether the delegate responds to shouldInsertText:. 2016-12-13 Joseph Pecoraro NSArray leaks seen in Safari, allocated under WKIconDatabaseTryCopyCGImageArrayForURL https://bugs.webkit.org/show_bug.cgi?id=165809 Reviewed by Dan Bernstein. * UIProcess/API/C/cg/WKIconDatabaseCG.cpp: (WKIconDatabaseTryCopyCGImageArrayForURL): Avoid an extra retain on already newly created array. 2016-12-13 Eric Carlson Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag https://bugs.webkit.org/show_bug.cgi?id=165251 Reviewed by Youenn Fablet. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Update the media stream and peer connection runtime feature instead of the setting. 2016-12-13 Sergio Villar Senin Fix GTK build after r209733 https://bugs.webkit.org/show_bug.cgi?id=165794 Document::visibilityState() now returns an IDL string enumeration. Reviewed by Žan Doberšek. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp: (webkit_dom_document_get_visibility_state): 2016-12-12 Dean Jackson [iOS] MediaDocument "Done" button should navigate the page back https://bugs.webkit.org/show_bug.cgi?id=165779 Reviewed by Sam Weinig. * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenModelContext::requestFullscreenMode): (WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode): * WebProcess/cocoa/WebVideoFullscreenManager.h: * WebProcess/cocoa/WebVideoFullscreenManager.messages.in: * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::requestFullscreenMode): 2016-12-12 Tim Horton Provide SPI to avoid blocking on painting when coming into view https://bugs.webkit.org/show_bug.cgi?id=165780 Reviewed by Simon Fraser. By default, when parenting a WKWebView which was previously in-window, we block on painting to ensure that we don't flash stale content. We added SPI to disable this behavior to WKWebViewConfiguration, but some clients might want the behavior most of the time, but sometimes instead want to not block the UI process main thread, but instead do their own work (e.g. removing a snapshot) when painting eventually occurs. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Tell WebPageProxy not to block on painting next time we are parented, and use doAfterNextPresentationUpdate to call the block when the painting does eventually happen. This SPI must be called before - but in the same runloop cycle - the WKWebView is brought back in-window to work correctly. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dispatchActivityStateChange): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::skipWaitingForPaintAfterNextViewDidMoveToWindow): If we would block because we're coming in-window, but the bit to skip blocking the next time we get brought in-window is set, reset the bit, and avoid blocking. 2016-12-12 Chris Dumez Document.visibilityState should use an IDL string enumeration https://bugs.webkit.org/show_bug.cgi?id=165774 Reviewed by Daniel Bates. * Shared/API/c/WKSharedAPICast.h: (WebKit::toPageVisibilityState): 2016-12-11 Konstantin Tokarev Unreviewed attempt to fix EFL and Mac/cmake builds after r209665. https://bugs.webkit.org/show_bug.cgi?id=165686 * PlatformEfl.cmake: WebKit2 should precede other target so that right config.h comes first in include path. 2016-12-11 Tim Horton Quarter-second stalls scrolling images that are links because of sync getPositionInformation https://bugs.webkit.org/show_bug.cgi?id=165707 Reviewed by Simon Fraser. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView positionInformationForActionSheetAssistant:]): (-[WKContentView updatePositionInformationForActionSheetAssistant:]): For now, synchronously block when presenting the action sheet if we don't have a snapshot ready. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): Respect includeSnapshot in another place in getPositionInformation, so that many getPositionInformations don't have to do extra snapshotting work. 2016-12-10 Filip Pizlo The DOM should have an advancing wavefront opaque root barrier https://bugs.webkit.org/show_bug.cgi?id=165712 Reviewed by Yusuke Suzuki. Propagate the JSDOMWindowBase::commonVM() -> commonVM() change. * Shared/linux/WebMemorySamplerLinux.cpp: (WebKit::WebMemorySampler::sampleWebKit): * Shared/mac/WebMemorySampler.mac.mm: (WebKit::WebMemorySampler::sampleWebKit): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::javaScriptObjectsCount): * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::JSNPObject::put): (WebKit::JSNPObject::deleteProperty): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScriptInMainFrame): (WebKit::WebPage::getBytecodeProfile): (WebKit::WebPage::getSamplingProfilerOutput): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWebCoreStatistics): 2016-12-11 Konstantin Tokarev Unreviewed build fix for EFL after r209665 * UIProcess/efl/TextCheckerClientEfl.h: 2016-12-10 Konstantin Tokarev [cmake] Include WTF, JSC, and WebCore headers automatically to targers using them https://bugs.webkit.org/show_bug.cgi?id=165686 Reviewed by Michael Catanzaro. This change reduces duplication of include path lists between modules, and reduces future need for fixes like r209605 (broken build because of WebCore header suddenly becoming used in WebKit2). * CMakeLists.txt: * PlatformEfl.cmake: * PlatformGTK.cmake: * PlatformMac.cmake: 2016-12-10 Antti Koivisto CrashTracer: com.apple.WebKit.Networking at WTF::ThreadSafeRefCounted::deref https://bugs.webkit.org/show_bug.cgi?id=165659 Reviewed by Darin Adler. * NetworkProcess/cache/NetworkCacheIOChannel.h: * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: (WebKit::NetworkCache::IOChannel::~IOChannel): Add non-inlined destructor and release assert against double deletion to narrow down this crash. 2016-12-09 Brent Fulgham WebCore::Timer is not compatible with UIProcess https://bugs.webkit.org/show_bug.cgi?id=165706 Reviewed by Andy Estes. Anders has explained to me (at least twice) that WebCore::Timer must not be used in UIProcess code. A recent bug fix introduced a WebCore::Timer, which led to another crash. This patch switches from WebCore::Timer to WTF::RunLoop::Timer to avoid the problem. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationState): 2016-12-09 Eric Carlson Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag https://bugs.webkit.org/show_bug.cgi?id=165251 Reviewed by Dean Jackson. Based on a patch by Dr Alex Gouaillard * Shared/WebPreferencesDefinitions.h: Add peerConnectionEnabled. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPeerConnectionEnabled): Added. (WKPreferencesGetPeerConnectionEnabled): Added. * UIProcess/API/C/WKPreferencesRef.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Add WebKitMediaStreamEnabled and WebKitPeerConnectionEnabled. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Initialize the peerConnection preference. 2016-12-09 Brady Eidson Re-landing: Add _WKIconLoadingDelegate SPI. https://bugs.webkit.org/show_bug.cgi?id=164894 Reviewed by Alex Christensen. With this client, WebCore will ask the FrameLoaderClient about each icon found in the . WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load. For icons the app decides to load, WebKit will pass the data to the app without storing locally. * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h. (API::IconLoadingClient::~IconLoadingClient): (API::IconLoadingClient::getLoadDecisionForIcon): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _iconLoadingDelegate]): (-[WKWebView _setIconLoadingDelegate:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h. * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h. * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h. (-[_WKLinkIconParameters _initWithLinkIcon:]): (-[_WKLinkIconParameters url]): (-[_WKLinkIconParameters mimeType]): (-[_WKLinkIconParameters size]): (-[_WKLinkIconParameters iconType]): * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h. * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h. * UIProcess/Cocoa/IconLoadingDelegate.mm: Added. (WebKit::IconLoadingDelegate::IconLoadingDelegate): (WebKit::IconLoadingDelegate::~IconLoadingDelegate): (WebKit::IconLoadingDelegate::createIconLoadingClient): (WebKit::IconLoadingDelegate::delegate): (WebKit::IconLoadingDelegate::setDelegate): (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient): (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient): (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setIconLoadingClient): (WebKit::WebPageProxy::getLoadDecisionForIcon): (WebKit::WebPageProxy::finishedLoadingIcon): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::iconLoadingClient): * UIProcess/WebPageProxy.messages.in: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::useIconLoadingClient): (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): (WebKit::WebFrameLoaderClient::finishedLoadingIcon): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: (WebKit::WebFrameLoaderClient::setUseIconLoadingClient): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didGetLoadDecisionForIcon): (WebKit::WebPage::setUseIconLoadingClient): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-12-09 Simon Fraser Fix initialization of contentUpdateFrequency https://bugs.webkit.org/show_bug.cgi?id=165705 rdar://problem/29602039 Reviewed by Tim Horton. The value that controls web content update frequency was not being initialized. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): 2016-12-09 Anders Carlsson Once we can send Mach messages again, make sure to send any pending outgoing messages https://bugs.webkit.org/show_bug.cgi?id=165693 Reviewed by Brady Eidson. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::initializeSendSource): 2016-12-09 Beth Dakin Password fields should not show the emoji button in TouchBar https://bugs.webkit.org/show_bug.cgi?id=165673 -and corresponding- rdar://problem/29235739 Reviewed by Wenson Hsieh. This patch adds a new member variable for the password touch bar and password candidateListTouchBarItem. Since this TouchBar will actually have a different set of identifiers than the plain text TouchBar, it should just have its own variable. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: Return m_passwordTextCandidateListTouchBarItem when appropriate. (WebKit::WebViewImpl::candidateListTouchBarItem): The candidate list should be the only item for passwords. (WebKit::passwordTextTouchBarDefaultItemIdentifiers): Account for m_passwordTextTouchBar. (WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers): (WebKit::WebViewImpl::setUpTextTouchBar): (WebKit::WebViewImpl::textTouchBar): The empty candidates array is not needed. We can just set @[ ] as the candidates for the m_passwordTextCandidateListTouchBarItem. Safe guards already exist in the other parts of the code to prevent us from requesting or setting other candidates when in a password field. (WebKit::WebViewImpl::updateTextTouchBar): 2016-12-09 Keith Rollin Fix string specification in print format https://bugs.webkit.org/show_bug.cgi?id=165650 Reviewed by Alex Christensen. Change "%{public}s" string specifier to something that can be changed to "%s" at compile time when the build environment doesn't support the former. * NetworkProcess/capture/NetworkCaptureLogging.h: * NetworkProcess/capture/NetworkCaptureManager.cpp: (WebKit::NetworkCapture::Manager::initialize): (WebKit::NetworkCapture::Manager::findMatch): (WebKit::NetworkCapture::Manager::findExactMatch): (WebKit::NetworkCapture::Manager::findBestFuzzyMatch): (WebKit::NetworkCapture::Manager::fuzzyMatchURLs): (WebKit::NetworkCapture::Manager::logPlayedBackResource): (WebKit::NetworkCapture::Manager::openCacheFile): (WebKit::NetworkCapture::Manager::getLine): * NetworkProcess/capture/NetworkCaptureRecorder.cpp: (WebKit::NetworkCapture::Recorder::recordRequestSent): (WebKit::NetworkCapture::Recorder::recordResponseReceived): (WebKit::NetworkCapture::Recorder::recordRedirectReceived): (WebKit::NetworkCapture::Recorder::recordRedirectSent): (WebKit::NetworkCapture::Recorder::writeEvents): * NetworkProcess/capture/NetworkCaptureResource.cpp: (WebKit::NetworkCapture::Resource::url): (WebKit::NetworkCapture::Resource::EventStream::nextEvent): * NetworkProcess/capture/NetworkDataTaskReplay.cpp: (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay): (WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay): (WebKit::NetworkCapture::NetworkDataTaskReplay::resume): (WebKit::NetworkCapture::NetworkDataTaskReplay::suspend): (WebKit::NetworkCapture::NetworkDataTaskReplay::complete): (WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel): (WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished): (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse): 2016-12-09 Jeremy Jones WebView doesn't become first responder in element fullscreen. https://bugs.webkit.org/show_bug.cgi?id=165664 rdar://problem/28927252 Reviewed by Tim Horton. WebView was being set as the first responder while the contentView was still hidden. A view can not become first responder while it or its ancestor is hidden. This change waits until after the contentView is visible to make the web view the first responder. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): 2016-12-09 Gustavo Noronha Silva Unreviewed build fix. Thanks to Konstantin Tokarev and Csaba Osztrogonác for pointing out the fix. * CMakeLists.txt: add WebCore/html/canvas to include paths. 2016-12-09 Gustavo Noronha Silva [GTK] Fix build after r209558 https://bugs.webkit.org/show_bug.cgi?id=165653 Unreviewed build fix. * UIProcess/API/APIPolicyClient.h: include WebsitePolicies.h. * UIProcess/API/gtk/WebKitPolicyClient.cpp: ditto. * UIProcess/API/gtk/WebKitPolicyDecision.cpp: (webkit_policy_decision_use): pass empty structure to new required argument. 2016-12-09 Gavin Barraclough Revert - Add _WKIconLoadingDelegate SPI https://bugs.webkit.org/show_bug.cgi?id=164894 Unreviewed rollout due to performance regression. * PlatformMac.cmake: * UIProcess/API/APIIconLoadingClient.h: Removed. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _iconLoadingDelegate]): Deleted. (-[WKWebView _setIconLoadingDelegate:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Removed. * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Removed. * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Removed. * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Removed. * UIProcess/Cocoa/IconLoadingDelegate.h: Removed. * UIProcess/Cocoa/IconLoadingDelegate.mm: Removed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setIconLoadingClient): Deleted. (WebKit::WebPageProxy::getLoadDecisionForIcon): Deleted. (WebKit::WebPageProxy::finishedLoadingIcon): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::iconLoadingClient): Deleted. * UIProcess/WebPageProxy.messages.in: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted. (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted. (WebKit::WebFrameLoaderClient::finishedLoadingIcon): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: (WebKit::WebFrameLoaderClient::setUseIconLoadingClient): Deleted. (): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didGetLoadDecisionForIcon): Deleted. (WebKit::WebPage::setUseIconLoadingClient): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-12-08 Keith Rollin Move FileHandle to WebCore FileHandle.h https://bugs.webkit.org/show_bug.cgi?id=165562 Reviewed by Alex Christensen. Move FileHandle from NetworkCaptureTypes.h (which can now be deleted) to WebCore. Update client code to use the new version. * NetworkProcess/capture/NetworkCaptureEvent.cpp: * NetworkProcess/capture/NetworkCaptureEvent.h: * NetworkProcess/capture/NetworkCaptureManager.cpp: (WebKit::NetworkCapture::Manager::initialize): (WebKit::NetworkCapture::Manager::terminate): (WebKit::NetworkCapture::Manager::logRecordedResource): (WebKit::NetworkCapture::Manager::logLoadedResource): (WebKit::NetworkCapture::Manager::logPlayedBackResource): (WebKit::NetworkCapture::Manager::openCacheFile): (WebKit::NetworkCapture::Manager::ensureFileHandle): Deleted. (WebKit::NetworkCapture::Manager::printToFile): Deleted. * NetworkProcess/capture/NetworkCaptureManager.h: * NetworkProcess/capture/NetworkCaptureRecorder.cpp: (WebKit::NetworkCapture::Recorder::writeEvents): * NetworkProcess/capture/NetworkCaptureTypes.h: Removed. * WebKit2.xcodeproj/project.pbxproj: 2016-12-08 Anders Carlsson Attempt to fix the iOS build. * Platform/IPC/mac/MachMessage.cpp: 2016-12-08 Anders Carlsson Defer sending Mach messages if the queue is full https://bugs.webkit.org/show_bug.cgi?id=165622 rdar://problem/29518036 Reviewed by Brady Eidson. * Platform/IPC/Connection.cpp: Include MachMessage.h so the Connection destructor can do its thing. * Platform/IPC/Connection.h: Add new members. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::platformInvalidate): Null out the pending outgoing mach message. (IPC::Connection::sendMessage): New helper that will send a Mach message. If we time out, store the message in m_pendingOutgoingMachMessage. When our send source will be triggered we'll try to send the message again. (IPC::Connection::platformCanSendOutgoingMessages): We can only send messages if we don't have a pending outgoing message. (IPC::Connection::sendOutgoingMessage): Call the newly added sendMessage function. (IPC::Connection::initializeSendSource): Add the DISPATCH_MACH_SEND_POSSIBLE mask (and DISPATCH_MACH_SEND_DEAD which was previously implicit). In our event handler, check for DISPATCH_MACH_SEND_POSSIBLE and try to send the pending outgoing message again. * Platform/IPC/mac/MachMessage.cpp: (IPC::MachMessage::create): Rename length to size. (IPC::MachMessage::MachMessage): Initialize m_shouldFreeDescriptors. (IPC::MachMessage::~MachMessage): Call mach_msg_destroy, which will free the descriptors. (IPC::MachMessage::leakDescriptors): Set m_shouldFreeDescriptors to false. * Platform/IPC/mac/MachMessage.h: (IPC::MachMessage::size): (IPC::MachMessage::length): Deleted. 2016-12-08 Chelsea Pugh [iOS] WKWebView should not allow app links to be opened on back or forward navigation https://bugs.webkit.org/show_bug.cgi?id=165502 Reviewed by Dan Bernstein. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): Add a condition to shouldOpenAppLinks (which we use when creating a NavigationAction) that the navigationActionData is not a navigation of type BackForward. This way, we don't open app links when a navigation is done via back or forward. 2016-12-08 Filip Pizlo Enable SharedArrayBuffer, remove the flag https://bugs.webkit.org/show_bug.cgi?id=165614 Rubber stamped by Geoffrey Garen. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2016-12-08 Alex Christensen Add SPI for sending WebsiteSettings to WebProcess during navigation https://bugs.webkit.org/show_bug.cgi?id=165517 We add the ability for the navigation client to send settings to the WebProcess based on the URL of the document being navigated to. This approach adds no new IPC messages and allows the application to decide what settings to use during navigation instead of declaratively before navigation. Right now there is only one setting, whether to disable content blockers, but this infrastructure can be used for more settings. Reviewed by Anders Carlsson. * CMakeLists.txt: * PlatformMac.cmake: * Shared/API/APIObject.h: * Shared/API/c/WKBase.h: * Shared/WebsitePolicies.h: Added. (WebKit::WebsitePolicies::encode): (WebKit::WebsitePolicies::decode): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::decidePolicyForNavigationAction): (API::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/API/APIPolicyClient.h: (API::PolicyClient::decidePolicyForNavigationAction): (API::PolicyClient::decidePolicyForNewWindowAction): (API::PolicyClient::decidePolicyForResponse): * UIProcess/API/APIWebsitePolicies.cpp: Added. (API::WebsitePolicies::create): * UIProcess/API/APIWebsitePolicies.h: Added. * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKFramePolicyListener.cpp: (WKFramePolicyListenerUse): (WKFramePolicyListenerUseWithPolicies): * UIProcess/API/C/WKFramePolicyListener.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPagePolicyClient): * UIProcess/API/C/WKWebsitePolicies.cpp: Added. (WKWebsitePoliciesGetTypeID): (WKWebsitePoliciesCreate): (WKWebsitePoliciesSetContentBlockersEnabled): (WKWebsitePoliciesGetContentBlockersEnabled): * UIProcess/API/C/WKWebsitePolicies.h: Added. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: Added. * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: Added. (-[_WKWebsitePolicies dealloc]): (-[_WKWebsitePolicies init]): (-[_WKWebsitePolicies setContentBlockersEnabled:]): (-[_WKWebsitePolicies contentBlockersEnabled]): (-[_WKWebsitePolicies description]): (-[_WKWebsitePolicies _apiObject]): * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: Added. (WebKit::wrapper): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::reloadBrowsingContext): * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::tryAppLink): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/WebFormSubmissionListenerProxy.cpp: (WebKit::WebFormSubmissionListenerProxy::continueSubmission): * UIProcess/WebFrameListenerProxy.cpp: (WebKit::WebFrameListenerProxy::receivedPolicyDecision): * UIProcess/WebFrameListenerProxy.h: * UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::use): (WebKit::WebFramePolicyListenerProxy::download): (WebKit::WebFramePolicyListenerProxy::ignore): * UIProcess/WebFramePolicyListenerProxy.h: (WebKit::WebFramePolicyListenerProxy::create): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::receivedPolicyDecision): * UIProcess/WebFrameProxy.h: * UIProcess/WebInspectorProxy.cpp: (WebKit::decidePolicyForNavigationAction): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2016-12-08 Antti Koivisto Salt network cache hashes https://bugs.webkit.org/show_bug.cgi?id=164924 Reviewed by Alex Christensen. To enhance privacy make cache content unidentifiable from file names alone. This is done by generating a unique persistent salt for each cache instance. It is used when computing hashes used in file names. The patch also replaces plain text partition directory names with salted hashes. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::makeCacheKey): (WebKit::NetworkCache::makeCacheKey): Deleted. * NetworkProcess/cache/NetworkCache.h: Increment cache version. * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: (WebKit::NetworkCache::BlobStorage::BlobStorage): (WebKit::NetworkCache::BlobStorage::add): (WebKit::NetworkCache::BlobStorage::get): Use salt for blob content hash. * NetworkProcess/cache/NetworkCacheBlobStorage.h: * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::computeSHA1): For simplicity all SHA1s are now salted. (WebKit::NetworkCache::makeSalt): (WebKit::NetworkCache::readOrMakeSalt): Read salt if it exists, generate and persist it otherwise. * NetworkProcess/cache/NetworkCacheData.h: * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::Key::Key): Remove the "No partition" string and just empty. That was only needed to have a directory name of some sort. (WebKit::NetworkCache::Key::computeHash): Use salt for key hash. (WebKit::NetworkCache::Key::computePartitionHash): Separate hash for partition. * NetworkProcess/cache/NetworkCacheKey.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::makeSubresourcesKey): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::makeSaltFilePath): (WebKit::NetworkCache::Storage::open): Cache can't be opened if we can't read or persist a salt. (WebKit::NetworkCache::traverseRecordsFiles): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::synchronize): (WebKit::NetworkCache::Storage::recordDirectoryPathForKey): Use the partition hash in the directory name instead of a plain text name. (WebKit::NetworkCache::decodeRecordHeader): (WebKit::NetworkCache::Storage::readRecord): (WebKit::NetworkCache::Storage::encodeRecord): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::Storage::clear): * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::salt): 2016-12-08 Eric Carlson Fix the EFL build. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): Add another ENABLE(MEDIA_STREAM) guard. 2016-12-08 Tomas Popela [GTK] Process accelerated compositing env variables only if they are really enabled https://bugs.webkit.org/show_bug.cgi?id=165300 Don't process the WEBKIT_FORCE_COMPOSITING_MODE and WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0). Reviewed by Michael Catanzaro. * UIProcess/gtk/WebPreferencesGtk.cpp: (WebKit::WebPreferences::platformInitializeStore): 2016-12-08 Alex Christensen Fix CMake build. * CMakeLists.txt: Add the new NetworkProcess/capture include directory to find new headers from r209498. * NetworkProcess/capture/NetworkCaptureEvent.cpp: (WebKit::NetworkCapture::Response::Response): (WebKit::NetworkCapture::Error::Error): The String constructor was ambiguous after r209498 because URL has an operator NSString* and String has an NSString constructor. We should get rid of operator NSString* and operator String on URL. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: Add some ENABLE(MEDIA_STREAM) macros to fix the build without it enabled after r209512. 2016-12-08 Alex Christensen Fix iOS debug build after r209498 https://bugs.webkit.org/show_bug.cgi?id=164527 * NetworkProcess/capture/NetworkCaptureLogging.h: Logs were causing compile warnings/errors. Disable logs for now. 2016-12-07 Dean Jackson Remove runtime toggle for pointer-lock https://bugs.webkit.org/show_bug.cgi?id=165577 Reviewed by Jon Lee. Remove any runtime calls to check if pointer-lock is enabled. It's either compiled in or out. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPointerLockEnabled): Deleted. (WKPreferencesGetPointerLockEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-12-07 Eric Carlson [MediaStream][Mac] Revoke sandbox extensions when capture ends https://bugs.webkit.org/show_bug.cgi?id=165476 Reviewed by Brady Eidson. Track media capture by process so it is possible to revoke the sandbox extensions issued to a web process when capture stops. Allocate WK2 user media permission manager lazily rather than every time a page is created as most pages won't need one. * CMakeLists.txt: Add new files. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register with process manager. (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox extension code to the process manager. (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New. (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state change to the process manager. (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: Added. (WebKit::ProcessState::ProcessState): (WebKit::ProcessState::managers): (WebKit::ProcessState::sandboxExtensionsGranted): (WebKit::ProcessState::setSandboxExtensionsGranted): (WebKit::stateMap): (WebKit::processState): (WebKit::ProcessState::addRequestManager): (WebKit::ProcessState::removeRequestManager): (WebKit::UserMediaProcessManager::singleton): (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): (WebKit::UserMediaProcessManager::willCreateMediaStream): (WebKit::UserMediaProcessManager::startedCaptureSession): (WebKit::UserMediaProcessManager::endedCaptureSession): * UIProcess/UserMediaProcessManager.h: Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Don't allocate m_userMediaPermissionRequestManager. (WebKit::WebPageProxy::resetState): Set m_userMediaPermissionRequestManager to null. (WebKit::WebPageProxy::userMediaPermissionRequestManager): Allocate m_userMediaPermissionRequestManager lazily as most pages don't need it. (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Call userMediaPermissionRequestManager(). (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): Ditto. (WebKit::WebPageProxy::clearUserMediaState): Ditto. (WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request manager proxy. * UIProcess/WebPageProxy.h: * WebKit2.xcodeproj/project.pbxproj: Add new files. * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added. (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions): (WebKit::MediaDeviceSandboxExtensions::encode): (WebKit::MediaDeviceSandboxExtensions::decode): (WebKit::MediaDeviceSandboxExtensions::operator[]): (WebKit::MediaDeviceSandboxExtensions::size): * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added. * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension is now in a HashMap, not a Vector. (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record IDs with extensions so they can be revoked later. (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New. (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-12-07 Jeremy Jones One esc to exit fullscreen and pointer lock https://bugs.webkit.org/show_bug.cgi?id=165416 rdar://problem/29430711 Reviewed by Jer Noble. Fix a crash when didLosePointerLock is not specified. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): 2016-12-07 Keith Rollin Network event record/replay https://bugs.webkit.org/show_bug.cgi?id=164527 Reviewed by Alex Christensen. Add WebKit2/NetworkProcess/capture/* for recording the network events that occur when loading a page and for replaying them later. Update NetworkLoad to invoke capture facilities. Add preferences for enabling record or replay. * CMakeLists.txt: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): (WebKit::NetworkLoad::initializeForRecord): (WebKit::NetworkLoad::initializeForReplay): (WebKit::NetworkLoad::initialize): (WebKit::NetworkLoad::setDefersLoading): (WebKit::NetworkLoad::continueWillSendRequest): (WebKit::NetworkLoad::sharedWillSendRedirectedRequest): (WebKit::NetworkLoad::notifyDidReceiveResponse): (WebKit::NetworkLoad::didReceiveData): (WebKit::NetworkLoad::didCompleteWithError): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::terminate): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/capture/NetworkCaptureEvent.cpp: Added. (WebKit::NetworkCapture::copyHeaders): (WebKit::NetworkCapture::KeyValuePair::KeyValuePair): (WebKit::NetworkCapture::ResourceRequest::ResourceRequest): (WebKit::NetworkCapture::ResourceRequest::operator WebCore::ResourceRequest): (WebKit::NetworkCapture::ResourceResponse::ResourceResponse): (WebKit::NetworkCapture::ResourceResponse::operator WebCore::ResourceResponse): (WebKit::NetworkCapture::ResourceError::ResourceError): (WebKit::NetworkCapture::ResourceError::operator WebCore::ResourceError): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder>::encode): (WebKit::NetworkCapture::JSONCoder>::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::decode): (WebKit::NetworkCapture::eventToString): (WebKit::NetworkCapture::stringToEvent): * NetworkProcess/capture/NetworkCaptureEvent.h: Added. (WebKit::NetworkCapture::TimedEvent::TimedEvent): * NetworkProcess/capture/NetworkCaptureLogging.h: Added. * NetworkProcess/capture/NetworkCaptureManager.cpp: Added. (WebKit::NetworkCapture::Manager::singleton): (WebKit::NetworkCapture::Manager::initialize): (WebKit::NetworkCapture::Manager::terminate): (WebKit::NetworkCapture::Manager::findMatch): (WebKit::NetworkCapture::Manager::findExactMatch): (WebKit::NetworkCapture::Manager::findBestFuzzyMatch): (WebKit::NetworkCapture::Manager::fuzzyMatchURLs): (WebKit::NetworkCapture::Manager::loadResources): (WebKit::NetworkCapture::Manager::reportLoadPath): (WebKit::NetworkCapture::Manager::reportRecordPath): (WebKit::NetworkCapture::Manager::reportReplayPath): (WebKit::NetworkCapture::Manager::requestToPath): (WebKit::NetworkCapture::Manager::stringToHash): (WebKit::NetworkCapture::Manager::hashToPath): (WebKit::NetworkCapture::Manager::logRecordedResource): (WebKit::NetworkCapture::Manager::logLoadedResource): (WebKit::NetworkCapture::Manager::logPlayedBackResource): (WebKit::NetworkCapture::Manager::ensureFileHandle): (WebKit::NetworkCapture::Manager::openCacheFile): (WebKit::NetworkCapture::Manager::readFile): (WebKit::NetworkCapture::Manager::getLine): (WebKit::NetworkCapture::Manager::getWord): (WebKit::NetworkCapture::Manager::printToFile): * NetworkProcess/capture/NetworkCaptureManager.h: Added. (WebKit::NetworkCapture::Manager::isRecording): (WebKit::NetworkCapture::Manager::isReplaying): (WebKit::NetworkCapture::Manager::mode): * NetworkProcess/capture/NetworkCaptureRecorder.cpp: Added. (WebKit::NetworkCapture::Recorder::recordRequestSent): (WebKit::NetworkCapture::Recorder::recordResponseReceived): (WebKit::NetworkCapture::Recorder::recordRedirectReceived): (WebKit::NetworkCapture::Recorder::recordRedirectSent): (WebKit::NetworkCapture::Recorder::recordDataReceived): (WebKit::NetworkCapture::Recorder::recordFinish): (WebKit::NetworkCapture::Recorder::writeEvents): * NetworkProcess/capture/NetworkCaptureRecorder.h: Added. (WebKit::NetworkCapture::Recorder::recordEvent): * NetworkProcess/capture/NetworkCaptureReplayer.cpp: Added. (WebKit::NetworkCapture::Replayer::replayResource): * NetworkProcess/capture/NetworkCaptureReplayer.h: Added. * NetworkProcess/capture/NetworkCaptureResource.cpp: Added. (WebKit::NetworkCapture::Resource::Resource): (WebKit::NetworkCapture::Resource::url): (WebKit::NetworkCapture::Resource::baseURL): (WebKit::NetworkCapture::Resource::queryParameters): (WebKit::NetworkCapture::Resource::eventStream): (WebKit::NetworkCapture::Resource::EventStream::EventStream): (WebKit::NetworkCapture::Resource::EventStream::nextEvent): * NetworkProcess/capture/NetworkCaptureResource.h: Added. * NetworkProcess/capture/NetworkCaptureTypes.h: Added. (WebKit::NetworkCapture::TypeHolder::forEachTypeImpl): (WebKit::NetworkCapture::TypeHolder::forEachType): * NetworkProcess/capture/NetworkDataTaskReplay.cpp: Added. (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay): (WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay): (WebKit::NetworkCapture::NetworkDataTaskReplay::resume): (WebKit::NetworkCapture::NetworkDataTaskReplay::suspend): (WebKit::NetworkCapture::NetworkDataTaskReplay::cancel): (WebKit::NetworkCapture::NetworkDataTaskReplay::complete): (WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel): (WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived): (WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished): (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse): (WebKit::NetworkCapture::NetworkDataTaskReplay::didFinish): * NetworkProcess/capture/NetworkDataTaskReplay.h: Added. (WebKit::NetworkCapture::NetworkDataTaskReplay::create): * NetworkProcess/capture/json.hpp: Added. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebKit2.xcodeproj/project.pbxproj: * config.h: 2016-12-07 Anders Carlsson Fix build. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::open): 2016-12-07 Anders Carlsson Rename the connection sources to better indicate what data direction they are used for https://bugs.webkit.org/show_bug.cgi?id=165548 Reviewed by Tim Horton. * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::platformInvalidate): (IPC::Connection::platformInitialize): (IPC::createReceiveSource): (IPC::Connection::initializeSendSource): (IPC::Connection::receiveSourceEventHandler): (IPC::createDataAvailableSource): Deleted. (IPC::Connection::initializeDeadNameSource): Deleted. Rename m_deadNameSource to m_sendSource, and m_receivePortDataAvailableSource to m_receiveSource. (IPC::Connection::open): Initialize the send source before we attempt to send a first message. 2016-12-07 Simon Fraser Fix use of enum in a WK2 C SPI header. rdar://problem/28725583 Followup to correctly prefix the enum values. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetEventThrottlingBehaviorOverride): * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: 2016-12-07 Simon Fraser Fix use of enum in a WK2 C SPI header. rdar://problem/28725583 Reviewed by Dan Bernstein. Use correct enum style for a C SPI header and fix the callers. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetEventThrottlingBehaviorOverride): * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: 2016-12-07 Beth Dakin Remove iCloud Pages and Keynote site-specific hacks https://bugs.webkit.org/show_bug.cgi?id=165544 -and corresponding- rdar://problem/29082536 Reviewed by Wenson Hsieh. * WebProcess/WebPage/WebPage.cpp: (WebKit::needsHiddenContentEditableQuirk): (WebKit::needsPlainTextQuirk): 2016-12-05 Ada Chan Add a getter for serverTrust in _WKObservablePageState https://bugs.webkit.org/show_bug.cgi?id=165433 Reviewed by Anders Carlsson. * UIProcess/API/C/mac/WKPagePrivateMac.h: * UIProcess/API/C/mac/WKPagePrivateMac.mm: (-[WKObservablePageState serverTrust]): 2016-12-07 Jer Noble Exiting Element Fullscreen mode loses focus on WKWebView. https://bugs.webkit.org/show_bug.cgi?id=165512 Reviewed by Eric Carlson. Setting 'window.contentView.hidden = YES' will reset the first-responder (whereas previously setting 'window.contentView.layer.hidden = YES' did not). Grab the first- responder before doing so, so that it can be reset correctly when moving the WKWebView back to it's original window. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): 2016-12-07 Alex Christensen Fix CMake build after r209418. https://bugs.webkit.org/show_bug.cgi?id=165484 * PlatformMac.cmake: 2016-12-07 Philippe Normand Unreviewed, GTK build fix after r209407. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): * UIProcess/LegacySessionStateCodingNone.cpp: (WebKit::decodeLegacySessionState): 2016-12-06 Ryan Haddad Unreviewed, rolling out r209422. This change caused assertion failures during API tests. Reverted changeset: "[MediaStream][Mac] Revoke sandbox extensions when capture ends" https://bugs.webkit.org/show_bug.cgi?id=165476 http://trac.webkit.org/changeset/209422 2016-12-06 Dean Jackson Include default value in Experimental Feature information https://bugs.webkit.org/show_bug.cgi?id=165509 Reviewed by Tim Horton. Add a defaultValue member variable to experimental features, both the C++ and ObjC interfaces. * UIProcess/API/APIExperimentalFeature.cpp: (API::ExperimentalFeature::create): (API::ExperimentalFeature::ExperimentalFeature): * UIProcess/API/APIExperimentalFeature.h: * UIProcess/API/Cocoa/_WKExperimentalFeature.h: * UIProcess/API/Cocoa/_WKExperimentalFeature.mm: (-[_WKExperimentalFeature description]): (-[_WKExperimentalFeature defaultValue]): * UIProcess/WebPreferences.cpp: (WebKit::createExperimentalFeaturesVector): 2016-12-06 Commit Queue Unreviewed, rolling out r209391. https://bugs.webkit.org/show_bug.cgi?id=165501 requires explicit nullptr checks so missing env vars don't flip AC mode (Requested by mcatanzaro on #webkit). Reverted changeset: "[GTK] Process accelerated compositing env variables only if they are really enabled" https://bugs.webkit.org/show_bug.cgi?id=165300 http://trac.webkit.org/changeset/209391 2016-12-06 Alexey Proskuryakov Correct SDKROOT values in xcconfig files https://bugs.webkit.org/show_bug.cgi?id=165487 rdar://problem/29539209 Reviewed by Dan Bernstein. Fix suggested by Dan Bernstein. * Configurations/DebugRelease.xcconfig: 2016-12-06 Andreas Kling [Cocoa] Add some memory usage related information to sysdiagnose state dumps Reviewed by Darin Adler. Follow-up to address two more review comments. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::registerWithStateDumper): Use adoptNS() instead of autorelease for NSStrings. 2016-12-06 Eric Carlson [MediaStream][Mac] Revoke sandbox extensions when capture ends https://bugs.webkit.org/show_bug.cgi?id=165476 Reviewed by Brady Eidson. Track media capture by process so it is possible to revoke the sandbox extensions issued to a web process when capture stops. * CMakeLists.txt: Add new files. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register with process manager. (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox extension code to the process manager. (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New. (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state change to the process manager. (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: Added. (WebKit::ProcessState::ProcessState): (WebKit::ProcessState::managers): (WebKit::ProcessState::sandboxExtensionsGranted): (WebKit::ProcessState::setSandboxExtensionsGranted): (WebKit::stateMap): (WebKit::processState): (WebKit::ProcessState::addRequestManager): (WebKit::ProcessState::removeRequestManager): (WebKit::UserMediaProcessManager::singleton): (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): (WebKit::UserMediaProcessManager::willCreateMediaStream): (WebKit::UserMediaProcessManager::startedCaptureSession): (WebKit::UserMediaProcessManager::endedCaptureSession): * UIProcess/UserMediaProcessManager.h: Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request manager proxy. * UIProcess/WebPageProxy.h: * WebKit2.xcodeproj/project.pbxproj: Add new files. * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added. (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions): (WebKit::MediaDeviceSandboxExtensions::encode): (WebKit::MediaDeviceSandboxExtensions::decode): (WebKit::MediaDeviceSandboxExtensions::operator[]): (WebKit::MediaDeviceSandboxExtensions::size): * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added. * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension is now in a HashMap, not a Vector. (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record IDs with extensions so they can be revoked later. (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New. (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-12-06 Anders Carlsson Add a new MachMessage class and use it for sending outgoing messages https://bugs.webkit.org/show_bug.cgi?id=165484 Reviewed by Sam Weinig. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::sendOutgoingMessage): Instead of trying to randomly use memory from the stack as well as using mmap for the message data for out of line messages (which makes no sense at all, since the body data is already mmapped), just always create a MachMessage object and use it. (IPC::machMessageSize): Deleted. This has been moved to MachMessage::messageSize(). * Platform/IPC/mac/MachMessage.cpp: Added. (IPC::MachMessage::create): Allocate extra memory to store the actual buffer. (IPC::MachMessage::MachMessage): Initialize variables. m_size isn't really used right now, but will be in a subsequent patch. (IPC::MachMessage::header): Return the header. * Platform/IPC/mac/MachMessage.h: Added. (IPC::MachMessage::length): * WebKit2.xcodeproj/project.pbxproj: Add new files. 2016-12-06 Simon Fraser Enable visual viewports by default on Mac, and iOS Wk2 https://bugs.webkit.org/show_bug.cgi?id=165452 Reviewed by Zalan Bujtas. Turn visual viewports on by default for WK2. * Shared/WebPreferencesDefinitions.h: 2016-12-06 Daniel Bates WebKitTestRunner: Plugins are disabled in new windows https://bugs.webkit.org/show_bug.cgi?id=165410 Reviewed by Alex Christensen. Remove SPI exposed to explicitly toggle plugins from WebKitTestRunner. Instead we will update WebKitTestRunner to make use of the SPI WKBundleOverrideBoolPreferenceForTestRunner() to toggle plugins in all windows. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetPluginsEnabled): Deleted. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPluginsEnabled): Deleted. 2016-12-05 Anders Carlsson Don't memcpy out of line data https://bugs.webkit.org/show_bug.cgi?id=165434 Reviewed by Sam Weinig. Change the Decoder constructor to take a buffer deallocator parameter. If the buffer deallocator is null, the data will be copied as before. Otherwise, the memory will be adopted by the Decoder object, and will be deallocated by invoking the data deallocator. * Platform/IPC/Decoder.cpp: (IPC::copyBuffer): Add a new helper. (IPC::Decoder::Decoder): Copy the buffer if the deallocator is null. (IPC::Decoder::~Decoder): Invoke the deallocator or call fastFree if it is null. (IPC::Decoder::unwrapForTesting): Update constructor. (IPC::roundUpToAlignment): (IPC::Decoder::alignBufferPosition): (IPC::Decoder::decodeVariableLengthByteArray): (IPC::decodeValueFromBuffer): Change all these to deal with const pointers. * Platform/IPC/Decoder.h: Add new members. * Platform/IPC/mac/ConnectionMac.mm: (IPC::createMessageDecoder): When we have out of line data, pass a deallocator that calls vm_deallocate, instead of copying the data and then immediately throwing the original away. 2016-12-06 Tim Horton Almost half-second stall scrolling apple.com because of synchronous getPositionInformation https://bugs.webkit.org/show_bug.cgi?id=165403 Reviewed by Enrica Casucci. When retrieving interaction information, we don't always need to do snapshots for 3D Touch or the action sheet, especially if we're synchronously blocking the UI process main thread waiting for the reply. Add a new InteractionInformationRequest, which allows callers of getPositionInformation and requestPositionInformation to specify which optional pieces of information they would like to compute. * Shared/AssistedNodeInformation.h: Fix a incorrect comment. * Shared/ios/InteractionInformationRequest.cpp: Added. (WebKit::InteractionInformationRequest::encode): (WebKit::InteractionInformationRequest::decode): (WebKit::InteractionInformationRequest::isValidForRequest): * Shared/ios/InteractionInformationRequest.h: Added. (WebKit::InteractionInformationRequest::InteractionInformationRequest): * WebKit2.xcodeproj/project.pbxproj: Add InteractionInformationRequest, which encapsulates all of the parameters required to generate an InteractionInformationAtPosition. Previously, that was just a point, but now we have two new parameters: whether we should generate a snapshot of the element, and whether we should generate a TextIndicator if the element is a link. * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode): (WebKit::InteractionInformationAtPosition::decode): (WebKit::InteractionInformationAtPosition::mergeCompatibleOptionalInformation): Adopt InteractionInformationRequest. * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::getPositionInformation): (WebKit::WebPageProxy::requestPositionInformation): * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]): (-[WKActionSheetAssistant presentationRectInHostViewForSheet]): (-[WKActionSheetAssistant showImageSheet]): (-[WKActionSheetAssistant showLinkSheet]): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Adopt InteractionInformationRequest. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _showAttachmentSheet]): (-[WKContentView ensurePositionInformationIsUpToDate:]): If we have a outstanding asynchronous position information request for the current point, instead of sending a second separate request, just wait for the async one to come in. (-[WKContentView requestAsynchronousPositionInformationUpdate:]): If asked to do an asynchronous request with more optional bits than the current otherwise-valid response's request, update the position information. (-[WKContentView gestureRecognizerShouldBegin:]): The design of this mechanism is that during the highlight long press, we do an async position information update, and then when we actually begin a 3D Touch gesture, we hope to already have the requisite snapshots ready (so that we can avoid synchronously blocking for them, there). So, in the highlight long-press async request, ask for all the goodies. (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView pointIsNearMarkedText:]): (-[WKContentView pointIsInAssistedNode:]): (-[WKContentView _didNotHandleTapAsClick:]): (-[WKContentView _positionInformationDidChange:]): If we get a position information update for the same point, but with less goodies attached (the snapshot/link indicator), copy them over from the old position information, so that we never accidentally "downgrade" our info. (-[WKContentView updatePositionInformationForActionSheetAssistant:]): (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): (-[WKContentView _dataForPreviewItemController:atPosition:type:]): (-[WKContentView _presentedViewControllerForPreviewItemController:]): More adoption. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleTap): (WebKit::WebPage::handleTwoFingerTapAtPoint): (WebKit::WebPage::commitPotentialTap): Adopt InteractionInformationRequest. (WebKit::WebPage::getPositionInformation): (WebKit::WebPage::requestPositionInformation): Copy the request into the response. Only snapshot if the request wants a snapshot. Only make a link indicator if the request wants one. 2016-12-06 Daniel Bates Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines https://bugs.webkit.org/show_bug.cgi?id=165451 Reviewed by Alex Christensen. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): 2016-12-06 Daniel Bates Remove unused InjectedBundle::overrideXSSAuditorEnabledForTestRunner() https://bugs.webkit.org/show_bug.cgi?id=165408 Reviewed by Alex Christensen. InjectedBundle::overrideXSSAuditorEnabledForTestRunner() is unused. This function was only called by WKBundleOverrideXSSAuditorEnabledForTestRunner(), which was removed in r106005. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideXSSAuditorEnabledForTestRunner): Deleted. * WebProcess/InjectedBundle/InjectedBundle.h: 2016-12-04 Darin Adler Use ASCIICType more, and improve it a little bit https://bugs.webkit.org/show_bug.cgi?id=165360 Reviewed by Sam Weinig. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code. 2016-12-06 Dave Hyatt [CSS Parser] Turn on the new CSS parser https://bugs.webkit.org/show_bug.cgi?id=165213 Reviewed by Zalan Bujtas. * Shared/WebPreferencesDefinitions.h: 2016-12-06 Tomas Popela [GTK] Process accelerated compositing env variables only if they are really enabled https://bugs.webkit.org/show_bug.cgi?id=165300 Don't process the WEBKIT_FORCE_COMPOSITING_MODE and WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0). Reviewed by Michael Catanzaro. * UIProcess/gtk/WebPreferencesGtk.cpp: (WebKit::WebPreferences::platformInitializeStore): 2016-12-06 Sam Weinig [WebIDL] Add support for converting dictionaries to JS https://bugs.webkit.org/show_bug.cgi?id=165367 Reviewed by Darin Adler and Alex Christensen. * CMakeLists.txt: Add missing directories to look in for headers. 2016-12-05 Tim Horton Try to fix the iOS Simulator build. * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore): 2016-12-03 Simon Fraser Minor reformat and renames in -didUpdateVisibleRect: https://bugs.webkit.org/show_bug.cgi?id=165365 Reviewed by Dave Hyatt. didUpdateVisibleRect:... has lots of parameters. Put one on each line. Rename the rects to make it clear they are "content" rects (i.e. in document coordinates). * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): 2016-12-05 Tim Horton Adopt CAMachPort-as-layer-contents https://bugs.webkit.org/show_bug.cgi?id=141687 Reviewed by Darin Adler. * Shared/mac/RemoteLayerBackingStore.h: * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::decode): On the UI process side, instead of actually looking up the surface, just keep the MachSendRight around, to later be turned into a CAMachPort. (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): Make a CAMachPort and leak our send right into it. CAMachPort will adopt the port and destroy it when needed. (WebKit::RemoteLayerBackingStore::setBufferVolatility): Tiny style fix. * Shared/mac/RemoteLayerTreePropertyApplier.h: * Shared/mac/RemoteLayerTreePropertyApplier.mm: (WebKit::applyPropertiesToLayer): (WebKit::RemoteLayerTreePropertyApplier::applyProperties): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::prepareForAppSuspension): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::prepareForAppSuspension): * UIProcess/mac/RemoteLayerTreeHost.h: * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): Two supporting changes in order to fix the two regressions that this caused when we tried to land it two years ago: When an app is being suspended, resolve all CAMachPort backing store into actual IOSurfaces. Otherwise, any live CAMachPorts will keep a +1 on their respective IOSurface's use count, causing us to fail to mark them volatile, keeping the app alive for more time (re-trying the volatility change), and increasing the likelihood of background jetsam. If the debugging tile map is enabled, do not use CAMachPort, because we don't have a great way to plumb the same CAMachPort to two layers (and it doesn't seem to work even if you do). Instead, just map the IOSurface into the UI process like we used to. 2016-12-05 Dean Jackson pointer lock needs to be feature detectable https://bugs.webkit.org/show_bug.cgi?id=165426 Reviewed by Antoine Quint. Set the RuntimeEnabledFeature as preferences change. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPointerLockEnabled): (WKPreferencesGetPointerLockEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-12-05 Andreas Kling [Cocoa] Add some memory usage related information to sysdiagnose state dumps Reviewed by Darin Adler. Add two new entries to the sysdiagnose state dumps for WebContent processes: "Memory Usage Stats" and "JavaScript Object Counts". The first category contains all the interesting stuff from task_info() along with some WebCore and JavaScriptCore object/memory counters. The second category contains a list of all the JS object types currently live on the heap, along with a count. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::registerWithStateDumper): Add two new entries to the state dictionary: "Memory Usage Stats" and "JavaScript Object Counts". 2016-12-05 Csaba Osztrogonác Unreviewed cmake buildfix after r209307. * PlatformMac.cmake: 2016-12-03 Dan Bernstein [Cocoa] Expose InjectedBundlePageEditorClient via the Objective-C bundle SPI https://bugs.webkit.org/show_bug.cgi?id=165276 Reviewed by Darin Adler. Test: TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegate.mm * Shared/Cocoa/APIObject.mm: (API::Object::newObject): Wrap InjectedBundleRangeHandle in WKWebProcessPlugInRangeHandle. * WebKit2.xcodeproj/project.pbxproj: Added references to new files, making WKWebProcessPlugInEditingDelegate.h and WKWebProcessPlugInRangeHandle.h private headers. * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: Added. An base class based on InjectedBundlePageEditorClient. (API::InjectedBundle::EditorClient::~EditorClient): (API::InjectedBundle::EditorClient::shouldBeginEditing): (API::InjectedBundle::EditorClient::shouldEndEditing): (API::InjectedBundle::EditorClient::shouldInsertNode): (API::InjectedBundle::EditorClient::shouldInsertText): (API::InjectedBundle::EditorClient::shouldDeleteRange): (API::InjectedBundle::EditorClient::shouldChangeSelectedRange): (API::InjectedBundle::EditorClient::shouldApplyStyle): (API::InjectedBundle::EditorClient::didBeginEditing): (API::InjectedBundle::EditorClient::didEndEditing): (API::InjectedBundle::EditorClient::didChange): (API::InjectedBundle::EditorClient::didChangeSelection): (API::InjectedBundle::EditorClient::willWriteToPasteboard): (API::InjectedBundle::EditorClient::getPasteboardDataForRange): (API::InjectedBundle::EditorClient::didWriteToPasteboard): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Added. Declares the new delegate protocol, currently comprising three methods corresponding to willWriteToPasteboard, getPasteboardDataForRange, and didWriteToPasteboard. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame jsRangeForRangeHandle:inWorld:]): Added. Gets the JS wrapper for the specified range handle. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: Added. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: Added. (-[WKWebProcessPlugInRangeHandle dealloc]): Call the InjectedBundleRangeHandle destructor. (+[WKWebProcessPlugInRangeHandle rangeHandleWithJSValue:inContext:]): Get or create an InjectedBundleRangeHandle for the specified object. (-[WKWebProcessPlugInRangeHandle frame]): Return the range’s owner document’s frame. (-[WKWebProcessPlugInRangeHandle _rangeHandle]): Return the InjectedBundleRangeHandle. (-[WKWebProcessPlugInRangeHandle _apiObject]): Ditto. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h: Added. (WebKit::wrapper): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetEditorClient): Updated for WebPage change. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _editingDelegate]): Added. Returns the delegate. (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Added. Defines a Client class, which derives from API::InjectedBundle::EditorClient, and invokes the delegate methods. Instantiates a Client and sets it on the WebPage. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h: Declared new _editingDelegate property. * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::document): Added. Returns an InjectedBundleNodeHandle for the range’s owner document. * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h: * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: (WebKit::InjectedBundlePageEditorClient::InjectedBundlePageEditorClient): Added. Calls initialize(). (WebKit::InjectedBundlePageEditorClient::shouldBeginEditing): Updated for type change. (WebKit::InjectedBundlePageEditorClient::shouldEndEditing): Ditto. (WebKit::InjectedBundlePageEditorClient::shouldInsertNode): Ditto. (WebKit::InjectedBundlePageEditorClient::shouldInsertText): Ditto. (WebKit::InjectedBundlePageEditorClient::shouldDeleteRange): Ditto. (WebKit::InjectedBundlePageEditorClient::shouldChangeSelectedRange): Ditto. (WebKit::InjectedBundlePageEditorClient::shouldApplyStyle): Ditto. (WebKit::InjectedBundlePageEditorClient::didBeginEditing): Ditto. (WebKit::InjectedBundlePageEditorClient::didEndEditing): Ditto. (WebKit::InjectedBundlePageEditorClient::didChange): Ditto. (WebKit::InjectedBundlePageEditorClient::didChangeSelection): Ditto. (WebKit::InjectedBundlePageEditorClient::willWriteToPasteboard): Ditto. (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): Ditto. (WebKit::InjectedBundlePageEditorClient::didWriteToPasteboard): Ditto. * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: Now derives from API::InjectedBundle::EditorClient. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::shouldDeleteRange): Ditto. (WebKit::WebEditorClient::shouldBeginEditing): Ditto. (WebKit::WebEditorClient::shouldEndEditing): Ditto. (WebKit::WebEditorClient::shouldInsertNode): Ditto. (WebKit::WebEditorClient::shouldInsertText): Ditto. (WebKit::WebEditorClient::shouldChangeSelectedRange): Ditto. (WebKit::WebEditorClient::shouldApplyStyle): Ditto. (WebKit::WebEditorClient::didBeginEditing): Ditto. (WebKit::WebEditorClient::respondToChangedContents): Ditto. (WebKit::WebEditorClient::respondToChangedSelection): Ditto. (WebKit::WebEditorClient::didEndEditing): Ditto. (WebKit::WebEditorClient::didWriteSelectionToPasteboard): Ditto. (WebKit::WebEditorClient::willWriteSelectionToPasteboard): Ditto. (WebKit::WebEditorClient::getClientPasteboardDataForRange): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Initialize m_editorClient. (WebKit::WebPage::setInjectedBundleEditorClient): Replaces initializeInjectedBundleEditorClient and just sets m_editorClient. (WebKit::WebPage::close): Resets m_editorClient. * WebProcess/WebPage/WebPage.h: Changed m_editorClient to a unique_ptr. 2016-12-02 Said Abou-Hallawa [iOS] Add a WebView private configuration for changing the WebContent update frequency https://bugs.webkit.org/show_bug.cgi?id=165289 Reviewed by Tim Horton. Expose a preference which allows us to control the fps of web content updates. * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::contentUpdateFrequency): (API::PageConfiguration::setContentUpdateFrequency): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _contentUpdateFrequency]): (-[WKWebViewConfiguration _setContentUpdateFrequency:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]): (WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency): 2016-12-02 Andy Estes [Cocoa] Adopt the PRODUCT_BUNDLE_IDENTIFIER build setting https://bugs.webkit.org/show_bug.cgi?id=164492 Reviewed by Dan Bernstein. * Configurations/DatabaseService.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to $(PRODUCT_NAME). * Configurations/NetworkService.xcconfig: Ditto. * Configurations/PluginService.32.xcconfig: Ditto. * Configurations/PluginService.64.xcconfig: Ditto. * Configurations/WebContentService.xcconfig: Ditto. * Configurations/WebKit.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to com.apple.$(PRODUCT_NAME:rfc1034identifier). * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist: Changed CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}. * Info.plist: Changed CFBundleIdentifier's value from com.apple.${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}. * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Changed CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}. * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: Ditto. * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: Ditto. * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Ditto. * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Ditto. * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Ditto. * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Ditto. * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto. 2016-12-02 Brent Fulgham [Mac] Update sandbox profiles to use modern syntax and avoid duplication https://bugs.webkit.org/show_bug.cgi?id=165332 Reviewed by Anders Carlsson. Update the Mac sandbox profiles to reflect that modern Cocoa applications communicate with cfprefsd, rather than plists on disk (and have done so for the past several releases). Get rid of some duplicated rules, as well as old compatibility rules that are never triggered under supported operating systems. * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2016-12-02 Gustavo Sverzut Barbieri Fix build break when disabling some features. https://bugs.webkit.org/show_bug.cgi?id=165254 The EFL port was broken if SPELLCHECK was disabled or PLUGIN_ARCHITECTURE is not x11. Reviewed by Michael Catanzaro. * UIProcess/efl/TextCheckerEfl.cpp: (WebKit::TextChecker::checkTextOfParagraph): (WebKit::TextChecker::checkSpellingOfString): Fix UNUSED_PARAM() usage if SPELLCHECK is disabled. * UIProcess/efl/WebPageProxyEfl.cpp: Isolate methods within #if PLUGIN_ARCHITECTURE(X11). 2016-12-01 Jiewen Tan Add a runtime flag for SubtleCrypto https://bugs.webkit.org/show_bug.cgi?id=164982 Reviewed by Brent Fulgham. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubtleCryptoEnabled): (WKPreferencesGetSubtleCryptoEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-12-01 Saam Barati Rename CallFrame::callee() to CallFrame::jsCallee() https://bugs.webkit.org/show_bug.cgi?id=165293 Reviewed by Keith Miller. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::callMethod): * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::callNPJSObject): (WebKit::constructWithConstructor): 2016-12-01 Chris Dumez [iOS][WK2] Tapping an element generates a 'click' event that has 0 as timeStamp https://bugs.webkit.org/show_bug.cgi?id=165270 Reviewed by Simon Fraser. Tapping an element generates a 'click' event that has 0 as timeStamp instead of having a proper timeStamp value. This is breaking some sites. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): (WebKit::WebPage::completeSyntheticClick): 2016-12-01 Tim Horton Try to fix the EFL/Gtk build * UIProcess/efl/WebProcessPoolEfl.cpp: (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions): * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions): 2016-12-01 Tim Horton Every WKWebView initialization spends a few milliseconds hitting the disk https://bugs.webkit.org/show_bug.cgi?id=165268 Reviewed by Brady Eidson. Every WKWebView init currently involves doing directory creation and symlink resolution for a number of paths (to create sandbox extensions for all of our storage directories), which means touching the disk a lot during init. All of these paths are immutable per-WebProcessPool, so, instead, cache them on WebProcessPool and create sandbox extensions from the already-resolved paths. This is a sizable (~4x) speedup when initializing subsequent web views. * Shared/SandboxExtension.h: (WebKit::SandboxExtension::createHandleWithoutResolvingPath): Add createHandleWithoutResolvingPath, which makes a sandbox extension handle without doing symlink resolution. (WebKit::resolvePathForSandboxExtension): (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension): Add two functions that do the same resolution that SandboxExtension::createHandle and ::createHandleForReadWriteDirectory do, but just return the paths, for later use with createHandleWithoutResolvingPath. * Shared/mac/SandboxExtensionMac.mm: (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension): (WebKit::resolvePathForSandboxExtension): (WebKit::SandboxExtension::createHandleWithoutResolvingPath): (WebKit::SandboxExtension::createHandle): (WebKit::SandboxExtension::createHandleForReadWriteDirectory): Implement the aforementioned functions, and reimplement the existing createHandle{ForReadWriteDirectory} functions in terms of them. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformDefaultIconDatabasePath): Stop wasting time generating and resolving a platform default icon database path, since we don't actually use it for anything anymore except to determine whether the icon database is enabled, and we only want to enable it if the client has provided a path. (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions): (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::m_hiddenPageThrottlingTimer): (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): (WebKit::WebProcessPool::createNewWebProcess): * UIProcess/WebProcessPool.h: Resolve paths in resolvePathsForSandboxExtensions, and use the resolved paths along with createHandleWithoutResolvingPath in order to effectively cache the resolution operation. 2016-12-01 Antti Koivisto Revert r208931 https://bugs.webkit.org/show_bug.cgi?id=164924 PLT regression. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeCacheKey): (WebKit::NetworkCache::Cache::makeCacheKey): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: (WebKit::NetworkCache::BlobStorage::BlobStorage): (WebKit::NetworkCache::BlobStorage::add): (WebKit::NetworkCache::BlobStorage::get): * NetworkProcess/cache/NetworkCacheBlobStorage.h: * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::computeSHA1): (WebKit::NetworkCache::makeSalt): Deleted. (WebKit::NetworkCache::readOrMakeSalt): Deleted. * NetworkProcess/cache/NetworkCacheData.h: * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::noPartitionString): (WebKit::NetworkCache::Key::Key): (WebKit::NetworkCache::Key::hasPartition): (WebKit::NetworkCache::Key::computeHash): (WebKit::NetworkCache::Key::hashAsString): (WebKit::NetworkCache::Key::computePartitionHash): Deleted. * NetworkProcess/cache/NetworkCacheKey.h: (WebKit::NetworkCache::Key::hash): (WebKit::NetworkCache::Key::partitionHash): Deleted. (WebKit::NetworkCache::Key::hashAsString): Deleted. (WebKit::NetworkCache::Key::partitionHashAsString): Deleted. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::makeSubresourcesKey): (WebKit::NetworkCache::constructRevalidationRequest): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::open): (WebKit::NetworkCache::traverseRecordsFiles): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::recordDirectoryPathForKey): (WebKit::NetworkCache::decodeRecordHeader): (WebKit::NetworkCache::Storage::readRecord): (WebKit::NetworkCache::Storage::encodeRecord): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::makeSaltFilePath): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::salt): Deleted. 2016-11-30 Sam Weinig [WebIDL] Remove custom bindings for File and Blob constructors https://bugs.webkit.org/show_bug.cgi?id=165218 Reviewed by Darin Adler. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURL): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerBlobURL): * NetworkProcess/NetworkConnectionToWebProcess.h: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerBlobURL): * WebProcess/FileAPI/BlobRegistryProxy.h: Avoid copies of the BlobPart Vector. 2016-11-30 Carlos Garcia Campos [GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting https://bugs.webkit.org/show_bug.cgi?id=164911 Reviewed by Michael Catanzaro. The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an image. We only use the buffer to get the image size, so we could save the image size when the image is created, and then we don't need to care about the buffer anymore. * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::Surface::prepareTextureForPainting): (WebKit::WaylandCompositor::Surface::commit): * UIProcess/gtk/WaylandCompositor.h: 2016-11-30 Antoine Quint [Modern Media Controls] Add an HTML comment flag to turn the feature on https://bugs.webkit.org/show_bug.cgi?id=165226 Reviewed by Dean Jackson. Add new methods to set the Modern Media Controls preference. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetModernMediaControlsEnabled): (WKPreferencesGetModernMediaControlsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2016-11-30 Said Abou-Hallawa Add separate settings and preferences to enable/disable async decoding for large images and animated images https://bugs.webkit.org/show_bug.cgi?id=165177 Reviewed by Simon Fraser. Hook up the async image decoding settings for WebKit2. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _largeImageAsyncDecodingEnabled]): (-[WKPreferences _setLargeImageAsyncDecodingEnabled:]): (-[WKPreferences _animatedImageAsyncDecodingEnabled]): (-[WKPreferences _setAnimatedImageAsyncDecodingEnabled:]): (-[WKPreferences _asyncImageDecodingEnabled]): Deleted. (-[WKPreferences _setAsyncImageDecodingEnabled:]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-11-30 Chris Dumez [iOS][WK2] Turn on HTML interactive form validation feature https://bugs.webkit.org/show_bug.cgi?id=165212 Reviewed by Simon Fraser. Turn on HTML interactive form validation feature on iOS WK2 now that we have a native UI. * Shared/WebPreferencesDefinitions.h: 2016-11-30 Brent Fulgham Correct plugin sandbox after r208611 https://bugs.webkit.org/show_bug.cgi?id=165187 Reviewed by Alex Christensen. In r208611 I removed the 'else' clause of a Scheme conditional that was needed to properly run plugins (such as Flash Player). This change retains the relevant current sandbox content, while still stripping out the old code that is no longer needed. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2016-11-29 Carlos Garcia Campos [GTK] Database process should not initialize gtk https://bugs.webkit.org/show_bug.cgi?id=165138 Reviewed by Sergio Villar Senin. It doesn't use GTK+ at all. * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp: (WebKit::DatabaseProcessMainUnix): (): Deleted. 2016-11-29 Gavin Barraclough Remove WebPage::SetPageSuppressed https://bugs.webkit.org/show_bug.cgi?id=165158 Unreviewed revert accidental change. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setActivityState): 2016-11-29 Gavin Barraclough Remove WebPage::SetPageSuppressed https://bugs.webkit.org/show_bug.cgi?id=165158 Reviewed by Tim Horton. This was scaffolding. We've now refactored to the point that the information driving throttling originates from the UI process (so UI and web processes can have a consistent view of what should throttle), but we don't need a separate message to handle this - necessary state to determine is provided in ActivityState. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateThrottleState): - used to send SetPageSuppressed; no longer does. * UIProcess/WebPageProxy.h: - removed m_pageSuppressed (was used to avoid duplicated messages). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateThrottleState): - compute throttle state based on m_activityState. (WebKit::WebPage::setActivityState): - update throttle state whenever activity state changes. (WebKit::WebPage::updatePreferences): - update throttle state whenever preferences change (throttling can be disabled via preference). (WebKit::WebPage::setPageSuppressed): Deleted. - Removed WebPage::SetPageSuppressed. * WebProcess/WebPage/WebPage.h: - Removed WebPage::SetPageSuppressed. - Added m_processSuppressionEnabled, to cache preference state. * WebProcess/WebPage/WebPage.messages.in: - Removed WebPage::SetPageSuppressed. 2016-11-29 Andy Estes [Cocoa] Enable two clang warnings recommended by Xcode https://bugs.webkit.org/show_bug.cgi?id=164498 Reviewed by Mark Lam. * Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE. 2016-11-29 Eric Carlson [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context https://bugs.webkit.org/show_bug.cgi?id=164760 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::FrameAuthorizationState::FrameAuthorizationState): (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice): (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice): (WebKit::FrameAuthorizationState::reset): (WebKit::FrameAuthorizationState::securityOriginsAreEqual): (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: (WebKit::FrameAuthorizationState::~FrameAuthorizationState): (WebKit::FrameAuthorizationState::frameID): * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::frameID): (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin): (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): 2016-11-29 Wenson Hsieh Scroll snapping on Mac should use AppKit animations https://bugs.webkit.org/show_bug.cgi?id=147261 Reviewed by Brent Fulgham. Add some logic to plumb filtered wheel velocity over to WebCore in the case of mainframe scrolling. See WebCore/ChangeLog for more details. * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::wheelEvent): 2016-11-21 Brian Burg Web Automation: add ObjC SPI to set whether a page is controlled by automation https://bugs.webkit.org/show_bug.cgi?id=165001 Reviewed by Dan Bernstein. Add SPI property to WKWebViewConfiguration and plumb it through to initialize WebPageProxy::m_controlledByAutomation. This is propagated to the WebProcess on creation via WebPageCreationParameters. * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy): * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::isControlledByAutomation): (API::PageConfiguration::setControlledByAutomation): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _isControlledByAutomation]): (-[WKWebViewConfiguration _setControlledByAutomation:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): 2016-11-28 Carlos Garcia Campos [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode https://bugs.webkit.org/show_bug.cgi?id=164303 Reviewed by Michael Catanzaro. Trap also BadDrawable and BadDamage X errors when creating the surface and damage. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::AcceleratedBackingStoreX11::update): 2016-11-28 Chris Dumez [Mac][WK2] Enable HTML interactive form validation https://bugs.webkit.org/show_bug.cgi?id=165123 Reviewed by Simon Fraser. Enable HTML interactive form validation now that we have a native UI for it. * Shared/WebPreferencesDefinitions.h: 2016-11-28 Brent Fulgham Generated sandbox profile is not being put in the correct Resources directory https://bugs.webkit.org/show_bug.cgi?id=165126 Reviewed by Tim Horton. * WebKit2.xcodeproj/project.pbxproj: Copy the generated file to the 'PlugInSandboxProfiles' sub-directory. 2016-11-28 Ryan Haddad Unreviewed, rolling out r209008. This change appears to have caused two fast/mediastrem LayoutTests to fail. Reverted changeset: "[MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context" https://bugs.webkit.org/show_bug.cgi?id=164760 http://trac.webkit.org/changeset/209008 2016-11-28 Andrew Gold Support for HTML Media Capture API https://bugs.webkit.org/show_bug.cgi?id=43239 Reviewed by Tim Horton. In order to enable media capture on iOS, we must first use the AVFoundation API to check/request capture permission from the user for Safari. Then, Safari must request permission on behalf of the webpage to use the capture devices. Additionally, Safari must present UI when the capture is taking place, so WebKit needs to notify the client of a capture session beginning and ending. To do this, we added four methods to WKUIDelegatePrivate to request permission from the user, check for permissions, notify that a capture session has begun, and notify that a capture session has ended. Additionally, we added a private method to WKWebView that allows the client to stop a capture session. * UIProcess/API/APIUIClient.h: (API::UIClient::didBeginCaptureSession): Notifies the client of a capture session beginning. (API::UIClient::didEndCaptureSession): Notifies the client of a capture session ending. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added new delegate methods to request permission, check for permission, notify of a capture session beginning, and notify of a capture session ending. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _stopMediaCapture]): Cancels a media capture session. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Added the new delegate methods. (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): First checks if the user has authorized the client application access capture devices, then uses the WKUIDelegate to request permission for a site from the user. (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): Checks the client for permission to access capture devices. (WebKit::UIDelegate::UIClient::didBeginCaptureSession): Notifies the client of a capture session beginning. (WebKit::UIDelegate::UIClient::didEndCaptureSession): Notifies the client of a capture session ending. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): Calls UIDelegate method to notify the client of a capture session beginning/ending. 2016-11-28 Eric Carlson [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context https://bugs.webkit.org/show_bug.cgi?id=164760 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::FrameAuthorizationState::FrameAuthorizationState): (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice): (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice): (WebKit::FrameAuthorizationState::reset): (WebKit::FrameAuthorizationState::securityOriginsAreEqual): (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: (WebKit::FrameAuthorizationState::~FrameAuthorizationState): (WebKit::FrameAuthorizationState::frameID): * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::frameID): (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin): (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): 2016-11-27 Dean Jackson Removed a WTFLogAlways I left in with a recent commit. * UIProcess/Cocoa/WebViewImpl.mm: (-[WKAccessibilitySettingsObserver _settingsDidChange:]): 2016-11-27 Csaba Osztrogonác Fix unused-private-field build warning in WebKit2/Platform/SharedMemory.h https://bugs.webkit.org/show_bug.cgi?id=165069 Reviewed by Darin Adler. * Platform/SharedMemory.h: 2016-11-26 Simon Fraser Fix the iOS build. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::eventThrottlingDelay): 2016-11-26 Yusuke Suzuki [WTF] Import std::optional reference implementation as WTF::Optional https://bugs.webkit.org/show_bug.cgi?id=164199 Reviewed by Saam Barati and Sam Weinig. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): * NetworkProcess/NetworkLoad.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::responseHasExpired): * NetworkProcess/cache/NetworkCacheCoders.h: (WebKit::NetworkCache::Coder>::encode): (WebKit::NetworkCache::Coder>::decode): (WebKit::NetworkCache::Coder>::encode): Deleted. (WebKit::NetworkCache::Coder>::decode): Deleted. * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::readOrMakeSalt): * NetworkProcess/cache/NetworkCacheData.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry): (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest): (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h: * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest): (WebKit::NetworkCache::Statistics::recordRetrievalFailure): (WebKit::NetworkCache::Statistics::queryWasEverRequested): * NetworkProcess/cache/NetworkCacheStatistics.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::storeBodyAsBlob): (WebKit::NetworkCache::Storage::encodeRecord): (WebKit::NetworkCache::Storage::dispatchWriteOperation): * NetworkProcess/cache/NetworkCacheStorage.h: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder>::encode): (IPC::ArgumentCoder>::decode): (IPC::ArgumentCoder>::encode): Deleted. (IPC::ArgumentCoder>::decode): Deleted. * Platform/IPC/Connection.h: (IPC::Connection::sendWithReply): * Platform/SharedMemory.h: * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::map): * Scripts/webkit/messages.py: (class_template_headers): * Shared/API/APISecurityOrigin.h: (API::SecurityOrigin::create): * Shared/API/Cocoa/_WKRemoteObjectInterface.mm: * Shared/API/c/WKSecurityOriginRef.cpp: (WKSecurityOriginGetPort): * Shared/SessionState.h: * Shared/WebPageCreationParameters.h: * Shared/mac/ObjCObjectGraph.mm: (WebKit::typeFromObject): * Shared/mac/SecItemShim.cpp: (WebKit::sendSecItemRequest): * UIProcess/API/C/WKKeyValueStorageManager.cpp: (WKKeyValueStorageManagerGetStorageDetailsByOrigin): * UIProcess/API/Cocoa/WKSecurityOrigin.mm: (-[WKSecurityOrigin port]): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _navigationGestureDidEnd]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): * UIProcess/API/efl/EwkView.cpp: (EwkView::setCursor): * UIProcess/API/mac/WKView.mm: (toCoreScrollbarStyle): (toAPIScrollbarStyle): * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection): (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection): (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection): * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentSummaryItem): (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::webFrameIDForHandle): (WebKit::WebAutomationSession::switchToBrowsingContext): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): (WebKit::WebAutomationSession::resolveChildFrameHandle): (WebKit::WebAutomationSession::resolveParentFrameHandle): (WebKit::WebAutomationSession::computeElementLayout): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateViewExposedRect): (WebKit::WebViewImpl::setOverlayScrollbarStyle): (WebKit::WebViewImpl::overlayScrollbarStyle): * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::setViewExposedRect): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::viewExposedRect): * UIProcess/InspectorServer/WebSocketServerConnection.cpp: (WebKit::WebSocketServerConnection::didReceiveSocketStreamData): * UIProcess/InspectorServer/WebSocketServerConnection.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll): * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::fileCreationTime): (WebKit::fileModificationTime): * UIProcess/Storage/LocalStorageDatabaseTracker.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::backForwardListState): (WebKit::WebBackForwardList::restoreFromState): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::setOverlayScrollbarStyle): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::overlayScrollbarStyle): * UIProcess/WebPageProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/efl/WebView.cpp: (WebKit::WebView::transformFromScene): * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: * UIProcess/gtk/WebPreferencesGtk.cpp: (WebKit::WebPreferences::platformInitializeStore): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _scrollOffsetForEvent:]): (-[WKContentView _interpretKeyEvent:isCharEvent:]): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeFormDataElement): (WebKit::decodeFormDataElement): (WebKit::decodeV1SessionHistory): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect): * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::completeShippingMethodSelection): (WebKit::WebPaymentCoordinator::completeShippingContactSelection): (WebKit::WebPaymentCoordinator::completePaymentMethodSelection): * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetEventThrottlingBehaviorOverride): * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: (WebKit::PDFPlugin::convertFromPDFViewToRootView): (WebKit::PDFPlugin::convertFromPDFViewToScreen): (WebKit::PDFPlugin::boundsOnScreen): (WebKit::PDFPlugin::geometryDidChange): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::geometryDidChange): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performFrameLoadURLRequest): (WebKit::PluginView::evaluate): * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::pluginLoadClientPolicyForHost): * WebProcess/Plugins/WebPluginInfoProvider.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toFormData): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::preferredScrollbarOverlayStyle): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::certificateInfo): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_userInterfaceLayoutDirection): (WebKit::WebPage::setScrollbarOverlayStyle): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::scrollbarOverlayStyle): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect): 2016-11-26 Sam Weinig Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script https://bugs.webkit.org/show_bug.cgi?id=164965 Reviewed by Simon Fraser. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetIntersectionObserverEnabled): (WKPreferencesGetIntersectionObserverEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Add a preference, defaulting to off, for enabling IntersectionObserver. 2016-11-26 Simon Fraser Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime https://bugs.webkit.org/show_bug.cgi?id=164992 Reviewed by Darin Adler. No more ugly conversion from seconds to milliseconds. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::eventThrottlingDelay): 2016-11-25 Michael Catanzaro [GTK] Follow-up fixes to r208974 https://bugs.webkit.org/show_bug.cgi?id=164771 Unreviewed, implement Carlos's review feedback. * UIProcess/API/gtk/WebKitNotification.cpp: (webkit_notification_get_tag): * UIProcess/API/gtk/WebKitNotificationProvider.cpp: (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag): (WebKitNotificationProvider::show): * UIProcess/API/gtk/WebKitNotificationProvider.h: 2016-11-24 Michael Catanzaro [GTK] Notifications API does not expose or respect the "tag" attribute https://bugs.webkit.org/show_bug.cgi?id=164771 Reviewed by Gustavo Noronha Silva. Expose a tag property on WebKitNotification. Ensure that any previous notification with the same tag is closed when showing a new notification with that tag. * UIProcess/API/gtk/WebKitNotification.cpp: (webkit_notification_class_init): (webkitNotificationCreate): (webkit_notification_get_tag): * UIProcess/API/gtk/WebKitNotification.h: * UIProcess/API/gtk/WebKitNotificationProvider.cpp: (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag): (WebKitNotificationProvider::show): * UIProcess/API/gtk/WebKitNotificationProvider.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: 2016-11-22 Sergio Villar Senin [GTK] Fix introspection warning https://bugs.webkit.org/show_bug.cgi?id=165026 Reviewed by Michael Catanzaro. This fixes an introspection annotation for a new API added in r208532. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkit_web_page_class_init): 2016-11-21 Carlos Garcia Campos [SOUP] Simplify custom protocols handler implementation https://bugs.webkit.org/show_bug.cgi?id=164922 Reviewed by Michael Catanzaro. We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have their own APIs and this is not used by WTR at all. * PlatformEfl.cmake: Remove files from compilation. * PlatformGTK.cmake: Ditto. * Shared/API/c/WKBase.h: * Shared/API/c/soup/WKBaseSoup.h: Removed. * UIProcess/API/APICustomProtocolManagerClient.h: Added. (API::CustomProtocolManagerClient::~CustomProtocolManagerClient): (API::CustomProtocolManagerClient::startLoading): (API::CustomProtocolManagerClient::stopLoading): (API::CustomProtocolManagerClient::invalidate): * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/soup/WKAPICastSoup.h: Removed. * UIProcess/API/C/soup/WKContextSoup.h: Removed. * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed. * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed. * UIProcess/API/C/soup/WKSoupRequestManager.h: Removed. * UIProcess/API/efl/ewk_context.cpp: Remove unneeded include. * UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef. (EwkUrlSchemeRequest::EwkUrlSchemeRequest): (EwkUrlSchemeRequest::finish): (EwkUrlSchemeRequest::invalidate): * UIProcess/API/efl/ewk_url_scheme_request_private.h: (EwkUrlSchemeRequest::create): (EwkUrlSchemeRequest::manager): * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added. (attachCustomProtocolManagerClientToContext): * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h. * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed. * UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed. * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager. (webkitURISchemeRequestCreate): (webkitURISchemeRequestCancel): (webkitURISchemeRequestGetManager): (webkitURISchemeRequestInvalidate): (webkitURISchemeRequestReadCallback): (webkit_uri_scheme_request_finish_error): * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h: * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkitWebContextDispose): (webkit_web_context_register_uri_scheme): (webkitWebContextStartLoadingCustomProtocol): (webkitWebContextInvalidateCustomProtocolRequests): * UIProcess/API/gtk/WebKitWebContextPrivate.h: * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h: * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm: (WebKit::CustomProtocolManagerProxy::processDidClose): * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp: (WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client. (WebKit::CustomProtocolManagerProxy::startLoading): Notify the client. (WebKit::CustomProtocolManagerProxy::stopLoading): Ditto. (WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process. (WebKit::CustomProtocolManagerProxy::didLoadData): Ditto. (WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto. (WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto. * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed. * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed. * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed. * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement. (WebKit::WebProcessPool::setCustomProtocolManagerClient): (WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol. (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache. * UIProcess/WebProcessPool.h: * UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient. (WebKit::RequestManagerClientEfl::RequestManagerClientEfl): (WebKit::RequestManagerClientEfl::registerURLSchemeHandler): * UIProcess/efl/RequestManagerClientEfl.h: * UIProcess/efl/WebProcessPoolEfl.cpp: * UIProcess/gtk/WebProcessPoolGtk.cpp: * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to build the list of custom protocols to send to the network process. 2016-11-21 Alex Christensen Fix Sierra CMake build after r208452 https://bugs.webkit.org/show_bug.cgi?id=164437 * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): I haven't enabled VIDEO_PRESENTATION_MODE in the CMake build yet. It's needed for WebPlaybackSessionInterfaceMac to exist. 2016-11-21 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.2 release. * gtk/NEWS: Add release notes for 2.15.2. 2016-11-21 Carlos Garcia Campos Remove m_customProtocolManagerProxy from WebProcessProxy https://bugs.webkit.org/show_bug.cgi?id=164908 Reviewed by Andreas Kling. Since the network process is mandatory, the custom protocol manager proxy of WebProcessProxy is unused and can be removed. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): * UIProcess/WebProcessProxy.h: 2016-11-20 Zan Dobersek [EncryptedMedia] Make EME API runtime-enabled https://bugs.webkit.org/show_bug.cgi?id=164927 Reviewed by Jer Noble. Add the new EncryptedMediaAPI preference. Set the same feature flag on the shared RuntimeEnabledFeatures object to the corresponding value that's stored in the WebPreferencesStore. InjectedBundle::overrideBoolPreferenceForTestRunner() does the same when the 'WebKitEncryptedMediaAPIEnabled' preference is overridden in WKTR for testing purposes. * Shared/WebPreferencesDefinitions.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-11-19 Antti Koivisto Salt network cache hashes https://bugs.webkit.org/show_bug.cgi?id=164924 Reviewed by Alex Christensen. To enhance privacy make cache content unidentifiable from file names alone. This is done by generating a unique persistent salt for each cache instance. It is used when computing hashes used in file names. The patch also replaces plain text partition directory names with salted hashes. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::makeCacheKey): (WebKit::NetworkCache::makeCacheKey): Deleted. * NetworkProcess/cache/NetworkCache.h: Increment cache version. * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: (WebKit::NetworkCache::BlobStorage::BlobStorage): (WebKit::NetworkCache::BlobStorage::add): (WebKit::NetworkCache::BlobStorage::get): Use salt for blob content hash. * NetworkProcess/cache/NetworkCacheBlobStorage.h: * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::computeSHA1): For simplicity all SHA1s are now salted. (WebKit::NetworkCache::makeSalt): (WebKit::NetworkCache::readOrMakeSalt): Read salt if it exists, generate and persist it otherwise. * NetworkProcess/cache/NetworkCacheData.h: * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::Key::Key): Remove the "No partition" string and just empty. That was only needed to have a directory name of some sort. (WebKit::NetworkCache::Key::computeHash): Use salt for key hash. (WebKit::NetworkCache::Key::computePartitionHash): Separate hash for partition. * NetworkProcess/cache/NetworkCacheKey.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::makeSubresourcesKey): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::makeSaltFilePath): (WebKit::NetworkCache::Storage::open): Cache can't be opened if we can't read or persist a salt. (WebKit::NetworkCache::traverseRecordsFiles): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::synchronize): (WebKit::NetworkCache::Storage::recordDirectoryPathForKey): Use the partition hash in the directory name instead of a plain text name. (WebKit::NetworkCache::decodeRecordHeader): (WebKit::NetworkCache::Storage::readRecord): (WebKit::NetworkCache::Storage::encodeRecord): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::Storage::clear): * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::salt): 2016-11-19 Simon Fraser [iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing https://bugs.webkit.org/show_bug.cgi?id=164855 Reviewed by Sam Weinig. During UI-process panning and zooming, we send visible rect updates to the web process with inStableState=false, and don't update GraphicsLayers until we get into a stable state. This causes a problem where the web process has a stale notion of where the GraphicsLayers for position:fixed elements are, but is then told to update tiling coverage with an up-to-date visible rect. The existing "sync layer positions" path isn't useful to fix this, because it breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints in the scrolling tree. To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to reconcileViewportConstrainedLayerPositions). Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll): * UIProcess/Scrolling/RemoteScrollingTree.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::flushPendingLayerChanges): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer): * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::flushPendingLayerChanges): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): Always push the custom fixed position rect down, but send ScrollingLayerPositionAction::SetApproximate if the state is not stable. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): 2016-11-18 Simon Fraser Make it possible to test non-stable-state scrolling on iOS https://bugs.webkit.org/show_bug.cgi?id=164905 Reviewed by Dan Bernstein. Make it possible for an iOS layout test to force every visible rect update from the UI process to the web process to be in a non-stable state. This emulates what happens during panning and zooming interactions, and allows us to test the scrolling and layer trees in these transient states. This is done by adding a testing property on WKWebView, _stableStateOverride, whose getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView consults the NSNumber's boolValue and uses it to override the stable state. To facilitate this kind of testing, also add immediateScrollToOffset() and immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate() which provides a callback that fires after one trip to the web process and back. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateVisibleContentRectAfterScrollInView:]): (-[WKWebView _stableStateOverride]): (-[WKWebView _setStableStateOverride:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2016-11-18 Simon Fraser [iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override https://bugs.webkit.org/show_bug.cgi?id=164980 Reviewed by Chris Dumez. WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser" flag that impacts tile coverage. During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare(). Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetEventThrottlingBehaviorOverride): * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::eventThrottlingDelay): 2016-11-18 Simon Fraser Remove use of std::chrono in WebPage and entrained code https://bugs.webkit.org/show_bug.cgi?id=164967 Reviewed by Tim Horton. Replace std::chrono with Seconds and Monotonic Time. Use more C++11 initialization for WebPage data members. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::timestamp): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/ios/WKContentView.mm: (WebKit::HistoricalVelocityData::HistoricalVelocityData): (WebKit::HistoricalVelocityData::velocityForNewData): (WebKit::HistoricalVelocityData::append): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::eventThrottlingDelay): * WebProcess/WebPage/ViewUpdateDispatcher.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::m_userActivityHysteresis): (WebKit::WebPage::didFlushLayerTreeAtTime): (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::eventThrottlingDelay): (WebKit::WebPage::updateVisibleContentRects): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): 2016-11-18 Dean Jackson AX: "(inverted-colors)" media query only matches on page reload; should match on change https://bugs.webkit.org/show_bug.cgi?id=163564 Reviewed by Simon Fraser. Listen for the appropriate notifications that accessibility settings have changed. This is a single notification on macOS, which uses WebViewImpl, and more fine-grained notifications on iOS, using WKWebView. When we see the notification, send a message to the WebProcess which will then tell the WebCore::Page. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _accessibilitySettingsDidChange:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (-[WKAccessibilitySettingsObserver initWithImpl:]): (-[WKAccessibilitySettingsObserver dealloc]): (-[WKAccessibilitySettingsObserver _settingsDidChange:]): (WebKit::WebViewImpl::WebViewImpl): (WebKit::WebViewImpl::accessibilitySettingsDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::accessibilitySettingsDidChange): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::accessibilitySettingsDidChange): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-11-18 Jeremy Jones USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12)) https://bugs.webkit.org/show_bug.cgi?id=164962 Reviewed by Dean Jackson. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 2016-11-18 Enrica Casucci Refactor drag and drop for WebKit2 to encode DragData message exchange. https://bugs.webkit.org/show_bug.cgi?id=164945 Reviewed by Tim Horton. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::performDragControllerAction): * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::willPerformDragDestinationAction): (WebKit::WebDragClient::actionMaskForDrag): * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-11-18 Jeremy Jones Add runtime flag to enable pointer lock. Enable pointer lock feature for mac. https://bugs.webkit.org/show_bug.cgi?id=163801 Reviewed by Simon Fraser. Add SPI to notify client of pointer lock and for client to allow or deny. Unlock pointer when view is not longer active. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/APIUIClient.h: (API::UIClient::requestPointerLock): (API::UIClient::didLosePointerLock): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): (WKPageDidAllowPointerLock): (WKPageDidDenyPointerLock): * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/C/WKPreferences.cpp: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::requestPointerLock): (WebKit::UIDelegate::UIClient::didLosePointerLock): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::resetStateAfterProcessExited): (WebKit::WebPageProxy::requestPointerLock): (WebKit::WebPageProxy::didAllowPointerLock): (WebKit::WebPageProxy::didDenyPointerLock): (WebKit::WebPageProxy::requestPointerUnlock): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-11-17 Carlos Garcia Campos Downloads started by context menu actions should also have a web view associated https://bugs.webkit.org/show_bug.cgi?id=164364 Reviewed by Michael Catanzaro. When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case. * UIProcess/API/gtk/WebKitDownload.cpp: (webkitDownloadCreateForRequest): Deleted. * UIProcess/API/gtk/WebKitDownloadPrivate.h: * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download() because the WebKitDownload could have already been created by the web view download handler at this point. * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_download_uri): We no longer need to associate the web view to the download here. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify the page client. 2016-11-17 Alex Christensen REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout https://bugs.webkit.org/show_bug.cgi?id=164631 Reviewed by Carlos Garcia Campos. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::convertToDownload): I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload. m_networkLoad was not being set to nullptr before it was being checked in NetworkResourceLoader::abort 2016-11-17 Alex Christensen Fix CMake build after r208865 https://bugs.webkit.org/show_bug.cgi?id=164894 * PlatformMac.cmake: Add new files. 2016-11-17 Ryosuke Niwa WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled https://bugs.webkit.org/show_bug.cgi?id=164857 Reviewed by Wenson Hsieh. * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled): 2016-11-17 John Wilander Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed https://bugs.webkit.org/show_bug.cgi?id=164659 Reviewed by Andy Estes. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Consistent naming with 'remove' rather than 'delete'. Now removes localStorage, IndexDB, disk cache, and memory cache too. Updates statistics with number of times it has removed data records. (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): No longer checks whether it has enough data since the classification rules are absolute, not relative. (WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted. * UIProcess/WebResourceLoadStatisticsStore.h: Consistent naming with 'remove' rather than 'delete'. 2016-11-17 Brady Eidson Add _WKIconLoadingDelegate SPI. https://bugs.webkit.org/show_bug.cgi?id=164894 Reviewed by Alex Christensen. With this client, WebCore will ask the FrameLoaderClient about each icon found in the . WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load. For icons the app decides to load, WebKit will pass the data to the app without storing locally. * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h. (API::IconLoadingClient::~IconLoadingClient): (API::IconLoadingClient::getLoadDecisionForIcon): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _iconLoadingDelegate]): (-[WKWebView _setIconLoadingDelegate:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h. * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h. * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h. (-[_WKLinkIconParameters _initWithLinkIcon:]): (-[_WKLinkIconParameters url]): (-[_WKLinkIconParameters mimeType]): (-[_WKLinkIconParameters size]): (-[_WKLinkIconParameters iconType]): * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h. * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h. * UIProcess/Cocoa/IconLoadingDelegate.mm: Added. (WebKit::IconLoadingDelegate::IconLoadingDelegate): (WebKit::IconLoadingDelegate::~IconLoadingDelegate): (WebKit::IconLoadingDelegate::createIconLoadingClient): (WebKit::IconLoadingDelegate::delegate): (WebKit::IconLoadingDelegate::setDelegate): (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient): (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient): (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setIconLoadingClient): (WebKit::WebPageProxy::getLoadDecisionForIcon): (WebKit::WebPageProxy::finishedLoadingIcon): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::iconLoadingClient): * UIProcess/WebPageProxy.messages.in: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::useIconLoadingClient): (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): (WebKit::WebFrameLoaderClient::finishedLoadingIcon): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: (WebKit::WebFrameLoaderClient::setUseIconLoadingClient): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didGetLoadDecisionForIcon): (WebKit::WebPage::setUseIconLoadingClient): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-11-17 Saam Barati Remove async/await compile time flag and enable tests https://bugs.webkit.org/show_bug.cgi?id=164828 Reviewed by Yusuke Suzuki. * Configurations/FeatureDefines.xcconfig: 2016-11-17 Yusuke Suzuki [JSC] WTF::TemporaryChange with WTF::SetForScope https://bugs.webkit.org/show_bug.cgi?id=164761 Reviewed by Saam Barati. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::initialize): * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::didReceiveMessage): (WebKit::WebProcessConnection::didReceiveSyncMessage): * Shared/API/Cocoa/WKRemoteObjectCoder.mm: (createEncodedObject): (decodeObject): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateTextTouchBar): * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): * UIProcess/gtk/WebPasteboardProxyGtk.cpp: (WebKit::WebPasteboardProxy::writeToClipboard): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::flushPendingLayerChanges): (WebKit::CompositingCoordinator::purgeBackingStores): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::mouseEvent): (WebKit::WebPage::keyEvent): (WebKit::WebPage::dispatchTouchEvent): (WebKit::WebPage::setInitialFocus): (WebKit::WebPage::insertTextAsync): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: * WebProcess/WebPage/mac/WebPageMac.mm: 2016-11-16 Brent Fulgham Unreviewed build fix after r208589 The generated com.apple.WebKit.plugin-common.sb file was not getting copied into the Resources folder, so was not deployed with WebKit. We need to treat it like com.apple.WebProcess.sb and the other generated files. * WebKit2.xcodeproj/project.pbxproj: Tell Xcode to include the generated file in the framework Resources. 2016-11-16 Yusuke Suzuki [ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag https://bugs.webkit.org/show_bug.cgi?id=164827 Reviewed by Ryosuke Niwa. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: Annotated ES6 Modules option with DEFAULT_EXPERIMENTAL_FEATURES_ENABLED. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetES6ModulesEnabled): (WKPreferencesGetES6ModulesEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-11-16 Simon Fraser Add logging support to VisibleContentRectUpdateInfo https://bugs.webkit.org/show_bug.cgi?id=164825 Reviewed by Zalan Bujtas. Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging stream does single-line output, so also make a convenience dump() function that will product multiline output. Result look like: (VisibleContentRectUpdateInfo (lastLayerTreeTransactionID 54) (exposedContentRect (523.44,1258.63) width=676.20 height=901.60) (unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82) (unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50) (customFixedPositionRect (219.64,935) width=980 height=1225) (obscuredInset width=0 height=39.50) (scale 1.14) (inStableState 0) (timestamp 736446.61) (verticalVelocity -11.36)) * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::dump): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): 2016-11-15 Simon Fraser [iOS WK2] Scroll view scrolling and zooming animations can keep running across page loads https://bugs.webkit.org/show_bug.cgi?id=164810 Reviewed by Tim Horton. Scrolling and zooming animations can leak across page loads, which makes tests flakey, and is unexpected by users. Tested by scrollingcoordinator/ios/sync-layer-positions-after-scroll.html followed by scrollingcoordinator/ios/ui-scrolling-tree.html * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLoadForMainFrame]): 2016-11-15 Jon Lee Report active video and audio capture devices separately https://bugs.webkit.org/show_bug.cgi?id=164769 Reviewed by Eric Carlson. Replace kWKMediaHasActiveCaptureDevice with kWKMediaHasActiveAudioCaptureDevice and kWKMediaHasActiveVideoCaptureDevice * UIProcess/API/C/WKPage.cpp: (WKPageGetMediaState): * UIProcess/API/C/WKPagePrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): Update the mask to include the two bits. 2016-11-14 Simon Fraser [iOS WK2] Implement support for visual viewports https://bugs.webkit.org/show_bug.cgi?id=164765 Reviewed by Tim Horton. Adopt the visual viewport scrolling model in iOS WK2. Pass the parameters used for computing the layout viewport up to WK2 via RemoteLayerTreeTransaction. These are stored on WebPageProxy. When they change, _didCommitLayerTree triggers a -_updateVisibleContentRects. WebPageProxy::computeCustomFixedPositionRect() is the function that computes the "override" layout viewport. It starts with the baseLayoutViewportSize from the web process (which is based on the initial containing block size), then ensures that it's no smaller than the unobscured content rect, since it makes no sense for the layout viewport to be smaller than the visual viewport. The static FrameView::computeLayoutViewportOrigin() is then use to "push" the layout viewport around as the visual viewport changes. * Shared/VisibleContentRectUpdateInfo.h: * Shared/WebCoreArgumentCoders.cpp: Encode LayoutSize and LayoutPoint. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::baseLayoutViewportSize): (WebKit::RemoteLayerTreeTransaction::setBaseLayoutViewportSize): (WebKit::RemoteLayerTreeTransaction::minStableLayoutViewportOrigin): (WebKit::RemoteLayerTreeTransaction::setMinStableLayoutViewportOrigin): (WebKit::RemoteLayerTreeTransaction::maxStableLayoutViewportOrigin): (WebKit::RemoteLayerTreeTransaction::setMaxStableLayoutViewportOrigin): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): (WebKit::RemoteLayerTreeTransaction::description): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled): Accessor. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::customFixedPositionRect): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect): * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView _didCommitLayerTree:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeCustomFixedPositionRect): When visual viewports are enabled, compute the layout viewport rect, taking the baseLayoutViewportSize and the current unobscured rect into account. (WebKit::WebPageProxy::updateLayoutViewportParameters): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): * WebProcess/WebPage/WebPage.cpp: Encode in the transaction the layout viewport parameters (with minor refactor). (WebKit::WebPage::willCommitLayerTree): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): This is where the web process receives the new override layout viewport from the web process (with some logging). 2016-11-15 Jon Lee Remove HasMediaCaptureDevice https://bugs.webkit.org/show_bug.cgi?id=164767 Reviewed by Eric Carlson. * UIProcess/API/C/WKPage.cpp: Remove kWKMediaHasCaptureDevice. (WKPageGetMediaState): * UIProcess/API/C/WKPagePrivate.h: 2016-11-15 Daniel Bates Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level https://bugs.webkit.org/show_bug.cgi?id=164662 Reviewed by Alex Christensen and Brady Eidson. Make changes to NetworkDataTask similar to the changes made to ResourceHandle so as to disallow non-default port HTTP 0.9 loads when using the ENABLE(NETWORK_SESSION) networking code path in WebKit2. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9. Otherwise notify the client that we received a response. * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::resume): Substitute dispatchDidReceiveResponse() for didReceiveResponse() as the latter has been renamed to the former. (WebKit::NetworkDataTaskBlob::getSizeForNext): Ditto. (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): Renamed from didReceiveResponse(). * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::didReceiveResponse): Deleted. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::didSendRequest): Substitute dispatchDidReceiveResponse() for didReceiveResponse() as the latter has been renamed to the former. (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Renamed from didReceiveResponse(). Also remove the local variable response and inline its value into the call to ResourceHandle::didReceiveResponse() as this variable is used exactly once in this function and its name does not describe its purpose any more than its value. (WebKit::NetworkDataTaskSoup::didRequestNextPart): Substitute dispatchDidReceiveResponse() for didReceiveResponse() as the latter has been renamed to the former. * NetworkProcess/soup/NetworkDataTaskSoup.h: 2016-11-14 Alex Christensen Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData https://bugs.webkit.org/show_bug.cgi?id=164720 Reviewed by Brady Eidson. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::indexedDatabaseOrigins): * DatabaseProcess/DatabaseProcess.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): * Shared/API/c/WKSecurityOriginRef.cpp: (WKSecurityOriginCreateFromDatabaseIdentifier): * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::Entry::encode): (WebKit::WebsiteData::Entry::decode): * Shared/WebsiteData/WebsiteData.h: * UIProcess/API/C/WKKeyValueStorageManager.cpp: (WKKeyValueStorageManagerGetStorageDetailsByOrigin): * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): (WebKit::LocalStorageDatabaseTracker::origins): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::exceededDatabaseQuota): (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota): (WebKit::WebPageProxy::requestGeolocationPermissionForFrame): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::mediaKeyOrigins): * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetDatabaseQuota): * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins): * WebProcess/Storage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::create): (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::securityOrigin): * WebProcess/Storage/StorageAreaImpl.h: * WebProcess/Storage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::dispatchSessionStorageEvent): (WebKit::StorageAreaMap::dispatchLocalStorageEvent): * WebProcess/Storage/StorageAreaMap.h: (WebKit::StorageAreaMap::securityOrigin): * WebProcess/Storage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap): (WebKit::StorageNamespaceImpl::storageArea): * WebProcess/Storage/StorageNamespaceImpl.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::exceededDatabaseQuota): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): 2016-11-14 Brent Fulgham [Mac][iOS][WK2] Tighten permissions to change CapsLock delay https://bugs.webkit.org/show_bug.cgi?id=164725 Reviewed by Alexey Proskuryakov. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Limit access to the IOKit connection that actually needs it. 2016-11-14 Brent Fulgham Unreviewed sandbox fix after r208702 Correct version check to avoid breaking users in Safari Technology Preview or WebKit nightlies. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2016-11-14 Pranjal Jumde Keychain access in WebKit should be limited to a single process. Earlier this was blocked on the networking framework requiring direct access to keychain, this will be resolved in the upcoming version of macOS. https://bugs.webkit.org/show_bug.cgi?id=163710 Reviewed by Darin Adler. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2016-11-13 Darin Adler Remove many includes of ExceptionCode.h https://bugs.webkit.org/show_bug.cgi?id=164706 Reviewed by Alex Christensen. * WebProcess/Storage/StorageAreaImpl.cpp: Removed include of ExceptionCode.h. 2016-11-13 Darin Adler Fix exception handling in SQL database code, streamline and update code https://bugs.webkit.org/show_bug.cgi?id=164685 Reviewed by Sam Weinig. * UIProcess/API/efl/ewk_database_manager.cpp: (EwkDatabaseManager::getDatabaseOrigins): Update for change to the DatabaseTracker::origins function. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): Use DatabaseTracker. (WebKit::WebsiteDataStore::removeData): Ditto. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetDatabaseQuota): Ditto. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processWillSuspendImminently): Ditto. 2016-11-12 Simon Fraser Add a way to get the UI-side scrolling tree as text via UIScriptController https://bugs.webkit.org/show_bug.cgi?id=164697 Reviewed by Zalan Bujtas. Add a property to WKWebView to retrieve the scrolling tree as text, for testing. Expose it via the RemoteScrollingCoordinatorProxy. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _scrollingTreeAsText]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeAsText): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: 2016-11-12 Daniel Bates Incorrect release log message emitted when waiting/not waiting for the WebProcess continue a load https://bugs.webkit.org/show_bug.cgi?id=164605 Reviewed by Darin Adler. Currently we emit a release log message of the form "didReceiveResponse: Should wait for message from WebContent process ..." when we are not waiting for the WebProcess and emit a message of the form "didReceiveResponse: Should not wait for message from WebContent process" when we are waiting on the WebProcess. Invert these messages to reflect whether we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponsewhether. For the main resource NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::No because we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponse to continue the load. For a subresource we do not need to wait for the WebProcess to allow the load to continue and hence NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::Yes. * NetworkProcess/NetworkResourceLoader.cpp: 2016-11-12 Simon Fraser [iOS WK2] Share some code with Mac for post-async-scroll state reconciliation https://bugs.webkit.org/show_bug.cgi?id=164694 Reviewed by Zalan Bujtas. Rather than calling FrameView directly, call reconcileScrollingState() on the scrolling coordinator. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2016-11-12 Brian Burg Web Automation: terminate the automation session if the web process crashes https://bugs.webkit.org/show_bug.cgi?id=164671 Reviewed by Joseph Pecoraro. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::disconnect): (WebKit::WebAutomationSession::terminate): Factor out code that disconnects the remote, unpairs, and notifies the client. Then, expose terminate() which can be called without a FrontendChannel. Calling this causes the _WKAutomationDelegate to clear the local-side session in the browser, and disconnecting from the remote will hang up the remote-side session. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidCrash): Terminate the session. 2016-11-11 Alex Christensen Use SecurityOriginData as keys in StorageManager https://bugs.webkit.org/show_bug.cgi?id=159834 Reviewed by Brady Eidson. * Platform/IPC/HandleMessage.h: (IPC::callMemberFunctionImpl): Add a missing std::forward so we can use this callMemberFunctionImpl with rvalues. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): * UIProcess/API/C/WKKeyValueStorageManager.cpp: (WKKeyValueStorageManagerGetKeyValueStorageOrigins): (WKKeyValueStorageManagerDeleteEntriesForOrigin): * UIProcess/API/C/WKResourceCacheManager.cpp: (WKResourceCacheManagerGetCacheOrigins): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getNetworkProcessConnection): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Storage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::create): (WebKit::LocalStorageDatabase::LocalStorageDatabase): (WebKit::LocalStorageDatabase::openDatabase): (WebKit::LocalStorageDatabase::close): * UIProcess/Storage/LocalStorageDatabase.h: * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::databasePath): (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin): (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin): (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): (WebKit::LocalStorageDatabaseTracker::origins): * UIProcess/Storage/LocalStorageDatabaseTracker.h: * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::StorageArea::securityOrigin): (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea): (WebKit::StorageManager::TransientLocalStorageNamespace::origins): (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin): (WebKit::StorageManager::StorageArea::StorageArea): (WebKit::StorageManager::StorageArea::clone): (WebKit::StorageManager::StorageArea::items): (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded): (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea): (WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin): (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas): (WebKit::StorageManager::SessionStorageNamespace::origins): (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin): (WebKit::StorageManager::SessionStorageNamespace::cloneTo): (WebKit::StorageManager::getSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins): (WebKit::StorageManager::getLocalStorageOrigins): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin): (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins): (WebKit::StorageManager::createLocalStorageMap): (WebKit::StorageManager::createTransientLocalStorageMap): (WebKit::StorageManager::createSessionStorageMap): (WebKit::StorageManager::getOrCreateLocalStorageNamespace): (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace): (WebKit::StorageManager::StorageArea::create): Deleted. (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea): Deleted. (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea): Deleted. * UIProcess/Storage/StorageManager.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::displayNameForOrigin): (WebKit::WebsiteDataRecord::add): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::mediaKeyOrigins): (WebKit::WebsiteDataStore::removeMediaKeys): * UIProcess/WebsiteData/WebsiteDataStore.h: Fewer SecurityOrigin uses in the UIProcess! Hooray! 2016-11-11 Ryosuke Niwa Hovering over a slotted Text node clears hover state https://bugs.webkit.org/show_bug.cgi?id=164002 Reviewed by Simon Fraser. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performImmediateActionHitTestAtLocation): 2016-11-11 Wenson Hsieh [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements https://bugs.webkit.org/show_bug.cgi?id=164538 Reviewed by Ryosuke Niwa. Consult HTMLElement::autocorrect() and HTMLElement::autocapitalizeType() when assembling the assisted node information for the currently assisted node. * Shared/AssistedNodeInformation.h: * UIProcess/ios/WKContentViewInteraction.mm: (toUITextAutocapitalize): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2016-11-11 Beth Dakin Move to modern TouchBar methods https://bugs.webkit.org/show_bug.cgi?id=164655 -and corresponding- rdar://problem/29226911 Reviewed by Wenson Hsieh. customizationDefaultItemIdentifiers -> defaultItemIdentifiers itemIdentifiers -> defaultItemIdentifiers defaultItems -> templateItems * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::plainTextTouchBarDefaultItemIdentifiers): (WebKit::richTextTouchBarDefaultItemIdentifiers): (WebKit::WebViewImpl::setUpTextTouchBar): (WebKit::WebViewImpl::updateTextTouchBar): (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers): Deleted. (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers): Deleted. 2016-11-11 Brent Fulgham Get rid of old sandbox rules for OS's we no longer support https://bugs.webkit.org/show_bug.cgi?id=164638 Reviewed by Simon Fraser. Clean up the various sandbox profiles to get rid of rules that applied to operating system versions we no longer support, or were added in support of bugs that have long since been fixed. This should introduce no change in behavior. * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb: * WebProcess/com.apple.WebProcess.sb.in: 2016-11-11 Brady Eidson IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing. https://bugs.webkit.org/show_bug.cgi?id=164641 Reviewed by Alex Christensen. * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: 2016-11-11 Eric Carlson [MediaStream] defer resolution of getUserMedia promise made in a background tab https://bugs.webkit.org/show_bug.cgi?id=164643 Reviewed by Brady Eidson. Do not ask for user for access to capture devices when the document does not allow media to play, wait until playback is allowed. * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest): (WebKit::UserMediaPermissionRequestManager::mediaCanStart): (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::mediaCanStart): * WebProcess/Plugins/PluginView.h: 2016-11-11 Darin Adler Move Node from ExceptionCode to ExceptionOr https://bugs.webkit.org/show_bug.cgi?id=164515 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp: (webkit_dom_html_select_element_remove): Updated exception handling. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp: (webkit_dom_node_insert_before): Ditto. (webkit_dom_node_replace_child): Ditto. (webkit_dom_node_remove_child): Ditto. (webkit_dom_node_append_child): Ditto. (webkit_dom_node_clone_node_with_error): Ditto. (webkit_dom_node_set_node_value): Ditto. (webkit_dom_node_set_text_content): Ditto. * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm: (-[WKDOMNode insertNode:before:]): Ditto. (-[WKDOMNode appendChild:]): Ditto. (-[WKDOMNode removeChild:]): Ditto. * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: (WebKit::PDFPlugin::PDFPlugin): Removed unneeded ASSERT_NO_EXCEPTION. * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): Ditto. 2016-11-11 Megan Gardner [Cocoa] Support wide gamut for Drag Image UI https://bugs.webkit.org/show_bug.cgi?id=164490 Reviewed by Tim Horton. Fixed an error in the gating for the new wide gamut support in ShareableBitmap. We should always respect the flags straight out, and not make decisions later, it can lead to mismatched data and data storage. Added support for wide gamut in createCGImage. * Shared/cg/ShareableBitmapCG.cpp: (WebKit::bitmapInfo): (WebKit::colorSpace): (WebKit::ShareableBitmap::createGraphicsContext): (WebKit::ShareableBitmap::createCGImage): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): (WebKit::WebDragClient::startDrag): 2016-11-11 Beth Dakin Get touch bar code building for open source builds https://bugs.webkit.org/show_bug.cgi?id=164610 Reviewed by Wenson Hsieh. * config.h: 2016-11-10 Brent Fulgham Remove unused FontService from sandbox profile https://bugs.webkit.org/show_bug.cgi?id=164625 Reviewed by Alex Christensen. Part of some general sandbox profile gardening. Convert the Plugin process sandbox into * Configurations/WebKit.xcconfig: Add exclude for com.apple.WebKit.plugin-common.sb.in. * DerivedSources.make: Update to generate com.apple.WebKit.plugin-common.sb from .in file * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Copied from Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb. * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Removed. * WebKit2.xcodeproj/project.pbxproj: Update for new .in file. * WebProcess/com.apple.WebProcess.sb.in: Remove com.apple.FontServer from macOS Sierra and newer. 2016-11-10 Eric Carlson [MediaStream] apply constraints passed to getUserMedia() https://bugs.webkit.org/show_bug.cgi?id=164561 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): 2016-11-10 Alex Christensen Move SecurityOrigin::databaseIdentifier() to SecurityOriginData https://bugs.webkit.org/show_bug.cgi?id=164573 Reviewed by Brady Eidson. * Shared/API/c/WKSecurityOriginRef.cpp: (WKSecurityOriginCopyDatabaseIdentifier): * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::databasePath): (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin): (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeMediaKeys): * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageCopyOriginsWithApplicationCache): * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::exceededDatabaseQuota): (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): 2016-11-10 Alex Christensen Remove unused CFURLCACHE code https://bugs.webkit.org/show_bug.cgi?id=164551 Reviewed by Antti Koivisto. WebKit2 doesn't use CFURLCache, but we still have some unused code that seems to use it. * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::clearDiskCacheEntries): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::partitionName): Deleted. (WebKit::NetworkProcess::cfURLCacheOrigins): Deleted. (WebKit::NetworkProcess::clearCFURLCacheForOrigins): Deleted. 2016-11-10 Carlos Garcia Campos [Linux] Memory process values shown by the WebMemorySampler in linux are wrong https://bugs.webkit.org/show_bug.cgi?id=164591 Reviewed by Michael Catanzaro. It's parsing /proc/self/statm, and returning the values as if they were bytes, but they are number of pages, so to get the bytes we need to take the page size into account. In r208534 I added a method to get /proc/self/statm values in bytes to Platform layer, so we can simply use that instead. * Shared/linux/WebMemorySamplerLinux.cpp: (WebKit::WebMemorySampler::sampleWebKit): Use currentProcessMemoryStatus() and update the descriptions to clarify that values are in bytes. 2016-10-14 Carlos Garcia Campos MemoryPressureHandler shouldn't know how to release WebCore memory https://bugs.webkit.org/show_bug.cgi?id=160497 Reviewed by Michael Catanzaro. Set the low memory handler before installing the memory pressure handler. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2016-10-27 Sergio Villar Senin [GTK] New API to notify about dynamically added forms https://bugs.webkit.org/show_bug.cgi?id=164050 Reviewed by Carlos Garcia Campos. This new API exports the WebCore event didAssociateFormControls through the web extension mechanism. This will help clients (mainly web browsers) to implement robust auto filling mechanisms. It deals nicely with dynamically created forms (and form controls) as many JS frameworks do nowadays. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Added a FormClient implementation of API::InjectedBundle::FormClient. (webkitWebPageFormControlsAssociated): Emit the new signal. (webkit_web_page_class_init): Added the new signal "forms-controls-associated". (webkitWebPageCreate): Set the WebPage as a FormClient. 2016-11-10 Carlos Alberto Lopez Perez [GTK] Allow to use WebMemorySampler feature. https://bugs.webkit.org/show_bug.cgi?id=164517 Reviewed by Carlos Garcia Campos. Enable the WebMemorySampler with the environment variable WEBKIT_SAMPLE_MEMORY. When enabled, it will dump the stats to /tmp each second. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): 2016-11-10 Philippe Normand [WK2][GTK][GStreamer] Build fails when -plugins-base and -core headers are not installed in the same directory https://bugs.webkit.org/show_bug.cgi?id=148894 Reviewed by Carlos Garcia Campos. The pbutils (gst-plugins-base-utils) headers are needed in WebKit2/GTK for the permission request API related with the GStreamer codec installer. It builds fine in most cases without explicitely requiring the pbutils include directory path because usually all the GStreamer headers are installed in the same path, excepted for some distributions, like NixOS. * PlatformGTK.cmake: The GStreamer pbutils include directory was missing in the header search path. 2016-11-09 Chris Dumez [WK2][!NETWORK_SESSION] Add support for downloading file backed blobs https://bugs.webkit.org/show_bug.cgi?id=164522 Reviewed by Alex Christensen. Add support for downloading file backed blobs for the non-NETWORK_SESSION code path of WebKit2, which is still use on pre-Sierra macOS. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::~Download): * NetworkProcess/Downloads/Download.h: (WebKit::Download::setBlobFileReferences): * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): (WebKit::DownloadManager::convertNetworkLoadToDownload): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::convertToDownload): 2016-11-09 Chris Dumez [WK2][NETWORK_SESSION] Add support for downloading file backed blobs https://bugs.webkit.org/show_bug.cgi?id=164458 Reviewed by Darin Adler. Add support for downloading file backed blobs on WebKit2. It previously wasn't working because we weren't calling BlobDataFileReference::prepareForFileAccess() for each blob file before starting the download, similarly to what is done in NetworkResourceLoader's consumeSandboxExtensions(). * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): * NetworkProcess/Downloads/DownloadManager.h: (WebKit::DownloadManager::startDownload): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::startDownload): (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob): (WebKit::NetworkDataTaskBlob::download): * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::downloadRequest): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/PingLoad.h: 2016-11-09 Carlos Garcia Campos NetworkSession: Network process crash when converting main resource to download https://bugs.webkit.org/show_bug.cgi?id=164220 Reviewed by Alex Christensen. Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been created yet. That's not expected to happen and when the response completion handler is called in the NetworkDataTask it tries to use either the client or the download and it crashes. We need to cleanup and destroy the ResourceLoader as soon as it becomes a download, because that's the expected behavior, but at the same time we need to keep the NetworkLoad alive until the NetworkDataTask finishes to become a download. This patch creates a PendingDownload to take the ownership of the NetworkLoad, so that ResourceLoader can be cleaned up and destroyed. The DownloadManager now will handle the PendingDownload as if it was created by startDownload(), but ensuring it's deleted right before the final Download object is added to the downloads map. That way NetworkDataTask will always have a valid client until the final Download is created, first the ResourceLoader and then the PendingDownload. Since the DownloadManager is the owner of the PendingDownload we no longer need the didBecomeDownload() callback to delete the NetworkLoad, because the NetworkLoad will always be owned by the PendingDownload now that will be deleted by the DownloadManager. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::dataTaskBecameDownloadTask): Change the ASSERT because at this point we should always have a PendingDownload, and then remove it from the map here before adding the final Download to the map. (WebKit::DownloadManager::convertNetworkLoadToDownload): This replaces convertHandleToDownload, but it also now used for the NetworkSession. It creates a PendingDownload for the given NetworkLoad. (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Do not take the PendingDownload from the map here, just check it's present, because it will be removed from dataTaskBecameDownloadTask(). (WebKit::DownloadManager::convertHandleToDownload): Deleted. * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::PendingDownload): Add a constructor that receives a NetworkLoad. * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Just ask the ResourceLoader to be converted to a download. * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::download): Do not call didBecomeDownload() and add an assert to ensure the client has already been removed right after the final Download object is created. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): Use a pointer for the client instead of a reference because now we need to change the client when the load is converted to a download. We don't need to null check the client in any case because the member is only updated internally and always from a passed reference. (WebKit::NetworkLoad::sharedDidReceiveResponse): (WebKit::NetworkLoad::sharedWillSendRedirectedRequest): (WebKit::NetworkLoad::convertTaskToDownload): This now receives a PendingDownload. It updates the client and no longer sends DidStart, because the PendingDownload sends it now. (WebKit::NetworkLoad::didReceiveChallenge): (WebKit::NetworkLoad::didReceiveData): (WebKit::NetworkLoad::didCompleteWithError): (WebKit::NetworkLoad::didSendData): (WebKit::NetworkLoad::wasBlocked): (WebKit::NetworkLoad::cannotShowURL): (WebKit::NetworkLoad::didReceiveBuffer): (WebKit::NetworkLoad::didFinishLoading): (WebKit::NetworkLoad::didFail): (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): (WebKit::NetworkLoad::didBecomeDownload): Deleted. * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: Remove didBecomeDownload(). * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::convertToDownload): This replaces didBecomeDownload() and didConvertToDownload(). It transfers the NetworkLoad to the DownloadManager. (WebKit::NetworkResourceLoader::abort): We don't need to check if the load was converted to a download here, because m_networkLoad will always be null here in such case. (WebKit::NetworkResourceLoader::didBecomeDownload): Deleted (WebKit::NetworkResourceLoader::didConvertToDownload): Deleted * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.h: Remove didBecomeDownload(). * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Ditto. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Ditto. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Do not call didBecomeDownload(). * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::download): Do not call didBecomeDownload() and add an assert to ensure the client has already been removed right after the final Download object is created. 2016-11-09 Alex Christensen Unreviewed, rolling out r208438. crashes Reverted changeset: "[WK2][NETWORK_SESSION] Add support for downloading file backed blobs" https://bugs.webkit.org/show_bug.cgi?id=164458 http://trac.webkit.org/changeset/208438 2016-11-04 Brent Fulgham Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked https://bugs.webkit.org/show_bug.cgi?id=155185 Reviewed by Brady Eidson. Provide SPI to access the new quirk for localStorage. The quirk defaults to 'on'. When active, this quirk says that localStorage access should be granted, without needing to grant universal file access. If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly grants universal file access. Tested by existing TestWebKitAPI tests and WebKit2.LocalStorageQuirkTest * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetNeedsLocalStorageQuirk): Added. (WKPreferencesGetNeedsLocalStorageQuirk): Added. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): Honor the new localStorage quirk. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): Honor the new localStorage quirk flag. (-[WKWebViewConfiguration copyWithZone:]): Ditto. (-[WKWebViewConfiguration _needsLocalStorageQuirk]): Added. (-[WKWebViewConfiguration _setNeedsLocalStorageQuirk:]): Added. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetNeedsLocalStorageQuirk): Added. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setNeedsLocalStorageQuirk): Added. * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Honor the new localStorage quirk flag. 2016-11-09 Simon Fraser Implement visual-viewport based position:fixed handling for Mac async scrolling https://bugs.webkit.org/show_bug.cgi?id=164495 Reviewed by Tim Horton. Educate the scrolling tree about visual and layout viewports. This is runtime-switchable, so we push the enable flag to via the root state node, then push the layout viewport, and the min/max scroll position that contstrain it, through frame state nodes. When a scroll happens, we compute a new layout viewport when the visual viewport hits an edge, and push that down through setScrollLayerPosition() since it's used to position fixed and sticky layers. The iOS code is made to compile, but not work yet. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll): * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): 2016-11-09 Beth Dakin More attempted build fix. * UIProcess/Cocoa/WebViewImpl.mm: 2016-11-09 Alex Christensen Clean up Storage code https://bugs.webkit.org/show_bug.cgi?id=164562 Reviewed by Brady Eidson. Use more Refs! * NetworkProcess/CustomProtocols/CustomProtocolManager.h: * Platform/IPC/Connection.cpp: (IPC::Connection::addWorkQueueMessageReceiver): * Platform/IPC/Connection.h: * UIProcess/Storage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::create): (WebKit::LocalStorageDatabase::LocalStorageDatabase): * UIProcess/Storage/LocalStorageDatabase.h: * 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): * UIProcess/mac/SecItemShimProxy.cpp: (WebKit::SecItemShimProxy::initializeConnection): * WebProcess/Plugins/PluginProcessConnectionManager.cpp: (WebKit::PluginProcessConnectionManager::initializeConnection): * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::initializeConnection): * WebProcess/WebPage/ViewUpdateDispatcher.cpp: (WebKit::ViewUpdateDispatcher::initializeConnection): 2016-11-09 Beth Dakin Another attempted build fix. * UIProcess/Cocoa/WebViewImpl.mm: 2016-11-09 Michael Catanzaro Experimental features should not be enabled by default https://bugs.webkit.org/show_bug.cgi?id=164367 Reviewed by Darin Adler. We have two classes of experimental features: (1) Features that are unstable and should be off by default, except for the developers currently working on them. This is straightforward to handle; the default value should be false. (2) Features that are still not ready for end users, but are stable enough for testing. We want these features to be enabled in testing environments like the bots, MiniBrowser, Safari Tech Preview, and so forth, but not in stable release builds. Implement this. It is better than having all experimental features on unconditionally, and expecting them to be disabled manually on release branches, which is not something we are keen to do. An exception is Cocoa ports, which to my knowledge do not currently have any concept of development builds. These ports seem happy to continue disabling features manually in release branches, and should continue to do so at least for now. We also have features that we wish to enumerate at runtime, yet have enabled by default unconditionally. We do not currently have any infrastructure to support this and should not abuse the experimental status for this purpose; it requires future work. All settings can still be toggled at runtime by clients that know about them using the existing runtime features API. Lastly, the custom elements feature is ready to be enabled by default, so it's no longer experimental and can graduate to the list of normal boolean features. * Shared/WebPreferencesDefinitions.h: 2016-11-09 Beth Dakin Build fix. * UIProcess/Cocoa/WebViewImpl.mm: 2016-11-09 Brady Eidson IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion. https://bugs.webkit.org/show_bug.cgi?id=164504 Reviewed by Darin Adler. * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::iterateCursor): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::iterateCursor): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: 2016-11-09 Darin Adler Move Range from ExceptionCode to ExceptionOr https://bugs.webkit.org/show_bug.cgi?id=164457 Reviewed by Alex Christensen. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp: (webkit_dom_range_set_start): Updated exception handling. (webkit_dom_range_set_end): Ditto. (webkit_dom_range_set_start_before): Ditto. (webkit_dom_range_set_start_after): Ditto. (webkit_dom_range_set_end_before): Ditto. (webkit_dom_range_set_end_after): Ditto. (webkit_dom_range_select_node): Ditto. (webkit_dom_range_select_node_contents): Ditto. (webkit_dom_range_compare_boundary_points): Ditto. (webkit_dom_range_delete_contents): Ditto. (webkit_dom_range_extract_contents): Ditto. (webkit_dom_range_clone_contents): Ditto. (webkit_dom_range_insert_node): Ditto. (webkit_dom_range_surround_contents): Ditto. (webkit_dom_range_create_contextual_fragment): Ditto. (webkit_dom_range_compare_node): Ditto. (webkit_dom_range_intersects_node): Ditto. (webkit_dom_range_compare_point): Ditto. (webkit_dom_range_is_point_in_range): Ditto. (webkit_dom_range_expand): Ditto. * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm: (-[WKDOMRange setStart:offset:]): Ditto. (-[WKDOMRange setEnd:offset:]): Ditto. (-[WKDOMRange selectNode:]): Ditto. (-[WKDOMRange selectNodeContents:]): Ditto. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::contentsAsString): Ditto. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): Ditto. (WebKit::WebPage::rangeForBlockAtPoint): Ditto. (WebKit::WebPage::selectWithGesture): Ditto. (WebKit::containsRange): Ditto. (WebKit::unionDOMRanges): Ditto. (WebKit::WebPage::switchToBlockSelectionAtPoint): Ditto. (WebKit::WebPage::getPositionInformation): Ditto. 2016-11-09 Darin Adler Move EventTarget from ExceptionCode to ExceptionOr https://bugs.webkit.org/show_bug.cgi?id=164465 Reviewed by Youenn Fablet. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp: (webkit_dom_attr_dispatch_event): Updated exception handling. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp: (webkit_dom_cdata_section_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp: (webkit_dom_character_data_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp: (webkit_dom_comment_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp: (webkit_dom_dom_window_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp: (webkit_dom_document_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp: (webkit_dom_document_fragment_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp: (webkit_dom_document_type_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp: (webkit_dom_html_anchor_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp: (webkit_dom_html_applet_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp: (webkit_dom_html_area_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp: (webkit_dom_html_br_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp: (webkit_dom_html_base_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp: (webkit_dom_html_body_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp: (webkit_dom_html_button_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp: (webkit_dom_html_canvas_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp: (webkit_dom_html_d_list_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp: (webkit_dom_html_directory_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp: (webkit_dom_html_div_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp: (webkit_dom_html_document_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp: (webkit_dom_html_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp: (webkit_dom_html_embed_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp: (webkit_dom_html_field_set_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp: (webkit_dom_html_font_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp: (webkit_dom_html_form_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp: (webkit_dom_html_frame_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp: (webkit_dom_html_frame_set_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp: (webkit_dom_html_hr_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp: (webkit_dom_html_heading_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp: (webkit_dom_html_head_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp: (webkit_dom_html_html_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp: (webkit_dom_html_iframe_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp: (webkit_dom_html_image_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp: (webkit_dom_html_input_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp: (webkit_dom_html_li_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp: (webkit_dom_html_label_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp: (webkit_dom_html_legend_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp: (webkit_dom_html_link_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp: (webkit_dom_html_map_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp: (webkit_dom_html_marquee_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp: (webkit_dom_html_menu_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp: (webkit_dom_html_meta_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp: (webkit_dom_html_mod_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp: (webkit_dom_html_o_list_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp: (webkit_dom_html_object_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp: (webkit_dom_html_opt_group_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp: (webkit_dom_html_option_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp: (webkit_dom_html_paragraph_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp: (webkit_dom_html_param_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp: (webkit_dom_html_pre_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp: (webkit_dom_html_quote_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp: (webkit_dom_html_script_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp: (webkit_dom_html_select_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp: (webkit_dom_html_style_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp: (webkit_dom_html_table_caption_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp: (webkit_dom_html_table_cell_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp: (webkit_dom_html_table_col_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp: (webkit_dom_html_table_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp: (webkit_dom_html_table_row_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp: (webkit_dom_html_table_section_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp: (webkit_dom_html_text_area_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp: (webkit_dom_html_title_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp: (webkit_dom_html_u_list_element_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp: (webkit_dom_node_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp: (webkit_dom_processing_instruction_dispatch_event): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp: (webkit_dom_text_dispatch_event): Ditto. 2016-11-08 Dean Jackson Rendering support for ExtendedColors https://bugs.webkit.org/show_bug.cgi?id=164443 Reviewed by Simon Fraser and Darin Adler. Implement argument coders for Color. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateScrollViewBackground]): 2016-11-09 Beth Dakin Build fix. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::~WebViewImpl): 2016-11-09 Chris Dumez [Mac] Stop using deprecated AppKit enumeration values https://bugs.webkit.org/show_bug.cgi?id=164494 Reviewed by Darin Adler. Stop using deprecated AppKit enumeration values. * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::stopNSAppRunLoop): * Shared/mac/WebEventFactory.mm: (WebKit::mouseButtonForEvent): (WebKit::mouseEventTypeForEvent): (WebKit::clickCountForEvent): (WebKit::globalPointForEvent): (WebKit::pointForEvent): (WebKit::textFromEvent): (WebKit::unmodifiedTextFromEvent): (WebKit::isKeypadEvent): (WebKit::isKeyUpEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::becomeFirstResponder): (WebKit::WebViewImpl::updateContentInsetsIfAutomatic): (WebKit::WebViewImpl::viewDidMoveToWindow): (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent): (WebKit::WebViewImpl::createFullScreenWindow): (WebKit::WebViewImpl::sendToolTipMouseExited): (WebKit::WebViewImpl::sendToolTipMouseEntered): (WebKit::applicationFlagsForDrag): (WebKit::WebViewImpl::setLastMouseDownEvent): (WebKit::WebViewImpl::doneWithKeyEvent): (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent): (WebKit::WebViewImpl::performKeyEquivalent): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::beginModal): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): * UIProcess/mac/WebInspectorProxyMac.mm: * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::populate): (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: (WebKit::modifierFlagsFromWebEvent): (WebKit::getEventTypeFromWebEvent): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::cssAlignmentValueForNSTextAlignment): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): 2016-11-09 Beth Dakin Support TouchBar in WebKit https://bugs.webkit.org/show_bug.cgi?id=164437 -and corresponding- rdar://problem/28876524 Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView makeTouchBar]): (-[WKWebView candidateListTouchBarItem]): (-[WKWebView _web_didAddMediaControlsManager:]): (-[WKWebView _web_didRemoveMediaControlsManager]): (-[WKWebView _interactWithMediaControlsForTesting]): (-[WKWebView _wantsMediaPlaybackControlsView]): (-[WKWebView _setWantsMediaPlaybackControlsView:]): (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): (-[WKWebView _removeMediaPlaybackControlsView]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView makeTouchBar]): (-[WKView candidateListTouchBarItem]): (-[WKView _web_didAddMediaControlsManager:]): (-[WKView _web_didRemoveMediaControlsManager]): (-[WKView _wantsMediaPlaybackControlsView]): (-[WKView _setWantsMediaPlaybackControlsView:]): (-[WKView _mediaPlaybackControlsView]): (-[WKView _addMediaPlaybackControlsView:]): (-[WKView _removeMediaPlaybackControlsView]): * UIProcess/Cocoa/WebViewImpl.h: (WebKit::WebViewImpl::currentTouchBar): (WebKit::WebViewImpl::clientWantsMediaPlaybackControlsView): (WebKit::WebViewImpl::setClientWantsMediaPlaybackControlsView): (WebKit::WebViewImpl::setIsCustomizingTouchBar): * UIProcess/Cocoa/WebViewImpl.mm: (-[WKTextListTouchBarViewController initWithWebViewImpl:]): (-[WKTextListTouchBarViewController didDestroyView]): (-[WKTextListTouchBarViewController _selectList:]): (-[WKTextListTouchBarViewController setCurrentListType:]): (-[WKTextTouchBarItemController initWithWebViewImpl:]): (-[WKTextTouchBarItemController didDestroyView]): (-[WKTextTouchBarItemController touchBar:makeItemForIdentifier:]): (-[WKTextTouchBarItemController itemForIdentifier:]): (-[WKTextTouchBarItemController candidateListTouchBarItem:endSelectingCandidateAtIndex:]): (-[WKTextTouchBarItemController candidateListTouchBarItem:changedCandidateListVisibility:]): (-[WKTextTouchBarItemController textListTouchBarViewController]): (-[WKTextTouchBarItemController setTextIsBold:]): (-[WKTextTouchBarItemController setTextIsItalic:]): (-[WKTextTouchBarItemController setTextIsUnderlined:]): (-[WKTextTouchBarItemController _wkChangeTextStyle:]): (-[WKTextTouchBarItemController setCurrentTextAlignment:]): (-[WKTextTouchBarItemController _wkChangeTextAlignment:]): (-[WKTextTouchBarItemController textColor]): (-[WKTextTouchBarItemController setTextColor:]): (-[WKTextTouchBarItemController _wkChangeColor:]): (-[WKTextTouchBarItemController textListViewController]): (WebKit::WebViewImpl::makeTouchBar): (WebKit::WebViewImpl::candidateListTouchBarItem): (WebKit::WebViewImpl::mediaPlaybackControlsView): (WebKit::WebViewImpl::useMediaPlaybackControlsView): (WebKit::WebViewImpl::dismissTextTouchBarPopoverItemWithIdentifier): (WebKit::textTouchBarCustomizationAllowedIdentifiers): (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers): (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers): (WebKit::touchBarDidExitCustomization): (WebKit::touchBarWillEnterCustomization): (WebKit::didChangeAutomaticTextCompletion): (WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers): (WebKit::WebViewImpl::setUpTextTouchBar): (WebKit::WebViewImpl::isRichlyEditable): (WebKit::WebViewImpl::textTouchBar): (WebKit::WebViewImpl::updateTextTouchBar): (WebKit::WebViewImpl::updateMediaTouchBar): (WebKit::WebViewImpl::forceRequestCandidatesForTesting): (WebKit::WebViewImpl::updateTouchBar): (WebKit::WebViewImpl::shouldRequestCandidates): (WebKit::WebViewImpl::showCandidates): (WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView): (WebKit::WebViewImpl::setEditableElementIsFocused): (WebKit::WebViewImpl::becomeFirstResponder): (WebKit::WebViewImpl::selectionDidChange): (WebKit::WebViewImpl::videoControlsManagerDidChange): (WebKit::WebViewImpl::updateWebViewImplAdditions): Deleted. 2016-11-09 Chris Dumez [WK2][NETWORK_SESSION] Add support for downloading file backed blobs https://bugs.webkit.org/show_bug.cgi?id=164458 Reviewed by Darin Adler. Add support for downloading file backed blobs on WebKit2. It previously wasn't working because we weren't calling BlobDataFileReference::prepareForFileAccess() for each blob file before starting the download, similarly to what is done in NetworkResourceLoader's consumeSandboxExtensions(). * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): * NetworkProcess/Downloads/DownloadManager.h: (WebKit::DownloadManager::startDownload): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::startDownload): (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob): (WebKit::NetworkDataTaskBlob::download): * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::downloadRequest): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/PingLoad.h: 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-09 Csaba Osztrogonác URTBF after r208361. * PlatformMac.cmake: 2016-11-09 Csaba Osztrogonác Unreviewed typo fix after r160616 to fix the build on case sensitive file systems. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: 2016-11-05 Carlos Garcia Campos [SOUP] Layout test http/tests/misc/authentication-redirect-3/authentication-sent-to-redirect-same-origin-with-location-credentials.html fails https://bugs.webkit.org/show_bug.cgi?id=139358 Reviewed by Michael Catanzaro. Stop putting the credentials in the URL unconditionally and ensure we only do that when provided by the URL itself. Libsoup has its own cache of SoupAuth, so we don't need to pass user/pass in the URL for every single request, libsoup will authenticate those automatically. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest): 2016-11-04 Filip Pizlo WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows https://bugs.webkit.org/show_bug.cgi?id=152045 Reviewed by Andy Estes. * Platform/IPC/Connection.cpp: (IPC::Connection::SyncMessageState::wait): (IPC::Connection::sendMessage): (IPC::Connection::timeoutRespectingIgnoreTimeoutsForTesting): (IPC::Connection::waitForMessage): (IPC::Connection::sendSyncMessage): (IPC::Connection::waitForSyncReply): * Platform/IPC/Connection.h: (IPC::Connection::sendSync): (IPC::Connection::waitForAndDispatchImmediately): * Platform/IPC/MessageSender.h: (IPC::MessageSender::sendSync): * UIProcess/ChildProcessProxy.h: (WebKit::ChildProcessProxy::sendSync): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently): * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::applicationWillTerminate): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::sendProcessWillSuspendImminently): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler displayLinkFired:]): (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState): * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::stringSelectionForPasteboard): (WebKit::WebPageProxy::dataSelectionForPasteboard): (WebKit::WebPageProxy::readSelectionFromPasteboard): (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent): (WebKit::WebPageProxy::acceptsFirstMouse): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): (WebKit::WebChromeClient::runJavaScriptAlert): (WebKit::WebChromeClient::runJavaScriptConfirm): (WebKit::WebChromeClient::runJavaScriptPrompt): (WebKit::WebChromeClient::print): (WebKit::WebChromeClient::exceededDatabaseQuota): (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::postSynchronousMessageForTesting): 2016-11-04 Wenson Hsieh Safari does not emit composition end if blurred for dead key / Japanese IME https://bugs.webkit.org/show_bug.cgi?id=164369 Reviewed by Ryosuke Niwa. Split WebPage::discardedComposition into two steps, where we first discard marked text and then update the editor state. This allows the codepath where we cancel the composition early (before setting the selection) to discard marked text without also forcing an editor state update at the same time. The editor state is later updated in WebPage::didChangeSelection. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::compositionWasCanceled): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::canceledComposition): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didChangeSelection): (WebKit::WebPage::discardedComposition): (WebKit::WebPage::canceledComposition): * WebProcess/WebPage/WebPage.h: 2016-11-04 Alex Christensen Unreviewed, rolling out r208293. asserts in API tests. Reverted changeset: "NetworkSession: Network process crash when converting main resource to download" https://bugs.webkit.org/show_bug.cgi?id=164220 http://trac.webkit.org/changeset/208293 2016-11-04 Said Abou-Hallawa Add a setting and preferences to enable/disable async image decoding https://bugs.webkit.org/show_bug.cgi?id=164417 Reviewed by Simon Fraser. Hook up the asyncImageDecodingEnabled setting for WebKit2. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _asyncImageDecodingEnabled]): (-[WKPreferences _setAsyncImageDecodingEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-11-04 Simon Fraser Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update" https://bugs.webkit.org/show_bug.cgi?id=164420 Reviewed by Tim Horton. Rename: commitNewTreeState -> commitTreeState ("new" was redundant) updateBeforeChildren -> commitStateBeforeChildren updateAfterChildren -> commitStateAfterChildren * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState): (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): Deleted. * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): Deleted. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): Deleted. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 2016-11-04 Carlos Garcia Campos NetworkSession: Add NetworkDataTask implementation for blobs https://bugs.webkit.org/show_bug.cgi?id=163939 Reviewed by Alex Christensen. Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession is enabled. * CMakeLists.txt: Add new files to compilation. * NetworkProcess/Downloads/BlobDownloadClient.cpp: * NetworkProcess/Downloads/BlobDownloadClient.h: * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor reveices a NetworkDataTask and is used by Soup backend and blobs. (WebKit::Download::~Download): (WebKit::Download::start): (WebKit::Download::startWithHandle): (WebKit::Download::cancel): (WebKit::Download::didReceiveAuthenticationChallenge): (WebKit::Download::didReceiveData): (WebKit::Download::didFinish): (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask. * NetworkProcess/Downloads/Download.h: (WebKit::Download::Download): (WebKit::Download::suggestedName): (WebKit::Download::request): * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession. (WebKit::DownloadManager::continueDecidePendingDownloadDestination): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::platformCancelNetworkLoad): * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when using NetworkSession. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob. * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method. * NetworkProcess/NetworkDataTaskBlob.cpp: Added. (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob): (WebKit::NetworkDataTaskBlob::clearStream): (WebKit::NetworkDataTaskBlob::resume): (WebKit::NetworkDataTaskBlob::suspend): (WebKit::NetworkDataTaskBlob::cancel): (WebKit::NetworkDataTaskBlob::invalidateAndCancel): (WebKit::NetworkDataTaskBlob::getSizeForNext): (WebKit::NetworkDataTaskBlob::didGetSize): (WebKit::NetworkDataTaskBlob::seek): (WebKit::NetworkDataTaskBlob::didReceiveResponse): (WebKit::NetworkDataTaskBlob::read): (WebKit::NetworkDataTaskBlob::readData): (WebKit::NetworkDataTaskBlob::readFile): (WebKit::NetworkDataTaskBlob::didOpen): (WebKit::NetworkDataTaskBlob::didRead): (WebKit::NetworkDataTaskBlob::consumeData): (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation): (WebKit::NetworkDataTaskBlob::suggestedFilename): (WebKit::NetworkDataTaskBlob::download): (WebKit::NetworkDataTaskBlob::writeDownload): (WebKit::NetworkDataTaskBlob::cleanDownloadFiles): (WebKit::NetworkDataTaskBlob::didFailDownload): (WebKit::NetworkDataTaskBlob::didFinishDownload): (WebKit::NetworkDataTaskBlob::didFail): (WebKit::NetworkDataTaskBlob::didFinish): * NetworkProcess/NetworkDataTaskBlob.h: Added. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession. (WebKit::NetworkLoad::~NetworkLoad): (WebKit::NetworkLoad::setDefersLoading): (WebKit::NetworkLoad::cancel): (WebKit::NetworkLoad::continueWillSendRequest): (WebKit::NetworkLoad::continueDidReceiveResponse): (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs. * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::registerNetworkDataTask): Ditto. (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing because in Cocoa all tasks are invalidated and canceled by the network session. * NetworkProcess/mac/NetworkLoadMac.mm: * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::download): * NetworkProcess/soup/NetworkDataTaskSoup.h: * NetworkProcess/soup/NetworkSessionSoup.cpp: * NetworkProcess/soup/NetworkSessionSoup.h: * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation. * PlatformGTK.cmake: Ditto. * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation. 2016-11-03 Simon Fraser Give all the geometry classes a single-argument scale() function for consistency https://bugs.webkit.org/show_bug.cgi?id=164400 Reviewed by Zalan Bujtas. Use single-argument scale() functions. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::paint): * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _takeViewSnapshot]): (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]): (-[WKWebView _scrollByContentOffset:]): (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): * UIProcess/ios/WKContentView.mm: (-[WKContentView _didCommitLayerTree:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _updateTapHighlight]): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation): (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::scaledMagnificationOrigin): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::snapshot): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::scrollToPoint): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createSelectionSnapshot): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::scalePageInViewCoordinates): (WebKit::WebPage::scaleView): (WebKit::WebPage::snapshotAtSize): (WebKit::WebPage::snapshotNode): (WebKit::WebPage::drawRectToImage): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::restorePageState): 2016-11-03 Chris Dumez [WK2][Cocoa] Implement user interface for HTML form validation https://bugs.webkit.org/show_bug.cgi?id=164143 Reviewed by Simon Fraser. Implement the ValidationMessageClient in WebKit2 and have it display a ValidationBubble on Cocoa. ValidationBubble is implemented using native popovers on both Mac and iOS. As a result, Mac and iOS WK2 now use native popover for HTML form validation instead of the old Shadow DOM based UI in WebCore. The native popover shows at the bottom (or top) of the input and it disapears as soon as the user starts typing or interacts with the view (e.g. tap / scroll / zoom). The feature is still disabled at runtime. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _keyboardWillShow:]): (-[WKWebView _keyboardDidShow:]): (-[WKWebView _contentsOfUserInterfaceItem:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebPageProxyCocoa.mm: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleWheelEvent): (WebKit::WebPageProxy::setPageZoomFactor): (WebKit::WebPageProxy::setPageAndTextZoomFactors): (WebKit::WebPageProxy::pageDidScroll): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::hideValidationMessage): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::validationBubble): (WebKit::WebPageProxy::setIsKeyboardAnimatingIn): * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::createValidationBubble): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _willStartScrollingOrZooming]): (-[WKContentView scrollViewWillStartPanOrPinchGesture]): (-[WKContentView _didEndScrollingOrZooming]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::potentialTapAtPosition): (WebKit::WebPageProxy::showValidationMessage): (WebKit::WebPageProxy::setIsScrollingOrZooming): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::createValidationBubble): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::showValidationMessage): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm. (WebKit::WebValidationMessageClient::WebValidationMessageClient): (WebKit::WebValidationMessageClient::~WebValidationMessageClient): (WebKit::WebValidationMessageClient::showValidationMessage): (WebKit::WebValidationMessageClient::hideValidationMessage): (WebKit::WebValidationMessageClient::isValidationMessageVisible): * WebProcess/WebCoreSupport/WebValidationMessageClient.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_userInterfaceLayoutDirection): 2016-11-03 Tim Horton Printing to PDF should produce internal links when HTML has internal links https://bugs.webkit.org/show_bug.cgi?id=112081 Reviewed by Simon Fraser. * UIProcess/mac/WKPrintingView.h: * UIProcess/mac/WKPrintingView.mm: (linkDestinationName): (-[WKPrintingView _drawPDFDocument:page:atPoint:]): Propagate link-to-destination annotations (and each page's destinations) into the printed PDF. Generate a unique destination name based on the page and position, because we have lost the fragment name information. (-[WKPrintingView drawRect:]): Compute all of the destinations for every page, so that we can add them to the context as we paint the pages (we need the page CTM in order to add them). 2016-11-03 Alex Christensen Unreviewed, rolling out r208298. https://bugs.webkit.org/show_bug.cgi?id=163939 caused asan crashes Reverted changeset: "NetworkSession: Add NetworkDataTask implementation for blobs" https://bugs.webkit.org/show_bug.cgi?id=163939 http://trac.webkit.org/changeset/208298 2016-11-03 Ryan Haddad Unreviewed, rolling out r208330. This change appears to have caused two editing tests to fail on macOS. Reverted changeset: "Reduce PassRefPtr use in WebKit2" https://bugs.webkit.org/show_bug.cgi?id=164360 http://trac.webkit.org/changeset/208330 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-02 Alex Christensen Reduce PassRefPtr use in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=164360 Reviewed by Tim Horton. * Shared/API/APISecurityOrigin.h: (API::SecurityOrigin::SecurityOrigin): * Shared/API/APISerializedScriptValue.h: (API::SerializedScriptValue::create): (API::SerializedScriptValue::SerializedScriptValue): * Shared/API/c/WKSharedAPICast.h: (WebKit::ProxyingRefPtr::ProxyingRefPtr): (WebKit::toAPI): * Shared/APIWebArchive.h: * Shared/APIWebArchive.mm: (API::WebArchive::create): (API::WebArchive::WebArchive): * UIProcess/API/APIHitTestResult.cpp: (API::HitTestResult::create): * UIProcess/API/APIHitTestResult.h: * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): * UIProcess/API/C/WKPage.cpp: (WebKit::RunBeforeUnloadConfirmPanelResultListener::create): (WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener): (WebKit::RunJavaScriptAlertResultListener::create): (WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener): (WebKit::RunJavaScriptConfirmResultListener::create): (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener): (WebKit::RunJavaScriptPromptResultListener::create): (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener): (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): * UIProcess/ios/WKGeolocationProviderIOS.mm: (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]): * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _webHitTestResult]): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (contextMenuItems): (WKBundlePageCopyContextMenuItems): (WKBundlePageCopyContextMenuAtPointInWindow): * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserMessageHandlerDescriptorProxy::create): * WebProcess/WebPage/WebUndoStep.cpp: (WebKit::WebUndoStep::create): * WebProcess/WebPage/WebUndoStep.h: (WebKit::WebUndoStep::WebUndoStep): 2016-11-01 Gavin Barraclough Remove PageThrottler & all related code https://bugs.webkit.org/show_bug.cgi?id=164302 Reviewed by Ryosuke Niwa. All relevant information now available from the ActivityState. * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::PluginProcess): (WebKit::PluginProcess::createWebProcessConnection): (WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted. (WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted. * PluginProcess/PluginProcess.h: (): Deleted. * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted. (WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted. * PluginProcess/WebProcessConnection.h: * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::evaluate): * WebProcess/Plugins/Plugin.h: (WebKit::Plugin::audioHardwareActivity): Deleted. * WebProcess/Plugins/PluginProcessConnection.cpp: (WebKit::PluginProcessConnection::PluginProcessConnection): (WebKit::PluginProcessConnection::didReceiveMessage): (WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted. (WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted. * WebProcess/Plugins/PluginProcessConnection.h: (WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization): (WebKit::PluginProcessConnection::audioHardwareActivity): Deleted. * WebProcess/Plugins/PluginProcessConnection.messages.in: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::audioHardwareActivity): Deleted. * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::audioHardwareActivity): Deleted. * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/WebPage.cpp: 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-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-02 Alex Christensen Remove Battery Status API from the tree https://bugs.webkit.org/show_bug.cgi?id=164213 Reviewed by Sam Weinig. * CMakeLists.txt: * PlatformEfl.cmake: * Shared/API/APIObject.h: * Shared/API/c/WKBase.h: * Shared/WebBatteryStatus.cpp: Removed. * Shared/WebBatteryStatus.h: Removed. * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKBatteryManager.cpp: Removed. * UIProcess/API/C/WKBatteryManager.h: Removed. * UIProcess/API/C/WKBatteryStatus.cpp: Removed. * UIProcess/API/C/WKBatteryStatus.h: Removed. * UIProcess/API/C/WKContext.cpp: (WKContextGetBatteryManager): Deleted. * UIProcess/API/C/WKContext.h: * UIProcess/API/efl/ewk_context.cpp: (EwkContext::EwkContext): * UIProcess/API/efl/ewk_context_private.h: * UIProcess/API/efl/ewk_main.cpp: (WebKit::EwkMain::initialize): (WebKit::EwkMain::finalize): (WebKit::EwkMain::shutdownInitializedEFLModules): * UIProcess/API/gtk/WebKitBatteryProvider.cpp: Removed. * UIProcess/API/gtk/WebKitBatteryProvider.h: Removed. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): * UIProcess/WebBatteryManagerProxy.cpp: Removed. * UIProcess/WebBatteryManagerProxy.h: Removed. * UIProcess/WebBatteryManagerProxy.messages.in: Removed. * UIProcess/WebBatteryProvider.cpp: Removed. * UIProcess/WebBatteryProvider.h: Removed. * UIProcess/WebProcessPool.cpp: (WebKit::m_hiddenPageThrottlingTimer): * UIProcess/efl/BatteryProvider.cpp: Removed. * UIProcess/efl/BatteryProvider.h: Removed. * WebProcess/Battery: Removed. * WebProcess/Battery/WebBatteryManager.cpp: Removed. * WebProcess/Battery/WebBatteryManager.h: Removed. * WebProcess/Battery/WebBatteryManager.messages.in: Removed. * WebProcess/WebCoreSupport/WebBatteryClient.cpp: Removed. * WebProcess/WebCoreSupport/WebBatteryClient.h: Removed. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_userInterfaceLayoutDirection): * WebProcess/WebProcess.cpp: (WebKit::m_resourceLoadStatisticsStorage): 2016-11-02 Carlos Garcia Campos NetworkSession: Add NetworkDataTask implementation for blobs https://bugs.webkit.org/show_bug.cgi?id=163939 Reviewed by Alex Christensen. Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession is enabled. * CMakeLists.txt: Add new files to compilation. * NetworkProcess/Downloads/BlobDownloadClient.cpp: * NetworkProcess/Downloads/BlobDownloadClient.h: * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor reveices a NetworkDataTask and is used by Soup backend and blobs. (WebKit::Download::~Download): (WebKit::Download::start): (WebKit::Download::startWithHandle): (WebKit::Download::cancel): (WebKit::Download::didReceiveAuthenticationChallenge): (WebKit::Download::didReceiveData): (WebKit::Download::didFinish): (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask. * NetworkProcess/Downloads/Download.h: (WebKit::Download::Download): (WebKit::Download::suggestedName): (WebKit::Download::request): * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession. (WebKit::DownloadManager::continueDecidePendingDownloadDestination): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::platformCancelNetworkLoad): * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when using NetworkSession. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob. * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method. * NetworkProcess/NetworkDataTaskBlob.cpp: Added. (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob): (WebKit::NetworkDataTaskBlob::clearStream): (WebKit::NetworkDataTaskBlob::resume): (WebKit::NetworkDataTaskBlob::suspend): (WebKit::NetworkDataTaskBlob::cancel): (WebKit::NetworkDataTaskBlob::invalidateAndCancel): (WebKit::NetworkDataTaskBlob::getSizeForNext): (WebKit::NetworkDataTaskBlob::didGetSize): (WebKit::NetworkDataTaskBlob::seek): (WebKit::NetworkDataTaskBlob::didReceiveResponse): (WebKit::NetworkDataTaskBlob::read): (WebKit::NetworkDataTaskBlob::readData): (WebKit::NetworkDataTaskBlob::readFile): (WebKit::NetworkDataTaskBlob::didOpen): (WebKit::NetworkDataTaskBlob::didRead): (WebKit::NetworkDataTaskBlob::consumeData): (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation): (WebKit::NetworkDataTaskBlob::suggestedFilename): (WebKit::NetworkDataTaskBlob::download): (WebKit::NetworkDataTaskBlob::writeDownload): (WebKit::NetworkDataTaskBlob::cleanDownloadFiles): (WebKit::NetworkDataTaskBlob::didFailDownload): (WebKit::NetworkDataTaskBlob::didFinishDownload): (WebKit::NetworkDataTaskBlob::didFail): (WebKit::NetworkDataTaskBlob::didFinish): * NetworkProcess/NetworkDataTaskBlob.h: Added. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession. (WebKit::NetworkLoad::~NetworkLoad): (WebKit::NetworkLoad::setDefersLoading): (WebKit::NetworkLoad::cancel): (WebKit::NetworkLoad::continueWillSendRequest): (WebKit::NetworkLoad::continueDidReceiveResponse): (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs. * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::registerNetworkDataTask): Ditto. (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing because in Cocoa all tasks are invalidated and canceled by the network session. * NetworkProcess/mac/NetworkLoadMac.mm: * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::download): * NetworkProcess/soup/NetworkDataTaskSoup.h: * NetworkProcess/soup/NetworkSessionSoup.cpp: * NetworkProcess/soup/NetworkSessionSoup.h: * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation. * PlatformGTK.cmake: Ditto. * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation. 2016-11-02 Andy Estes REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding https://bugs.webkit.org/show_bug.cgi?id=164311 Reviewed by Tim Horton. -[NSURL fileSystemRepresentation] returns a char* in file system representation, which on iOS is UTF-8, but we were implicitly converting it to a String, which assumes a char* is Latin-1 encoded. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Changed to use fromUTF8() to convert fileURL.fileSystemRepresentation to a String. 2016-11-02 Carlos Garcia Campos NetworkSession: Network process crash when converting main resource to download https://bugs.webkit.org/show_bug.cgi?id=164220 Reviewed by Alex Christensen. Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been created yet. That's not expected to happen and when the response completion handler is called in the NetworkDataTask it tries to use either the client or the download and it crashes. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Update ASSERT, because abort doesn't cleanup the resource loader in case it's becoming a download. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load. (WebKit::NetworkResourceLoader::isBecomingDownload): Helper method to check if the resource load was converted to a download, but didBecomeDownload() hasn't been called yet. (WebKit::NetworkResourceLoader::abort): If the resource load is becoming a download do not call cleanup() because it will be called by didBecomeDownload() later. * NetworkProcess/NetworkResourceLoader.h: 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-02 Carlos Garcia Campos [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode https://bugs.webkit.org/show_bug.cgi?id=164303 Reviewed by Michael Catanzaro. This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): (WebKit::AcceleratedBackingStoreX11::update): 2016-11-02 Carlos Garcia Campos [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead https://bugs.webkit.org/show_bug.cgi?id=164315 Reviewed by Michael Catanzaro. * Shared/gtk/ProcessExecutablePathGtk.cpp: (WebKit::getExecutablePath): (WebKit::findWebKitProcess): * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp: (API::WebsiteDataStore::defaultNetworkCacheDirectory): (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkit_web_context_set_favicon_database_directory): (webkit_web_context_set_additional_plugins_directory): (webkit_web_context_set_disk_cache_directory): * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp: (webkitWebsiteDataManagerGetDataStore): * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::PluginInfoCache): * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::WebProcessPool::platformDefaultIconDatabasePath): * WebProcess/gtk/WebGtkExtensionManager.cpp: (WebKit::parseUserData): 2016-11-02 Romain Bellessort [Readable Streams API] Enable creation of ReadableByteStreamController https://bugs.webkit.org/show_bug.cgi?id=164014 Reviewed by Youenn Fablet. Added flag for the byte stream part of Readable Streams API. * Configurations/FeatureDefines.xcconfig: 2016-11-02 Carlos Garcia Campos PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times https://bugs.webkit.org/show_bug.cgi?id=164103 Reviewed by Michael Catanzaro. Follow symlinks when scanning plugins to avoid duplicates. * UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed from the cache. * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp: (WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path. 2016-11-02 Carlos Garcia Campos [GTK] Plugin process crash in WebKit::NetscapePluginX11::visibilityDidChange with evince browser plugin https://bugs.webkit.org/show_bug.cgi?id=164204 Reviewed by Michael Catanzaro. Check the platform plugin widget is embedded before trying to get its socket window. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: (WebKit::NetscapePluginX11::geometryDidChange): (WebKit::NetscapePluginX11::visibilityDidChange): 2016-11-01 Wenson Hsieh Turn the Input Events runtime flag on by default https://bugs.webkit.org/show_bug.cgi?id=164297 Reviewed by Ryosuke Niwa. * Shared/WebPreferencesDefinitions.h: 2016-11-01 Jaehun Lim Unreviewed, EFL build fix after r208225 Rename ViewState to ActivityState * UIProcess/efl/WebView.cpp: (WebKit::WebView::setActive): (WebKit::WebView::setFocused): (WebKit::WebView::setVisible): 2016-11-01 Alex Christensen Fix CMake build. * PlatformMac.cmake: 2016-11-01 Ryosuke Niwa Remove CUSTOM_ELEMENTS build flag https://bugs.webkit.org/show_bug.cgi?id=164267 Reviewed by Antti Koivisto. Removed the build flag. * Configurations/FeatureDefines.xcconfig: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-11-01 Eric Carlson [MediaStream] restrict media capture secure connections https://bugs.webkit.org/show_bug.cgi?id=164234 Reviewed by Alex Christensen. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMediaCaptureRequiresSecureConnection): (WKPreferencesGetMediaCaptureRequiresSecureConnection): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Drive by fix: remove some unused parameters in a lambda call. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-11-01 Gavin Barraclough Add IsAudible, IsLoading to ActivityState https://bugs.webkit.org/show_bug.cgi?id=164286 Reviewed by Geoff Garen. By computing these values in the UIProcess and passing them to WebContent we can more closely unify iOS & macOS throttling, and remove the PageThrottler class. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): - Added update for IsAudible, IsLoading flags. (WebKit::WebPageProxy::updateThrottleState): - Read IsAudible, IsLoading flags from ActivityState. (WebKit::WebPageProxy::setMuted): - call activityStateDidChange to trigger update. (WebKit::WebPageProxy::isPlayingMediaDidChange): - call activityStateDidChange to trigger update. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isLoadingChanged): - call activityStateDidChange to trigger update. 2016-10-31 Gavin Barraclough Rename ViewState to ActivityState https://bugs.webkit.org/show_bug.cgi?id=164254 Reviewed by Andreas Kling. We plan to add a couple more flags to ViewState that aren't directly related to the view itself - whether there is an ongoing page load, and whether whether there is audio playback. This will allow viewState (now activityState) to fully drive throttling decisions. Renaming this bitfield accordingly. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView didMoveToWindow]): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate): (_WebKitWebViewBasePrivate::updateActivityStateTimerFired): (webkitWebViewBaseScheduleUpdateActivityState): (toplevelWindowFocusInEvent): (toplevelWindowFocusOutEvent): (toplevelWindowStateEvent): (webkitWebViewBaseSetToplevelOnScreenWindow): (webkitWebViewBaseMap): (webkitWebViewBaseUnmap): (webkitWebViewBaseSetFocus): (webkitWebViewBaseIsInWindowActive): (webkitWebViewBaseIsFocused): (webkitWebViewBaseIsVisible): (webkitWebViewBaseIsInWindow): (_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted. (webkitWebViewBaseScheduleUpdateViewState): Deleted. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::becomeFirstResponder): (WebKit::WebViewImpl::resignFirstResponder): (WebKit::WebViewImpl::windowDidOrderOffScreen): (WebKit::WebViewImpl::windowDidOrderOnScreen): (WebKit::WebViewImpl::windowDidBecomeKey): (WebKit::WebViewImpl::windowDidResignKey): (WebKit::WebViewImpl::windowDidMiniaturize): (WebKit::WebViewImpl::windowDidDeminiaturize): (WebKit::WebViewImpl::windowDidChangeOcclusionState): (WebKit::WebViewImpl::viewDidMoveToWindow): (WebKit::WebViewImpl::viewDidHide): (WebKit::WebViewImpl::viewDidUnhide): (WebKit::WebViewImpl::activeSpaceDidChange): (WebKit::WebViewImpl::endDeferringViewInWindowChanges): (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync): (WebKit::WebViewImpl::prepareForMoveToWindow): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState): (WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::setSuppressVisibilityUpdates): (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::updateThrottleState): (WebKit::WebPageProxy::waitForDidUpdateActivityState): (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler): (WebKit::WebPageProxy::updateViewState): Deleted. (WebKit::WebPageProxy::viewStateDidChange): Deleted. (WebKit::WebPageProxy::dispatchViewStateChange): Deleted. (WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted. (WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isInWindow): (WebKit::WebPageProxy::didUpdateActivityState): (WebKit::WebPageProxy::isViewVisible): (WebKit::WebPageProxy::didUpdateViewState): Deleted. * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::windowServerConnectionStateChanged): * UIProcess/efl/WebView.cpp: * UIProcess/ios/WKContentView.mm: (-[WKContentView _applicationDidEnterBackground]): (-[WKContentView _applicationWillEnterForeground]): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _applicationDidEnterBackground]): (-[WKPDFView _applicationWillEnterForeground]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState): (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted. * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState): (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::activityStateDidChange): (WebKit::PluginView::viewStateDidChange): Deleted. * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::activityStateDidChange): (WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted. * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::activityStateDidChange): (WebKit::DrawingArea::viewStateDidChange): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_userInterfaceLayoutDirection): (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::updateIsInWindow): (WebKit::WebPage::setActivityState): (WebKit::WebPage::setViewState): Deleted. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::isVisible): (WebKit::WebPage::isVisibleOrOccluded): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange): (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange): (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired): (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted. (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted. 2016-10-31 Jaehun Lim Unreviewed, CMake build fix Adds #include * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: 2016-10-31 Simon Fraser Add basic visual/layout viewport support for fixed position layout https://bugs.webkit.org/show_bug.cgi?id=164261 Reviewed by Dean Jackson. Don't make visualViewportEnabled an experimental feature, because I don't want it enabled by default in WebKitTestRunner (and therefore mismatching DumpRenderTree). * Shared/WebPreferencesDefinitions.h: 2016-10-29 Filip Pizlo JSC should support SharedArrayBuffer https://bugs.webkit.org/show_bug.cgi?id=163986 Reviewed by Keith Miller. Adds some small things we need for SharedArrayBuffer. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::createWebDataFromUint8Array): 2016-10-31 Brady Eidson IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys. and https://bugs.webkit.org/show_bug.cgi?id=164097 Reviewed by Darin Adler. - Handle moving "Get All" requests to and from the DatabaseProcess. - Handle the additional task of creating/passing Sandbox Extensions for referenced files when necessary. * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::handleGetResult): (WebKit::WebIDBConnectionToClient::didGetAllRecords): (WebKit::WebIDBConnectionToClient::getAllRecords): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * Shared/WebCoreArgumentCoders.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::getAllRecords): (WebKit::preregisterSandboxExtensionsIfNecessary): (WebKit::WebIDBConnectionToServer::didGetAllRecords): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in: 2016-10-31 Wenson Hsieh [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup https://bugs.webkit.org/show_bug.cgi?id=164236 Reviewed by Beth Dakin. See WebCore ChangeLog for more detail. Removes m_isGettingDictionaryPopupInfo from the WebPage in favor of keeping track of the same state in Editor, so that both the WK1 and WK2 cases can share the same codepath. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didChangeSelection): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::dictionaryPopupInfoForRange): 2016-10-31 Simon Fraser Implement IntersectionObserver https://bugs.webkit.org/show_bug.cgi?id=159475 Reviewed by Ryosuke Niwa. Add ENABLE_INTERSECTION_OBSERVER, enabled by default. * Configurations/FeatureDefines.xcconfig: 2016-10-31 Ryan Haddad Unreviewed, rolling out r208154. This change caused an assertion failure during API tests on macOS. Reverted changeset: "NetworkSession: Network process crash when converting main resource to download" https://bugs.webkit.org/show_bug.cgi?id=164220 http://trac.webkit.org/changeset/208154 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 Carlos Garcia Campos NetworkSession: Network process crash when converting main resource to download https://bugs.webkit.org/show_bug.cgi?id=164220 Reviewed by Alex Christensen. Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been created yet. That's not expected to happen and when the response completion handler is called in the NetworkDataTask it tries to use either the client or the download and it crashes. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load. (WebKit::NetworkResourceLoader::abort): If we still have a network load that was converted to a download, do not call cleanup() because it will be called by didBecomeDownload() later. 2016-10-31 Darin Adler Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr https://bugs.webkit.org/show_bug.cgi?id=164214 Reviewed by Alex Christensen. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp: (webkit_dom_document_query_selector): Updated exception handling. (webkit_dom_document_query_selector_all): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp: (webkit_dom_document_fragment_query_selector): Ditto. (webkit_dom_document_fragment_query_selector_all): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_query_selector): Ditto. (webkit_dom_element_query_selector_all): Ditto. 2016-10-31 Darin Adler Convert Document from ExceptionCode to Exception https://bugs.webkit.org/show_bug.cgi?id=164212 Reviewed by Alex Christensen. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp: (webkit_dom_document_create_element): Updated exception handling. (webkit_dom_document_create_cdata_section): Ditto. (webkit_dom_document_create_processing_instruction): Ditto. (webkit_dom_document_create_attribute): Ditto. (webkit_dom_document_import_node): Ditto. (webkit_dom_document_create_element_ns): Ditto. (webkit_dom_document_create_attribute_ns): Ditto. (webkit_dom_document_adopt_node): Ditto. (webkit_dom_document_create_event): Ditto. (webkit_dom_document_set_xml_version): Ditto. (webkit_dom_document_get_cookie): Ditto. (webkit_dom_document_set_cookie): Ditto. (webkit_dom_document_set_body): Ditto. * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm: (-[WKDOMDocument createElement:]): Ditto. 2016-10-31 Wenson Hsieh Holding down a key to choose an accented character should fire "insertReplacementText" input events https://bugs.webkit.org/show_bug.cgi?id=164209 Reviewed by Darin Adler. When replacing text, call Editor::insertText with the correct TextEventInputType so that WebCore will know to use EditActionInsertReplacement when creating and applying the corresponding TypingCommand. Additional minor changes in order to support testing replacement text insertion. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _insertText:replacementRange:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertTextAsync): 2016-10-30 Darin Adler Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception https://bugs.webkit.org/show_bug.cgi?id=164206 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp: (webkit_dom_named_node_map_set_named_item): Updated exception handling. (webkit_dom_named_node_map_remove_named_item): Ditto. (webkit_dom_named_node_map_set_named_item_ns): Ditto. (webkit_dom_named_node_map_remove_named_item_ns): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_set_attribute): Ditto. (webkit_dom_element_set_attribute_node): Ditto. (webkit_dom_element_remove_attribute_node): Ditto. (webkit_dom_element_set_attribute_ns): Ditto. (webkit_dom_element_set_attribute_node_ns): Ditto. (webkit_dom_element_matches): Ditto. (webkit_dom_element_closest): Ditto. (webkit_dom_element_webkit_matches_selector): Ditto. (webkit_dom_element_insert_adjacent_element): Ditto. (webkit_dom_element_insert_adjacent_html): Ditto. (webkit_dom_element_insert_adjacent_text): Ditto. (webkit_dom_element_set_inner_html): Ditto. (webkit_dom_element_set_outer_html): Ditto. * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm: (-[WKDOMElement setAttribute:value:]): Ditto. 2016-10-30 Yusuke Suzuki [DOM] Introduce WebCore::jsDynamicDowncast https://bugs.webkit.org/show_bug.cgi?id=164137 Reviewed by Darin Adler. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::elementForNodeHandle): 2016-10-29 Darin Adler Convert more of DOM from ExceptionCode to Exception https://bugs.webkit.org/show_bug.cgi?id=164173 Reviewed by Ryosuke Niwa. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp: (webkit_dom_character_data_substring_data): Updated since this now uses ExceptionOr. (webkit_dom_character_data_insert_data): Ditto. (webkit_dom_character_data_delete_data): Ditto. (webkit_dom_character_data_replace_data): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp: (webkit_dom_text_replace_whole_text): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp: (webkit_dom_text_split_text): Ditto. 2016-10-28 Darin Adler Move all classes in the HTML directory from ExceptionCode to Exception https://bugs.webkit.org/show_bug.cgi?id=163876 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp: (webkit_dom_dom_token_list_add): Updated exception handling. (webkit_dom_dom_token_list_remove): Ditto. (webkit_dom_dom_token_list_toggle): Ditto. (webkit_dom_dom_token_list_replace): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_remove): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp: (webkit_dom_html_element_set_inner_text): Ditto. (webkit_dom_html_element_set_outer_text): Ditto. (webkit_dom_html_element_set_content_editable): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp: (webkit_dom_html_input_element_set_max_length): Ditto. (webkit_dom_html_input_element_set_size): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp: (webkit_dom_html_select_element_set_length): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp: (webkit_dom_html_table_element_insert_row): Ditto. (webkit_dom_html_table_element_delete_row): Ditto. (webkit_dom_html_table_element_set_caption): Ditto. (webkit_dom_html_table_element_set_t_head): Ditto. (webkit_dom_html_table_element_set_t_foot): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp: (webkit_dom_html_table_row_element_insert_cell): Ditto. (webkit_dom_html_table_row_element_delete_cell): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp: (webkit_dom_html_table_section_element_insert_row): Ditto. (webkit_dom_html_table_section_element_delete_row): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState): Removed ASSERT_NO_EXCEPTION. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setAssistedNodeValueAsNumber): Removed ASSERT_NO_EXCEPTION. * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionManager::seekableRangesChanged): Changed the code to use a different interface to TimeRange that does not involve exceptions. 2016-10-28 Wenson Hsieh iOS autocorrection does not trigger an input event of inputType "insertReplacementText" https://bugs.webkit.org/show_bug.cgi?id=164077 Reviewed by Simon Fraser. Small tweak to mark text insertion when autocorrecting as such, as opposed to regular keyboard input. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::syncApplyAutocorrection): 2016-10-28 Megan Gardner Rename SharedMemoryMac to SharedMemoryCocoa https://bugs.webkit.org/show_bug.cgi?id=164156 Reviewed by Alex Christensen. Renamed SharedMemoryMac to SharedMemoryCocoa, as it runs on all cocoa platforms, not exclusively just mac, and thus should be named to reflect that reality. * Platform/cocoa: Added. * Platform/cocoa/SharedMemoryCocoa.cpp: Copied from Source/WebKit2/Platform/mac/SharedMemoryMac.cpp. * Platform/mac/SharedMemoryMac.cpp: Removed. * WebKit2.xcodeproj/project.pbxproj: 2016-10-28 Antti Koivisto Enable CFNetwork connection cache fast lane for WebKit2 https://bugs.webkit.org/show_bug.cgi?id=164129 Reviewed by Andreas Kling. The idea of this feature is keep a connection free for higher priority requests so low-priority image loads can't take all the available connections. We have this enabled on WK1 but not on WK2. See what enabling it does for performance in bots. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::initializeNetworkSettings): Based on code inspection setting kHTTPMinimumFastLanePriority is not sufficient to enable this feature, kHTTPNumFastLanes needs also be set to a non-zero value. Use the same constants as WK1. Also enable this on Mac to unify behavior. 2016-10-27 Michael Catanzaro [GTK] New stable DOM API headers should be included from webkitdom.h https://bugs.webkit.org/show_bug.cgi?id=164069 Reviewed by Carlos Garcia Campos. * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h: 2016-10-27 Simon Fraser Fix when building against the MacOSX10.12.sdk where "macos" is not recognized in the availability macros. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2016-10-27 Megan Gardner Add support for wide gamut for ShareableBitmap for image popovers https://bugs.webkit.org/show_bug.cgi?id=164001 Reviewed by Simon Fraser. Added suppport for wide gamut in ShareableBitmap. SharableBitmaps now know the size of their pixels, and that data is passed back and forth between the processes. The callers of SharedBitmap will determine if their image should support wide gamut, but ShareableBitmap will override a set flag on a device that is incapbable of supporting a wide gamut image. This makes it possible to show wide gamut images in image popovers on iOS. This is currently untestable, so no tests added. * Platform/IPC/Decoder.cpp: (IPC::Decoder::decode): * Platform/IPC/Decoder.h: * Platform/IPC/Encoder.cpp: (IPC::Encoder::encode): * Platform/IPC/Encoder.h: * Shared/ShareableBitmap.cpp: (WebKit::bytesPerPixel): (WebKit::ShareableBitmap::Handle::encode): (WebKit::ShareableBitmap::Handle::decode): (WebKit::ShareableBitmap::Handle::clear): (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::createShareable): (WebKit::ShareableBitmap::createHandle): (WebKit::ShareableBitmap::ShareableBitmap): * Shared/ShareableBitmap.h: (WebKit::ShareableBitmap::numBytesForSize): (WebKit::ShareableBitmap::sizeInBytes): * Shared/cg/ShareableBitmapCG.cpp: (WebKit::bitmapInfo): (WebKit::ShareableBitmap::createGraphicsContext): (WebKit::ShareableBitmap::createCGImage): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): 2016-10-27 Wenson Hsieh Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec https://bugs.webkit.org/show_bug.cgi?id=163948 Reviewed by Darin Adler. Add support for new drag and drop-related EditAction enum values. * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::nameForEditAction): 2016-10-26 Chris Dumez Replace IDBKeyPath with a WTF::Variant https://bugs.webkit.org/show_bug.cgi?id=163909 Reviewed by Darin Adler. Add coders to encode / decode IDBKeyPath type for IPC. * Shared/Databases/IndexedDB/WebIDBResult.cpp: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: 2016-10-26 Brian Burg Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend https://bugs.webkit.org/show_bug.cgi?id=164046 Reviewed by Joseph Pecoraro. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::sendMessageToFrontend): * WebProcess/WebPage/WebInspector.h: 2016-10-26 Eric Carlson [MediaStream] Add "has capture device" bit to media state flags https://bugs.webkit.org/show_bug.cgi?id=163952 Unreviewed fix after r207839. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setMuted): Take an MutedStateFlags, not a bool. * WebProcess/WebPage/WebPage.h: 2016-10-26 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.1 release. * gtk/NEWS: Add release notes for 2.15.1. 2016-10-26 Carlos Garcia Campos REGRESSION(r206505) [GTK] Build broken with GTK+ 3.14 https://bugs.webkit.org/show_bug.cgi?id=162776 Reviewed by Xabier Rodriguez-Calvar. Do not use gtk_widget_get_action_group() when GTK+ < 3.16, use g_object_set instead to attach the action group to the menu widget. * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::WebContextMenuProxyGtk::append): (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk): (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): 2016-10-25 Alex Christensen CMake build fix. * PlatformMac.cmake: * Shared/WebHitTestResultData.cpp: (WebKit::WebHitTestResultData::WebHitTestResultData): Explicitly call AtomicString::string to make the String constructor no longer ambiguous. It couldn't decide whether to use operator const String& or operator NSString*. 2016-10-25 Carlos Garcia Campos [SOUP] Network process assertion in NetworkDataTask::continueHTTPRedirection https://bugs.webkit.org/show_bug.cgi?id=163941 Reviewed by Michael Catanzaro. equalLettersIgnoringASCIICase() expects the second argument to be the letters to compare in lowercase, so use "get" instead of "GET". * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::continueHTTPRedirection): 2016-10-25 Eric Carlson [MediaStream] Add "has capture device" bit to media state flags https://bugs.webkit.org/show_bug.cgi?id=163952 Reviewed by Sam Weinig. * UIProcess/API/C/WKPage.cpp: (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice. * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice. 2016-10-25 Commit Queue Unreviewed, rolling out r207827 and r207828. https://bugs.webkit.org/show_bug.cgi?id=163965 Caused LayoutTest webaudio/web-audio-is-playing.html to time out on macOS. (Requested by ryanhaddad on #webkit). Reverted changesets: "[MediaStream] Add "has capture device" bit to media state flags" https://bugs.webkit.org/show_bug.cgi?id=163952 http://trac.webkit.org/changeset/207827 "[MediaStream] Add "has capture device" bit to media state flags" https://bugs.webkit.org/show_bug.cgi?id=163952 http://trac.webkit.org/changeset/207828 2016-10-25 Eric Carlson [MediaStream] Add "has capture device" bit to media state flags https://bugs.webkit.org/show_bug.cgi?id=163952 Reviewed by Sam Weinig. * UIProcess/API/C/WKPage.cpp: (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice. * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice. 2016-10-25 Chris Dumez Unreviewed, rolling out r207494. iOS SDK has been updated on the bots now so rollout the rollout Reverted changeset: "Unreviewed, rolling out r207413." https://bugs.webkit.org/show_bug.cgi?id=163547 http://trac.webkit.org/changeset/207494 2016-10-25 Jonathan Bedard Unreviewed build fix. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _fullscreenDelegate]): Removed unneeded parenthesis. 2016-10-19 Jer Noble Add WKWebView fullscreen delegate SPI https://bugs.webkit.org/show_bug.cgi?id=163674 Reviewed by Anders Carlsson. Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits. * UIProcess/API/APIFullscreenClient.h: Added. (API::FullscreenClient::~FullscreenClient): (API::FullscreenClient::willEnterFullscreen): (API::FullscreenClient::didEnterFullscreen): (API::FullscreenClient::willExitFullscreen): (API::FullscreenClient::didExitFullscreen): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): (-[WKWebView _isInFullscreen]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added. * UIProcess/Cocoa/FullscreenClient.h: Added. (WebKit::FullscreenClient::~FullscreenClient): * UIProcess/Cocoa/FullscreenClient.mm: Added. (WebKit::FullscreenClient::FullscreenClient): (WebKit::FullscreenClient::delegate): (WebKit::FullscreenClient::setDelegate): (WebKit::FullscreenClient::willEnterFullscreen): (WebKit::FullscreenClient::didEnterFullscreen): (WebKit::FullscreenClient::willExitFullscreen): (WebKit::FullscreenClient::didExitFullscreen): * UIProcess/WebFullScreenManagerProxy.cpp: (WebKit::WebFullScreenManagerProxy::willEnterFullScreen): (WebKit::WebFullScreenManagerProxy::didEnterFullScreen): (WebKit::WebFullScreenManagerProxy::willExitFullScreen): (WebKit::WebFullScreenManagerProxy::didExitFullScreen): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::setFullscreenClient): (WebKit::WebPageProxy::fullScreenManager): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::fullscreenClient): * WebKit2.xcodeproj/project.pbxproj: 2016-10-25 Carlos Garcia Campos Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812. * NetworkProcess/NetworkProcessCreationParameters.h: Initialize loadThrottleLatency. 2016-10-25 Carlos Garcia Campos Unreviewed. Fix Soup based ports debug build after r207813. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::authenticateCallback): (WebKit::NetworkDataTaskSoup::requestStartedCallback): 2016-10-25 Andreas Kling More PassRefPtr purging in WebCore. Reviewed by Antti Koivisto. * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h: * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: (WebKit::PDFPlugin::createScrollbar): 2016-10-25 Carlos Garcia Campos NetworkSession: switch to use subclasses for NetworkSession and NetworkDataTask implementations https://bugs.webkit.org/show_bug.cgi?id=163777 Reviewed by Alex Christensen. The subclass model allows us to choose the implementation at run time, so we could add other implementations like a mock network class to measure performance, and even one for blobs and finally get rid of ResourceHandle in WebKit2. * CMakeLists.txt: Add new files to compilation. * NetworkProcess/NetworkDataTask.cpp: Added. (WebKit::NetworkDataTask::create): Create a NetworkDataTaskCocoa or NetworkDataTaskSoup. (WebKit::NetworkDataTask::NetworkDataTask): Move common code from NetworkDataTaskCocoa and NetworkDataTaskSoup here to handle the early failures. (WebKit::NetworkDataTask::~NetworkDataTask): (WebKit::NetworkDataTask::scheduleFailure): (WebKit::NetworkDataTask::failureTimerFired): * NetworkProcess/NetworkDataTask.h: Remove platform specific members. (WebKit::NetworkDataTask::setPendingDownloadLocation): Make it virtual and set the m_pendingDownloadLocation. (WebKit::NetworkDataTask::suggestedFilename): Make it virtual and const with a default implementation. (WebKit::NetworkDataTask::setSuggestedFilename): Ditto. (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost): Ditto. * NetworkProcess/NetworkLoad.cpp: Include NetworkDataTaskCocoa.h. * NetworkProcess/NetworkLoad.h: Include NetworkDataTask.h instead of NetworkSession.h. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): Use NetworkSessionCocoa. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::create): Create a NetworkSessionCocoa or NetworkSessionSoup. (WebKit::NetworkSession::defaultSession): In case of cocoa use NetworkSessionCocoa::defaultSession() because of the custom protocol manager, otherwise simply create a default session. (WebKit::NetworkSession::networkStorageSession): Move common code from NetworkSessionCocoa and NetworkSessionSoup here. (WebKit::NetworkSession::NetworkSession): (WebKit::NetworkSession::~NetworkSession): * NetworkProcess/NetworkSession.h: Remove platform specific members. (WebKit::NetworkSession::invalidateAndCancel): Make it virtual. (WebKit::NetworkSession::clearCredentials): Ditto. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: Include NetworkSession.h. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Added. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::didSendData): (WebKit::NetworkDataTaskCocoa::didReceiveChallenge): (WebKit::NetworkDataTaskCocoa::didCompleteWithError): (WebKit::NetworkDataTaskCocoa::didReceiveResponse): (WebKit::NetworkDataTaskCocoa::didReceiveData): (WebKit::NetworkDataTaskCocoa::didBecomeDownload): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): (WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation): (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication): (WebKit::NetworkDataTaskCocoa::transferSandboxExtensionToDownload): (WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost): (WebKit::NetworkDataTaskCocoa::suggestedFilename): (WebKit::NetworkDataTaskCocoa::cancel): (WebKit::NetworkDataTaskCocoa::resume): (WebKit::NetworkDataTaskCocoa::suspend): (WebKit::NetworkDataTaskCocoa::state): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: Added. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): (WebKit::configurationForSessionID): (WebKit::NetworkSessionCocoa::setCustomProtocolManager): (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData): (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier): (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier): (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType): (WebKit::NetworkSessionCocoa::create): (WebKit::NetworkSessionCocoa::defaultSession): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::NetworkSessionCocoa::~NetworkSessionCocoa): (WebKit::NetworkSessionCocoa::invalidateAndCancel): (WebKit::NetworkSessionCocoa::clearCredentials): (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): (WebKit::NetworkSessionCocoa::addDownloadID): (WebKit::NetworkSessionCocoa::downloadID): (WebKit::NetworkSessionCocoa::takeDownloadID): * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::suggestedFilename): (WebKit::NetworkDataTaskSoup::setPendingDownloadLocation): (WebKit::NetworkDataTaskSoup::createRequest): (WebKit::NetworkDataTaskSoup::clearRequest): (WebKit::NetworkDataTaskSoup::resume): (WebKit::NetworkDataTaskSoup::suspend): (WebKit::NetworkDataTaskSoup::cancel): (WebKit::NetworkDataTaskSoup::invalidateAndCancel): (WebKit::NetworkDataTaskSoup::state): (WebKit::NetworkDataTaskSoup::timeoutFired): (WebKit::NetworkDataTaskSoup::startTimeout): (WebKit::NetworkDataTaskSoup::stopTimeout): (WebKit::NetworkDataTaskSoup::sendRequestCallback): (WebKit::NetworkDataTaskSoup::didSendRequest): (WebKit::NetworkDataTaskSoup::didReceiveResponse): (WebKit::NetworkDataTaskSoup::tlsErrorsChangedCallback): (WebKit::NetworkDataTaskSoup::tlsErrorsChanged): (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest): (WebKit::NetworkDataTaskSoup::authenticateCallback): (WebKit::NetworkDataTaskSoup::authenticate): (WebKit::NetworkDataTaskSoup::continueAuthenticate): (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirectionCallback): (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection): (WebKit::NetworkDataTaskSoup::didFinishSkipInputStreamForRedirection): (WebKit::NetworkDataTaskSoup::shouldStartHTTPRedirection): (WebKit::NetworkDataTaskSoup::continueHTTPRedirection): (WebKit::NetworkDataTaskSoup::readCallback): (WebKit::NetworkDataTaskSoup::read): (WebKit::NetworkDataTaskSoup::didRead): (WebKit::NetworkDataTaskSoup::didFinishRead): (WebKit::NetworkDataTaskSoup::requestNextPartCallback): (WebKit::NetworkDataTaskSoup::requestNextPart): (WebKit::NetworkDataTaskSoup::didRequestNextPart): (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart): (WebKit::NetworkDataTaskSoup::gotHeadersCallback): (WebKit::NetworkDataTaskSoup::didGetHeaders): (WebKit::NetworkDataTaskSoup::wroteBodyDataCallback): (WebKit::NetworkDataTaskSoup::didWriteBodyData): (WebKit::NetworkDataTaskSoup::download): (WebKit::NetworkDataTaskSoup::writeDownloadCallback): (WebKit::NetworkDataTaskSoup::writeDownload): (WebKit::NetworkDataTaskSoup::didWriteDownload): (WebKit::NetworkDataTaskSoup::didFinishDownload): (WebKit::NetworkDataTaskSoup::didFailDownload): (WebKit::NetworkDataTaskSoup::cleanDownloadFiles): (WebKit::NetworkDataTaskSoup::didFail): (WebKit::NetworkDataTaskSoup::networkEventCallback): (WebKit::NetworkDataTaskSoup::networkEvent): (WebKit::NetworkDataTaskSoup::startingCallback): (WebKit::NetworkDataTaskSoup::requestStartedCallback): (WebKit::NetworkDataTaskSoup::didStartRequest): (WebKit::NetworkDataTaskSoup::restartedCallback): (WebKit::NetworkDataTaskSoup::didRestart): * NetworkProcess/soup/NetworkDataTaskSoup.h: Added. * NetworkProcess/soup/NetworkSessionSoup.cpp: (WebKit::NetworkSessionSoup::NetworkSessionSoup): (WebKit::NetworkSessionSoup::~NetworkSessionSoup): (WebKit::NetworkSessionSoup::soupSession): (WebKit::NetworkSessionSoup::invalidateAndCancel): * NetworkProcess/soup/NetworkSessionSoup.h: Added. * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API. * PlatformEfl.cmake: Add new files to compilation. * PlatformGTK.cmake: Ditto. * WebKit2.xcodeproj/project.pbxproj: Ditto. * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API. * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Ditto. 2016-10-25 Antti Koivisto Add support for introducing simulated latency in network process https://bugs.webkit.org/show_bug.cgi?id=163902 Reviewed by Alex Christensen. For testing purposes it is useful to have a mechanism for simulating high latency. This patch adds a basic mechanism that introduces a delay to each response in network process. In Safari it can be used with defaults write com.apple.Safari WebKitNetworkLoadThrottleLatencyMilliseconds 200 Setting the delay to 0 disables the feature. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::Throttle::Throttle): (WebKit::NetworkLoad::didReceiveResponseNetworkSession): (WebKit::NetworkLoad::notifyDidReceiveResponse): (WebKit::NetworkLoad::didReceiveData): (WebKit::NetworkLoad::didCompleteWithError): (WebKit::NetworkLoad::throttleDelayCompleted): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::loadThrottleLatency): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2016-10-24 Dan Bernstein REGRESSION (r206410): Sandbox violations beneath WebProcessProxy::platformIsBeingDebugged https://bugs.webkit.org/show_bug.cgi?id=163879 Reviewed by Darin Adler. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::platformIsBeingDebugged): Check if the current process, which is the UI process, is sandboxed before trying to find out if the Web process is being debugged. 2016-10-21 Alex Christensen URL::port should return Optional https://bugs.webkit.org/show_bug.cgi?id=163806 Reviewed by Darin Adler. * NetworkProcess/mac/NetworkProcessMac.mm: (WebKit::overrideSystemProxies): * Shared/API/APISecurityOrigin.h: (API::SecurityOrigin::create): * Shared/API/APIURL.h: (API::URL::protocol): * Shared/API/c/WKSecurityOriginRef.cpp: (WKSecurityOriginGetPort): * UIProcess/API/Cocoa/WKSecurityOrigin.mm: (-[WKSecurityOrigin port]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::canHandleRequest): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::origin): 2016-10-24 Eric Carlson [MediaStream] Separate media capture and audio playback muting https://bugs.webkit.org/show_bug.cgi?id=163855 Reviewed by Darin Adler. * Shared/WebPageCreationParameters.h: Change 'muted' from bool to MutedStateFlags. * UIProcess/API/C/WKPage.cpp: Change parameter from bool to WKMediaMutedState. (WKPageSetMuted): * UIProcess/API/C/WKPagePrivate.h: Define WKMediaMutedState. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::setMuted): m_muted -> m_mutedState. (WebKit::WebPageProxy::creationParameters): Ditto. * UIProcess/WebPageProxy.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::isMuted): page.isMuted -> page.mutedState. * WebProcess/WebPage/WebPage.messages.in: Change SetMuted parameter. 2016-10-24 Youenn Fablet Activate WEB_RTC compilation flags for Mac bots https://bugs.webkit.org/show_bug.cgi?id=163886 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2016-10-24 Brady Eidson IndexedDB 2.0: Support IDBIndex name assignment. and https://bugs.webkit.org/show_bug.cgi?id=163805 Reviewed by Alex Christensen. * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::didRenameIndex): (WebKit::WebIDBConnectionToClient::renameIndex): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::renameIndex): (WebKit::WebIDBConnectionToServer::didRenameIndex): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in: 2016-10-23 Michael Catanzaro [GTK] Remove DO NOT MODIFY headers from files that are no longer autogenerated https://bugs.webkit.org/show_bug.cgi?id=163867 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttrPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlobPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASectionPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRulePrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclarationPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheetPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterDataPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCommentPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementationPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelectionPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowUnstable.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentUnstable.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentTypePrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentUnstable.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementUnstable.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFilePrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollectionPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocumentPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementUnstable.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollectionPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElementPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEventPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEventPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMapPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIteratorPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstructionPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangePrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangeUnstable.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTextPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalkerPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEventPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEventPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpressionPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolverPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResultPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h: * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomautocleanups.h: * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomdefines.h: 2016-10-23 Chris Dumez Another unreviewed attempt to fix the WatchOS / TvOS build after r207585. Disable USE_CFURLCONNECTION on newer WatchOS / TvOS. * config.h: 2016-10-23 Chris Dumez Unreviewed attempt to fix WatchOS / TvOS build after r207585. Enable NETWORK_SESSION on those platforms. * config.h: 2016-10-22 Dan Bernstein [iOS] _webViewWillEndNavigationGesture:withNavigationToBackForwardListItem: is never called https://bugs.webkit.org/show_bug.cgi?id=163758 Reviewed by Darin Adler. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): Don’t reset the interactive update handler. 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-21 Eric Carlson [MediaStream] Dynamically generate media capture sandbox extensions https://bugs.webkit.org/show_bug.cgi?id=154861 Reviewed by Tim Horton. * Shared/SandboxExtension.h: (WebKit::SandboxExtension::createHandleForGenericExtension): * Shared/mac/SandboxExtensionMac.mm: (WebKit::wkSandboxExtensionType): Add case for generic handle. (WebKit::SandboxExtension::createHandleForGenericExtension): New. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Clear the list of extensions granted. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Extend the web process sandbox as necessary. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Revoke all sandbox extensions. (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Consume sandbox extensions. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Pass-through to user media manager. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add GrantUserMediaDevicesSandboxExtension. * WebProcess/com.apple.WebProcess.sb.in: Add rules, defines, and a macro to allow dynamic extensions for media capture devices. 2016-10-21 Gavin Barraclough WebPageProxy should not need PageActivityState https://bugs.webkit.org/show_bug.cgi?id=163821 Reviewed by Geoff Garen. The PageActivityState is currently plumbed back from WebCore up to the UI process, to determine whether to enabled process suppression. However the information it contains (whether a page load is ongoing, whether audio is playing) is already available via other means. Remove this use of PageActivityState. * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::commitChanges): - PageLoadState notifies WebPageProxy when loading state changes. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateThrottleState): - Now relies on info from PageLoadState, setMuted, isPlayingMediaDidChange. (WebKit::WebPageProxy::setMuted): (WebKit::WebPageProxy::isPlayingMediaDidChange): - If audio playback state changes we may need to update the throttle state. (WebKit::WebPageProxy::setPageActivityState): Deleted. - removed PageActivityState from WK2. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isLoadingChanged): - PageLoadState notifies WebPageProxy when loading state changes. * UIProcess/WebPageProxy.messages.in: - removed PageActivityState from WK2. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setPageActivityState): Deleted. - removed PageActivityState from WK2. * WebProcess/WebCoreSupport/WebChromeClient.h: - removed PageActivityState from WK2. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setPageActivityState): Deleted. - removed PageActivityState from WK2. * WebProcess/WebPage/WebPage.h: - removed PageActivityState from WK2. 2016-10-21 Gavin Barraclough WebPage should take UserActivity directly for user input https://bugs.webkit.org/show_bug.cgi?id=163813 Reviewed by Anders Carlsson. When we receive mouse/keyboard events in a page, we want to prevent AppNap. We currently do so via the PageThrottler. This patch is to just make the WebPage drive the UserActivity directly. Two reasons to do so: (1) to cleanup & simplify for further refactoring. (2) The current code isn't really achieving the desired effect. The page setting the flag in the throttler to get the activity to be set is now a less effective way of achieving this goal, since the PageActivityState bounces back across to the UI process & then messages back to the WebContent process to take the UserActivity. These extra hops defeat the purpose of making sure the boost from the initial message isn't lost. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_userActivityHysteresis): - m_userActivityHysteresis triggers updateUserActivity. (WebKit::WebPage::setPageSuppressed): - setPageSuppressed starts/stops m_userActivityHysteresis. (WebKit::WebPage::updateUserActivity): - update UserActivity based on state of m_userActivityHysteresis. (WebKit::WebPage::mouseEvent): (WebKit::WebPage::wheelEvent): (WebKit::WebPage::keyEvent): - input events impulse m_userActivityHysteresis. * WebProcess/WebPage/WebPage.h: 2016-10-21 Wenson Hsieh Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents https://bugs.webkit.org/show_bug.cgi?id=163460 Reviewed by Darin Adler. Handle new EditAction types for inserting/deleting pending/final compositions. * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::nameForEditAction): 2016-10-21 Jeremy Jones Implement basic pointer lock behavior for WebKit and WebKit2. https://bugs.webkit.org/show_bug.cgi?id=162745 Reviewed by Simon Fraser. Enable basic pointer lock functionality by plumbing requests through WebPage IPC. Pass through mouse movement deltas. Unlock pointer when view is no longer visible. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): Pass along mouse movement. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dispatchViewStateChange): Unlock pointer when page is not visible. (WebKit::WebPageProxy::requestPointerLock): Hide and disassociate pointer. (WebKit::WebPageProxy::requestPointerUnlock): Show and associate pointer. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add methods. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestPointerLock): Pass along to web page. (WebKit::WebChromeClient::requestPointerUnlock): Ditto. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didAcquirePointerLock): Forward to PointerLockController. (WebKit::WebPage::didNotAcquirePointerLock): Ditto. (WebKit::WebPage::didLosePointerLock): Ditto. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add methods. 2016-10-21 Wenson Hsieh Implement InputEvent.getTargetRanges() for the input events spec https://bugs.webkit.org/show_bug.cgi?id=162947 Reviewed by Darin Adler. Boilerplate change to add a runtime guard for InputEvents-related IDL interfaces. See WebCore ChangeLog entry for more details. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-10-20 Carlos Garcia Campos [GTK] Configures but fails to link with ENABLE_OPENGL=OFF https://bugs.webkit.org/show_bug.cgi?id=163449 Reviewed by Michael Catanzaro. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseRealize): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER and also ensure the current display is X11. (webkitWebViewBaseUnrealize): Ditto. (webkitWebViewBaseDidRelaunchWebProcess): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER. (webkitWebViewBasePageClosed): Ditto. * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState): Ditto. (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): Check EGL is enabled before trying to use the WaylandCompositor. * UIProcess/AcceleratedDrawingAreaProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): Ditto. * UIProcess/gtk/AcceleratedBackingStore.cpp: (WebKit::AcceleratedBackingStore::create): Ditto. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: * UIProcess/gtk/WaylandCompositor.cpp: * UIProcess/gtk/WaylandCompositor.h: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER. * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/LayerTreeHost.h: 2016-10-20 Chris Dumez "Download Linked File" context menu action should use 'download' attribute as suggested filename https://bugs.webkit.org/show_bug.cgi?id=163742 Reviewed by Darin Adler. Update "Download Linked File" context menu action to use the anchor element's 'download' attribute as suggested filename for the download. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::downloadRequest): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Shared/WebHitTestResultData.cpp: (WebKit::WebHitTestResultData::WebHitTestResultData): (WebKit::WebHitTestResultData::encode): (WebKit::WebHitTestResultData::decode): * Shared/WebHitTestResultData.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contextMenuItemSelected): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::download): * UIProcess/WebProcessPool.h: * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename): 2016-10-19 Myles C. Maxfield [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9 https://bugs.webkit.org/show_bug.cgi?id=163374 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: 2016-10-20 Brady Eidson IndexedDB 2.0: Support IDBObjectStore name assignment. and https://bugs.webkit.org/show_bug.cgi?id=163749 Reviewed by Alex Christensen. * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::didRenameObjectStore): (WebKit::WebIDBConnectionToClient::renameObjectStore): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::renameObjectStore): (WebKit::WebIDBConnectionToServer::didRenameObjectStore): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in: 2016-10-20 Carlos Garcia Campos [GTK] Avoid strstr() when checking (E)GL extensions https://bugs.webkit.org/show_bug.cgi?id=161958 Reviewed by Žan Doberšek. Use GLContext::isExtensionSupported() instead of strstr(). * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::initializeEGL): 2016-10-20 Carlos Garcia Campos Wrong use of EGL_DEPTH_SIZE https://bugs.webkit.org/show_bug.cgi?id=155536 Reviewed by Michael Catanzaro. Use XErrorTrapper class instead of the custom XErrorHandler. * PluginProcess/unix/PluginProcessMainUnix.cpp: (WebKit::PluginProcessMainUnix): 2016-10-19 Carlos Garcia Campos [SOUP] Add NetworkSession implementation and switch to use it https://bugs.webkit.org/show_bug.cgi?id=163597 Reviewed by Alex Christensen. Basically move the ResourceHandle implementation to the network process, but modernized, cleaned up, and adapted to the NetworkSession model. * CMakeLists.txt: Add new files to compilation. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::Download): Use the same code for all ports using NetworkSession and add missing initialization of m_sessionID. * NetworkProcess/Downloads/Download.h: (WebKit::Download::Download): Define PlatformDownloadTaskRef on every platform to make the constructor common to all ports using NetworkSession. * NetworkProcess/Downloads/soup/DownloadSoup.cpp: (WebKit::Download::cancelNetworkLoad): (WebKit::Download::platformDidFinish): * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTask::pendingDownloadID): Make const. (WebKit::NetworkDataTask::pendingDownload): Ditto. (WebKit::NetworkDataTask::pendingDownloadLocation): Ditto. (WebKit::NetworkDataTask::isDownload): Helper to check if the task is a download. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveResponseNetworkSession): Use NetworkDataTask::isDownload(). * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): NetworkSession::setCustomProtocolManager() is Cocoa only. * NetworkProcess/NetworkSession.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSession::networkStorageSession): Make const. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: Added. (WebKit::NetworkDataTask::NetworkDataTask): (WebKit::NetworkDataTask::~NetworkDataTask): (WebKit::NetworkDataTask::scheduleFailure): (WebKit::NetworkDataTask::failureTimerFired): (WebKit::NetworkDataTask::suggestedFilename): (WebKit::NetworkDataTask::setSuggestedFilename): (WebKit::NetworkDataTask::setPendingDownloadLocation): (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost): (WebKit::NetworkDataTask::createRequest): (WebKit::NetworkDataTask::clearRequest): (WebKit::NetworkDataTask::resume): (WebKit::NetworkDataTask::suspend): (WebKit::NetworkDataTask::cancel): (WebKit::NetworkDataTask::invalidateAndCancel): (WebKit::NetworkDataTask::state): (WebKit::NetworkDataTask::timeoutFired): (WebKit::NetworkDataTask::startTimeout): (WebKit::NetworkDataTask::stopTimeout): (WebKit::NetworkDataTask::sendRequestCallback): (WebKit::NetworkDataTask::didSendRequest): (WebKit::NetworkDataTask::didReceiveResponse): (WebKit::NetworkDataTask::tlsErrorsChangedCallback): (WebKit::NetworkDataTask::tlsErrorsChanged): (WebKit::NetworkDataTask::applyAuthenticationToRequest): (WebKit::NetworkDataTask::authenticateCallback): (WebKit::isAuthenticationFailureStatusCode): (WebKit::NetworkDataTask::authenticate): (WebKit::NetworkDataTask::continueAuthenticate): (WebKit::NetworkDataTask::skipInputStreamForRedirectionCallback): (WebKit::NetworkDataTask::skipInputStreamForRedirection): (WebKit::NetworkDataTask::didFinishSkipInputStreamForRedirection): (WebKit::shouldRedirectAsGET): (WebKit::NetworkDataTask::shouldStartHTTPRedirection): (WebKit::NetworkDataTask::continueHTTPRedirection): (WebKit::NetworkDataTask::readCallback): (WebKit::NetworkDataTask::read): (WebKit::NetworkDataTask::didRead): (WebKit::NetworkDataTask::didFinishRead): (WebKit::NetworkDataTask::requestNextPartCallback): (WebKit::NetworkDataTask::requestNextPart): (WebKit::NetworkDataTask::didRequestNextPart): (WebKit::NetworkDataTask::didFinishRequestNextPart): (WebKit::NetworkDataTask::gotHeadersCallback): (WebKit::NetworkDataTask::didGetHeaders): (WebKit::NetworkDataTask::wroteBodyDataCallback): (WebKit::NetworkDataTask::didWriteBodyData): (WebKit::NetworkDataTask::download): (WebKit::NetworkDataTask::writeDownloadCallback): (WebKit::NetworkDataTask::writeDownload): (WebKit::NetworkDataTask::didWriteDownload): (WebKit::NetworkDataTask::didFinishDownload): (WebKit::NetworkDataTask::didFailDownload): (WebKit::NetworkDataTask::cleanDownloadFiles): (WebKit::NetworkDataTask::didFail): (WebKit::NetworkDataTask::networkEventCallback): (WebKit::NetworkDataTask::networkEvent): (WebKit::NetworkDataTask::startingCallback): (WebKit::NetworkDataTask::requestStartedCallback): (WebKit::NetworkDataTask::didStartRequest): (WebKit::NetworkDataTask::restartedCallback): (WebKit::NetworkDataTask::didRestart): * NetworkProcess/soup/NetworkSessionSoup.cpp: (WebKit::NetworkSession::create): (WebKit::NetworkSession::defaultSession): (WebKit::NetworkSession::networkStorageSession): (WebKit::NetworkSession::NetworkSession): (WebKit::NetworkSession::~NetworkSession): (WebKit::NetworkSession::soupSession): (WebKit::NetworkSession::invalidateAndCancel): (WebKit::NetworkSession::clearCredentials): * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Add implementation matching WebFrameNetworkingContext::ensurePrivateBrowsingSession(). (WebKit::RemoteNetworkingContext::storageSession): Do not always return the default session if the given one is in the global map. * PlatformEfl.cmake: Ad new files to compilation. * PlatformGTK.cmake: Ditto. * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Also create a NetworkSession. * config.h: Enable NetworkSession unconditionally for Soup based ports. 2016-10-19 Alex Christensen Revert r207151 https://bugs.webkit.org/show_bug.cgi?id=163675 Reviewed by Brent Fulgham. * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/mac/DownloadMac.mm: * NetworkProcess/NetworkLoad.h: * NetworkProcess/mac/NetworkLoadMac.mm: (WebKit::NetworkLoad::willCacheResponseAsync): * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: (WebKit::AuthenticationManager::receivedCredential): (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential): (WebKit::AuthenticationManager::receivedCancellation): (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling): (WebKit::AuthenticationManager::receivedChallengeRejection): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * WebKit2.xcodeproj/project.pbxproj: 2016-10-19 Chris Dumez [WK2] Expose suggested filename via WKBundleHitTestResult API https://bugs.webkit.org/show_bug.cgi?id=163693 Reviewed by Anders Carlsson. Expose suggested filename via WKBundleHitTestResult API. The implementation currently relies on the 'download' attribute on anchor / area elements that we recently started supporting. * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp: (WKBundleHitTestResultCopyLinkSuggestedFilename): * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h: * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: (WebKit::InjectedBundleHitTestResult::create): (WebKit::InjectedBundleHitTestResult::mediaType): (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename): (WebKit::InjectedBundleHitTestResult::imageRect): * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h: 2016-10-19 Ryan Haddad Unreviewed, rolling out r207557. This change caused animations/font-variations tests to time out on pre-Sierra Macs. Reverted changeset: "[macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9" https://bugs.webkit.org/show_bug.cgi?id=163374 http://trac.webkit.org/changeset/207557 2016-10-19 Andy Estes Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type https://bugs.webkit.org/show_bug.cgi?id=163476 Reviewed by Andreas Kling. When custom content providers are registered and a response has a null MIME type, WebPage will pass a null String to HashSet::contains(). This results in a null pointer dereference, since the String hash functions do not support null Strings and unconditionally dereference their StringImpls. Fixed by checking that Strings are non-null before calling HashSet::contains() on m_mimeTypesWithCustomContentProviders. New API test: WebKit2.LoadDataWithNilMIMEType. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::shouldUseCustomContentProviderForResponse): Checked if mimeType is null before calling m_mimeTypesWithCustomContentProviders.contains(). (WebKit::WebPage::canShowMIMEType): Ditto. * WebProcess/WebPage/WebPage.h: Made private the declaration of canPluginHandleResponse(). 2016-10-19 Chris Dumez Move HTML Interactive Form Validation behind an experimental flag https://bugs.webkit.org/show_bug.cgi?id=163673 Reviewed by Daniel Bates. Move HTML Interactive Form Validation behind an experimental feature flag and disable by default until by have a better UI. * Shared/WebPreferencesDefinitions.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2016-10-19 Damian Kaleta https://bugs.webkit.org/show_bug.cgi?id=163292 Reviewed by Brady Eidson. Added ability to display context menu asynchronously. * Shared/API/APIObject.h: Added ContextMenuListener. * Shared/API/c/WKBase.h: Added WKContextMenuListenerRef struct. * UIProcess/API/APIContextMenuClient.h: (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): New method that allows showing context menu asynchronously. * UIProcess/API/C/WKAPICast.h: Added a new mapping for WebContextMenuListenerProxy. * UIProcess/API/C/WKContextMenuListener.cpp: Added. New class that allow a client to return results asynchronously. (WKContextMenuListenerGetTypeID): (WKContextMenuListenerUseContextMenuItems): * UIProcess/API/C/WKContextMenuListener.h: Added. * UIProcess/API/C/WKPage.cpp: Added WKPageContextMenuClientV4. (WKPageSetPageContextMenuClient): * UIProcess/API/C/WKPageContextMenuClient.h: * UIProcess/WebContextMenuListenerProxy.cpp: Copied from Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h. (WebKit::WebContextMenuListenerProxy::WebContextMenuListenerProxy): (WebKit::WebContextMenuListenerProxy::~WebContextMenuListenerProxy): (WebKit::WebContextMenuListenerProxy::useContextMenuItems): Passes items to m_contextMenuMac. (WebKit::WebContextMenuListenerProxy::invalidate): * UIProcess/WebContextMenuListenerProxy.h: Copied from Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h. (WebKit::WebContextMenuListenerProxy::create): * UIProcess/mac/WebContextMenuProxyMac.h: * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): Shows context menu. (WebKit::WebContextMenuProxyMac::showContextMenu): Extracted some logic to showContextMenuWithItems(). * WebKit2.xcodeproj/project.pbxproj: 2016-10-19 Myles C. Maxfield [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9 https://bugs.webkit.org/show_bug.cgi?id=163374 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: 2016-10-19 Darin Adler Move XPath from ExceptionCode to Exception https://bugs.webkit.org/show_bug.cgi?id=163656 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp: (webkit_dom_document_create_expression): Use ExceptionOr. (webkit_dom_document_evaluate): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp: (webkit_dom_xpath_expression_evaluate): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp: (webkit_dom_xpath_result_iterate_next): Ditto. (webkit_dom_xpath_result_snapshot_item): Ditto. (webkit_dom_xpath_result_get_number_value): Ditto. (webkit_dom_xpath_result_get_string_value): Ditto. (webkit_dom_xpath_result_get_boolean_value): Ditto. (webkit_dom_xpath_result_get_single_node_value): Ditto. (webkit_dom_xpath_result_get_snapshot_length): Ditto. 2016-10-19 Carlos Garcia Campos NetworkSession: updatedRequest parameter of NetworkProcess::findPendingDownloadLocation is unused since r206988 https://bugs.webkit.org/show_bug.cgi?id=163588 Reviewed by Alex Christensen. The parameter was used only for the DownloadProxy::DidStart message that is no longer sent from findPendingDownloadLocation since r206988. * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTask::currentRequest): Removed since it's unused now. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::convertTaskToDownload): Update the m_currentRequest and pass it to DidStart message. (WebKit::NetworkLoad::didReceiveResponseNetworkSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::findPendingDownloadLocation): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Remove currentRequest() implementation. 2016-10-19 Carlos Garcia Campos Unreviewed. Fix GTK+ build after r207522. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp: (webkit_dom_dom_window_webkit_message_handlers_post_message): Use new exceptions. 2016-10-19 Carlos Garcia Campos Unreviewed. Fix GTK+ build after r207497. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp: (webkit_dom_html_select_element_add): Update implementation since add() now takes a Variant. 2016-10-18 Simon Fraser Add a MiniBrowser menu item to apply page scale in WK1 and WK2 https://bugs.webkit.org/show_bug.cgi?id=163627 Reviewed by Dean Jackson. New SPI to set and retrieve page scale. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setPageScale:withOrigin:]): (-[WKWebView _pageScale]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2016-10-18 Dean Jackson Remove CSS_SHAPES feature definition. This should always be on. https://bugs.webkit.org/show_bug.cgi?id=163628 Reviewed by Tim Horton. * Configurations/FeatureDefines.xcconfig: 2016-10-18 Ryan Haddad Unreviewed, rolling out r207413. This change broke iOS builds. Reverted changeset: "[iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates" https://bugs.webkit.org/show_bug.cgi?id=163547 http://trac.webkit.org/changeset/207413 2016-10-18 Commit Queue Unreviewed, rolling out r207443. https://bugs.webkit.org/show_bug.cgi?id=163616 "Caused 5% PLT regression" (Requested by krollin on #webkit). Reverted changeset: "Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type" https://bugs.webkit.org/show_bug.cgi?id=163476 http://trac.webkit.org/changeset/207443 2016-10-18 Megan Gardner Fix build for platforms where HAVE(LINK_PREVIEW) is false https://bugs.webkit.org/show_bug.cgi?id=163607 Reviewed by Tim Horton. Added needed # for link preview * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _contentsOfUserInterfaceItem:]): 2016-10-18 Joseph Pecoraro Remote Web Inspector: Timeline UI not updating while recording https://bugs.webkit.org/show_bug.cgi?id=163582 Reviewed by Timothy Hatcher. * WebProcess/WebPage/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::frontendLoaded): Local inspector windows keep the web view alive and toggle the WebInspector.visible state depending on whether or not an inspector is open. Remote Inspector windows go away when closed, so they can always be marked as open. This matches earlier remote inspector behavior. 2016-10-18 Eric Carlson [MediaStream] Resolve constraints and enumerate devices in the UI process https://bugs.webkit.org/show_bug.cgi?id=162147 Reviewed by Darin Adler. Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device access happens in the UI process. * Scripts/webkit/messages.py: (headers_for_type): Special case MediaConstraintsData. * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap encoder. (IPC::ArgumentCoder::encode): MediaConstraintsData encoder. (IPC::decodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap decoder. (IPC::ArgumentCoder::decode): MediaConstraintsData decoder. (IPC::ArgumentCoder::encode): CaptureDevice enoder. (IPC::ArgumentCoder::decode): CaptureDevice decoder. * Shared/WebCoreArgumentCoders.h: * UIProcess/API/APIUIClient.h: Remove UserMediaPermissionCheckProxy forward declaration. * UIProcess/API/C/WKUserMediaPermissionRequest.cpp: (toWK): Translate UserMediaPermissionRequestDenialReason to UserMediaAccessDenialReason. (WKUserMediaPermissionRequestDeny): Add "reason" parameter. * UIProcess/API/C/WKUserMediaPermissionRequest.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Invalidate pending device requests. (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Make private. (WebKit::toWebCore): Map from UserMediaAccessDenialReason to MediaAccessDenialReason, cast to uint64_t to pass to web process. (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest): Send to web process. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Validate constraints and make sure gUM is enabled before prompting user. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): New. (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Send results of device enumeration to web process. (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::createUserMediaPermissionCheck): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::allow): (WebKit::UserMediaPermissionRequestProxy::deny): Take "reason" parameter. * UIProcess/UserMediaPermissionRequestProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): (WebKit::WebPageProxy::checkUserMediaPermissionForFrame): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): userMediaAccessDenied -> deny. Pass the audio and video constraints to the UI process. (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied): (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): Send the enumeration request to the UI process. (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration): (WebKit::UserMediaPermissionRequestManager::didCompleteMediaDeviceEnumeration): (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision): Deleted. (WebKit::UserMediaPermissionRequestManager::startUserMediaPermissionCheck): Deleted. (WebKit::UserMediaPermissionRequestManager::cancelUserMediaPermissionCheck): Deleted. (WebKit::UserMediaPermissionRequestManager::didCompleteUserMediaPermissionCheck): Deleted. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: (WebKit::WebUserMediaClient::enumerateMediaDevices): New. (WebKit::WebUserMediaClient::cancelMediaDevicesEnumerationRequest): New. (WebKit::WebUserMediaClient::checkUserMediaPermission): Deleted. (WebKit::WebUserMediaClient::cancelUserMediaPermissionCheck): Deleted. * WebProcess/WebCoreSupport/WebUserMediaClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): New. (WebKit::WebPage::userMediaAccessWasDenied): Ditto. (WebKit::WebPage::didCompleteMediaDeviceEnumeration): (WebKit::WebPage::didReceiveUserMediaPermissionDecision): Deleted. (WebKit::WebPage::didCompleteUserMediaPermissionCheck): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-10-17 Antti Koivisto Rename setNeedsStyleRecalc to invalidateStyle https://bugs.webkit.org/show_bug.cgi?id=163542 Reviewed by Darin Adler. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::didInitializePlugin): (WebKit::PluginView::pluginProcessCrashed): 2016-10-17 Carlos Garcia Campos NetworkSession: PendingDownload is leaked if canceled before willDecidePendingDownloadDestination https://bugs.webkit.org/show_bug.cgi?id=163545 Reviewed by Alex Christensen. If a download started by DownloadManager::startDownload() is cancelled before DownloadManager::willDecidePendingDownloadDestination() is called, DownloadManager::cancelDownload() does nothing, because the Download hasn't been created yet and m_downloadsWaitingForDestination map doesn't contain the download ID, and the PendingDownload is never removed from the m_pendingDownloads map. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::cancelDownload): Always take the PendingDownload from m_pendingDownloads map. Then, if the download was already in m_downloadsWaitingForDestination map, get the network data task to properly cancel it and then call the completion handler to ignore the request. Otherwise cancel the pending download if exists. * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::cancel): Cancel the network load and notify the UI process that the download was canceled. * NetworkProcess/Downloads/PendingDownload.h: 2016-10-17 Megan Gardner Add test and infrastructure for link popover https://bugs.webkit.org/show_bug.cgi?id=163406 Reviewed by Simon Fraser. Add infrastructure to see when a link popover appears, and what URL it has loaded. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView didShowForcePressPreview]): (-[WKWebView didDismissForcePressPreview]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _contentsOfUserInterfaceItem:]): (-[WKContentView _presentedViewControllerForPreviewItemController:]): (-[WKContentView _previewItemController:didDismissPreview:committing:]): (-[WKContentView _previewItemControllerDidCancelPreview:]): 2016-10-17 Tim Horton REGRESSION (r169805): WKWebView canGoBack returning YES when nothing is in the back-forward list after restoring session state https://bugs.webkit.org/show_bug.cgi?id=163573 Reviewed by Dan Bernstein. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::restoreFromSessionState): Update PageLoadState's canGoBack/canGoForward bits when restoring from session state, because in the don't-navigate case, nothing else will make this happen, and it will remain stale. 2016-10-17 Andy Estes Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type https://bugs.webkit.org/show_bug.cgi?id=163476 Reviewed by Tim Horton. When custom content providers are registered and a response has a null MIME type, WebPage will pass a null String to HashSet::contains(). This results in a null pointer dereference, since the String hash functions do not support null Strings and unconditionally dereference their StringImpls. Fixed by checking that Strings are non-null before calling HashSet::contains() on m_mimeTypesWithCustomContentProviders. Rearranging WebPage::shouldUseCustomContentProviderForResponse() to call canPluginHandleResponse() before checking m_mimeTypesWithCustomContentProviders uncovered a crash in existing layout tests where WebPage::m_mainFrame can be NULL during WebPage construction (m_mainFrame isn't yet initialized). Fixed this by passing the main Frame to canPluginHandleResponseInFrame() instead of relying on m_mainFrame. New API test: WebKit2.LoadDataWithNilMIMEType. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): Passed m_frame->coreFrame() to shouldUseCustomContentProviderForResponse(). (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::canPluginHandleResponse): Added a mainFrame parameter and used it instead of m_mainFrame->coreFrame(). (WebKit::WebPage::shouldUseCustomContentProviderForResponse): Passed mainFrame to canPluginHandleResponse(), and checked if mimeType is null before calling m_mimeTypesWithCustomContentProviders.contains(). (WebKit::WebPage::canShowMIMEType): Checked if MIMEType is null before calling m_mimeTypesWithCustomContentProviders.contains(). * WebProcess/WebPage/WebPage.h: Made canPluginHandleResponse() a private declaration. 2016-10-17 Chris Dumez [WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked https://bugs.webkit.org/show_bug.cgi?id=163569 Reviewed by Antti Koivisto. PendingFrameLoad objects are created to track frame loads and added to the m_pendingFrameLoads hash map. These objects are supposed to remove themselves from the hash map once they detect that the page load has finished by calling PendingFrameLoad::m_loadCompletionHandler(). PendingFrameLoad::m_loadCompletionHandler() is called from markLoadAsCompleted() when we detect that the page load has finished via the m_loadHysteresisActivity HysteresisActivity. We call impulse() on the HysteresisActivity every time a subresource is loaded in the frame. The issue is that if no subresource is ever loaded, then we never call impulse() on the HysteresisActivity, which is therefore never started. If it nevers starts, then it nevers stops and never calls markLoadAsCompleted(). To address the problem, we now call impulse() on the HysteresisActivity as soon as we construct it. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: 2016-10-17 Jeremy Jones Enable keyboard in fullscreen. https://bugs.webkit.org/show_bug.cgi?id=163146 Reviewed by Jer Noble. Allow keyboard in fullscreen. * UIProcess/WebFullScreenManagerProxy.cpp: (WebKit::WebFullScreenManagerProxy::supportsFullScreen): 2016-10-17 Chris Dumez Move form.reportValidity() behind InteractiveFormValidation setting https://bugs.webkit.org/show_bug.cgi?id=163550 Reviewed by Darin Adler. Enable InteractiveFormValidation setting by default and link it to RuntimeEnabledFeatures so we can use it in the IDL. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-10-17 Gavin Barraclough UIProcess should determine throttle state for WebContent process https://bugs.webkit.org/show_bug.cgi?id=163556 Reviewed by Anders Carlsson. This is a step towards merging page/process throttling code for mac & iOS. Previously WebPage determined whether to start a UserActivity based on page activity, visibility and the preference to disable. Now WebPage passes the activity state across to WebPageProxy, which makes the decision & explicitly instructs WebPage to start/stop the UserActivity. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): - updateActivityToken + updateProccessSuppressionState -> updateThrottleState (WebKit::WebPageProxy::reattachToWebProcess): - updateActivityToken -> updateThrottleState (WebKit::WebPageProxy::dispatchViewStateChange): - updateActivityToken -> updateThrottleState (WebKit::WebPageProxy::setPageActivityState): - Record activity state passed from WebPage, and update. (WebKit::WebPageProxy::preferencesDidChange): - updateProccessSuppressionState -> updateThrottleState (WebKit::WebPageProxy::updateActivityToken): Deleted. (WebKit::WebPageProxy::updateProccessSuppressionState): Deleted. (WebKit::WebPageProxy::updateThrottleState): - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState. - Compute whether page should be suppressed, and send SetPageSuppressed message accordingly. * UIProcess/WebPageProxy.h: - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState. - Added setPageActivityState/m_activityState to report/record page activity. - Added m_pageSuppressed to prevent redundant message sends. * UIProcess/WebPageProxy.messages.in: - Expose SetPageActivityState message (called by WebPage). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): - removed m_processSuppressionEnabled - updateUserActivity -> setPageSuppressed - explicitly set the page to not be suppressed, until WebPageProxy tells us to do so. (WebKit::WebPage::setPageActivityState): - post activity state on to WebPageProxy. (WebKit::WebPage::setPageSuppressed): - Start/stop USerActivity accordingly. (WebKit::WebPage::setViewState): - No longer need to monitor ViewState changes on the WebProcess side. (WebKit::WebPage::updatePreferences): - No longer need to monitor preference changes on the WebProcess side. (WebKit::WebPage::updateUserActivity): Deleted. - Only updated on reciept of setPageSuppressed message. * WebProcess/WebPage/WebPage.h: - Removed m_activityState, m_processSuppressionEnabled, updateUserActivity. - Added setPageSuppressed message. * WebProcess/WebPage/WebPage.messages.in: - Added SetPageSuppressed message. 2016-10-17 Michael Catanzaro REGRESSION(r206189): logs error statements when API::URLRequest is canceled https://bugs.webkit.org/show_bug.cgi?id=163393 Reviewed by Antti Koivisto. Print this case at normal logging level, not as an error. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResource): 2016-10-17 Chris Dumez [iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates https://bugs.webkit.org/show_bug.cgi?id=163547 Reviewed by Darin Adler. Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates now that it is available in UIKit. * Platform/spi/ios/UIKitSPI.h: * Shared/ios/NativeWebTouchEventIOS.mm: (WebKit::NativeWebTouchEvent::extractWebTouchPoint): 2016-10-17 Konstantin Tokarev Eleminate code duplication between ResourceRequest encoding/decoding implementations https://bugs.webkit.org/show_bug.cgi?id=163507 Reviewed by Carlos Garcia Campos. ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of ArgumentCoder::encodePlatformData() share most of the code, ditto for decoding implementations. * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2016-10-17 Michael Catanzaro Move user agent quirks to cross-platform location https://bugs.webkit.org/show_bug.cgi?id=163508 Reviewed by Carlos Garcia Campos. #include instead of . * UIProcess/API/gtk/WebKitSettings.cpp: * UIProcess/efl/WebPageProxyEfl.cpp: * UIProcess/gtk/WebPageProxyGtk.cpp: * WebProcess/WebPage/gtk/WebPageGtk.cpp: 2016-10-17 Carlos Garcia Campos [SOUP] Downloads should always sniff contents https://bugs.webkit.org/show_bug.cgi?id=163538 Reviewed by Michael Catanzaro. It's quite common that downloads have weird filenames with no extension, so it would be better if the loader sniff the contents to guess the mime type. * NetworkProcess/Downloads/soup/DownloadSoup.cpp: (WebKit::Download::startNetworkLoad): Pass true for shouldContentSniff parameter of ResourceHandle::create(). 2016-10-17 Carlos Garcia Campos [GTK] Switch to use API::DownloadClient instead of the C API client https://bugs.webkit.org/show_bug.cgi?id=163537 Reviewed by Michael Catanzaro. The code is simpler and we avoid all the toImpl/toAPI. * UIProcess/API/gtk/WebKitDownloadClient.cpp: (attachDownloadClientToContext): (didStart): (didReceiveResponse): (didReceiveData): (decideDestinationWithSuggestedFilename): (didCreateDestination): (didFail): (didCancel): (didFinish): 2016-10-17 Manuel Rego Casasnovas [css-grid] Disable CSS Grid Layout runtime flag by default https://bugs.webkit.org/show_bug.cgi?id=163432 Reviewed by Darin Adler. It was enabled in r201042, but now Safari Technology Preview has a UI to switch runtime flags so it doesn't need to be enabled by default anymore. * Shared/WebPreferencesDefinitions.h: Disable grid layout runtime flag by default. 2016-10-16 Darin Adler Move CSS classes from ExceptionCode to Exception https://bugs.webkit.org/show_bug.cgi?id=163494 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp: (webkit_dom_css_rule_set_css_text): Updated for ExceptionOr. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp: (webkit_dom_css_style_declaration_remove_property): Ditto. (webkit_dom_css_style_declaration_set_property): Ditto. (webkit_dom_css_style_declaration_set_css_text): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp: (webkit_dom_css_style_sheet_insert_rule): Ditto. (webkit_dom_css_style_sheet_delete_rule): Ditto. (webkit_dom_css_style_sheet_add_rule): Ditto. (webkit_dom_css_style_sheet_remove_rule): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp: (webkit_dom_css_value_set_css_text): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp: (webkit_dom_media_list_delete_medium): Ditto. (webkit_dom_media_list_append_medium): Ditto. (webkit_dom_media_list_set_media_text): Ditto. 2016-10-16 Carlos Garcia Campos [GTK] Default WebKitWebsiteDataManager is always leaked in WebKitWebContext https://bugs.webkit.org/show_bug.cgi?id=163443 Reviewed by Michael Catanzaro. Adopt the reference returned by webkitWebsiteDataManagerCreate(). * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): 2016-10-16 Carlos Garcia Campos [GTK] WebKitWebPage URI not updated after URI is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame https://bugs.webkit.org/show_bug.cgi?id=163389 Reviewed by Michael Catanzaro. Update the page URI also when the load is committed. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (getDocumentLoaderURL): (didStartProvisionalLoadForFrame): (didReceiveServerRedirectForProvisionalLoadForFrame): (didCommitLoadForFrame): (webkitWebPageCreate): (getProvisionalURLForFrame): Deleted. 2016-10-15 Simon Fraser Sort the project file. * WebKit2.xcodeproj/project.pbxproj: 2016-10-14 Anders Carlsson Fix Mac build. * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): 2016-10-14 Anders Carlsson Pass on networking settings to the PKPaymentRequest https://bugs.webkit.org/show_bug.cgi?id=163462 rdar://problem/28567629 Reviewed by Dan Bernstein. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentRequest): * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): 2016-10-14 Anders Carlsson Clean up BackForwardClient https://bugs.webkit.org/show_bug.cgi?id=163454 Reviewed by Sam Weinig. Remove empty iOS only stubs. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebBackForwardListProxy.h: * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed. 2016-10-14 Brady Eidson Enable Gamepads by default in WK2. https://bugs.webkit.org/show_bug.cgi?id=163447 Rubberstamped by Sam Weinig. * Shared/WebPreferencesDefinitions.h: 2016-10-14 Gavin Barraclough Add API to restrict WebKit processes to background priority https://bugs.webkit.org/show_bug.cgi?id=163363 Reviewed by Anders Carlson. Add API on _WKProcessPoolConfiguration to flag a process pool as 'alwaysRunsAtBackgroundPriority'. WebContent and Networking processes associated with that pool will only run a background priority, when they otherwise would have run at foreground priority. * UIProcess/API/APIProcessPoolConfiguration.h: - Add m_alwaysRunsAtBackgroundPriority flag to pool configuration object. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration alwaysRunsAtBackgroundPriority]): (-[_WKProcessPoolConfiguration setAlwaysRunsAtBackgroundPriority:]): - Expose new configuration property through API. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::alwaysRunsAtBackgroundPriority): * UIProcess/Network/NetworkProcessProxy.h: - Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set. * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::assertionState): - When determining whether to take a foreground exception check alwaysRunsAtBackgroundPriority. * UIProcess/ProcessThrottlerClient.h: - Add interface to access alwaysRunsAtBackgroundPriority state of WebProcess of NetworkProcess. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): * UIProcess/WebProcessPool.h: - Add m_alwaysRunsAtBackgroundPriority, set by configuration. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::alwaysRunsAtBackgroundPriority): * UIProcess/WebProcessProxy.h: - Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set. 2016-10-14 Youenn Fablet Make NetworkCache aware of fetch cache mode https://bugs.webkit.org/show_bug.cgi?id=163332 Reviewed by Antti Koivisto. Adding explicit serialization of ResourceRequest cachePolicy since it does no longer map to platform request cache policy. Added support for: - Bypassing entirely the network cache in case cache mode is NoStore. - requiring revalidation in case of cache hit and cache mode is NoCache. - Not using any entry if cache mode is Reload (but cache can still be updated) Also made sure that the ResourceRequest::cachePolicy remains the same throughout redirections. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::canUseCache): (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::continueWillSendRequest): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::cachePolicyAllowsExpired): (WebKit::NetworkCache::makeRetrieveDecision): * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2016-10-13 Tim Horton Rename the SPI added in r207292 due to post-landing review comments https://bugs.webkit.org/show_bug.cgi?id=163364 Reviewed by Simon Fraser. * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::waitsForPaintAfterViewDidMoveToWindow): (API::PageConfiguration::setWaitsForPaintAfterViewDidMoveToWindow): (API::PageConfiguration::shouldWaitForPaintAfterViewDidMoveToWindow): Deleted. (API::PageConfiguration::setShouldWaitForPaintAfterViewDidMoveToWindow): Deleted. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _waitsForPaintAfterViewDidMoveToWindow]): (-[WKWebViewConfiguration _setWaitsForPaintAfterViewDidMoveToWindow:]): (-[WKWebViewConfiguration _shouldWaitForPaintAfterViewDidMoveToWindow]): Deleted. (-[WKWebViewConfiguration _setShouldWaitForPaintAfterViewDidMoveToWindow:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::dispatchViewStateChange): * UIProcess/WebPageProxy.h: 2016-10-13 Jonathan Bedard GTK and EFL on Mac fail to compile WebTextChecker due to missing definition of WKTextCheckerClientBase https://bugs.webkit.org/show_bug.cgi?id=163346 Reviewed by Daniel Bates. * UIProcess/API/C/WKTextChecker.cpp: Fixed #ifdefs for GTK and EFL builds on Darwin machines. * UIProcess/API/C/WKTextChecker.h: Ditto. 2016-10-13 Tim Horton Expose SPI to disable synchronously blocking on painting after parenting a WKWebView https://bugs.webkit.org/show_bug.cgi?id=163364 Reviewed by Geoff Garen. Some clients may not want the default WKWebView behavior where we synchronously block on the Web process after the first time a WKWebView is re-added to the window, because they are e.g. parenting re-used WKWebViews while scrolling. * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::shouldSynchronizeInitialPaintAfterMovingToWindow): (API::PageConfiguration::setShouldSynchronizeInitialPaintAfterMovingToWindow): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _shouldSynchronizeInitialPaintAfterMovingToWindow]): (-[WKWebViewConfiguration _setShouldSynchronizeInitialPaintAfterMovingToWindow:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Add and plumb a new WKWebView configuration parameter. (WebKit::WebPageProxy::dispatchViewStateChange): If the new configuration parameter is set, don't block the main thread when a view is reparented. 2016-10-12 Chris Dumez [Web IDL] Drop support for legacy [ConstructorConditional=*] https://bugs.webkit.org/show_bug.cgi?id=163368 Reviewed by Ryosuke Niwa. Drop ENABLE_DOM4_EVENTS_CONSTRUCTOR compiler flag. * Configurations/FeatureDefines.xcconfig: 2016-10-12 Alex Christensen Fix assertion after switching to URLParser https://bugs.webkit.org/show_bug.cgi?id=163350 rdar://problem/28739938 Reviewed by Brady Eidson. Covered by a new API test. * UIProcess/API/Cocoa/_WKUserStyleSheet.mm: (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]): The { } here is not understood by the compiler to mean WebCore::URL(), but rather the empty constructor for the enum ParsedURLStringTag. We used to be unsafely trusting that the URL was valid and canonicalized, but with URLParser we are canonicalizing it, and the assertion (url == m_string) in URL.cpp was failing. 2016-10-12 Anders Carlsson Remove an unused function https://bugs.webkit.org/show_bug.cgi?id=163341 Reviewed by Dan Bernstein. * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::isActive): Deleted. * WebProcess/WebPage/WebBackForwardListProxy.h: 2016-10-11 Gyuyoung Kim [EFL] Update API tests which are passed or failed https://bugs.webkit.org/show_bug.cgi?id=163322 Unreviewed, simple on/off API test. *ewk_favicon_database_clear* has been crashed for a long time, however *ewk_cookie_manager_permanent_storage* is fine now. So the passing test is enabled again, and disable the failure tests. * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp: (TEST_F): * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp: (TEST_F): 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-11 Anders Carlsson Clean up WebPageGroup somewhat https://bugs.webkit.org/show_bug.cgi?id=163299 Reviewed by Tim Horton. * Shared/API/c/WKDeprecatedFunctions.cpp: (WKPageGroupCopyIdentifier): Move this here from WKPageGroup. (WKPageGroupAddUserContentFilter): (WKPageGroupRemoveUserContentFilter): (WKPageGroupRemoveAllUserContentFilters): Just call directly into the user content controller. * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupAddUserStyleSheet): (WKPageGroupRemoveAllUserStyleSheets): (WKPageGroupAddUserScript): (WKPageGroupRemoveAllUserScripts): Just call directly into the user content controller. * UIProcess/API/C/WKPageGroup.h: * UIProcess/WebPageGroup.cpp: (WebKit::WebPageGroup::addUserStyleSheet): Deleted. (WebKit::WebPageGroup::addUserScript): Deleted. (WebKit::WebPageGroup::removeAllUserStyleSheets): Deleted. (WebKit::WebPageGroup::removeAllUserScripts): Deleted. (WebKit::WebPageGroup::removeAllUserContent): Deleted. (WebKit::WebPageGroup::addUserContentExtension): Deleted. (WebKit::WebPageGroup::removeUserContentExtension): Deleted. (WebKit::WebPageGroup::removeAllUserContentExtensions): Deleted. Get rid of these, all their callers just call into the user content controller now. * UIProcess/WebPageGroup.h: (WebKit::WebPageGroup::identifier): Deleted. (WebKit::WebPageGroup::sendToAllProcessesInGroup): Deleted. Remove unused code. 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-11 Alex Christensen Remove dead networking code https://bugs.webkit.org/show_bug.cgi?id=163263 Reviewed by Daniel Bates. * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed. * NetworkProcess/Downloads/mac/DownloadMac.mm: * NetworkProcess/NetworkLoad.h: * NetworkProcess/mac/NetworkLoadMac.mm: (WebKit::NetworkLoad::willCacheResponseAsync): Deleted. * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: (WebKit::AuthenticationManager::receivedCredential): (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential): (WebKit::AuthenticationManager::receivedCancellation): (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling): (WebKit::AuthenticationManager::receivedChallengeRejection): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * WebKit2.xcodeproj/project.pbxproj: 2016-10-11 Anders Carlsson Move no longer used functions to WKDeprecatedFunctions.cpp https://bugs.webkit.org/show_bug.cgi?id=163290 Reviewed by Dan Bernstein. * Shared/API/c/WKDeprecatedFunctions.cpp: (WKPageGroupAddUserContentFilter): (WKPageGroupRemoveUserContentFilter): (WKPageGroupRemoveAllUserContentFilters): (WKContextSetProcessModel): Deleted. * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupRemoveAllUserScripts): (WKPageGroupAddUserContentFilter): Deleted. (WKPageGroupRemoveUserContentFilter): Deleted. (WKPageGroupRemoveAllUserContentFilters): Deleted. * UIProcess/API/C/WKPageGroup.h: 2016-10-11 Konstantin Tokarev Use modern for loops for iterating supplement maps https://bugs.webkit.org/show_bug.cgi?id=163274 Reviewed by Alex Christensen. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::initializeConnection): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::~WebProcessPool): (WebKit::WebProcessPool::networkProcessCrashed): (WebKit::WebProcessPool::databaseProcessCrashed): Iterate by values() like in other places. 2016-10-11 Wenson Hsieh The "Input Events" experimental feature runtime flag should not be on by default https://bugs.webkit.org/show_bug.cgi?id=163278 Reviewed by Zalan Bujtas. This was intended to be off by default. * Shared/WebPreferencesDefinitions.h: 2016-10-10 Zan Dobersek Add ENABLE_ENCRYPTED_MEDIA configuration option https://bugs.webkit.org/show_bug.cgi?id=163219 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used to enable or disable the new EME implementation at build-time. 2016-10-10 Carlos Garcia Campos NetworkSession: NetworkDataTask is leaked if download finishes in didReceiveResponse completion handler https://bugs.webkit.org/show_bug.cgi?id=163204 Reviewed by Alex Christensen. After the completion handler a reference of the NetworkDataTask is saved in m_downloadsAfterDestinationDecided. If the download failed or was canceled DownloadManager::dataTaskBecameDownloadTask is never called and the data task is kept in the download manager forever. This patch exposes NSURLSessionTask state property in NetworkDataTask, so that the download manager can check the task state after the completion handler and return early if the download finished or was cancelled. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueDecidePendingDownloadDestination): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTask::state): 2016-10-10 Konstantin Tokarev Added final specifier to WebInspectorServer and to its overridden methods https://bugs.webkit.org/show_bug.cgi?id=163228 Reviewed by Darin Adler. * UIProcess/InspectorServer/WebInspectorServer.h: 2016-10-10 Carlos Garcia Campos [GTK] 2.14.0 Compile Errors: GTK 3.22.1 https://bugs.webkit.org/show_bug.cgi?id=163190 Reviewed by Alex Christensen. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: Include gtk.h since we are using gtk_widget_queue_draw(). 2016-10-10 Gyuyoung Kim [EFL] ewk_context_preferred_languages has been failed since r206949 https://bugs.webkit.org/show_bug.cgi?id=163211 Reviewed by Chris Dumez. r206949 changed to return value of navigator.language from en-us to en-US in order to match other browsers and w3c spec. So ewk_context_preferred_languages needs to change the expected result as well. * UIProcess/API/efl/tests/test_ewk2_context.cpp: (TEST_F): 2016-10-10 Carlos Garcia Campos NetworkSession: downloads started by startDownload() can fail before starting from the API point of view https://bugs.webkit.org/show_bug.cgi?id=163107 Reviewed by Alex Christensen. In the network process we use a PendingDownload in this case, but in the UI process we always have a single download proxy. If an error happens before the pending download is converted inot a real download, the DidFail messages is received in the download proxy before the DidStart one. This is problematic at least for the GTK+ API, because it's common to connect to the started signal and connect to all other signals from there, but in this case the started signal is never emitted, and then the failed one is not handled. This is not a problem for downloads started by convertTaskToDownload, because in that case those loads are not considered a download by the UI process when those early errors happen, and then the web page handles them. * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::PendingDownload): Send DidStart message right after the network load starts like the non network session code does. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::convertTaskToDownload): Send DidStart message now that the normal load has been converted into a download. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::findPendingDownloadLocation): Do not send DidStart message here. 2016-10-10 Carlos Garcia Campos Network Session: PendingDownload is always nullptr in DownloadManager::dataTaskBecameDownloadTask https://bugs.webkit.org/show_bug.cgi?id=163006 Reviewed by Alex Christensen. In DownloadManager::dataTaskBecameDownloadTask() we are supposed to have either a pending download, or a network data task depending on whether the download was started by startDownload() or convertTaskToDownload. However, in both cases we do have a data task and never a pending download. In the case of startDownload() the pending download is removed from m_pendingDownloads in willDecidePendingDownloadDestination(). The task is always added to m_downloadsWaitingForDestination in willDecidePendingDownloadDestination() and to m_downloadsAfterDestinationDecided in continueDecidePendingDownloadDestination() in both cases. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::dataTaskBecameDownloadTask): Add an ASSERT to ensure we don't have a pending download at this point and that the download is not already in the map. Remove the download from the m_downloadsAfterDestinationDecided map, but don't check its result because it might not bein that map if dataTaskBecameDownloadTask is called synchronously from the didReceiveResponse completion handler. (WebKit::DownloadManager::willDecidePendingDownloadDestination): Do not take the pending download here, wait until didReceiveResponse completion handler is called. (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Take the pending download here ensuring it's alive while the didReceiveResponse completion handler is called. Also remove invalid early return when either networkDataTask or completionHandler are nullptr because we are using both unconditionally, we should return early if both are nullptr to avoid crashes. However, we are checking that the download is in the m_downloadsWaitingForDestination and in that case we should always have both, so better add asserts there. If the download is already in the map after the completion handler it means that dataTaskBecameDownloadTask() has alrady been called, so we can just return in that case. * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Protect the NetworkDataTask that can be deleted by dataTaskBecameDownloadTask(). 2016-10-10 Tim Horton Share more code between iOS and macOS ViewGestureController https://bugs.webkit.org/show_bug.cgi?id=163158 Reviewed by Simon Fraser. Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism. Make ViewGestureController operate in terms of WebPageProxy, not WKWebView, because it shouldn't know anything about WKWebView. Refactor scrollEventCanBecomeSwipe a bit to be less repetitive. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setAllowsBackForwardNavigationGestures:]): * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage): (WebKit::ViewGestureController::canSwipeInDirection): (WebKit::ViewGestureController::gestureControllerForPage): Deleted. * UIProcess/Cocoa/ViewGestureController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::createWeakPtr): * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted. (WebKit::ViewGestureController::canSwipeInDirection): Deleted. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker): (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe): 2016-10-10 Tomas Popela [GTK] UIProcess crashes when using Japanese IM https://bugs.webkit.org/show_bug.cgi?id=163011 We have to reference the current GdkEventKey before we try process it as later when the lambda body is reached the event could be already freed. Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseKeyPressEvent): (webkitWebViewBaseKeyReleaseEvent): * UIProcess/gtk/InputMethodFilter.h: Use non-copyable Function so we can use WTFMove to pass the event to lambda. 2016-10-09 Wenson Hsieh Support InputEvent.inputType for the new InputEvent spec https://bugs.webkit.org/show_bug.cgi?id=163025 Reviewed by Darin Adler. Accounts for some changes to the EditAction enum in nameForEditAction. Some former edit actions, such as EditActionTyping, have been split out into its more specific subtypes, so we preserve shipping behavior by treating all of the new subtypes the same way as the original type. * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::nameForEditAction): 2016-10-08 Emanuele Aina [GTK] Drop redundant wl_display_flush_clients() call https://bugs.webkit.org/show_bug.cgi?id=161904 Reviewed by Michael Catanzaro. The Wayland GSource::prepare() function already calls wl_display_flush_clients() at every mainloop iteration, so there's no need to further call it on Surface::commit(). * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::Surface::commit): * UIProcess/gtk/WaylandCompositor.h: 2016-10-06 Darin Adler Next step on moving to modern way to return DOM exceptions https://bugs.webkit.org/show_bug.cgi?id=163016 Reviewed by Ryosuke Niwa. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp: (webkit_dom_dom_implementation_create_document_type): Updated for name change from takeReturnValue to releaseReturnValue. (webkit_dom_dom_implementation_create_document): Ditto. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp: (webkit_dom_dom_selection_collapse_to_end): Use ExceptionOr instead of ExceptionCode. (webkit_dom_dom_selection_collapse_to_start): Ditto. (webkit_dom_dom_selection_extend): Ditto. (webkit_dom_dom_selection_get_range_at): Ditto. 2016-10-08 Commit Queue Unreviewed, rolling out r206950. https://bugs.webkit.org/show_bug.cgi?id=163169 broke an API test (Requested by thorton on #webkit). Reverted changeset: "Share more code between iOS and macOS ViewGestureController" https://bugs.webkit.org/show_bug.cgi?id=163158 http://trac.webkit.org/changeset/206950 2016-10-08 Tim Horton Share more code between iOS and macOS ViewGestureController https://bugs.webkit.org/show_bug.cgi?id=163158 Reviewed by Simon Fraser. Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism. Make ViewGestureController operate in terms of WebPageProxy, not WKWebView, because it shouldn't know anything about WKWebView. Refactor scrollEventCanBecomeSwipe a bit to be less repetitive. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setAllowsBackForwardNavigationGestures:]): * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage): (WebKit::ViewGestureController::canSwipeInDirection): (WebKit::ViewGestureController::gestureControllerForPage): Deleted. * UIProcess/Cocoa/ViewGestureController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::createWeakPtr): * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted. (WebKit::ViewGestureController::canSwipeInDirection): Deleted. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker): (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe): 2016-10-07 Anders Carlsson Get rid of API::Session and WKSessionRef https://bugs.webkit.org/show_bug.cgi?id=163140 Reviewed by Tim Horton. This API is no longer used. * CMakeLists.txt: * Shared/API/APIObject.h: * Shared/API/c/WKSharedAPICast.h: * UIProcess/API/APISession.cpp: Removed. (API::generateID): Deleted. (API::Session::defaultSession): Deleted. (API::Session::Session): Deleted. (API::Session::createEphemeral): Deleted. (API::Session::isEphemeral): Deleted. (API::Session::getID): Deleted. (API::Session::~Session): Deleted. * UIProcess/API/APISession.h: Removed. * UIProcess/API/C/WKPage.h: * UIProcess/API/C/WKSessionRef.cpp: Removed. (WKSessionCreate): Deleted. (WKSessionGetTypeID): Deleted. (WKSessionIsEphemeral): Deleted. * UIProcess/API/C/WKSessionRef.h: Removed. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.h: * WebKit2.xcodeproj/project.pbxproj: 2016-10-07 Tim Horton Move ViewGestureController files to more accurate locations https://bugs.webkit.org/show_bug.cgi?id=163141 Reviewed by Anders Carlsson. * PlatformMac.cmake: * UIProcess/Cocoa/ViewGestureController.cpp: Renamed from UIProcess/ViewGestureController.cpp. * UIProcess/Cocoa/ViewGestureController.h: Renamed from UIProcess/mac/ViewGestureController.h. * UIProcess/Cocoa/ViewGestureController.messages.in: Renamed from UIProcess/mac/ViewGestureController.messages.in. * WebKit2.xcodeproj/project.pbxproj: 2016-10-07 Tim Horton Adopt BlockPtr in ViewGestureController https://bugs.webkit.org/show_bug.cgi?id=163132 Reviewed by Anders Carlsson. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setDidMoveSwipeSnapshotCallback): * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent): * UIProcess/mac/ViewGestureController.h: (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback): (WebKit::ViewGestureController::m_didMoveSwipeSnapshotCallback): Deleted. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::platformTeardown): (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback): Deleted. 2016-10-07 Anders Carlsson Get rid of WKPageSetSession https://bugs.webkit.org/show_bug.cgi?id=163129 Reviewed by Tim Horton. This function is no longer used. * UIProcess/API/C/WKPage.cpp: (WKPageSetSession): Deleted. * UIProcess/API/C/WKPage.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setSessionID): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::sessionID): * WebProcess/WebPage/WebPage.messages.in: 2016-10-07 Commit Queue Unreviewed, rolling out r206909. https://bugs.webkit.org/show_bug.cgi?id=163116 Caused most of GTK layout tests to crash (Requested by KaL on #webkit). Reverted changeset: "[GTK] UIProcess crashes when using Japanese IM" https://bugs.webkit.org/show_bug.cgi?id=163011 http://trac.webkit.org/changeset/206909 2016-10-07 Carlos Garcia Campos Network Session: Allow NetworkDataTask decide what to do when override is allowed for a download https://bugs.webkit.org/show_bug.cgi?id=163010 Reviewed by Alex Christensen. Current code always deletes the file before starting a download when allow override is True. In soup backend we use glib API that takes care of it and tries to ensure that the original file is not deleted if the new file creation fails for whatever reason. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Pass allowOverride to setPendingDownloadLocation(). * NetworkProcess/NetworkDataTask.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTask::setPendingDownloadLocation): Delete the destination file if exists and allowOverride is True. 2016-10-07 Tomas Popela [GTK] UIProcess crashes when using Japanese IM https://bugs.webkit.org/show_bug.cgi?id=163011 We have to reference the current GdkEventKey before we try process it as later when the lambda body is reached the event could be already freed. Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseKeyPressEvent): (webkitWebViewBaseKeyReleaseEvent): * UIProcess/gtk/InputMethodFilter.h: Use non-copyable Function so we can use WTFMove to pass the event to lambda. 2016-10-06 Michael Catanzaro [GTK] Expose WebKitDOMHTMLInputElement APIs for form autofill https://bugs.webkit.org/show_bug.cgi?id=163082 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp: (webkit_dom_html_input_element_get_auto_filled): Added. (webkit_dom_html_input_element_set_auto_filled): Added. (webkit_dom_html_input_element_set_editing_value): Added. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt: 2016-10-06 John Wilander Update Resource Load Statistics https://bugs.webkit.org/show_bug.cgi?id=162811 Reviewed by Alex Christensen. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Switched to vector-based classification. (WebKit::WebResourceLoadStatisticsStore::classifyResource): Simplified logic and moved the split between has and has no user interaction into ResourceLoadStatisticsStore. (WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Added. (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Updated to make use of the new functions. (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath): Removed stray whitespace. (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Removed stray whitespace. (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk): Removed stray whitespace. (WebKit::hasPrevalentResourceCharacteristics): Deleted. (WebKit::classifyPrevalentResources): Deleted. * UIProcess/WebResourceLoadStatisticsStore.h: Added member variables for clearing of data records. 2016-10-06 Youenn Fablet [WK2] 304 revalidation on the network process does not update the validated response https://bugs.webkit.org/show_bug.cgi?id=162973 Reviewed by Darin Adler. * NetworkProcess/NetworkResourceLoader.cpp: Updating cache entry with the revalidated one. 2016-10-05 Wenson Hsieh Introduce InputEvent bindings in preparation for the input events spec https://bugs.webkit.org/show_bug.cgi?id=162954 Reviewed by Ryosuke Niwa. Adds a new runtime switch for enabling InputEvents. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-10-05 Myles C. Maxfield Put variation fonts work behind a compile-time flag https://bugs.webkit.org/show_bug.cgi?id=162949 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2016-10-05 Tim Horton Fix the build. * UIProcess/Cocoa/WebViewImpl.mm: 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-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-05 Chris Dumez KeyboardEvent.getModifierState() should support "CapsLock" modifier https://bugs.webkit.org/show_bug.cgi?id=162861 Reviewed by Darin Adler. Add support for CapsLock modifier on events. * Shared/API/c/WKEvent.h: * Shared/API/c/WKSharedAPICast.h: (WebKit::toAPI): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): * Shared/efl/WebEventFactory.cpp: (WebKit::toWebEventModifiers): * Shared/ios/WebIOSEventFactory.mm: (modifiersForEvent): * Shared/mac/WebEventFactory.mm: (WebKit::modifiersForEvent): * UIProcess/API/Cocoa/WKNavigationAction.mm: (toNSEventModifierFlags): * UIProcess/Cocoa/WebAutomationSessionCocoa.mm: (WebKit::WebAutomationSession::platformSimulateMouseInteraction): 2016-10-05 Zan Dobersek Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA https://bugs.webkit.org/show_bug.cgi?id=162903 Reviewed by Alex Christensen. Rename build guards for the remaining implementation of the legacy EME API to ENABLE_LEGACY_ENCRYPTED_MEDIA. This will allow for the future implementation of the near-finished API to be guarded with the simple ENABLE_ENCRYPTED_MEDIA guards. * Configurations/FeatureDefines.xcconfig: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_userInterfaceLayoutDirection): * WebProcess/WebProcess.cpp: (WebKit::m_resourceLoadStatisticsStorage): 2016-10-05 Daniel Bates [WK2][NetworkSession] Ping requests should follow redirects if applicable https://bugs.webkit.org/show_bug.cgi?id=162580 Reviewed by Alex Christensen. Implement support for following redirects, if applicable, of a ping request when using the Network Session (ENABLE(NETWORK_SESSION)) code path in WebKit2. For ping requests that are in response to hyperlink auditing (e.g. ) we should follow redirect responses. For Content Security Policy and XSS Auditor violation reports we should not follow redirect responses. Currently we always ignore redirects for ping requests that are sent using the Network Session code path in WebKit2. This behavior disagrees with the behavior described in section "Hyperlink auditing" of the HTML standard, (27 September 2016), as well as the behavior in Legacy WebKit and WebKit2 with Network Session disabled. We should follow redirects for ping requests initiated as part of hyperlink auditing to more closely conform to the HTML standard and match the behavior in Legacy WebKit and WebKit2 with Network Session disabled. * NetworkProcess/PingLoad.h: 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-05 Carlos Garcia Campos [SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession https://bugs.webkit.org/show_bug.cgi?id=162910 Reviewed by Alex Christensen. Use SoupNetworkSession instead of ResourceHandle. * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::setIgnoreTLSErrors): (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): 2016-10-05 Carlos Garcia Campos Unreviewed. Fix GTK+ build with USE_REDIRECTED_XCOMPOSITE_WINDOW disabled. * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing): 2016-10-04 Chris Dumez Implement KeyboardEvent.code from the UI Event spec https://bugs.webkit.org/show_bug.cgi?id=149584 Reviewed by Darin Adler. Add support for Keyboard.code attribute: - https://w3c.github.io/uievents/#dom-keyboardevent-code - https://w3c.github.io/uievents-code/ * Shared/WebEvent.h: (WebKit::WebKeyboardEvent::code): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): (WebKit::WebKeyboardEvent::encode): (WebKit::WebKeyboardEvent::decode): * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebKeyboardEvent): 2016-10-04 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 Reviewed by Tim Horton. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name. 2016-10-04 Ryosuke Niwa Revert a change erroneously committed in r206795. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-10-04 Anders Carlsson Properly kill web processes in the launching state https://bugs.webkit.org/show_bug.cgi?id=162938 Reviewed by Tim Horton. * UIProcess/Launcher/ProcessLauncher.h: Add m_xpcConnection member. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): Store the XPC connection in the m_xpcConnection member variable. In the reply handler, handle m_xpcConnection being null. (WebKit::ProcessLauncher::platformInvalidate): Cancel and kill the connection. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::terminateProcess): Get rid of an assertion. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::requestTermination): Handle the launching state. 2016-10-04 Tim Horton Fix the build. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::WebBackForwardListItem): (WebKit::WebBackForwardListItem::highestUsedItemID): 2016-10-04 Tim Horton Fix a typo in WebBackForwardListItem (highed->highest) https://bugs.webkit.org/show_bug.cgi?id=162935 Reviewed by Anders Carlsson. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::highestUsedItemID): (WebKit::WebBackForwardListItem::highedUsedItemID): Deleted. * Shared/WebBackForwardListItem.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): 2016-10-04 Yusuke Suzuki [DOMJIT] Introduce DOMJIT::GetterSetter to tell JIT information https://bugs.webkit.org/show_bug.cgi?id=162916 Reviewed by Filip Pizlo. * CMakeLists.txt: 2016-10-04 Carlos Garcia Campos [SOUP] Remove SSLPolicyFlags from SoupNetworkSession https://bugs.webkit.org/show_bug.cgi?id=162906 Reviewed by Michael Catanzaro. * NetworkProcess/soup/NetworkProcessMainSoup.cpp: (WebKit::NetworkProcessMainUnix): 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-04 Zan Dobersek Unreviewed GTK+ build fix. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): Guard the call to getDefaultWebCryptoMasterKey() with ENABLE(SUBTLE_CRYPTO), since the same guard is used for the definition. Fixes GTK+ production builds where the feature is disabled. 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-03 Ryan Haddad Unreviewed, rolling out r206754. This change broke the El Capitan and Yosemite debug builds. Reverted changeset: "More logging to diagnose "WebKit encountered an internal error" messages" https://bugs.webkit.org/show_bug.cgi?id=162754 http://trac.webkit.org/changeset/206754 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-03 Chris Dumez Add support for KeyboardEvent.key attribute https://bugs.webkit.org/show_bug.cgi?id=36267 Reviewed by Darin Adler. Add support for KeyboardEvent.key attribute. * Shared/WebEvent.h: (WebKit::WebKeyboardEvent::key): (WebKit::WebKeyboardEvent::unmodifiedText): Deleted. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): (WebKit::WebKeyboardEvent::encode): (WebKit::WebKeyboardEvent::decode): * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebKeyboardEvent): 2016-10-03 Chris Dumez Add support for KeyboardEvent.key attribute https://bugs.webkit.org/show_bug.cgi?id=36267 Reviewed by Darin Adler. Add support for KeyboardEvent.key attribute. * Shared/WebEvent.h: (WebKit::WebKeyboardEvent::key): (WebKit::WebKeyboardEvent::unmodifiedText): Deleted. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): (WebKit::WebKeyboardEvent::encode): (WebKit::WebKeyboardEvent::decode): * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebKeyboardEvent): 2016-10-03 Carlos Garcia Campos [SOUP] Cleanup persistent credential storage code https://bugs.webkit.org/show_bug.cgi?id=162777 Reviewed by Alex Christensen. Use USE(LIBSECRET) instead of ENABLE(CREDENTIAL_STORAGE). * UIProcess/API/gtk/WebKitAuthenticationRequest.cpp: (webkit_authentication_request_can_save_credentials): 2016-10-02 Ryan Haddad Unreviewed, rolling out r206683. This change caused API test WebKit2.FindMatches to fail on Mac. Reverted changeset: "The dragged image should be the current frame only of the animated image" https://bugs.webkit.org/show_bug.cgi?id=162109 http://trac.webkit.org/changeset/206683 2016-09-30 Myles C. Maxfield Follow-up patch after r206701 https://bugs.webkit.org/show_bug.cgi?id=162818 Unreviewed. I missed one place required to enable an experimental feature by default. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::registerUserDefaultsIfNeeded): 2016-09-30 Dan Bernstein [iOS] Editing menu omits the Share command if the selected text is longer than 200 characters https://bugs.webkit.org/show_bug.cgi?id=162821 Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformAction:withSender:]): Changed to return YES for the _share: action even if the selection is longer than 200 characters. While Define should not have been available for longer selections, Share does not have such a limitation. 2016-09-30 Myles C. Maxfield Turn variation fonts on by default https://bugs.webkit.org/show_bug.cgi?id=162818 Reviewed by Simon Fraser. * Shared/WebPreferencesDefinitions.h: 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-09-30 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 Reviewed by Tim Horton. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name. 2016-09-30 Anders Carlsson Second time going into fullscreen using silverlight, will hide the menu bar and dock for Safari https://bugs.webkit.org/show_bug.cgi?id=162805 rdar://problem/28208495 Reviewed by Dan Bernstein. Turns out that the WindowRef wrappers for full screen NSWindows can end up in the m_windows HashSet, and never go away. Fix this by storing the canonical CGWindowIDs in the hash map instead. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::cgWindowID): (WebKit::windowCoversAnyScreen): (WebKit::FullscreenWindowTracker::windowShown): (WebKit::FullscreenWindowTracker::windowHidden): 2016-09-30 Myles C. Maxfield Create runtime flag for variation font work https://bugs.webkit.org/show_bug.cgi?id=162780 Reviewed by Alex Christensen. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-09-30 Chris Dumez [WK2][iOS] Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint https://bugs.webkit.org/show_bug.cgi?id=162787 Reviewed by Benjamin Poulain. Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint. * Platform/spi/ios/UIKitSPI.h: * Shared/WebEvent.h: (WebKit::WebPlatformTouchPoint::setRadiusX): (WebKit::WebPlatformTouchPoint::radiusX): (WebKit::WebPlatformTouchPoint::setRadiusY): (WebKit::WebPlatformTouchPoint::radiusY): (WebKit::WebPlatformTouchPoint::setRotationAngle): (WebKit::WebPlatformTouchPoint::rotationAngle): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint): * Shared/ios/NativeWebTouchEventIOS.mm: (WebKit::NativeWebTouchEvent::extractWebTouchPoint): * Shared/ios/WebPlatformTouchPointIOS.cpp: (WebKit::WebPlatformTouchPoint::encode): (WebKit::WebPlatformTouchPoint::decode): 2016-09-30 Megan Gardner Make it possible to test web-related user-interface features https://bugs.webkit.org/show_bug.cgi?id=162657 Reviewed by Simon Fraser. Added the ability to pull the strings from an Action Sheet and pass them to test scripts to make sure we are giving the correct available actions for the item we are interacting with. Added a test for long press on an image, and used the sheet scraping functionality to make sure that the correct actions were being displayed. Test for previous patch, Changeset 205915; Bug 161761 * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _contentsOfUserInterfaceItem:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant currentAvailableActionStrings]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _contentsOfUserInterfaceItem:]): 2016-09-27 Anders Carlsson Remove a couple of unused members from PlatformKeyboardEvent https://bugs.webkit.org/show_bug.cgi?id=162641 Reviewed by Tim Horton. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): 2016-09-29 Nan Wang AX: iOS: Tapping in Safari zooms in a bit when page has max scale = 1 https://bugs.webkit.org/show_bug.cgi?id=162471 Reviewed by Simon Fraser. * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode): (WebKit::AssistedNodeInformation::decode): * Shared/AssistedNodeInformation.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _displayFormNodeInputView]): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::maximumPageScaleFactorIgnoringAlwaysScalable): (WebKit::WebPage::getAssistedNodeInformation): 2016-09-29 Daniel Bates Mark NetworkLoad as final https://bugs.webkit.org/show_bug.cgi?id=162681 Reviewed by Alex Christensen. Mark class NetworkLoad as final as we do not have any derived classes at the moment and it is unclear if it would make sense to subclass it. We can always unmark the class if it turns out that it makes sense to subclass it. * NetworkProcess/NetworkLoad.h: 2016-09-29 Sam Weinig Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis https://bugs.webkit.org/show_bug.cgi?id=162735 Reviewed by Dan Bernstein. Add SPI for overriding the following NSURLSessionConfigurations properties: - _sourceApplicationBundleIdentifier - _sourceApplicationSecondaryIdentifier - _CTDataConnectionServiceType * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkSession.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::globalSourceApplicationBundleIdentifier): (WebKit::globalSourceApplicationSecondaryIdentifier): (WebKit::globalCTDataConnectionServiceType): (WebKit::NetworkSession::setCustomProtocolManager): (WebKit::NetworkSession::setSourceApplicationAuditTokenData): (WebKit::NetworkSession::setSourceApplicationBundleIdentifier): (WebKit::NetworkSession::setSourceApplicationSecondaryIdentifier): (WebKit::NetworkSession::setCTDataConnectionServiceType): (WebKit::NetworkSession::NetworkSession): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]): (-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]): (-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]): (-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]): (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]): (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2016-09-29 Carlos Garcia Campos NetworkSession: HTTP authentication doesn't work if PROTECTION_SPACE_AUTH_CALLBACK is not enabled https://bugs.webkit.org/show_bug.cgi?id=162724 Reviewed by Alex Christensen. NetworkLoad always expects continueCanAuthenticateAgainstProtectionSpace() to be called to complete the authentication challenge, which is only defined when PROTECTION_SPACE_AUTH_CALLBACK is enabled. I've added missing #ifdefs for PROTECTION_SPACE_AUTH_CALLBACK. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace): * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::~NetworkLoad): (WebKit::NetworkLoad::didReceiveChallenge): Call completeAuthenticationChallenge() instead of canAuthenticateAgainstProtectionSpaceAsync() when PROTECTION_SPACE_AUTH_CALLBACK is not enabled. (WebKit::NetworkLoad::completeAuthenticationChallenge): Moved common code to complete the authentication challenge from continueCanAuthenticateAgainstProtectionSpace(). (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): Call completeAuthenticationChallenge(). (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync): (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * Shared/Authentication/AuthenticationManager.h: * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Downloads/DownloadProxy.messages.in: 2016-09-28 Joseph Pecoraro WKSharedAPICast should not warn about acceptable custom context menu tag values https://bugs.webkit.org/show_bug.cgi?id=162597 Reviewed by Tim Horton. * Shared/API/c/WKSharedAPICast.h: (WebKit::toAPI): (WebKit::toImpl): Don't log an error when casting ContextMenu types if it is within the Custom ContextMenu tag range. 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 Carlos Garcia Campos [GTK] Switch to use GMenu internally in the context menu implementation https://bugs.webkit.org/show_bug.cgi?id=162603 Reviewed by Michael Catanzaro. Switch to use GAction instead of GtkAction internally, but still keeping a GtkAction associated to the GAction, because our API depends on GtkAction. * Shared/gtk/WebContextMenuItemGtk.cpp: (WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk): (WebKit::WebContextMenuItemGtk::createActionIfNeeded): Create the GAction and the associated GtkAction. Ensure a unique name for the GAction, since the name now matters. * Shared/gtk/WebContextMenuItemGtk.h: (WebKit::WebContextMenuItemGtk::gtkAction): (WebKit::WebContextMenuItemGtk::gAction): (WebKit::WebContextMenuItemGtk::submenuItems): Deleted. * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::contextMenuItemActivatedCallback): Use the GAction. (WebKit::WebContextMenuProxyGtk::append): Create a new GMenuItem for the GAction. (WebKit::WebContextMenuProxyGtk::buildMenu): Build a GMenu for the given items. (WebKit::WebContextMenuProxyGtk::populate): Create a GMenu and bind it ot the GtkMenu. (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk): Create the GActionGroup for the menu. (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): Remove the action group from the GtkMenu. * UIProcess/gtk/WebContextMenuProxyGtk.h: 2016-09-27 Daniel Bates NetworkLoad and PingLoad should use private inheritance https://bugs.webkit.org/show_bug.cgi?id=162649 Reviewed by Alex Christensen. Make NetworkLoad privately inherit from NetworkDataTaskClient and ResourceHandleClient, and make the client callbacks from these interfaces private as this class implements these interfaces. Similarly, make PingLoad privately inherit from ResourceHandleClient. * NetworkProcess/NetworkLoad.h: * NetworkProcess/PingLoad.h: 2016-09-20 Anders Carlsson PlatformEvent::m_modifiers should be an OptionSet https://bugs.webkit.org/show_bug.cgi?id=162326 Reviewed by Daniel Bates. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): 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-09-27 Jer Noble Remove deprecated ENCRYPTED_MEDIA implementation. https://bugs.webkit.org/show_bug.cgi?id=161010 Reviewed by Eric Carlson. Remove ENABLE_ENCRYPTED_MEDIA. * Configurations/FeatureDefines.xcconfig: 2016-09-27 Chris Dumez [WK2] Navigating to a Blob URL does not trigger a download https://bugs.webkit.org/show_bug.cgi?id=162574 Reviewed by Darin Adler. Add support for converting Blob URL loads into downloads. * NetworkProcess/Downloads/BlobDownloadClient.cpp: (WebKit::BlobDownloadClient::didReceiveResponseAsync): Make sure we return a valid suggested filename because the client side (Safari) does not deal with empty suggested filenames. Use "unknown" by default to match the default suggested filename of non-Blob downloads. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::startWithHandle): * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::convertHandleToDownload): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/ios/DownloadIOS.mm: (WebKit::Download::startNetworkLoadWithHandle): * NetworkProcess/Downloads/mac/DownloadMac.mm: (WebKit::Download::startNetworkLoadWithHandle): * NetworkProcess/Downloads/soup/DownloadSoup.cpp: (WebKit::Download::startNetworkLoadWithHandle): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): * NetworkProcess/NetworkLoad.h: (WebKit::NetworkLoad::handle): 2016-09-27 Michael Catanzaro [GTK] Unreviewed typo fix * UIProcess/API/gtk/WebKitWebInspector.cpp: (webkit_web_inspector_class_init): 2016-09-27 Gustavo Noronha Silva [GTK] Should check whether GDK can use GL before asking it to https://bugs.webkit.org/show_bug.cgi?id=162598 Reviewed by Michael Catanzaro. gdk_cairo_draw_from_gl can fail even when WebKit itself has been able to use GL (its context creation code might be buggy, GL may have been disabled using GDK_GL=disable, …). Unfortunately it does not have any error reporting other than a warning printed to stderr, so we cannot fallback from it. We have to first check if GL can be used by GDK by trying to create a context. See https://bugzilla.redhat.com/show_bug.cgi?id=1378987 * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::AcceleratedBackingStoreWayland::canGdkUseGL): decide whether GDK can use GL by trying to create a context for a GdkWindow. (WebKit::AcceleratedBackingStoreWayland::paint): fallback to glReadPixels if GDK cannot use GL. * UIProcess/gtk/AcceleratedBackingStoreWayland.h: 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-09-26 Dan Bernstein -_webViewWebProcessDidBecomeUnresponsive: gets called when the Web process is stopped in the debugger https://bugs.webkit.org/show_bug.cgi?id=162234 Reviewed by Sam Weinig. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::platformIsBeingDebugged): Use the KERN_PROC sysctl to get the process flags and check for P_TRACED. * UIProcess/ResponsivenessTimer.cpp: (WebKit::ResponsivenessTimer::timerFired): Call the new client function mayBecomeUnresponsive. If it returns false, restart the timer and bail out without changing the responsiveness state. * UIProcess/ResponsivenessTimer.h: Declared new client function mayBecomeUnresponsive. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::platformIsBeingDebugged): A generic implementation that always returns false. (WebKit::WebProcessProxy::mayBecomeUnresponsive): Implement this new ResponsivenessTimer::Client function to return true unless the process is being debugged. * UIProcess/WebProcessProxy.h: 2016-09-26 Chris Dumez [WK2] BlobDownloadClient should use asynchronous IPC to decide destination path https://bugs.webkit.org/show_bug.cgi?id=162568 Reviewed by Alex Christensen. Use DecideDestinationWithSuggestedFilenameAsync IPC to decide the destination path in the case of Blob downloads, instead of the synchronous alternative. To achieve this, BlobResourceHandle was updated in WebCore to properly support asynchronous callback and BlobDownloadClient was updated to use asynchronous callbacks. When BlobDownloadClient::didReceiveResponseAsync() is called, we now ask the WebContent process asynchronously to decide what the destination path should be. Then, when we later get the destination path back from the WebContent process, we create the file on disk and call continueDidReceiveResponse() on the BlobResourceHandle so we start getting the blob data to write. * NetworkProcess/Downloads/BlobDownloadClient.cpp: (WebKit::BlobDownloadClient::didReceiveResponseAsync): (WebKit::BlobDownloadClient::didDecideDownloadDestination): * NetworkProcess/Downloads/BlobDownloadClient.h: * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::decideDestinationWithSuggestedFilenameAsync): (WebKit::Download::didDecideDownloadDestination): (WebKit::Download::continueDidReceiveResponse): (WebKit::Download::decideDestinationWithSuggestedFilename): Deleted. * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::willDecidePendingDownloadDestination): (WebKit::DownloadManager::continueDecidePendingDownloadDestination): (WebKit::DownloadManager::convertHandleToDownload): Deleted. * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::continueDidReceiveResponse): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::continueDecidePendingDownloadDestination): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): Deleted. * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Downloads/DownloadProxy.messages.in: 2016-09-26 Daniel Bates Mark Ping{Handle, Load} as final https://bugs.webkit.org/show_bug.cgi?id=162576 Reviewed by Alex Christensen. We should not support subclassing of a ping handle or overriding its NetworkDataTaskClient callbacks because there are security/privacy implications with a ping request. We should not encourage subclassing without careful consideration. * NetworkProcess/PingLoad.h: 2016-09-26 Daniel Bates Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING https://bugs.webkit.org/show_bug.cgi?id=162365 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-09-26 Michael Catanzaro Fix -Wformat warnings in WebLoaderStrategy https://bugs.webkit.org/show_bug.cgi?id=162553 Reviewed by Alex Christensen. Consistently use PRIu64 to print uint64_t * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::didReceiveResponse): (WebKit::Download::didReceiveData): (WebKit::Download::didFinish): (WebKit::Download::didFail): (WebKit::Download::didCancel): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::setDefersLoading): (WebKit::NetworkResourceLoader::abort): (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::continueWillSendRequest): * 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): == Rolled over to ChangeLog-2016-09-26 ==