2016-11-13  Darin Adler  <darin@apple.com>

        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  <darin@apple.com>

        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  <simon.fraser@apple.com>

        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  <dabates@apple.com>

        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  <simon.fraser@apple.com>

        [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  <bburg@apple.com>

        Web Automation: terminate the automation session if the web process crashes
        https://bugs.webkit.org/show_bug.cgi?id=164671
        <rdar://problem/29028964>

        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  <achristensen@webkit.org>

        Use SecurityOriginData as keys in StorageManager
        https://bugs.webkit.org/show_bug.cgi?id=159834
        <rdar://problem/27346948>

        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  <rniwa@webkit.org>

        Hovering over a slotted Text node clears hover state
        https://bugs.webkit.org/show_bug.cgi?id=164002
        <rdar://problem/29040471>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::performImmediateActionHitTestAtLocation):

2016-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
        https://bugs.webkit.org/show_bug.cgi?id=164538
        <rdar://problem/8418711>

        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  <bdakin@apple.com>

        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  <bfulgham@apple.com>

        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  <beidson@apple.com>

        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  <eric.carlson@apple.com>

        [MediaStream] defer resolution of getUserMedia promise made in a background tab
        https://bugs.webkit.org/show_bug.cgi?id=164643
        <rdar://problem/29048317>

        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  <darin@apple.com>

        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  <megan_gardner@apple.com>

        [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  <bdakin@apple.com>

        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  <bfulgham@apple.com>

        Remove unused FontService from sandbox profile
        https://bugs.webkit.org/show_bug.cgi?id=164625
        <rdar://problem/26899976>

        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  <eric.carlson@apple.com>

        [MediaStream] apply constraints passed to getUserMedia()
        https://bugs.webkit.org/show_bug.cgi?id=164561

        Reviewed by Youenn Fablet.
        <rdar://problem/29191384>

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):

2016-11-10  Alex Christensen  <achristensen@webkit.org>

        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  <achristensen@webkit.org>

        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  <cgarcia@igalia.com>

        [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  <cgarcia@igalia.com>

        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  <svillar@igalia.com>

        [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  <clopez@igalia.com>

        [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  <pnormand@igalia.com>

        [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  <cdumez@apple.com>

        [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  <cdumez@apple.com>

        [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
        https://bugs.webkit.org/show_bug.cgi?id=164458
        <rdar://problem/28905514>

        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  <cgarcia@igalia.com>

        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  <achristensen@webkit.org>

        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  <bfulgham@apple.com>

        Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
        https://bugs.webkit.org/show_bug.cgi?id=155185
        <rdar://problem/11101440>

        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  <simon.fraser@apple.com>

        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<ScrollingStateFrameScrollingNode>::encode):
        (ArgumentCoder<ScrollingStateFrameScrollingNode>::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  <bdakin@apple.com>

        More attempted build fix.

        * UIProcess/Cocoa/WebViewImpl.mm:

2016-11-09  Alex Christensen  <achristensen@webkit.org>

        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  <bdakin@apple.com>

        Another attempted build fix.

        * UIProcess/Cocoa/WebViewImpl.mm:

2016-11-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        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  <bdakin@apple.com>

        Build fix.

        * UIProcess/Cocoa/WebViewImpl.mm:

2016-11-09  Brady Eidson  <beidson@apple.com>

        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  <darin@apple.com>

        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  <darin@apple.com>

        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  <dino@apple.com>

        Rendering support for ExtendedColors
        https://bugs.webkit.org/show_bug.cgi?id=164443
        <rdar://problems/29123243>

        Reviewed by Simon Fraser and Darin Adler.

        Implement argument coders for Color.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<Color>::encode):
        (IPC::ArgumentCoder<Color>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _updateScrollViewBackground]):

2016-11-09  Beth Dakin  <bdakin@apple.com>

        Build fix.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::~WebViewImpl):

2016-11-09  Chris Dumez  <cdumez@apple.com>

        [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  <bdakin@apple.com>

        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  <cdumez@apple.com>

        [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
        https://bugs.webkit.org/show_bug.cgi?id=164458
        <rdar://problem/28905514>

        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  <cdumez@apple.com>

        [WK2] Network cache speculative revalidation can cause loads to hang
        https://bugs.webkit.org/show_bug.cgi?id=164532
        <rdar://problem/28519331>

        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  <ossy@webkit.org>

        URTBF after r208361.

        * PlatformMac.cmake:

2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>

        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  <cgarcia@igalia.com>

        [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  <fpizlo@apple.com>

        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  <wenson_hsieh@apple.com>

        Safari does not emit composition end if blurred for dead key / Japanese IME
        https://bugs.webkit.org/show_bug.cgi?id=164369
        <rdar://problem/29050439>

        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  <achristensen@webkit.org>

        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  <sabouhallawa@apple.com>

        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  <simon.fraser@apple.com>

        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  <cgarcia@igalia.com>

        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  <simon.fraser@apple.com>

        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  <cdumez@apple.com>

        [WK2][Cocoa] Implement user interface for HTML form validation
        https://bugs.webkit.org/show_bug.cgi?id=164143
        <rdar://problem/28944652>

        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  <timothy_horton@apple.com>

        Printing to PDF should produce internal links when HTML has internal links
        https://bugs.webkit.org/show_bug.cgi?id=112081
        <rdar://problem/5955705>

        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  <achristensen@webkit.org>

        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  <ryanhaddad@apple.com>

        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  <mitz@apple.com>

        WKWebView’s _observedRenderingProgressEvents not restored after web process crash
        https://bugs.webkit.org/show_bug.cgi?id=164368
        <rdar://problem/29091954>

        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  <achristensen@webkit.org>

        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  <barraclough@apple.com>

        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  <mitz@apple.com>

        REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
        https://bugs.webkit.org/show_bug.cgi?id=164340
        <rdar://problem/29074344>

        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  <ddkilzer@apple.com>

        Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
        <https://webkit.org/b/164333>
        <rdar://problem/29072727>

        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  <achristensen@webkit.org>

        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  <cgarcia@igalia.com>

        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  <aestes@apple.com>

        REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding
        https://bugs.webkit.org/show_bug.cgi?id=164311
        <rdar://problem/26995374>

        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  <cgarcia@igalia.com>

        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  <ddkilzer@apple.com>

        Add logging for "WebKit encountered an internal error" messages
        <https://webkit.org/b/164272>
        <rdar://problem/28546064>

        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  <cgarcia@igalia.com>

        [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  <cgarcia@igalia.com>

        [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  <romain.bellessort@crf.canon.fr>

        [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  <cgarcia@igalia.com>

        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  <cgarcia@igalia.com>

        [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  <wenson_hsieh@apple.com>

        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  <ljaehun.lim@samsung.com>

        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  <achristensen@webkit.org>

        Fix CMake build.

        * PlatformMac.cmake:

2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>

        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  <eric.carlson@apple.com>

        [MediaStream] restrict media capture secure connections
        https://bugs.webkit.org/show_bug.cgi?id=164234
        <rdar://problem/28944906>

        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  <barraclough@apple.com>

        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  <barraclough@apple.com>

        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  <ljaehun.lim@samsung.com>

        Unreviewed, CMake build fix

        Adds #include <WebCore/IDBGetAllRecordsData.h>

        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:

2016-10-31  Simon Fraser  <simon.fraser@apple.com>

        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  <fpizlo@apple.com>

        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  <beidson@apple.com>

        IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
        <rdar://problem/28806934> 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  <wenson_hsieh@apple.com>

        [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
        https://bugs.webkit.org/show_bug.cgi?id=164236
        <rdar://problem/28747712>

        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  <simon.fraser@apple.com>

        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  <ryanhaddad@apple.com>

        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  <bfulgham@apple.com>

        Do a better job of protecting Frame objects in the context of JavaScript calls
        https://bugs.webkit.org/show_bug.cgi?id=164163
        <rdar://problem/28955249>

        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  <cgarcia@igalia.com>

        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  <darin@apple.com>

        Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
        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  <darin@apple.com>

        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  <wenson_hsieh@apple.com>

        Holding down a key to choose an accented character should fire "insertReplacementText" input events
        https://bugs.webkit.org/show_bug.cgi?id=164209
        <rdar://problem/29019305>

        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  <darin@apple.com>

        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  <utatane.tea@gmail.com>

        [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  <darin@apple.com>

        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  <darin@apple.com>

        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  <wenson_hsieh@apple.com>

        iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
        https://bugs.webkit.org/show_bug.cgi?id=164077
        <rdar://problem/28987810>

        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  <megan_gardner@apple.com>

        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  <antti@apple.com>

        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  <mcatanzaro@igalia.com>

        [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  <simon.fraser@apple.com>

        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  <megan_gardner@apple.com>

        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  <wenson_hsieh@apple.com>

        Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
        https://bugs.webkit.org/show_bug.cgi?id=163948
        <rdar://problem/28921433>

        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  <cdumez@apple.com>

        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<IDBKeyPath>::encode):
        (IPC::ArgumentCoder<IDBKeyPath>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:

2016-10-26  Brian Burg  <bburg@apple.com>

        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  <eric.carlson@apple.com>

        [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  <cgarcia@igalia.com>

        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  <cgarcia@igalia.com>

        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  <achristensen@webkit.org>

        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  <cgarcia@igalia.com>

        [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  <eric.carlson@apple.com>

        [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  <commit-queue@webkit.org>

        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  <eric.carlson@apple.com>

        [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  <cdumez@apple.com>

        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  <jbedard@apple.com>

        Unreviewed build fix.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _fullscreenDelegate]): Removed unneeded parenthesis.

2016-10-19  Jer Noble  <jer.noble@apple.com>

        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  <cgarcia@igalia.com>

        Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.

        * NetworkProcess/NetworkProcessCreationParameters.h: Initialize loadThrottleLatency.

2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix Soup based ports debug build after r207813.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::authenticateCallback):
        (WebKit::NetworkDataTaskSoup::requestStartedCallback):

2016-10-25  Andreas Kling  <akling@apple.com>

        More PassRefPtr purging in WebCore.
        <https://webkit.org/b/163895>

        Reviewed by Antti Koivisto.

        * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
        * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
        (WebKit::PDFPlugin::createScrollbar):

2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        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  <antti@apple.com>

        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  <mitz@apple.com>

        REGRESSION (r206410): Sandbox violations beneath WebProcessProxy::platformIsBeingDebugged
        https://bugs.webkit.org/show_bug.cgi?id=163879
        <rdar://problem/28728735>

        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  <achristensen@webkit.org>

        URL::port should return Optional<uint16_t>
        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  <eric.carlson@apple.com>

        [MediaStream] Separate media capture and audio playback muting
        https://bugs.webkit.org/show_bug.cgi?id=163855
        <rdar://problem/28827186>

        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  <youenn@apple.com>

        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  <beidson@apple.com>

        IndexedDB 2.0: Support IDBIndex name assignment.
        <rdar://problem/28806932> 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  <mcatanzaro@igalia.com>

        [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  <cdumez@apple.com>

        Another unreviewed attempt to fix the WatchOS / TvOS build after r207585.
        <rdar://problem/28902292>

        Disable USE_CFURLCONNECTION on newer WatchOS / TvOS.

        * config.h:

2016-10-23  Chris Dumez  <cdumez@apple.com>

        Unreviewed attempt to fix WatchOS / TvOS build after r207585.
        <rdar://problem/28902292>

        Enable NETWORK_SESSION on those platforms.

        * config.h:

2016-10-22  Dan Bernstein  <mitz@apple.com>

        [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  <ddkilzer@apple.com>

        Bug 163762: IntSize::area() should used checked arithmetic
        <https://webkit.org/b/163762>

        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<unsigned, RecordOverflow> 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  <eric.carlson@apple.com>

        [MediaStream] Dynamically generate media capture sandbox extensions
        https://bugs.webkit.org/show_bug.cgi?id=154861
        <rdar://problem/24909411>

        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  <barraclough@apple.com>

        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  <barraclough@apple.com>

        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  <wenson_hsieh@apple.com>

        Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents
        https://bugs.webkit.org/show_bug.cgi?id=163460
        <rdar://problem/28784142>

        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  <jeremyj@apple.com>

        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  <wenson_hsieh@apple.com>

        Implement InputEvent.getTargetRanges() for the input events spec
        https://bugs.webkit.org/show_bug.cgi?id=162947
        <rdar://problem/28853079>

        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  <cgarcia@igalia.com>

        [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  <cdumez@apple.com>

        "Download Linked File" context menu action should use 'download' attribute as suggested filename
        https://bugs.webkit.org/show_bug.cgi?id=163742
        <rdar://problem/28840734>

        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  <mmaxfield@apple.com>

        [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  <beidson@apple.com>

        IndexedDB 2.0: Support IDBObjectStore name assignment.
        <rdar://problem/28806931> 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  <cgarcia@igalia.com>

        [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  <cgarcia@igalia.com>

        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  <cgarcia@igalia.com>

        [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  <achristensen@webkit.org>

        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<ResourceRequest>::encodePlatformData):
        (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
        * WebKit2.xcodeproj/project.pbxproj:

2016-10-19  Chris Dumez  <cdumez@apple.com>

        [WK2] Expose suggested filename via WKBundleHitTestResult API
        https://bugs.webkit.org/show_bug.cgi?id=163693
        <rdar://problem/28840734>

        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  <ryanhaddad@apple.com>

        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  <aestes@apple.com>

        Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
        https://bugs.webkit.org/show_bug.cgi?id=163476
        <rdar://problem/26941395>

        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  <cdumez@apple.com>

        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  <dkaleta@apple.com>

        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  <mmaxfield@apple.com>

        [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  <darin@apple.com>

        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  <cgarcia@igalia.com>

        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  <cgarcia@igalia.com>

        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  <cgarcia@igalia.com>

        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  <simon.fraser@apple.com>

        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  <dino@apple.com>

        Remove CSS_SHAPES feature definition. This should always be on.
        https://bugs.webkit.org/show_bug.cgi?id=163628
        <rdar://problem/28834613>

        Reviewed by Tim Horton.

        * Configurations/FeatureDefines.xcconfig:

2016-10-18  Ryan Haddad  <ryanhaddad@apple.com>

        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  <commit-queue@webkit.org>

        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  <megan_gardner@apple.com>

        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  <pecoraro@apple.com>

        Remote Web Inspector: Timeline UI not updating while recording
        https://bugs.webkit.org/show_bug.cgi?id=163582
        <rdar://problem/28766837>

        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  <eric.carlson@apple.com>

        [MediaStream] Resolve constraints and enumerate devices in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=162147
        <rdar://problem/28803569>

        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<MediaConstraintsData>::encode): MediaConstraintsData encoder.
        (IPC::decodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap decoder.
        (IPC::ArgumentCoder<MediaConstraintsData>::decode): MediaConstraintsData decoder.
        (IPC::ArgumentCoder<CaptureDevice>::encode): CaptureDevice enoder.
        (IPC::ArgumentCoder<CaptureDevice>::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  <antti@apple.com>

        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  <cgarcia@igalia.com>

        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  <megan_gardner@apple.com>

        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  <timothy_horton@apple.com>

        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
        <rdar://problem/28744549>

        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  <aestes@apple.com>

        Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
        https://bugs.webkit.org/show_bug.cgi?id=163476
        <rdar://problem/26941395>

        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  <cdumez@apple.com>

        [WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked
        https://bugs.webkit.org/show_bug.cgi?id=163569
        <rdar://problem/28810836>

        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  <jeremyj@apple.com>

        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  <cdumez@apple.com>

        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  <barraclough@apple.com>

        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  <mcatanzaro@igalia.com>

        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  <cdumez@apple.com>

        [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  <annulen@yandex.ru>

        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<ResourceRequest>::encodePlatformData() share most of the code,
        ditto for decoding implementations.

        * Shared/soup/WebCoreArgumentCodersSoup.cpp:
        (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
        (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):

2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>

        Move user agent quirks to cross-platform location
        https://bugs.webkit.org/show_bug.cgi?id=163508

        Reviewed by Carlos Garcia Campos.

        #include <WebCore/UserAgent.h> instead of <WebCore/UserAgentGtk.h>.

        * UIProcess/API/gtk/WebKitSettings.cpp:
        * UIProcess/efl/WebPageProxyEfl.cpp:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:

2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [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  <cgarcia@igalia.com>

        [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  <rego@igalia.com>

        [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  <darin@apple.com>

        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  <cgarcia@igalia.com>

        [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  <cgarcia@igalia.com>

        [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  <simon.fraser@apple.com>

        Sort the project file.

        * WebKit2.xcodeproj/project.pbxproj:

2016-10-14  Anders Carlsson  <andersca@apple.com>

        Fix Mac build.

        * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):

2016-10-14  Anders Carlsson  <andersca@apple.com>

        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  <andersca@apple.com>

        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  <beidson@apple.com>

        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  <barraclough@apple.com>

        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  <youenn@apple.com>

        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<ResourceRequest>::encodePlatformData):
        (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):

2016-10-13  Tim Horton  <timothy_horton@apple.com>

        Rename the SPI added in r207292 due to post-landing review comments
        https://bugs.webkit.org/show_bug.cgi?id=163364
        <rdar://problem/28012494>

        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  <jbedard@apple.com>

        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  <timothy_horton@apple.com>

        Expose SPI to disable synchronously blocking on painting after parenting a WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=163364
        <rdar://problem/28012494>

        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  <cdumez@apple.com>

        [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  <achristensen@webkit.org>

        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  <andersca@apple.com>

        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  <gyuyoung.kim@navercorp.com>

        [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  <dabates@apple.com>

        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  <andersca@apple.com>

        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  <dabates@apple.com>

        [iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
        https://bugs.webkit.org/show_bug.cgi?id=163244
        <rdar://problem/27250015>

        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  <achristensen@webkit.org>

        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<ResourceRequest>::encodePlatformData):
        (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
        * WebKit2.xcodeproj/project.pbxproj:

2016-10-11  Anders Carlsson  <andersca@apple.com>

        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  <annulen@yandex.ru>

        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  <wenson_hsieh@apple.com>

        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  <zdobersek@igalia.com>

        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  <cgarcia@igalia.com>

        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  <annulen@yandex.ru>

        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  <cgarcia@igalia.com>

        [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  <gyuyoung.kim@navercorp.com>

        [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  <cgarcia@igalia.com>

        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  <cgarcia@igalia.com>

        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  <timothy_horton@apple.com>

        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  <tpopela@redhat.com>

        [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  <wenson_hsieh@apple.com>

        Support InputEvent.inputType for the new InputEvent spec
        https://bugs.webkit.org/show_bug.cgi?id=163025
        <rdar://problem/28658092>

        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  <emanuele.aina@collabora.com>

        [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  <darin@apple.com>

        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  <commit-queue@webkit.org>

        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  <timothy_horton@apple.com>

        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  <andersca@apple.com>

        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  <timothy_horton@apple.com>

        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  <timothy_horton@apple.com>

        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  <andersca@apple.com>

        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  <commit-queue@webkit.org>

        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  <cgarcia@igalia.com>

        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  <tpopela@redhat.com>

        [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  <mcatanzaro@igalia.com>

        [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  <wilander@apple.com>

        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  <youenn@apple.com>

        [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  <wenson_hsieh@apple.com>

        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  <mmaxfield@apple.com>

        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  <timothy_horton@apple.com>

        Fix the build.

        * UIProcess/Cocoa/WebViewImpl.mm:

2016-10-05  Tim Horton  <timothy_horton@apple.com>

        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
        <rdar://problem/27659173>

        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  <timothy_horton@apple.com>

        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  <cdumez@apple.com>

        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  <zdobersek@igalia.com>

        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  <dabates@apple.com>

        [WK2][NetworkSession] Ping requests should follow redirects if applicable
        https://bugs.webkit.org/show_bug.cgi?id=162580
        <rdar://problem/28631274>

        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. <a ping>) 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, <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (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  <dabates@apple.com>

        Do not follow redirects when sending violation report
        https://bugs.webkit.org/show_bug.cgi?id=162520
        <rdar://problem/27957639>

        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 <https://bugs.webkit.org/show_bug.cgi?id=162580>.

        * 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 <https://bugs.webkit.org/show_bug.cgi?id=162580>
        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  <cgarcia@igalia.com>

        [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  <cgarcia@igalia.com>

        Unreviewed. Fix GTK+ build with USE_REDIRECTED_XCOMPOSITE_WINDOW disabled.

        * UIProcess/AcceleratedDrawingAreaProxy.cpp:
        (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):

2016-10-04  Chris Dumez  <cdumez@apple.com>

        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  <sabouhallawa@apple.com>

        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  <rniwa@webkit.org>

        Revert a change erroneously committed in r206795.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):

2016-10-04  Anders Carlsson  <andersca@apple.com>

        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  <timothy_horton@apple.com>

        Fix the build.

        * Shared/WebBackForwardListItem.cpp:
        (WebKit::WebBackForwardListItem::WebBackForwardListItem):
        (WebKit::WebBackForwardListItem::highestUsedItemID):

2016-10-04  Tim Horton  <timothy_horton@apple.com>

        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  <utatane.tea@gmail.com>

        [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  <cgarcia@igalia.com>

        [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  <wenson_hsieh@apple.com>

        Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
        https://bugs.webkit.org/show_bug.cgi?id=162766
        <rdar://problem/28533523>

        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  <zdobersek@igalia.com>

        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  <krollin@apple.com>

        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  <ryanhaddad@apple.com>

        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  <krollin@apple.com>

        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  <cdumez@apple.com>

        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  <cdumez@apple.com>

        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  <cgarcia@igalia.com>

        [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  <ryanhaddad@apple.com>

        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  <mmaxfield@apple.com>

        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  <mitz@apple.com>

        [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
        <rdar://problem/28409828>

        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  <mmaxfield@apple.com>

        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  <beidson@apple.com>

        REGRESSION (Safari 10 combined with WK changes): Unable to store WebCrypto keys in IndexedDB database.
        <rdar://problem/28334440> 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  <sabouhallawa@apple.com>

        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  <andersca@apple.com>

        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  <mmaxfield@apple.com>

        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  <cdumez@apple.com>

        [WK2][iOS] Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint
        https://bugs.webkit.org/show_bug.cgi?id=162787
        <rdar://problem/28554292>

        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  <megan_gardner@apple.com>

        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  <andersca@apple.com>

        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  <n_wang@apple.com>

        AX: iOS: Tapping <input> 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  <dabates@apple.com>

        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  <sam@webkit.org>

        Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
        <rdar://problem/27648683>
        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  <cgarcia@igalia.com>

        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  <pecoraro@apple.com>

        WKSharedAPICast should not warn about acceptable custom context menu tag values
        https://bugs.webkit.org/show_bug.cgi?id=162597
        <rdar://problem/28487627>

        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  <wenson_hsieh@apple.com>

        Adopt MediaRemote SPI to achieve desired Now Playing behavior
        https://bugs.webkit.org/show_bug.cgi?id=162658
        <rdar://problem/28499358>

        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  <cgarcia@igalia.com>

        [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  <dabates@apple.com>

        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  <andersca@apple.com>

        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  <mitz@apple.com>

        [iOS] REGRESSION (r182126): Selection highlight and handles aren’t visible with WKSelectionGranularityCharacter
        https://bugs.webkit.org/show_bug.cgi?id=162577
        <rdar://problem/28481984>

        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  <jer.noble@apple.com>

        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  <cdumez@apple.com>

        [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  <mcatanzaro@igalia.com>

        [GTK] Unreviewed typo fix

        * UIProcess/API/gtk/WebKitWebInspector.cpp:
        (webkit_web_inspector_class_init):

2016-09-27  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        [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  <timothy_horton@apple.com>

        Delete some unused code from r202695
        https://bugs.webkit.org/show_bug.cgi?id=162595
        <rdar://problem/28343784>

        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  <mitz@apple.com>

        -_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  <cdumez@apple.com>

        [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  <dabates@apple.com>

        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  <dabates@apple.com>

        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  <mcatanzaro@igalia.com>

        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 ==
